A New Twist in a Famous Problem

I recently gave my STEP students a question from our old 2014 PRIMES entrance test.

Puzzle. John’s secret number is between 1 and 216 inclusive, and you can ask him yes-or-no questions, but he may lie in response to one of the questions. Explain how to determine his number in 21 questions.

Here is the standard solution. We start by asking John to convert his number into binary and add zeros at the beginning if needed to make the result a binary string of length 16. For the first 15 questions, we do the following. For question i, we ask: “Is the i-th digit of your string zero?” For question 16, we ask, “Have you lied in response to a previous question?” If he lied on a previous question, he must say YES. If he didn’t, he might lie on question 16 and also say YES. In any case, if the answer is NO, he didn’t lie on the first 15 questions and we know the first 15 digits of the number. Then, we ask about the last digit three times, and the answer given at least twice is correct, so we know the number.

If the answer to question 16 is YES, then he lied on one of the questions 1–16. From now on, he has to tell the truth since he already lied. We use binary search (4 questions) to determine on which question he lied. This will tell us the first 15 digits, and we can use the 21st question to find the last digit.

One of my students, Tanish, invented an out-of-the-box solution that uses 18 questions. The idea is to force John to lie in the first two questions, and then safely proceed with the binary search.

He suggested asking the following two questions: “Are you going to answer NO in response to the next question?” and “Did you respond YES to the previous question?” The reader can check that whatever John replies, he is forced to lie exactly once.

Another student, Vivek, had a similar idea but used only one question to force John to lie: “Will you say NO to this question?”


Share:Facebooktwitterredditpinterestlinkedinmail

2025 MIT Mystery Hunt

My team, Death and Mayhem, organized the 2025 MIT Mystery Hunt. The hunt was a great success. Many people commented that it was the best mystery hunt ever.

This year, we added a new and interesting feature. Not only were teams allowed to choose which puzzles to unlock, but they were also given a short description of each puzzle in addition to its title. So, small teams who liked crosswords could choose to work only on crosswords.

As usual, I will list the mathy puzzles, including our official puzzle descriptions. All the puzzles can be found at the hunt’s All puzzles page.

We had a special round called Stakeout, with easy puzzles. My team isn’t too nerdy, so we didn’t have too many mathematical puzzles overall, and just two puzzles with a math flavor in the Stakeout round, incidentally coauthored by me. Somehow, I like designing easy puzzles. There were two additional puzzles in this round that I enjoyed during testing. I loved the popsicle puzzle so much that I brought it to my grandchildren to solve.

The first round wasn’t too difficult either. Several people praised the ChatGPT puzzle, though it’s not mathy.

  • ChatGPT: A blank textbox with a text entry field below it.

Now, moving to more difficult puzzles, Denis Auroux is famous for designing fantastic logic puzzles. His puzzles below aren’t easy, but many people loved them. I even heard magnificent as praise.

Here are two puzzles I test-solved and enjoyed. The first one is a logic puzzle, while the second one isn’t math-related.

Here are two puzzles that I edited and highly recommend. The first puzzle was initially called Gin and Tonic; I wonder if anyone can guess why.

  • Follow The Rules: An interactive interface with a grid of toggle switches and a grid of lights.
  • Incognito: Cryptic crossword.

These are math-related puzzles that people liked.

I asked only a few people for recommendations. These are math-related puzzles that weren’t mentioned but seem cool. The fourth puzzle was an invitation to the Mystery Hunt, which, not surprisingly, was a puzzle.

I also got a recommendation for a non-math puzzle, which I would definitely have enjoyed watching solved. I’m not sure I’d enjoy solving it alone.

Finally, here is the list of non-math puzzles that seem cool. A warning about the first puzzle: It’s rated R. The first three puzzles are relatively easy; they are from the Stakeout round.

Here is a video from Cracking the Cryptic, joined in this episode by Matt Parker, titled Matt Parker Sets Us A Challenge!. The video is devoted to the second part of the puzzle Maze of Lies, mentioned above, by Denis Auroux and Becca Chang.


Share:Facebooktwitterredditpinterestlinkedinmail

Happy Fractal Holidays!

Take a look at a card one of my students gave me last December. You can spot the Koch snowflake, the Sierpiński triangle, and the Sierpiński carpet on it. I guess my fractal class was a hit.

Happy Holidays card from a student

Share:Facebooktwitterredditpinterestlinkedinmail

A Math Quiz

I am a proud member of the Death and Mayhem team, which participates in the MIT Mystery Hunt every year. This year, our team had the honor of running the hunt.

Here is a puzzle I contributed, titled A Math Quiz. It consists of a list of math problems. I am especially happy that I was able to turn a collection of cute math puzzles into a puzzle-hunt challenge with a word or phrase as its final answer.

Share:Facebooktwitterredditpinterestlinkedinmail

New Gozinta Boxes Trick

Imagine you’re watching a magician. She pulls out two perfectly ordinary boxes — or so it seems. One box is inside the other, like a set of nesting dolls. So far, nothing suspicious.

Then she removes the smaller box, closes the larger one, and slides the larger box inside the smaller one. Ta-da!

The name comes from the way one box goes into the other. Would you like to know the secret? The two boxes are actually identical. Moreover, they are not cubes but cuboids. The inner box is fully closed, while the outerbox is slightly expanded, and the inner box is rotated relative to the outer one.

I first heard about Gozinta Boxes at the Gathering for Gardner conference in 2024. Ivo David gave a talk and presented his new trick: Triple Gozinta Boxes, which you can now buy at TCC Magic. He can place three boxes inside one another — and then repeat the trick in the reverse order.

During his presentation, David mentioned that he knew how to prove that you cannot have more than ten Gozinta Boxes. My immediate reaction was that ten must be overkill. So I decided to give the problem to my STEP students as a project.

We proved that in three or higher dimensions, the maximum number of boxes is three. We also showed that in two dimensions, the maximum is four. You can find all the details in our paper Mathematics of Gozinta Boxes, posted on the arXiv. But we didn’t stop there. We invented a new trick. We constructed three boxes such that not only can they be nested in one order — say, ABC — and in the reverse order, CBA, but they can also be nested in three additional orders, for example ACB, BAC, and BCA. We also proved that achieving all six possible orders is impossible. You can see the trick by following the link for A New Gozinta Boxes Trick.


Share:Facebooktwitterredditpinterestlinkedinmail

Each Point has Three Closest Neighbors

I met Alexander Karabegov during the All-Soviet Math Olympiad in Yerevan. He was one year older than me. By then, when I was still competing in 1976, he was already a freshman at Moscow State University. He proposed the following two related puzzles for the Moscow Olympiad, which I had to solve.

Puzzle 1. You are given a finite number of points on a plane. Prove that there exists a point with not more than 3 closest neighbors.

Just in case, by closest neighbors I mean all points at the minimal distance from a given point. I am sure I solved both puzzles at the time. I leave the solution to the first one to the reader.

Puzzle 2. Can you place a finite number of points on the plane in such a way that each point has exactly 3 closest neighbors?

The last problem has an elegant solution with 24 points chosen from a triangular grid. The story continued almost 40 years later, when Alexander sent me an image (below) of such a configuration with 16 points. He conjectures that this is the minimal configuration.

Conjectured minimal configuration

Karabegov’s Conjecture. Any finite planar point configuration in which every point has exactly 3 closest neighbors must contain at least 16 points.

Can you prove it?

Initially, I didn’t want to give the 24-points solution, but the image above is a big hint, so here you go.

24-point configuration

Both constructions reveal the same underlying pattern. The constructions consist of rhombuses formed by two equilateral triangles, and the rhombuses are connected to each other. The 24-point construction consists of 6 rhombuses, while the 16-point construction consists of 4 rhombuses. What will happen if we try the construction with 3 rhombuses? The image below shows such a configuration, which now has extra edges with the shortest distance. We now see 3 points with more than three closest neighbors each, violating the condition. So the conjecture doesn’t break.

12-point configuration

So far, every smaller attempt failed — can you prove that 16 is minimal?


Share:Facebooktwitterredditpinterestlinkedinmail

Dividing Estate

I was teaching my students the Knaster method of dividing an estate, which I learned from my friend Ingrid Daubechies. Let’s look at an example.

Problem. Alice and Bob are divorcing. They have the portrait of Alice’s grandpa and $10,000. Alice values the portrait at $10,000 because of its sentimental value. Bob values it at a market price of $2,000. How do they divide their estate?

Here is what my students initially suggest.

  1. Give Alice the portrait, and give Bob all the cash.
  2. Give Alice the portrait, and divide the cash in half.

Let’s look at these suggestions in greater detail. Alice values the whole estate at $20,000; Bob values it at $12,000. In the first version, Alice gets half of the estate from her point of view; Bob gets the rest, which is more than half in his point of view. The students are obviously rooting for Bob. In the second version, Bob gets half of the estate in his estimate, while Alice gets the rest, which is more than half in her estimate. The students are obviously rooting for Alice. After some discussion, the students agree that there should be a number between $5,000 and $10,000 that Bob gets, which would be a fairer division than the two initial examples. But how do we find such a number?

This is where the Knaster algorithm comes in. The main idea is that each gets the same amount of money on top of their perceived half. In other words, the Knaster method treats the estate like a sealed-bid auction and equalizes bonuses. Alice thinks that her fair half is $10,000, while Bob thinks his half is $6,000. To equalize bonuses, we want Alice and Bob to each receive their perceived half plus the same amount — call it x. Solving gives x = $2,000. Alice gets the portrait and $2,000, while Bob gets $8,000.

This is a beautiful algorithm that allows each person to be very happy, receiving more than one half. The bigger the taste difference, the more each person gets on top of their portion. The next question is: how can people cheat if they know this algorithm is used?

Alice can cheat by claiming that she values the portrait at $2,000 plus epsilon. Epsilon is needed to guarantee she gets the portrait. This way, they both value the estate the same. Alice gets the portrait and $4,000, which is $2,000 more than the honest way. Symmetrically, Bob can cheat by claiming he values the portrait at $10,000 minus epsilon. This way, he gets $10,000, which is $2,000 more than the honest way.

I’ve been teaching this topic several times now. This year, my student Ben had an out-of-the-box idea on how Alice can cheat. Alice declares that she values the portrait at $0. Bob thinks the estate is worth $12,000, while Alice pretends that she values it at $10,000. After the calculation, Bob gets the portrait and $4,500, which is $500 more than his half of the estate in his view. Alice gets $5,500, which is $500 more than half of the estate in her declaration. Then she buys the portrait from Bob for $2,000. In the end, Alice gets the portrait and $3,500, way more than she would get after an honest use of the algorithm.

The first cheating method seems more profitable than the new one. But still, I love it when my students suggest unexpected ideas.


Share:Facebooktwitterredditpinterestlinkedinmail

A Story about a Scam

Recently, I gave my STEP students the following discussion question.

Puzzle. A long time ago, before anyone had ever heard of ultrasound, there was a psychic who could predict the gender of a future child. No one ever filed a complaint against her. Why?

I based this puzzle on a story I once read. In the story, the psychic kept a neat little journal where she wrote down each client’s name and the predicted gender — except she secretly wrote down the opposite of what she told them. When someone came back complaining that she was wrong, she would calmly open her journal and say, “Oh, you must have misheard”.

This scam demonstrates conditional probability. The satisfied customers never came back; only the unhappy ones did — and those she could ‘prove’ wrong. Understanding probability can help my students detect and expose scams.

My students, of course, had their own theories. The most mathematical one was a pay-on-delivery scheme: if the psychic was right, she got paid; if not, she didn’t. Another innocent idea was for the psychic to keep moving. By the time the babies were born, she’d be long gone predicting future children’s genders somewhere far away.

ChatGPT offered a different explanation: the psychic never said whose future child she was predicting. If the prediction failed, she could always clarify that she meant someone else’s child. After some prodding, the idea evolved and became even sneakier: If the prediction failed, she could always clarify that she meant the couple’s next child, or, if they weren’t planning more children, a grandchild. Another brilliant, but unrealistic idea was to never charge anyone. Hard to sue someone who never took your money.

One student suggested that the psychic wasn’t wrong at all — she was predicting the baby’s true inner gender. In today’s world, rather than in the world before ultrasound, that one almost sounds plausible!

And finally, I’ll leave you to guess one more explanation — proposed, surprisingly, by several students. (Hint: they were disturbingly creative.)

To conclude: I enjoy teaching my students. Understanding probability won’t let them predict the future, but it might make them less gullible.

Share:Facebooktwitterredditpinterestlinkedinmail

Card Dealing Math

Once I wrote a blog essay titled Seven, Ace, Queen, Two, Eight, Three, Jack, Four, Nine, Five, King, Six, Ten. It was about a “magic” card trick. Magic trick. Take a deck of cards face down. Move the top card to the bottom, then deal the new top card face-up on the table. Repeat this process until all the cards are dealt. And — abracadabra — the cards come out in perfect order!

If you want to perform this trick with one suit, the title of that earlier post tells you exactly how to stack your deck.

In the fall of 2023, I gave this trick as a homework problem to my STEP students. The result? We ended up writing a 40-page paper, Card Dealing Math, now available on the arXiv. At one point, we seriously considered calling it The Art of the Deal, but decided against it.

In the homework version, the deck consisted of cards from a single suit, but we generalized it to a deck of N cards labeled 1 through N. The dealing process we studied is called under–down dealing: you alternate between placing one card under the deck and then dealing the next one face-up. It’s very similar to down–under dealing, where you start by dealing the first card instead. These two patterns are often, unsurprisingly, called the Australian dealings.

The under-down dealing turns out to be mathematically equivalent to the Josephus problem. In that famous ancient problem, people are arranged in a circle, and you repeatedly skip one person and execute the next (much grimmer than playing with cards). The classic question asks: given N people, who survives? In our card context, this corresponds to asking where the card labeled N ends up in the prepared deck.

More generally, the Josephus problem can ask the following question. If we number the people in a circle 1 through N, in what order are they eliminated? In our research, we flipped the question around: how should we number the people in the circle so that they’re eliminated in increasing order?

Naturally, we couldn’t stop there. We explored several other dealing patterns, discovered delightful mathematical properties, and along the way added 44 new sequences to the OEIS. The funnest part? We also invented a few brand-new card tricks.


Share:Facebooktwitterredditpinterestlinkedinmail

Do Nothing

Puzzle. How can you make the following equation correct without changing it: 8 + 8 = 91?

The intended answer: turn the paper over! When flipped upside down, the equation becomes 16 = 8 + 8.

As you might expect, my blog post doesn’t stop there. I’d like to share some creative ideas my students came up with when they tackled this puzzle as part of their homework.

The most common suggestion was to interpret the equation modulo some number. For example, it works modulo 75. By extension, it also works modulo any divisor of 75: 3, 5, 15, or 25.

They also suggested interpreting the equation in base 5/3.

One far-fetched but imaginative submission proposed the following: Suppose the equation is written in an alien language whose symbols look identical to ours but have different meanings. In this alien base-10 system, the symbols + and = mean the same as on Earth, but an 8 represents 6, a 9 represents 1, and a 1 represents 2. Then the alien equation 8 + 8 = 91 translates to 6 + 6 = 12 in human, which is perfectly true.

But my favorite answer was the following:

  • Interpret the question mark as a variable and solve the equation. This gives ? = 16/91. We didn’t change the equation — just solved it!

Share:Facebooktwitterredditpinterestlinkedinmail