Tuesday, June 04, 2019

[hhcsnrke] Some deck sizes

Create a deck of cards, or generically N items, for a game of up to P players.  We would like the deck to be evenly divisible among the players, no cards left over.  For example, a standard deck can be divided among 4 players for contract bridge.

The number of cards necessary is the LCM of integers 1 through P: OEIS A003418.  These are smooth numbers.

Consider not permitting 7 or 11 players because those primes are inconvenient.  If you have that many players, find one more player, or first vote someone off the island.  Similarly, we limit the game only up to 12 players to avoid 13, which is too big a party anyway.  The sequence of minimum deck sizes is

1, 2, 6, 12, 60, 60, 60, (60 mod 7 = 4), 120, 360, 360, (360 mod 7 = 3, 360 mod 11 = 8), 360

We include in the list the number of cards left over when dividing by 7 or 11.

Far better would be a divMod deck, which would work for any number of players.

No comments :