Factorial: The factorial of 5, written as 5!, is 1*2*3*4*5=120. Similarly 3!=1*2*3=6 and 8!=1*2*3*4*5*6*7*8=40320.

WTH is this post about? Some interest was expressed in a probability FAQ. In no particular order but influenced by what I think is relevant to board game design and what I think is fun to write about, I'm going to explain some concepts used in probability. The most common use of probability for board game design is to have a better chance to get numbers right before actually playtesting them, thus shortening playtesting time and improving the experience for those you rope into helping you. If you have any questions, corrections, suggestions, etc. please post them.

Anyway, factorial. Its basic job is to count the number of ways a bunch of things can be ordered. For example, a standard deck of cards has 52! different ways it could be ordered: 52 choices for the first card, times 51 choices for the second card, times 50, times 49, etc. A really nice thing about factorials is how they divide. 52! / 48!, for example, is just 52*51*50*49, since most of the numbers cancel. So if we had a game with 4 rounds where in each round we flipped the top card of a deck and each card meant something different, there would be 52! / 48! ways it could come out.

That's nice, but the real power of factorials is in something called a combination. Most of the time instead of flipping one card at a time we do things like deal a hand of 5 cards. The difference is that with the hand of 5 cards we don't care what order they come off of the deck. Say, for example, you got to look at the top two cards and choose one. You could say there are 52 choices for the first card, times 51 choices for the second card, for a total of 52*51 choices of two-card-combos you might get to look at. The problem is that Ten of Spades for the first card, Five of Hearts for the second card is no different than Five of Hearts for the first card, Ten of Spades for the second card. You've actually counted each two-card-combo twice. So really there are 52*51/2 choices. And in fact what we're actually doing is saying there are (52!)/(50! * 2!) choices - dividing 52 cards into two piles, one with 50 cards and one with 2 cards. That's true in general - the number of ways to take a pile of 10 different cards and divide it into two piles of 3 cards and a pile of 4 cards is (10!)/(3! * 3! * 4!).

PRACTICAL APPLICATIONS: There are many! Here are two.

STRAIGHT POKER: I'm designing straight poker (no drawing more cards, etc.). Which hand should win, a straight or a flush? Whichever is less likely to be dealt! We'll find the probability of both.

First, how many straight flushes are there? A-5, 2-6, 3-7, ... 10-A makes 10 types of straights, and they can be in one of 4 suits, so there are 40.

How many straights are there? For the 10 types, each of 5 cards can be any suit, so 10*4*4*4*4*4=10240, minus 40 straight flushes is 10200.

How many flushes? There are 4 suits, and for any suit, we need to divide the 13 cards of that suit into a pile of 5 (in the hand) and a pile of 8 (not in the hand), so 4*(13!)/(5! * 8!)=4*1287=5148. Subtract the 40 straight flushes and we have 5108 flushes.

So a flush is about twice as unlikely as a straight, and should definitely beat it.

If we wanted actual probabilities we would divide, say, the number of straights by the number of possible 5-card hands. How many is that? Put 52 cards in two piles, one with 5 cards and one with 47 cards. There are (52!)/(5! * 47!)=2598960 5-card hands, so the probability of being dealt a straight is 10200/2598960, or about 0.4%, 1 in 250 hands.

DARKEHORSE'S WRECK ASHORE LENGTH: In this post, Darkehorse proposes a method of ending the game in a random but bounded number of turns. Namely, a deck of 12 labeled and 6 unlabeled cards is shuffled, and each turn a new card is turned up. The game end is triggered by the last labeled card being turned up. Obviously the game will end in anywhere from 12 to 18 turns. How likely are each of the lengths?

Imagine you have a pile of cards numbered 1-18. These represent the 1st card, 2nd card, etc. Make two piles, one with 12 cards and one with 6. These represent where the labeled and unlabeled cards will come up in the deck. For example, {1,3,4,5,7,9,10,11,13,14,16,17} and {2,6,8,12,15,18} means that the 1st card will be labeled, the 2nd unlabeled, the 3rd labeled, the 4th labeled, etc. This shows that the number of ways to arrange the deck is (18!)/(12! * 6!).

How many of those ways result in a game length of 12? Just 1, since all 12 labeled cards have to come up first. How about length 13? Well, now the 13th card has to be labeled, and of the previous 12, exactly one has to be unlabeled, but it can be any of them. So there are 12 ways.

Length 14 is trickier. The 14th card must be labeled. The previous 13 have to have 11 labeled and 2 unlabeled, so we can do the piles of positions thing to show that there are (13!)/(11! * 2!) ways of doing that. So to get length 15 we need the 15th labeled and 3 unlabeled in the previous 14, which is (14!)/(11! * 3!). The pattern holds in general. There are (N!)/(11! * (N-11)!) ways to arrange the deck to get a game of length N+1. You'll notice that for length 12, making N=11, that's (11!)/(11! * 0!). It turns out that 0! is defined as being equal to 1.

Divide by the total number of ways of arranging the deck to get the probabilities.

12: [(11!)/(11! * 0!)] / [(18!)/(12! * 6!)] = 1/18564

13: [(12!)/(11! * 1!)] / 18564 = 12/18564

14: [(13!)/(11! * 2!)] / 18564 = 78/18564

15: [(14!)/(11! * 3!)] / 18564 = 364/18564

16: [(15!)/(11! * 4!)] / 18564 = 1365/18564

17: [(16!)/(11! * 5!)] / 18564 = 4368/18564

18: [(17!)/(11! * 6!)] / 18564 = 12376/18564

We can check our work by adding everything up: 1+12+78+364+1365+4368+12376=18564.

Tell me if this is too wordy, way over everyone's head, too much theory, not enough theory, not even forseeably useful, or whatever!