Math Fun Facts!
hosted by the Harvey Mudd College Math Department created, authored and ©1999-2010 by Francis Su
Subscribe to our RSS feed   or follow us on Twitter.
Get a random Fun Fact!
No subject limitations
Search only in selected subjects
    Calculus or Analysis
    Number Theory
    Other subjects
  Select Difficulty  
Enter keywords 

  The Math Fun Facts App!
  List All : List Recent : List Popular
  About Math Fun Facts / How to Use
  Contributors / Fun Facts Home
© 1999-2010 by Francis Edward Su
All rights reserved.

From the Fun Fact files, here is a Fun Fact at the Easy level:

Binary Card Trick

You put a deck of cards in your pocket, and invite anyone in the audience to call out a number between 1 and 15. Then you reach into your pocket, you take out a set of cards whose sum is the number that was called!

How can you perform this magic trick?

The Math Behind the Fact:
This mathematical magic trick can be found in the reference and is based on the properties of binary numbers. Every number between 1 and 15 has a unique representation as a sum of some collection of the numbers 1, 2, 4, and 8. (To see which collection, just take the given number and successively subtract the largest number of 1, 2, 4, and 8 that is less than the given number. That number is part of your collection. The subtraction yields a new number; now repeat the process with this number, over and over, until you get 0.) The collection of numbers you obtain reveals the binary decomposition of the given number into sums of powers of two (in contrast to the usual representation of a number into sums of powers of ten).

Now before the trick starts, pick an Ace, 2, 4, and 8 and put them on top of the deck, and then put the deck in your pocket.

Then when a number between 1 and 15 is called out, take the binary decomposition of the number, and use that to determine which of the first four cards you will pull out. No one needs to know that you never need to use the other cards!

How to Cite this Page:
Su, Francis E., et al. "Binary Card Trick." Math Fun Facts. <>.

Keywords:    binary arithmetic, mathematical magic trick
Subjects:    number theory, other
Level:    Easy
Fun Fact suggested by:   Francis Su
Suggestions? Use this form.
Click to rate this Fun Fact...
    *   Awesome! I totally dig it!
    *   Fun enough to tell a friend!
    *   Mildly interesting
    *   Not really noteworthy
and see the most popular Facts!
New: get the MathFeed iPhone App!

Brings you news and views on math:
showcasing its power, beauty, and humanity

Want another Math Fun Fact?

For more fun, tour the Mathematics Department at Harvey Mudd College!