## Matching Numbers and Letters

A group of five logical thinkers each push a different button on a machine (numbered 1, 2, ..., N).  When the fifth button is pushed, five balls are released (lettered A, B, C, ...), each corresponding to one of the pressed buttons.  After four such rounds, they are able to uniquely identify which number is linked to which letter.  What is the highest possible number on the machine?

Extension:   Is there a way to determine the maximum number of buttons for P people in R rounds?  Or the minimum number of rounds needed to identify N pairings?

Source: Original.  Based upon puzzle 12 in the High IQ Society's Smartest Person Challenge 2006.

Solutions were received from Alan O'Donnel and Philippe Fondanaiche.  Philippe's solution captures the main points below:
The highest possible number on the machine could be 12:

1st round: 1  2  3  4  5

2nd round: 1  6  7  8  9
By comparing the results of the two first rounds, it is possible to identify the letter associated to the button n°1

3rd round: 2  3  6  7  10
By comparing the results of the 1st and 3rd rounds, it is possible to separate the couple 2-3 from the couple 4-5 and by comparing the results of the 2nd and 3rd rounds, to separate the couple 6-7 and the couple 8-9. For each couple of numbers x-y, we have the corresponding pair of letters X-Y but we don't know what is the letter X or Y  linked to x (or to y).
On the other hand, we can identify the letter associated to the button n°10 as the corresponding letter appears once.

4th round: 2  4  6  8  11
With this round, it is possible to identify each button within the four couples 2-3, 4-5, 6-7 and 8-9.

On the other hand, we can identify the letter associated to the button n°11 and with the 11 letters now identified, we can also infer by difference the letter associated to the button n°12.

Mail to Ken