Card Game Twenty-Four
learn math with fun

To play the game, either click the  Deal  button, or enter any four numbers, preferably positive integers between 1 and 13. Then think of a caculation using addition, subtraction, multiplication and/or division to get the number 24. Click the  Show Answer  button to show "all" possible calculations.

Click
or enter numbers





Force reorder (What's this?)

History Twenty years ago, three out of four Chinese were farmers and most of them were undereducated. Yet they all have remarkable talent in mental arithmetic; they can tell you the answers for 72/2+83 or 3.8*2.5 almost instantly, sometimes even faster than an abacus (ancient Chinese "calculator"). When I was a kid, I got trained by a Chinese poker card game called twenty-four. Not sure if this game contributed to the Chinese farmers' math talent, but the popularity of it among all young people attests to the truth that most Chinese are good at arithmetic.

The game goes like this. Four people each show one card. You think of a calculation with addition, subtraction, multiplication and division on the numbers shown on the cards to get 24. Card Ace is 1, Jack 11, Queen 12, King 13, excluding big and small Jokers. Whoever comes up with the answer first wins that round. For instance, if the cards are 3, 4, 1, and 9, you can say 3*(4+1)+9 (* here means multiply). Obviously, if you or your kid is a third- or fourth-grader in school, this game has some educational value. You're always welcome to download it to your PC and play offline (if clicking the link doesn't work, save this page in View Source as an HTML file, and open it with a Web browser).

Programming A friend of mine told me that recently he wrote exactly the same program, except in VBA for Excel. His program also did an exhaustive computation and concludes that with four positive integers 1 through 13, 88% of the time you should get an answer (i.e. 12% of the time you can't get 24 with any calculation.) But neither of our programs is perfect. For instance, my program shows 1*2*3*4 together with (1*2*3)*4 and others while they are mathematically the same calculation; ideally only one of them should be shown. Jesse Hull emailed me and said his program, written in Java, "accounts for the algebraic differences". For simplicity, my program also does not consider different orders of input numbers unless it doesn't find an answer without changing their order (you can override this behavior by checking Force reorder).

Links If you don't feel challenge playing this game of twenty-four, take a look at my game of forty-eight. (You can change it to any arbitrary number in a matter of minutes.) Or for a younger kid, the game of twelve may be more appropriate. A number of people on the Internet have done similar work, such as Twenty-Four Game at PA HOMESCHOOLERS, Dr. WuWu's Catch 24 and Dr. Math's summary Math in Card Games.

To my Miscellaneous Page