Archive for the ‘Puzzles’ Category.

## Candy Game

I recently saw another puzzle on Facebook, a generalization of a problem from the 2002 Belarus Olympiad. In the problem, there are red and white boxes. Given how Russia and Belarus are filled with propaganda, my first question was whether the Belarusian flag was red and white. But in fact, the official flag is red and green; however, the opposition uses a red and white one. It could either be a coincidence or a sneaky way of protesting. Anyway, here is the problem.

Puzzle. There are two boxes filled with candy. The red box has R candies, and the white box has W candies. Alice and Bob are playing a game where Alice starts, and both players have the same options each turn: Either move one candy from the red box to the white box or take two candies from any box and eat them. The player who can’t move loses. For which values of R and W is each of the following true?

• Alice, following her optimal strategy, wins but might lose if she makes a mistake.
• Alice wins no matter what.
• Bob, following his optimal strategy, wins but might lose if he makes a mistake.
• Bob wins no matter what.

The list of options is weird, but I decided to keep it to emphasize …. Oops, I do not want to spoil it. You can decide for yourself what I wanted to emphasize.

Share:

## Childhood Memories

I was browsing my analog archives, my high-school notes, and stumbled upon a couple of problems from a math battle we had.

Puzzle. A square is divided into 100 pieces of the same area, in two ways. Prove that you can find 100 points such that each piece in the first division has a point inside, and each piece in the second division also has a point inside.

Puzzle. There is a finite number of points on a plane. All distances between any pairs of points are distinct. Each point is connected to its closest neighboring point. Prove that each point is connected to no more than 5 points.

Share:

## Nostalgia

I used to love math problems about weighing things. But then I got distracted by my own personal scale with its slowly rising numbers. However, having recently lost a few pounds, I want to get back to other scales!

Puzzle. You have a balance scale that is broken in a consistent way: if you put two objects on its two pans, the scale will show you that the left pan is heavier, lighter, or the same weight as the right pan, but it may be wrong. However, it will give the same answer each time you repeat this test with the same two weights. You have a bag of flour and a 1-kilo weight. How can you use this scale to measure out 1 kilo of flour?

Puzzle. This time, your scale is not broken, and, moreover, it is not a balance scale but a digital one that tells you the weight of the objects you put on it. The scale does have a quirk. It can only measure two objects at a time. You have 13 coins of potentially different weights. How can you figure out the total weight of the 13 coins in 8 measurements?

The next puzzle was sent to me by Konstantin Knop, a coin puzzle master. This time there is no physical scale involved; rather, some sort of god answers your questions.

Puzzle. 26 identical-looking coins are arranged in a circle. Two of the coins which are next to each other are fake. You are allowed to pick any set of coins and ask how many fake coins are in the set. What is the smallest number of questions you need to find both fake coins if you only get the answers after you have posed all your questions?

Share:

## The Power of a Computational Proof: Uncrossed Knight’s Tours Continued

In December 2022, I wrote a blog post Uncrossed Knight’s Tours about Derek Kisman’s amazing achievement of calculating the largest uncrossed knight’s tours on rectangular chessboards on sizes M-by-N, where M is small, and N can be very very large.

The data showed some asymptotic periodicity, and I wondered how to prove it mathematically. I didn’t realize that Derek already proved it. In my ignorance of programming, I assumed that programs just spewed out the data and didn’t think they could prove anything. I was wrong. It appears that no other proof is needed. Derek tried to explain the details to me using the terminology of dynamic programming, but I am not sure I can reproduce it here.

Let’s recall the problem. Consider an M-by-N chessboard and a knight that moves according to standard chess rules: jumping one square in one direction and two squares in an orthogonal direction. The knight must visit as many squares as possible, without repeats, and then return to its starting square. In addition, the knight may never cross its own path. If you imagine the knight’s path consisting of straight line segments connecting the centers of the squares it visits, these segments must form a simple polygon. To summarize, given M and N, we want to calculate the longest uncrossed knight’s tour length.

To be clear: the programs, their output data, proven answers, and images are by Derek Kisman. I am just a humble messenger showing my new appreciation of the power of a computational proof.

The image shows Derek’s solution for a 3-by-13 chessboard. There is a repeating 3-by-4 pattern marked by dashed lines. The same tour works for boards of lengths 10, 11, and 12. Thus, for chessboards of width 3 and length from 10 to 13 inclusive, the longest uncrossed knight’s tour is length 10. We can write the answers for 3-by-N chessboards as a sequence with index N, where -1 means the tour is impossible. The sequence starts with N = 1: -1, -1, -1, 4, 6, 6, 6, 6, 10, 10, 10, 10, 14, 14, ….

We can prove that this sequence is correct without programming. Suppose the tour starts in the leftmost column. If we start in the middle of the column, the whole tour ends as a rhombus and a tour of length 4, which, by the way, is the longest tour for N = 5. Thus, for a larger N, we have to start in a corner. From there, there are only two possible moves. We can see that the continuation is unique and that, asymptotically, we gain one step per extra column. That is, asymptotically, the length of the longest tour divided by N is 1.

Derek uses an additional notation in the following sequence: each cycle is in brackets. Any two consecutive cycles differ by the same constant. So to continue the sequence indefinitely, it is enough to know the first two cycles.

Closed tours: 3xN (asymptote 1):  -1, -1, -1, -1, 4, [6, 6, 6, 6], [10, 10, 10, 10], …

I continue with other examples Derek calculated:

Closed tours: 4xN (asymptote 2): -1, -1, -1, [4], [6], …

Closed tours: 5xN (asymptote 2 3/5):  -1, -1, 4, 6, [8, 12, 14, 18, 20, 22, 24, 28, 30, 34], [34, 38, 40, 44, 46, 48, 50, 54, 56, 60], …

Closed tours: 6xN (asymptote 4): -1, -1, 6, 8, 12, 12, 18, 22, 24, 28, 32, 36, [38], [42], …

Closed tours: 7xN (asymptote 4 10/33):  -1, -1, 6, 10, 14, 18, 24, 26, 32, 36, 42, 44, 48, 54, 58, 62, 66, 72, 74, 80, 84, 88, 94, 98, 100, 106, 112, 114, 118, 124, 128, 130, [136, 140, 144, 148, 154, 158, 162, 166, 170, 176, 180, 184, 188, 192, 196, 200, 204, 210, 214, 218, 222, 226, 232, 236, 240, 244, 248, 254, 256, 260, 266, 270, 274], [278, 282, 286, 290, 296, 300, 304, 308, 312, 318, 322, 326, 330, 334, 338, 342, 346, 352, 356, 360, 364, 368, 374, 378, 382, 386, 390, 396, 398, 402, 408, 412, 416], …

Closed tours: 8xN (asymptote 6): -1, -1, 6, 12, 18, 22, 26, 32, 36, 42, 46, 52, 58, [64, 70, 76, 80, 88, 92], [100, 106, 112, 116, 124, 128], …

Closed tours: 9xN (asymptote 6 6/29): -1, -1, 6, 14, 20, 24, 32, 36, 42, 50, 56, 60, 68, 74, 80, 86, 94, 98, 106, 114, 118, 126, 132, 136, [144, 150, 156, 162, 168, 174, 180, 186, 192, 200, 206, 212, 218, 224, 230, 236, 242, 250, 254, 262, 268, 274, 280, 286, 292, 300, 304, 312, 318, 324, 330, 336, 342, 348, 354, 360, 366, 372, 378, 386, 392, 398, 404, 410, 416, 422, 428, 436, 440, 448, 454, 460, 466, 474, 478, 486, 492, 498], [504, 510, 516, 522, 528, 534, 540, 546, 552, 560, 566, 572, 578, 584, 590, 596, 602, 610, 614, 622, 628, 634, 640, 646, 652, 660, 664, 672, 678, 684, 690, 696, 702, 708, 714, 720, 726, 732, 738, 746, 752, 758, 764, 770, 776, 782, 788, 796, 800, 808, 814, 820, 826, 834, 838, 846, 852, 858], …

Closed tours: 10xN (asymptote 8): -1, -1, 10, 16, 22, 28, 36, 42, 50, 54, 64, 70, 78, 84, 92, 100, [106], [114], … I do not have an image for this case.

As you might have noticed, for an even M, the asymptote equals M-2. The asymptote for an odd M is slightly greater than the asymptote for M-1.

Derek also calculated the longest open knight’s tours: the tours where the knight doesn’t have to return to its starting position.

Open tours: 2xN (asymptote 1/2): -1, -1, [2, 2], [3, 3], …

Open tours: 3xN (asymptote 1): -1, 2, 3, 5, 6, 7, [9], [10], …

Open tours: 4xN (asymptote 2): -1, 2, 5, [6], [8], …

Open tours: 5xN (asymptote 3): -1, 3, 6, 8, 11, 15, 17, 20, 23, 26, 29, [32, 35, 38, 41, 44, 46], [50, 53, 56, 59, 62, 64], …

Open tours: 6xN (asymptote 4): -1, 3, 7, 10, 15, 18, 22, 26, 30, 33, [36], [40], …

Open tours: 7xN (asymptote 5): -1, 4, 9, 12, 17, 22, 25, 31, 36, [40], [45], …

Open tours: 8xN (asymptote 6): -1, 4, 10, 14, 20, 26, 31, 36, 43, 48, 54, 60, [64], [70], …

Open tours: 9xN open (asymptote 7): -1, 5, 11, 16, 23, 30, 36, 43, 48, 56, 62, 68, 75, [82, 88, 94], [103, 109, 115], … I do not have an image for this case.

There are a lot of interesting new sequences in this essay that were very nontrivial to calculate. I hope someone adds them to the OEIS database.

Share:

## Balls in Boxes

I stumbled upon a cute puzzle on Facebook which originally came from a new book, Creative Puzzles to Ignite Your Mind by Shyam Sunder Gupta.

Puzzle. We have four identical boxes. One of the boxes contains three black balls (BBB), another box has two black and one white balls (BBW), the third box has one black and two white balls (BWW), and the last box has three white balls (WWW). Four labels, BBB, BBW, BWW, and WWW, are put on the boxes, one per box. As is often the case in such puzzles, none of the labels match the contents, and this fact is common knowledge. Four sages get one box each. Each sage sees his label but doesn’t know the other’s labels. Without looking in the box, each sage is asked to take out two balls and guess the color of the third ball. All the sages are in the same room and can hear each other and see the colors of the balls that are taken out.

• The first sage takes out two black balls and says, “I know the color of the third ball.”
• The second sage takes out one black and one white ball and says, “I know the color of the third ball.”
• The third sage takes out two white balls and says, “I don’t know the color of the third ball.”
• The fourth sage says, without taking out any balls, “I know the color of all the balls in my box and also the content of all the other boxes.”

Can you figure out what’s in the boxes?

Share:

## The Odd-one-out Dilemma

I do not like odd-one-out puzzles. This old and famous example is one of the reasons why. When given the list: skyscraper, cathedral, temple, and prayer, people usually pick “prayer” as the odd-one-out because it’s not a building. On the other hand, when the order is prayer, temple, cathedral, and skyscraper, people would pick “skyscraper” as it is not related to religion.

I created several pairs of questions that might have a similar issue: the answer depends on how the list is ordered.

Odd-one-out dilemma. Pick the odd-one-out from:

• Pen, book, notebook, tissue.
• Tissue, notebook, book, pen.

Odd-one-out dilemma. Pick the odd-one-out from:

• Banana, apple, orange, grape, lime, nectarine, artichoke.
• Artichoke, nectarine, lime, grape, orange, apple, banana.

Odd-one-out dilemma. Pick the odd-one-out from:

• 6, 3, 15, 9, 5.
• 5, 9, 15, 3, 6.

Share:

## Cooperative Dedicated Liars

My new logic puzzle happens in the usual place: an island with truth-tellers and liars. Truth-tellers always tell the truth, while liars always lie. The liars on this island are dedicated to their lies: they do not want other people to figure out that they are liars and want to confuse people with their responses as much as possible. They also are cooperative: they coordinate their answers. The islanders all know each other and who is who.

Puzzle. A stranger arrives on this island with a plan. Each time the stranger hangs out with a group of people, he will ask each person the same question:

How many truth-tellers are in this group?

The liars on this island discover the stranger’s plan, and, being cooperative and dedicated, they do not want the stranger to figure out the true answer to his question. They also do not want the stranger to know anyone’s identity. What should they say?

For starters, any dedicated liar should always provide a theoretically possible answer. The liar shouldn’t say, “three quarters” or “infinitely many”, as these are obvious lies. In addition, the answer “zero” is too revealing: a truth-teller would never say this. Thus, the liar would answer with a positive integer that doesn’t exceed the total number of people in the group.

Suppose, for example, the stranger meets three people. Then there could be 0, 1, 2, or 3 truth-tellers in the group. As we discussed before, everyone replies 1, 2, or 3.

If there are t truth-tellers in the group, then the answer t is repeated exactly t times. That means the following sets of three answers reveal that all three islanders are liars: {1,1,1}, {1,1,2}, {1,1,3}, {2,2,2}, and {2,3,3}. With the following sets of answers, the stranger can figure out who is the only truth-teller: {1,2,3} and {1,3,3}. The set {2,2,3} allows the stranger to find both truth-tellers. And the following sets of answers do not allow the stranger to figure out who is who: {1,2,2} and {3,3,3}. So those sets of answers are the ones the liars will choose.

To sum up, the best strategy is for all the liars in the group to answer x, where x is the number of liars. Meanwhile, all the truth-tellers would say: 3 − x. That way, the stranger cannot differentiate between the truth-tellers and the liars.

The strategy above works with a group of any size as long as the number of liars is not equal to the number of truth-tellers.

Bonus Puzzle. Is there a way to confuse the stranger when the liars make are half of the group?

Share:

## The Vicious Dragon

Another gem posted by Konstantin Knop on Facebook.

Puzzle. The Vicious Dragon captured two princesses, Evangelina and Oddetta, and placed them in different towers in his castle. Then the Vicious Dragon flipped a fair coin an infinite number of times. He informed Evangelina of all the results of the even tosses and Oddetta of all the results of the odd tosses. Next, the Dragon asks each princess to name the number of any toss whose result is unknown to her. In other words, Evangelina must name an odd number, and Oddetta must name an even number.
If the tosses named by Evangelina and Oddetta are the same (both are tails or both are heads), the Vicious Dragon gives each princess a cake and a pink plush bunny and sets them free. But if the results differ, the Vicious Dragon devours Evangelina and Oddetta with cranberry jam. The Dragon loves princesses and cranberry jam!
The princesses know the Vicious Dragon’s habits and could have agreed on strategies in advance. What are the chances of the princesses escaping if Oddetta names a number first, and Evangelina names her number, knowing which number Oddetta chose?

Share:

## A Puzzle from Alex Ryba

Puzzle. Alice and Bob roll an unbiased 6-sided die until two consecutive rolls are the same. They add up the scores from all of the rolls. If the total is even, Alice wins; if it is odd, Bob wins. Who is more likely to win?

Share:

## Alexey’s Puzzle

My son, Alexey Radul, designed a puzzle for my students.

Puzzle. Simplify the expression: ln ln a · ln ln b · ⋯ · ln ln z.

Share: