Just for fun, some calculations concerning the card game "Skat".Short introduction for non-German readers:
Skat is one of the most popular card games in Germany. It is played by 3 players. It's also allowed that there are 4 players sitting at a table. In that case in each round the dealer has a break, and only the 3 others are actually playing together in that round. In the next round, someone else is the dealer. Skat is played with a deck of 32 cards. At the beginning of each round each player is dealt ten cards, with the two remaining cards (the so-called Skat) being put face down in the middle of the table.a) How many ways are there for distributing 32 cards to 3 players and the Skat?Here the
order of the 3 players must be taken into account.
Code:
XIncludeFile "set.pbi" ; version 1.71+
Debug Set::NumberOf_PartitionsT("10,10,10,2", Set::#SameSize) ; = 2753294408504640
b) When organizing a Skat tournament, how many different possibilities are there for the players sitting at the tables?This is asking for
unordered partitions of particular types, since the tables are not distinguishable (i.e. it doesn't matter whether say players A, B, C sit e.g. at table #1 or at table #2).
Code:
XIncludeFile "set.pbi"
Debug " 8 players: " + Set::NumberOf_PartitionsT("4,4") ; = 35
Debug " 9 players: " + Set::NumberOf_PartitionsT("3,3,3") ; = 280
Debug "10 players: " + Set::NumberOf_PartitionsT("4,3,3") ; = 2100