At first it doesn’t even sound like this problem could possibly be solved. It’s hard enough to estimate the number of magic tricks there are today. How the heck could we figure out how many magic tricks there were over 400 years ago with limited historical records? And what does this have to do with math?

This is the kind of topic covered in the book Magical Mathematics by mathematics professors Persi Diaconis and Ron Graham. The book is about the connection between magic tricks and fairly complicated math. In a way, the book is something of a magic trick itself: in one paragraph you’re innocently reading about a magic trick, in the next you are reading about combinatorics, probability, or graph theory, and then you return to the magic and have a sudden urge to pick up a deck of cards to try out the trick yourself. Along the way you’ve been tricked into learning math, and you wonder why all of math education can’t be this much fun.

So to return to the original problem, how is it possible to estimate the number of magic tricks?

.

.

"All will be well if you use your mind for your decisions, and mind only your decisions." Since 2007, I have devoted my life to sharing the joy of game theory and mathematics. MindYourDecisions now has over 1,000 free articles with no ads thanks to community support! Help out and get early access to posts with a pledge on Patreon. .

.



A bit of luck

An unusual historical event provides the background to this problem.

We can use a remarkable coincidence that occurred in 1584 to estimate the number of magic tricks. The coincidence is the appearance of the first two serious magic books, Reginald Scot’s Discoverie of Witchcraft, and J. Prevost’s La Premiere des Subtitles et Plaisantes Inventions. As mentioned above, they are very different books.

…

The two books present us with a natural experiment.

…

The key is that there were two books written independently that each wrote about a sample of magic tricks. This is the information that can lead to an estimate on the total number of tricks.

The model

This technique is capture/recapture and it’s used to estimate things like the number of fish in a pond. I’ve previously written about how it can be used to estimate the number of errors in a book missed by two proofreaders.

The idea is this: in 1584 there was some number of known magic tricks. Each of the two authors independently wrote about a portion of these tricks. And lucky for us, a few of the tricks they commonly wrote about.

Imagine there were N tricks in total, and author 1 sampled p 1 of the tricks (t 1 ), author 2 sampled p 2 of the tricks (t 2 ), and there were some number of common tricks (c). Then we have the following.

t 1 = p 1 N t 2 = p 2 N c = p 1 p 2 N After a bit of algebra, –> N = t 1 t 2 /c

So you multiply the tricks found in each book and divide by the number of tricks they both wrote about.

This is one way to estimate the total number of tricks. This estimator works fine, but it is slightly biased, and can be problematic when the number of common tricks is zero (this will mean dividing by 0).

So a slightly refined estimator is the Chapman estimator, in which 1 is added to each variable.

–> N = (t 1 + 1)(t 2 )/(c + 1) – 1

As written in Magical Mathematics, the estimate was taken without subtracting 1.

–> N = (t 1 + 1)(t 2 + 1)/(c + 1)

The estimate

In the magic books, it was found that t 1 = 52, t 2 = 84, and c = 7. This leads to an estimate of 563 magic tricks.

There are some cautions about this estimate, and the text continues by saying this estimate is high and not all that precise. A 90 percent confidence interval can be estimated from the same variables as [234, 820], centered about 552.

Putting all the facts together, it seems there were about a couple hundred magic tricks that were known at the time. But perhaps the real magic is the math used to find this estimate.

To learn more about the connection between math and magic, do check out Magical Mathematics.