There are 126 ways to choose four items from a set of 9, and there are 128 results from flipping a two-sided coin seven times. The procedure below lets you make a random choice of four numbers from nine using seven flips of a coin. The procedure will succeed about 98% of the time. The rest of the time it will fail, requiring you to start over.

Before we start, we divide the numbers into four pairs, {1,5}, {2,6}, {3,7}, and {4,8}, with 9 leftover as a special case. The procedure makes use of the diagram below, which can be drawn on a scrap of paper. Coins are placed on the diagram to indicate which numbers are chosen.

If 9

The procedure:

- Flip three coins and place them, in the order they are flipped, on the numbers 1, 2 and 3.
- [“1111” case] If there are no heads, we will use one number from
each of the four pairs.
- Pick up the three coins.
- Consider the four pairs from left to right. For each of four flips, if it is heads, place a coin to the higher number in the pair. Otherwise, place one on the lower number.
- The procedure is finished. The four coins mark the chosen numbers.

- [“211” case] If there is only one head, we will use three of the
pairs, with the head being used (indirectly) to indicate which pair to
double up.
- Make a note of whether the head is on 1, 2 or 3. Call this value “X”.
- Place a coin on 4 (1..4 all have coins)
- Flip two coins to determine which of the four pairs will be empty. Interpreting them in binary, remove the coin from the indicated pair.
- Considering the three chosen pairs left to right, place a coin on the higher number of the “X”th pair.
- Consider the two remaining pairs from left to right. For each of two flips, if it is heads, move the marker coin to the higher number in the pair. Otherwise, leave it on the lower number.
- The procedure is finished. The four coins mark the chosen numbers.

- Flip a coin and place it on 4.
- [“9-21” case] If there are only two heads, 9 is chosen, and we
will use two of the pairs.
- There is one tail among 1, 2 or 3. Make a note of which it is. Call this value “X”.
- Pick up the four coins.
- Flip two coins to determine which of the four pairs will be have both numbers chosen. Interpreting them in binary, place coins on both the lower and higher numbers of the the indicated pair.
- Considering the three empty pairs left to right, flip a coin and place it on the “X”th pair; if it is heads, place it on the higher number, otherwise on the lower.
- Place a coin on 9.
- The procedure is finished. The four coins mark the chosen numbers.

- [“9-111” case] If there are three heads, 9 is chosen, and we
will use three of the pairs.
- The three heads mark the chosen pairs. Remove the tail.
- Consider the chosen pairs from left to right. For each of three flips, if it is heads, move the marker coin to the higher number in the pair. Otherwise, leave it on the lower number.
- Place a coin on 9.
- The procedure is finished. The four coins mark the chosen numbers.

- [“22” case] Otherwise, there are four heads.
- Pick up the four coins.
- Flip three coins and place them, in the order they are flipped, on the
numbers 1, 2 and 3.
- If all four are the same, pick them up and start over at (A).

- Pick up all the tails.
- If only one coin is placed, place a coin on number four. After this step, two coins will have been placed.
- Place coins on the higher number for each of the two chosen pairs.
- The procedure is finished. The four coins mark the chosen numbers.

Back to Bob’s main Dice and Coins page.