Tuesday, June 7, 2011

Mind-reading card trick

Alice draws 5 cards from a deck, keeps one secret, and shows the other 4 to Bob in a particular order that allows him to guess the secret card. To anyone observing who doesn't know the trick, it looks like Bob is reading Alice's mind.

This trick works because of two facts:
  • When Alice draws a 5-card hand from a deck of cards, she must get at least two cards of the same suit.
  • Think of a deck of cards as going from 1 (ace) to 13 (king) and put these numbers around a clock. The farthest apart any two cards can be is 6 steps, so long as you start on the correct card (it takes 7 steps to get from 13 to 7 but only 6 steps to get from 7 to 13).
Alice draws her hand and chooses two cards in the same suit. One of these is the "base" card and the other is the secret card. It must be possible to get from the base card to the secret card in 6 or fewer steps.

Alice shows Bob the base card. Now Bob knows the suit of the secret card, and he knows he has to count upward some amount from the base card to find the number of the secret card.

To tell Bob how much to count, Alice hands Bob her three remaining cards in the appropriate order:
low medium high - count up 1 step
low high medium - count up 2
medium low high - count up 3
medium high low - count up 4
high low medium - count up 5
high medium low - count up 6

If Alice has multiple cards with the same number, she orders those cards by suit. From lowest to highest, the suits go Clubs, Diamonds, Hearts, Spades.

Here are a couple of examples.

Example 1

Alice draws: A clubs, 4 diamonds, 5 hearts, 6 spades, 7 spades.

Since spades is the only suit in which she has 2 cards, she has to use spades for the base card and the secret card. Since it takes only 1 step to go from 6 to 7, she shows Bob the 6 of spades as the base card.

Her remaining cards are A clubs (low), 4 diamonds (medium), 5 hearts (high). She shows Bob these cards in this order.

Bob knows he must step up 1 from the 6 of spades, so the secret card must be the 7 of spades.

Example 2

Alice draws: K hearts, 4 hearts, 2 clubs, 2 diamonds, J spades.

Since hearts is the only suit in which she has 2 cards, the secret card and the base card must be hearts. The base card has to be the king of hearts, since we can get from K to 4 in 5 steps but it takes 9 steps to get from 4 to K.

The remaining cards are 2 clubs (low), 2 diamonds (medium), J spades (high). She needs to tell Bob to step up 5, so she shows him the cards in the order
J spades (high), 2 clubs (low), 2 diamonds (medium)

Bob knows to step up 5 from the king of hearts, so the secret card must be the 4 of hearts.

Monday, June 6, 2011

Cryptology - the final foray

This was my favorite day. During the previous five weeks of the EB I felt that I was having trouble finding the optimal working arrangement for this group - they didn't want to work alone, or in pairs, or in small groups, or all together with me at the chalkboard. What to do?

On week six I handed them these rules:
  • If there are prizes, they must be divided evenly.
  • Cooperate! Help each other! Also, make sure everyone gets to help.
  • Leave the room as you found it.
Then I handed them a box labeled "Spy Tools" containing alphabet clocks, enigma machines, sheets with the alphabet for solving substitution ciphers, and some odd-looking index cards with weird holes cut out.


Then I handed them the first clue and stood back.

1. Easiest first! XQGHU WKH WUDVK FDQ


They correctly figured out that "easiest first" referred to the Caesar cipher, the easiest code we had learned. They found the next clue UNDER THE TRASH CAN:


2. The mystery starts with AAA. AIHFACJQMBJOLYW


"Starts with AAA" indicated that they needed to use an Enigma machine with all its rotors initially set to A.


The next clue was found on the BOTTOMBOOKSHELF.


3. VMVVPNPMFGQVGGQCETDI - Jesse

This one didn't even hint at which method was needed, but since they hadn't used the alphabet clock yet they decided to try that, with my name as the key. It worked.


The next clue was found under the MIDDLELUNCHROOMTABLE.

4. Congratulations! Sorry there aren't any prizes, but at least you're not getting painted red, boxed up, and given as an inter-office Christmas gift.

This is very unhelpful! However, when they held one of those funny-looking index cards over it, the cut-out spaces revealed this message:

4. Congratulations! Sorry there aren't any prizes, but at least you're not getting painted red, boxed up, and given as an inter-office Christmas gift.

They found the PRIZES IN RED BAG IN OFFICE as advertised. One bottle of bubbles, one grow-beast dinosaur, and two pencil erasers for everyone. Max took charge of the prize distribution in a very effective way, declaring that dinosaurs would be picked from youngest to oldest. It was subsequently decided that pencil erasers would be chosen first from youngest to oldest, then from oldest to youngest.

Catching up on the blog!

In which we build all the Platonic solids and do one real mathematical proof:

With the big group, we spent a lot of time playing with zome tools to build the Platonic solids. Platonic solids are convex regular polyhedra. Here's what that mouthful means:
  • A polyhedron is a 3-D object, as opposed to a polygon, which is a 2-D object.
  • Regular in this case means "all the same." A regular polygon is a polygon where all the sides and angles are the same length, such as an equilateral triangle or a square. A regular polyhedron is one for which all the sides are the same regular polygon.
  • A polygon or polyhedron is convex if, when we pick two points inside it and connect them by the shortest straight line, the line is entirely contained inside the polygon or polyhedron.
There are three different Platonic solids whose faces are triangles (tetrahedron, octahedron, and icosahedron), one whose faces are squares (cube), and one whose faces are pentagons (dodecahedron). We tried to build one whose faces were hexagons but we ended up with a soccer ball instead - some faces were hexagons, some faces were pentagons.

We talked about what a proof is. To a mathematician, a proof is an argument that convinces a reasonable listener of some claim. I made the claim that we had in fact built all the Platonic solids there were to be built, then went through the geometric proof of this claim. Most of the reasonable listeners were convinced.

In which we do calculus:

With the small group, I had gotten some requests to do calculus, so we did.

We talked a little about limits: the sequence 1, 1/2, 1/3, 1/4, ... has a limit of 0. The sequence 1, 1, 1,... has a limit of 1.

We found the area of a circle by filling the circle with concentric rings (using yarn or playdoh), then unrolling the rings into a triangle and finding the area of the triangle, which is the same as the area of the circle. This is explained beautifully at the website betterexplained.com.

We had a refresher of what "slope" means. I like the phrase
"slope equals rise over run"
since I think it's easier to remember "rise over run" than it is to remember whether x or y goes on top. Then we tried to figure out what "slope" should mean if the line isn't straight. We found the slope of the function y=x^2 pretty much as you would do it in a calculus class, by calculating the slope of the line between the points
(x,x^2) and (x+delta x, (x+delta x)^2)
and talking about what happens as delta x gets smaller and smaller.

In which we do origami:

When the schedules were crazy with field trips and such, I caved and let them do origami again. Rabbits and turtles and boxes, oh my. The small group did some modular origami and we talked about what "modular" means.

Friday, May 13, 2011

Creating Hydrogen and Oxygen from Water

Renata blogged about the electrolysis demonstration Zach did for her class. Here are his directions for a version of that experiment that the kids can do at home.

Simple Electrolysis Experiment

This is a smaller scale experiment than what we did in class. This can be safely done at home, and will not involve the collection of the gasses.

Here are the items you will need.

1: Glass container (a jam jar works well here).
2: Two pencils
3: A piece of cardboard slightly bigger than the glass.
4: Two pieces of thin electrical wire about 8-10 inches in length.
5: Electrical tape.
6: Epsom Salt (this is NOT table salt. Ask your parents!)
7: A 9 volt battery.

Experiment steps:

1: Remove the erasers from the pencils and sharpen both ends.

2: Attach one wire (about 8-10 inches long) to each pencil by wrapping the exposed wire around one end of the pencil, and using the electrical tape to secure it.

3: Fill the glass container about 3/4 of the way with water.

4: Mix several tablespoons of the Epsom salt in with the water. You want to saturate the solution, so keep mixing until no more will dissolve. Do this about 1 tablespoon at a time.

5: Put the cardboard piece on top of the glass, and poke two holes about 2 inches apart. Push the end of each pencil that does not have the wire attached through the holes, and into the water.

6: Finally, attach the other end of the wire to the 9 volt battery with the electrical tape to help hold them in place.

At this point you will see bubbles forming at the tips of the pencils in the water. If you look closely, one will be forming bubbles more quickly than the other. This is the Hydrogen. The one with the fewer
bubbles is the Oxygen.

That's it! You have successfully split hydrogen and oxygen from water.

Wednesday, May 11, 2011

Cryptology - Enigma Machine

Today we learned that the Germans used a device called the Engima machine to encrypt their messages during WWII. They thought it was completely secure, but the Allies broke the code!

We watched this video about how the Engima machine works. The general idea is that when you encode a letter, it goes through three different substitution ciphers, bounces off a "reflector," and then goes back through those same three substitution ciphers again. Each substitution cipher is on a rotor. Each time you encrypt a new letter, at least one rotor moves, so you end up using a different set of substitution ciphers for each letter!


We made our own Enigma machines out of paper and tape. Here's the Enigma machine construction in progress:


Using the engima machine to decode a message:


There's a nice article here about how the Engima machine works and about some of the things that helped the Allies figure out what was going on.

Cryptology - The Alphabet Clock

In classes 3 and 4 we learned about modular arithmetic and the one-time pad.

Modular arithmetic is the sort of arithmetic you do on a clock. On a normal clock, if you start at 7 and add 11 hours you end up at 6. Mathematicians would write it like this:
7+11 = 6 mod 12
(actually, we use three horizontal lines instead of two for the equal sign, but I don't know how to make that symbol on the blog). The "mod 12'' part means that we're on a clock with 12 numbers, starting with 0 at the top (instead of 12) and continuing around to 11.

For cryptology, we use a clock with the 26 letters on it. These correspond to the numbers from 0 to 25.
On the alphabet clock,
0 and 26 both mean A
1 and 27 both mean B
25 and -1 both mean Z
and so on.

To use this clock to encrypt a message, we need some starting plaintext and a key. A key is a secret bit of information that the person sending the message and the person receiving the message both have to know in order for this to work.

Let's use CHICKEN as the plaintext and MOOFAZA as the key.

We translate the plaintext and key into numbers, using the clock. We add the first number of plaintext and the first number of key, then the second number of plaintext and the second number of key, and so on.
plaintext   CHICKEN   2    7    8    2   10  4  13
key MOOFAZA 12 14 14 5 0 25 0
sum 14 21 22 7 10 29 13

Then we translate the numbers back into letters. On the alphabet clock, 29 and 3 are both D.

14 21 22 7 10 29 13
O V W H K D N

We send the ciphertext OVWHKDN.


To decrypt the message, we need to know the ciphertext and the key. Since we added the key to get the ciphertext, we have to subtract the key to get the plaintext. Translate the ciphertext and key into numbers, and take the difference between each pair of numbers:

ciphertext OVWHKDN 14 21 22 7 10 29 13
key MOOFAZA 12 14 14 5 0 25 0
difference 2 7 8 2 10 4 13

Finally we translate those numbers back into letters:

2 7 8 2 10 4 13
C H I C K E N

If the key is totally random and as long as the message, we have what's called a one-time pad. In one sense, this is the best cryptography there is: if you don't know the key, you can't figure out the message. I don't care how good your computer is - it can tell all the possible messages, but it can't tell which was the real one.


In another sense, this is horribly impractical. You have to get a gigantic list of completely random letters to your buddy, without anyone else seeing them, and you and your buddy have to always be at the same place in the gigantic list of letters. What a mess!

Wednesday, April 20, 2011

EB: Cryptology

The first class we learned about the Caesar Cipher and other shift ciphers, as well as learning some useful cryptology words.
  • Plaintext - the meaningful English message
  • Ciphertext - what you actually send; the secret coded message
  • Encrypt - turn the plaintext into ciphertext
  • Decrypt - turn the ciphertext back into plaintext
The students paired off and sent their partners encrypted messages to decrypt.

Today I gave the class several encrypted messages to break, of increasing degrees of difficulty. We worked them all out on the board. It was helpful that I forgot what the plaintext messages were!

Here's the first one:

MJQQT, HQFXX.
HTSLWFYZQFYNTSX TS GWJFPNSL YMNX HNUMJW!
- OJXXJ

This one is pretty easy. It looks like a letter, and I wrote it, so "OJXXJ" stands for "JESSE." The first word, "MJQQT," is "HELLO." Since I used a shift cipher, the rest follows from there.

For the next message, I didn't give them any helpful formatting.

KXNDRSCYXOKVCYFOBIXSMO

The most common English letter is "E," and the most common characters in this ciphertext are "X" and "O." I was still using a shift cipher, so there were really only two things to try. That didn't take long either.

Then, since they kept breaking my shift ciphers, I changed to a cipher that randomly mixed up the letters. I did give them back the formatting, though - I didn't want it to be impossible (or take more than the hour-long class)!

VCPT PT E DPYYRHRNV VMSR FY ZFDR

The letter "E" in the ciphertext is a one-letter word, so it must be either "I" or "A" (assuming I'm using grammatical English!). The class went with "A".

Then the two-letter words in the ciphertext, "PT" and "FY," must translate to two-letter English words that don't contain the letter "A." Also, the two-letter word "PT" is the second half of the four-letter word "VCPT." It was agreed that "THIS IS" was a reasonable guess at those first two words.

From there, they got the answer!

The picture shows, from left to right:
  • The ciphertext-to-plaintext translation (we used this more for the first two puzzles)
  • The ciphertext, with plaintext underneath
  • A list of common 2-letter English words

Tuesday, April 19, 2011

More Killer Sudoku

Yesterday and today we worked on this puzzle. Renata and I were impressed with how well everyone worked on it - almost every moment was full of raised hands and kids saying "I know something!" We finished before the end of class!




Thursday, April 14, 2011

Origami and Pascal's Triangle

The first quarter of April was spring break, and we haven't had time to do a whole lot since then. We've made some neat origami vases and boxes. The vase required folding the paper exactly in thirds, so we had to figure out how to do that (Google "origami thirds" and you'll find several different ways).

We also did a little more stuff with Pascal's Triangle. If we left-justify all the numbers, we get a staircase instead of a pyramid:

1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1

If we sum the numbers in each row, we get doubles:

Sum
1 1
1 1 2
1 2 1 4
1 3 3 1 8
1 4 6 4 1 16
1 5 10 10 5 1 32

If we sum the numbers on each finite diagonal, we get the Fibonacci numbers. I think this is really cool.

Sum
1 1
1 1 1
2 1 2 1
3 1 3 3 1
5 1 4 6 4 1
8 1 5 10 10 5 1

Thursday, March 31, 2011

Pascal's Triangle and Tetrahedrons

Here's Pascal's Triangle as we left it yesterday. Comparing to the one I posted yesterday, it looks like we made a few mistakes in the bottom two rows. Oops! I think the infinity signs on the right are there to show that the triangle can keep going on and on forever.


Today we started with square numbers, so called because they're the numbers of dots you can arrange into squares of increasing sizes (see upper right corner of chalkboard). There are also "triangular numbers," which are the numbers of dots you can arrange into equilateral triangles of increasing sizes (see middle right chalkboard).


The diagonal of Pascal's triangle that contains the numbers 1, 3, 6, 10, 15, etc. consists of the triangular numbers.

Pascal's triangle also contains "tetrahedral numbers." To make sense of this we had to know what a tetrahedron is. First we tried to make one out of ourselves:


Since our building pieces (the kids) were different heights, this didn't exactly work. I started to build a tetrahedron using pencils, and then the kids brought out the zometools. I had never played with these before. Now I want buckets of zometools. So much fun!

We all built tetrahedra, myself included.


Lydia built a tetrahedron tree.



Saul made a very large tetrahedron and filled it with the little white zomespheres. This is where the "tetrahedral numbers" come in - by counting up the number of spheres it takes to make tetrahedra of increasing sizes.


He very kindly let Noah put on the last one:


The tetrahedral numbers are 1, 4, 10, ... which just happen to be the next diagonal in Pascal's Triangle. We have the natural numbers, the triangular numbers, and the tetrahedral numbers:

1

1 1

1 2 1

1 3 3 1

1 4 6 4 1

1 5 10 10 5 1

1 6 15 20 15 6 1

1 7 21 35 35 21 7 1

1 8 28 56 70 56 28 8 1

1 9 36 84 126 126 84 36 9 1

1 10 45 120 210 252 210 120 45 10 1

1 11 55 165 330 462 462 300 165 55 11


When Saul counted up all the zomespheres he stacked inside his tetrahedron, he got 165, which is indeed one of the tetrahedral numbers. No zomespheres were lost in the counting of this tetrahedral number.


Wednesday, March 30, 2011

Patterns in Pascal's Triangle

Today we got all the way to row 14. The very first row, the point of the triangle that only has one number, is row zero.


1

1 1

1 2 1

1 3 3 1

1 4 6 4 1

1 5 10 10 5 1

1 6 15 20 15 6 1

1 7 21 35 35 21 7 1

1 8 28 56 70 56 28 8 1

1 9 36 84 126 126 84 36 9 1

1 10 45 120 210 252 210 120 45 10 1

1 11 55 165 330 462 462 300 165 55 11 1

1 12 66 220 495 792 924 792 495 220 66 12 1

1 13 78 186 715 1287 1716 1716 1287 715 186 78 13 1

1 14 91 264 901 2002 3003 3432 3003 2002 901 264 91 14 1


We expanded on some of the patterns from yesterday and found new patterns. I was very impressed with the pattern-finding. Here are some of the patterns.


The numbers in the second diagonal go up by 1 each time:


1

1 1

1 2 1

1 3 3 1

1 4 6 4 1

1 5 10 10 5 1

1 6 15 20 15 6 1

1 7 21 35 35 21 7 1

1 8 28 56 70 56 28 8 1

1 9 36 84 126 126 84 36 9 1


The numbers in the next diagonal go up by 2, then 3, then 4, then 5, etc.


1

1 1

1 2 1

1 3 3 1

1 4 6 4 1

1 5 10 10 5 1

1 6 15 20 15 6 1

1 7 21 35 35 21 7 1

1 8 28 56 70 56 28 8 1

1 9 36 84 126 126 84 36 9 1


The numbers in the next diagonal go up by 3, then 6, then 10, then 15, etc.:


1

1 1

1 2 1

1 3 3 1

1 4 6 4 1

1 5 10 10 5 1

1 6 15 20 15 6 1

1 7 21 35 35 21 7 1

1 8 28 56 70 56 28 8 1

1 9 36 84 126 126 84 36 9 1


The numbers in row 7, except for the outer 1's, are all multiples of 7. I added that this is true for any prime number row: all the numbers in that row, except the outer 1's, will be multiples of the prime.


1

1 1

1 2 1

1 3 3 1

1 4 6 4 1

1 5 10 10 5 1

1 6 15 20 15 6 1

1 7 21 35 35 21 7 1

1 8 28 56 70 56 28 8 1

1 9 36 84 126 126 84 36 9 1

1 10 45 120 210 252 210 120 45 10 1

1 11 55 165 330 462 462 300 165 55 11 1

1 12 66 220 495 792 924 792 495 220 66 12 1

1 13 78 186 715 1287 1716 1716 1287 715 186 78 13 1

1 14 91 264 901 2002 3003 3432 3003 2002 901 264 91 14 1



Row 0 has 1 number, the next row has 2 numbers, the next row has 3 numbers, etc.:


1 - 1 number

1 1 - 2 numbers

1 2 1 - 3 numbers

1 3 3 1 - 4 numbers


Only even-number rows have a middle number (this is because we can split an even number in half, but we can't split an odd number in half).


In even-number rows the "choose 2" number is a multiple of half the row number. In row 4 the number 4C2=6 is a multiple of 2, in row 6 the number 6C2=15 is a multiple of 3, in row 8 the number 8C2=28 is a multiple of 4, etc:


1

1 1

1 2 1

1 3 3 1

1 4 6 4 1

1 5 10 10 5 1

1 6 15 20 15 6 1

1 7 21 35 35 21 7 1

1 8 28 56 70 56 28 8 1

1 9 36 84 126 126 84 36 9 1

1 10 45 120 210 252 210 120 45 10 1

1 11 55 165 330 462 462 300 165 55 11 1

1 12 66 220 495 792 924 792 495 220 66 12 1

1 13 78 186 715 1287 1716 1716 1287 715 186 78 13 1

1 14 91 264 901 2002 3003 3432 3003 2002 901 264 91 14 1



The other numbers in that diagonal, on the odd-number rows, are special for a different reason:

3*1=3

5*2=10

7*3=21

9*4=36

etc.



1

1 1

1 2 1

1 3 3 1

1 4 6 4 1

1 5 10 10 5 1

1 6 15 20 15 6 1

1 7 21 35 35 21 7 1

1 8 28 56 70 56 28 8 1

1 9 36 84 126 126 84 36 9 1

1 10 45 120 210 252 210 120 45 10 1

1 11 55 165 330 462 462 300 165 55 11 1

1 12 66 220 495 792 924 792 495 220 66 12 1

1 13 78 186 715 1287 1716 1716 1287 715 186 78 13 1

1 14 91 264 901 2002 3003 3432 3003 2002 901 264 91 14 1

Monday, March 28, 2011

Counting Part 3: Buttons

Buttons (The Big Group)

Take 5 buttons: red, white, green, yellow, and purple. How many ways are there to choose 1 button from those 5? 5, of course.

How many ways are there to choose 2 buttons of different colors? The class agreed that order didn't matter - choosing red and white was the same thing as choosing white and red. The students found 10 ways to choose 2 buttons from 5.

We started in with the mathematical notation. The mathematical notation for "the number of ways to choose 2 things from 5" is 5C2. So we found
5C1=5
5C2=10

The most prevalent guess was that 5C3 would be 15, but it turned out that 5C3=10.

We found that 5C4=5, because choosing 4 buttons is the same as choosing 1 button to exclude. Here's what the board looked like after we figured all this out and started discussing what would happen if we started with 6 buttons:


The next day we continued finding 6C0, 6C2, ... , 6C6. Then we went back and started with 0C0. There's only one way to not take any buttons, which is to not take any. So
0C0=1
If we start with 1 button, we get
1C0=1, 1C1=1
With 2 buttons,
2C0=1, 2C1=2, 2C2=1
With 3 buttons,
3C0=1, 3C1=3, 3C2=3, 3C3=1
We continued down to row 6, and got the following pretty picture:
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
1 6 15 20 15 6 1

This is a very famous creature called "Pascal's Triangle." To get each number for the next row, you add up the two numbers above it. For example, 5+10=15:
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
1 6 15 20 15 6 1

On their own, each kid completed the triangle up to row 10 and looked for patterns. Some student observations:
  • All the numbers in row 7 (except 1) are multiples of 7:
1 7 21 35 35 21 7 1
  • All the numbers along the outside of the triangle are 1.
  • The numbers that aren't quite along the outside go up by 1 each time:
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
1 6 15 20 15 6 1
  • To fill in the triangle, you only have to find half of a row because the second half mirrors the first:
1 6 15 20 15 6 1
  • In rows that have a "middle number," the middle number is always even:
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
1 6 15 20 15 6 1

Counting Part 2: Poker

Poker (The Small Group)

The first question: How many possible poker hands are there?

After playing around with 2- and 3- card hands, which are easier to think about, they arrived at their first answer:
52*51*50*49*48.

This is a good start, but it's assuming order matters, and thus is counting each hand more than once. Order doesn't matter in poker, because whether you have 2-3-4-5-5 or 2-5-5-4-3, it's the same poker hand. Each 5-card hand gets counted 5*4*3*2*1 times, so the real answer is
(52*51*50*49*48)/(5*4*3*2*1)=2,598,960
possible poker hands.

Then we figured out how many ways there were to get various hands. There are only 4 ways to get a a royal flush, which means the probability of getting a royal flush is
(4)/(2598960) ~=~ .0000015
A straight flush that isn't also a royal flush can start on A, 2, 3, 4, 5, 6, 7, 8, or 9, so there are 9 ways per suit for a total of 36 ways to get a royal flush. The probability of getting a straight flush is
(36)/(2598960) ~=~ .000014
These hands are not very likely!

It's harder to figure out how many ways there are to get one pair. There are 13 choices of what the pair will be (A through K). Suppose we have a pair of aces. There are 6 different ways to choose a pair of aces from the 4 aces in the deck. Then we have to fill in the other 3 cards in the hand.
A-A-_-_-_

Since the third card can't be an ace (or we wouldn't have one pair), there are 48 choices for the third card. The fourth card can't be an ace, and also can't be whatever we picked for the third card, so there are 44 choices. The fifth card can't be an ace, the same as the third card, or the same as the fourth card, so there are 40 choices for the fifth card.

To make sure we aren't over-counting those last three cards, we need to divide by 6 (the number of ways to order those cards). This gives us
(13*6*48*44*40)/6 = 1,098,240
ways to get a single pair. The probability of getting a single pair in a five-card poker hand is
1,098,240 / 2,598,960 ~=~ .42

After figuring all this out, we spent a couple of days playing poker and tallying up the hands we got to see if they looked like we expected they would. There were lots of single pairs, as expected, with a scattering of two pair and three of a kind. I got lots of junk hands, which the kids found very amusing.

We played with buttons, starting with 20 buttons each. I pointed out to the loser of the first game that if we had been using real money, he would have just lost $20 in half an hour. He replied that he wasn't going to gamble with real money. :)

Here's a site that explains how to calculate odds for various poker hands.

Counting, Part 1: Dice

After working in math books, Renata and I usually split up the kids into two groups. The small group consists of Max, Alec, and Lukas; the big group consists of everyone else. I've been on a combinatorics kick recently, so both groups have been counting things.

Dice (Everyone)

The big group and the small group did the same activities on different days, with slight variations.

If you roll two dice and add up the numbers on their faces, you get a sum between 2 and 12. What are the different ways to get each sum?

The students came up with a very nice way to write the results. It looks like a mountain:

1+6
3+3 6+1 4+4
3+2 4+2 5+2 6+2 5+4
2+2 2+3 2+4 2+5 2+6 4+5 5+5
2+1 3+1 4+1 1+5 4+3 3+5 3+6 4+6 5+6
1+1 1+2 1+3 1+4 5+1 3+4 5+3 6+3 6+4 6+5 6+6
Sum: 2 3 4 5 6 7 8 9 10 11 12
Ways: 1 2 3 4 5 6 5 4 3 2 1

We moved on to three dice. The mountain was much bigger, but still nicely mountain-shaped! This is good intuition for dealing with probability distributions in future years. Look at the pretty mountains.

There's a shortcut if you care about how many ways you can make a particular sum, but don't care what the ways are. Suppose you want 3 dice to sum to 6. The first die can be 1, 2, 3, or 4 (the three dice can't add up to 6 if one of them is 5 or 6).

If the first die is 1, the next two must add up to 5. Looking at our two-dice mountain, there are 4 ways for this to happen.
1+_+_=6 _+_=5 4 ways

We can do the same sort of thing for the other possible values of the first die.
2+_+_=6 _+_=4 3 ways
3+_+_=6 _+_=3 2 ways
4+_+_=6 _+_=2 1 way

This means there are 4+3+2+1=10 ways for three dice to sum to 6.

Using this shortcut, I think the small group counted how many ways you could make each possible sum with 4 dice!