Combinations

We need to review some basic counting mathematics to have a basis for doing some poker analysis.  Roughly, what we're doing is counting the number of ways you can make a given end result.  We usually do this with cards by counting the number of ways you can make each card, and then dividing by the number of ways you can re-arrange the cards and still have the same result.

For example, how many ways are there to hold AK?  There are 4 aces (the four suits), and 4 kings, so the number of ways is 4*4 = 16.
How many ways to make AKs?  Well, there are just four suits, so there are 4.  Another way to look at is there are 4 choices of aces, and then once you've chose an Ace, your choice of King is fixed, so it's 4*1 = 4.
How many ways are there to make AKo?  Well, you can just just do |AK| - |AKs| = 16 - 4 = 12, or you can say there are 4 choices for the Aces, then you can choose any K except the same suit as the ace, so it's 4*3 = 12.

A common thing we use is the number of permutations of a some elements.  Basically, if we're saying you have some certain set of N cards, it doesn't affect your poker hand what order they're in, so we need to take out the number of ways to reorder them.  That's like, for hole cards it doesn't matter if you have AK or KA, it's the same poker hand.  When you have a pair, it doesn't matter if you have 255JA or 2A5J5 , etc.  So, the thing we have to use is the number of ways to re-order N cards.  The answer is N!, which reads "N factorial", which means N*(N-1)*(N-2)* ...   For 1 this is just 1, 1! = 1 ; then 2! = 2*1 , 3! = 3*2*1, etc.  If you like you can use a recursive definition :
N! = N * (N-1)!
0! = 1

You can see the permutation counting by thinking of having N different marbles in a bag.  How many ways can you order them?  Just think of picking them one by one.  Well, you can choose any of N  for the first pick, then any of (N-1) for the next pick (since one is already taken), then any of (N-2), etc. until it's down to one, and you have only 1 choice.

So, for example, how many ways are there to draw 1 card from a deck?  It's just 52.  How many ways to draw 2 cards?  It's 52*51/2! ; first you draw one card, and there are 52 choices, then you draw another, so there are 51 choices (one is gone), but then the order doesn't matter, so you have to divide by the number of ways to re-order, that's 2! = 2.  How many ways are there to draw 3 cards?  52*51*50/3! ; in general to draw N cards from a 52 card deck, it's 52!/(N! * (52-N)!)   You can see the number of ways do draw 52 cards is just 1 - you always draw the whole deck.  How many ways are there to draw 51 cards?  52! / 51! = 52 , just the number of ways to leave one card behind.  This is Combinations, it's symmetrical like that since you can always reverse the situation, eg. instead of thinking of drawing the deck, you can think of leaving the deck behind.

So, now we can count some things.  How many ways can you make a pair (or better) with a five card hand?  Ok, the order doesn't matter, so we're going to fix the order, like PPOOO, with the two paired cards and the other cards after.  There are 52 cards you can draw for the first one.  Then, you need to draw a paired card, so there are only 3 of those, so we start with 52*3.  Now it doesn't matter if we drew those the other way around, so you have to divide by 2, that's 2!.  Now, how many ways are there to draw the other cards?  There are 50 other cards, then 49 after you draw one, then 48, but there are 3 of them and the order doesn't matter, so we divide by 3! = 6.   The total is (52*3*49*48*47)/(2*6) = 1437072   ;  Note that you may have made better than just a pair here because the other cards may have made you trips or two pair or something.  [ @@ is this right? ]