Skip to content
ADVERTISEMENT
Sign In
  • Sections
    • News
    • Advice
    • The Review
  • Topics
    • Data
    • Diversity, Equity, & Inclusion
    • Finance & Operations
    • International
    • Leadership & Governance
    • Teaching & Learning
    • Scholarship & Research
    • Student Success
    • Technology
    • Transitions
    • The Workplace
  • Magazine
    • Current Issue
    • Special Issues
    • Podcast: College Matters from The Chronicle
  • Newsletters
  • Virtual Events
  • Ask Chron
  • Store
    • Featured Products
    • Reports
    • Data
    • Collections
    • Back Issues
  • Jobs
    • Find a Job
    • Post a Job
    • Professional Development
    • Career Resources
    • Virtual Career Fair
  • More
  • Sections
    • News
    • Advice
    • The Review
  • Topics
    • Data
    • Diversity, Equity, & Inclusion
    • Finance & Operations
    • International
    • Leadership & Governance
    • Teaching & Learning
    • Scholarship & Research
    • Student Success
    • Technology
    • Transitions
    • The Workplace
  • Magazine
    • Current Issue
    • Special Issues
    • Podcast: College Matters from The Chronicle
  • Newsletters
  • Virtual Events
  • Ask Chron
  • Store
    • Featured Products
    • Reports
    • Data
    • Collections
    • Back Issues
  • Jobs
    • Find a Job
    • Post a Job
    • Professional Development
    • Career Resources
    • Virtual Career Fair
    Upcoming Events:
    An AI-Driven Work Force
    AI and Microcredentials
Sign In
The Review

A Magic Trick Inspired by Math

By Jeffrey R. Young October 16, 2011
A Magic Trick Inspired by Math 1

Here’s the secret behind one of the mathematical tricks that Persi Diaconis, of Stanford University, developed for his magic act:

In order to guess the cards held by five audience members who have all taken consecutive cards from the top of the deck after the cards have been cut several times, the performer must arrange the cards in the deck carefully before starting the trick. In a way, the cards are arranged in a coded sequence of alternating red and black, which the performer can decode—although doing so takes some work.

To continue reading for FREE, please sign in.

Sign In

Or subscribe now to read with unlimited access for as low as $10/month.

Don’t have an account? Sign up now.

A free account provides you access to a limited number of free articles each month, plus newsletters, job postings, salary data, and exclusive store discounts.

Sign Up

Here’s the secret behind one of the mathematical tricks that Persi Diaconis, of Stanford University, developed for his magic act:

In order to guess the cards held by five audience members who have all taken consecutive cards from the top of the deck after the cards have been cut several times, the performer must arrange the cards in the deck carefully before starting the trick. In a way, the cards are arranged in a coded sequence of alternating red and black, which the performer can decode—although doing so takes some work.

Oh, and this trick works best with a deck of only 32 cards, rather than the standard 52. (In the book, Diaconis notes that spectators never seem to notice the thinner deck he has handed out.)

Because of a concept known as de Bruijn sequences, Diaconis was able to find an order of the cards so that there are 32 distinct arrangements of black cards and red cards, with no repetition of color order. The goal is to make it so that only one arrangement with any given order could be held by one of the five volunteers. That way, if the performer knows which spectators have the red cards and which have the black cards, he can determine which cards all of them hold.

Of course, memorizing 32 sequences would be difficult, so Diaconis would write the possible card orders on a cheat sheet and would pretend to scribble notes on that sheet while delivering banter about how difficult it is to read the minds of his audience members.

The arrangement of the cards, when coded into a binary sequence of zeros and ones (where 1 = red and 0 = black), can be decoded to determine the first card (so the performer knows where to start on the cheat sheet). The first two digits denote the suit of the card: 00 = club, 10 = diamond, 01 = spade, and 11 = heart. The last three digits, when converted from base two (binary) to the familiar base 10, reveal the card’s value; a three, for example, is represented by 0,1,1. So the sequence 1,0,0,1,1 means the first card is the three of diamonds.

Here is how to arrange the 32 cards to make the trick work:

8 of clubs, ace of clubs, 2 of clubs, 4 of clubs, ace of spades, 2 of diamonds, 5 of clubs, 3 of spades, 6 of diamonds, 4 of spades, ace of hearts, 3 of diamonds, 7 of clubs, 7 of spades, 7 of hearts, 6 of hearts, 4 of hearts, 8 of hearts, ace of diamonds, 3 of clubs, 6 of clubs, 5 of spades, 3 of hearts, 7 of diamonds, 6 of spades, 5 of hearts, 2 of hearts, 5 of diamonds, 2 of spades, 4 of diamonds, 8 of spades, and 8 of diamonds.

We welcome your thoughts and questions about this article. Please email the editors or submit a letter for publication.
Tags
Opinion
Share
  • Twitter
  • LinkedIn
  • Facebook
  • Email
Portrait of Jeff Young
About the Author
Jeffrey R. Young
Jeffrey R. Young was a senior editor and writer focused on the impact of technology on society, the future of education, and journalism innovation. He led a team at The Chronicle of Higher Education that explored new story formats. He is currently managing editor of EdSurge.
ADVERTISEMENT
ADVERTISEMENT

Related Content

The Magical Mind of Persi Diaconis

More News

Photo illustration showing Santa Ono seated, places small in the corner of a dark space
'Unrelentingly Sad'
Santa Ono Wanted a Presidency. He Became a Pariah.
Illustration of a rushing crowd carrying HSI letters
Seeking precedent
Funding for Hispanic-Serving Institutions Is Discriminatory and Unconstitutional, Lawsuit Argues
Photo-based illustration of scissors cutting through paper that is a photo of an idyllic liberal arts college campus on one side and money on the other
Finance
Small Colleges Are Banding Together Against a Higher Endowment Tax. This Is Why.
Pano Kanelos, founding president of the U. of Austin.
Q&A
One Year In, What Has ‘the Anti-Harvard’ University Accomplished?

From The Review

Photo- and type-based illustration depicting the acronym AAUP with the second A as the arrow of a compass and facing not north but southeast.
The Review | Essay
The Unraveling of the AAUP
By Matthew W. Finkin
Photo-based illustration of the Capitol building dome propped on a stick attached to a string, like a trap.
The Review | Opinion
Colleges Can’t Trust the Federal Government. What Now?
By Brian Rosenberg
Illustration of an unequal sign in black on a white background
The Review | Essay
What Is Replacing DEI? Racism.
By Richard Amesbury

Upcoming Events

Plain_Acuity_DurableSkills_VF.png
Why Employers Value ‘Durable’ Skills
Warwick_Leadership_Javi.png
University Transformation: a Global Leadership Perspective
  • Explore Content
    • Latest News
    • Newsletters
    • Letters
    • Free Reports and Guides
    • Professional Development
    • Virtual Events
    • Chronicle Store
    • Chronicle Intelligence
    • Jobs in Higher Education
    • Post a Job
  • Know The Chronicle
    • About Us
    • Vision, Mission, Values
    • DEI at The Chronicle
    • Write for Us
    • Work at The Chronicle
    • Our Reporting Process
    • Advertise With Us
    • Brand Studio
    • Accessibility Statement
  • Account and Access
    • Manage Your Account
    • Manage Newsletters
    • Individual Subscriptions
    • Group and Institutional Access
    • Subscription & Account FAQ
  • Get Support
    • Contact Us
    • Reprints & Permissions
    • User Agreement
    • Terms and Conditions
    • Privacy Policy
    • California Privacy Policy
    • Do Not Sell My Personal Information
1255 23rd Street, N.W. Washington, D.C. 20037
© 2025 The Chronicle of Higher Education
The Chronicle of Higher Education is academe’s most trusted resource for independent journalism, career development, and forward-looking intelligence. Our readers lead, teach, learn, and innovate with insights from The Chronicle.
Follow Us
  • twitter
  • instagram
  • youtube
  • facebook
  • linkedin