1
$\begingroup$

There are $2n$ persons shaking hands in turns. In every turn every person shakes hands with exactly one other person. After the turn all of them may choose another partner.

I'm searching for:

  • The minimal number of turns needed so that every person has shaken hands with all of the $2n-1$ other persons.
  • An algorithm that calculates a minimal sequence of turns.
  • 0
    Does each person shake their hands with all the other people in the party?2017-01-17
  • 0
    Yes, each person shakes hands with all of the $2n-1$ other people.2017-01-17
  • 0
    it would take 2n-1 turns, starting in alphabetical order of names, the person would shake hands with the first person in alphabetical order that they have not shaken hands with, and is not selected to shake hands with anyone - then the next unselected person in alphabetical order would have the same applied to them2017-01-17

3 Answers 3

0

From wikipedia: https://en.wikipedia.org/wiki/Round-robin_tournament#Scheduling_algorithm

If $n$ is the number of competitors, a pure round robin tournament requires $\begin{matrix} \frac{n}{2} \end{matrix}(n - 1)$ games. If $n$ is even, then in each of $(n - 1)$ rounds, $\begin{matrix} \frac{n}{2} \end{matrix}$ games can be run concurrently, provided there exist sufficient resources (e.g. courts for a tennis tournament). If $n$ is odd, there will be $ n$ rounds, each with $\begin{matrix} \frac{n - 1}{2} \end{matrix}$ games, and one competitor having no game in that round.

The wikipedia entry goes on to provide a scheduling algorithm.

0

would take $2n-1$ turns, starting in alphabetical order of names, the person would shake hands with the first person in alphabetical order that they have not shaken hands with yet and is not selected to shake hands with anyone in this turn - then the next unselected person in alphabetical order would have the same applied to them - this process would result in n handshakes per turn and would go through n-1 turns

for n = 2 : 4 people

if you had A,B,C,D

round 1

A-B

C-D

round 2

A-C (has shaken B's hand)

B-D (C is shaking hands)

round 3

A-D (only person left)

B-C

done!

  • 0
    How does this work for $n = 3$?2017-01-17
  • 0
    n can not be 3, since there are 2n people, an even number - if there was 3, then on each round there would be a person not shaking hands - so I'd have to think about that out of scope requirement2017-01-17
  • 0
    Of course it can. In my question $n$ is the number of pairs. So $n = 3$ means 6 people.2017-01-17
  • 0
    sorry I should have mentioned that, I put n=2 to give 4 people and 3 rounds in the answer2017-01-17
  • 1
    Ok. Your answer is for $n=2$. I doubt that the principle works for $n=3$ without needing more than $2*3-1=5$ rounds.2017-01-17
  • 0
    sorry you're right - it wouldn't work! needs more thought2017-01-17
  • 0
    the other way I was thinking of was a long table, with everyone moving one space each turn to face someone else - but it runs into a sort of parity problem - but can they all move one seat to the left, and one side swaps in twos if n is even?2017-01-17
  • 0
    how about - they are on a long table n on each side, shake hands, then rotate one seat at a time, until they have not shaken the hand of the person in front of them, then shake hands - all people end up in front of a person they have not shaken with at the same point in the rotation2017-01-17
  • 0
    also above - not working - they never get opposite the person next to them2017-01-17
  • 0
    Yes but you are on to something. I think I've found a solution!2017-01-17
  • 0
    the rotation at wikipedia with a fixed person seems to do it2017-01-17
0

If there are $2n$ people then there must be $1+ \ldots + (2n-1) = n(2n-1)$ handshakes. Each turn we can do $n$ handshakes so we want to solve for $x$ in the following equation: $$ n(2n-1) - xn = 0. $$ If we do this we get $$ x = 2n-1 .$$

  • 0
    That's the lower bound, yes. Every person needs to do $2n-1$ handshakes. So at least $2n-1$ rounds are needed. But is there an actual sequence of turns that achieves this (for every person)?2017-01-17