Archive for the ‘Puzzles’ Category.

Four Puzzles for the Price of One

Here is a math problem from the 1977 USSR Math Olympiad:

Let A be a 2n-digit number. We call this number special if it is a square and a concatenation of two n-digits squares. Also, the first n-digit square can’t start with zero; the second n-digit square can start with zero, but can’t be equal to zero.

  • Find all two- and four-digit special numbers.
  • Prove that there exists a 20-digit special number.
  • Prove that not more than ten 100-digit special numbers exist.
  • Prove that there exists a 30-digit special number.

Obviously, these questions are divided into two groups: show the existence and estimate the bound. Furthermore, this problem can be naturally divided into two other groups. Do you see them? The puzzle about special numbers makes a special day today — you get a four-in-one puzzle.

Share:Facebooktwitterredditpinterestlinkedinmail

A Math Puzzle that Sounds like a Computer Science Puzzle

David Bernstein gave me this puzzle. He says that the puzzle was given at a Moscow math Olympiad a long time ago. At that time there were no computer science olympiads yet. I do not know why this puzzle feels to me like computer science. Maybe because the trivial solution is of order N, the easy solution is of order square root of N and the requested solution is of order logarithm of N:

Can you cut a square into N convex pieces minimizing the number of possible intersections of any straight line with your pieces?

It is easy to maximize the number of intersections. If you cut your square with N-1 parallel cuts into N equal thin rectangles, then there exists a line with N intersections.

It is easy to cut a square to guarantee no more than 2√N intersections. Can you cut your square so that any line makes no more than 2log2N intersections?

Share:Facebooktwitterredditpinterestlinkedinmail

Linear Algebra at a Math Olympiad

A puzzle from the 1977 USSR math Olympiad can be solved naturally with linear algebra:

Seven dwarfs are sitting at a round table. Each dwarf has a cup partially filled with milk. Each dwarf in turn divides all his milk evenly between the six other cups. After the seventh dwarf has done this, every cup happens to contain the initial amount of milk. What was the initial distribution of milk?

Can you use linear algebra to intelligently solve this puzzle?

Share:Facebooktwitterredditpinterestlinkedinmail

The Polynomial Game

This puzzle is a generalization of a problem from the 1977 USSR math Olympiad:

At the beginning of the game you are given a polynomial, which has 1 as its leading coefficient and 1 as its constant term. Two people play. On your turn you assign a real value to one of the unknown coefficients. The person that goes last wins if the polynomial has no real roots at the end. Who wins?

It is clear that if the last person’s goal is for the polynomial to have a root, then the game is trivial: in this case, he can always make 1 a root with the last move. Also, an odd degree polynomial always has a real root. Therefore, to make the game interesting we should assume that the degree of the polynomial is even.

Though I can’t imaging myself ever being interested in playing this game, figuring out the strategy is a lot of fun.

Share:Facebooktwitterredditpinterestlinkedinmail

Recounting Cats

Here is a math puzzle for kids from a nice collection of ThinkFun Visual Brainstorms:

Wendy has cats. All but two of them are Siamese, all but two of them are Persian, and all but two of them are Maine Coon. How many cats does Wendy have altogether?

This puzzle has two answers: the expected answer and an unexpected answer. Can you find both?

Share:Facebooktwitterredditpinterestlinkedinmail

An Organic Puzzle

Here is a puzzle that my ex-brother-in-law, Dodik, gave to me today:

Prove that every group with more than two elements has a non-trivial automorphism.

I usually love puzzles that are solved with a counter-intuitive brilliant idea. This puzzle is different — I didn’t solve it in one elegant swoop. But I still love the puzzle: it feels so natural, and it’s solution feels so natural, that I even decided to call this puzzle “organic.” Or, maybe, I am just in an organic mood today waiting for my organic bananas to be delivered from Boston Organics.

Share:Facebooktwitterredditpinterestlinkedinmail

Through-the-Looking-Glass Monsters

MonstersHere is a funny puzzle from Kvant (1996, vol 4), the best Russian journal of recreational math.

When Alice goes through the looking-glass, she might meet many multi-headed, multi-armed, multi-legged beings. A being with H heads, A arms and L legs is considered:

  • smart, if H > A+L,
  • strong, if A > H+L,
  • fast, if L > H+A.

Can there exist a well-rounded personality behind the looking-glass: someone who is smart, strong and fast at the same time?

Share:Facebooktwitterredditpinterestlinkedinmail

Why are Manhole Covers Square?

Manhole CoverOne of Microsoft’s biggest contributions to humanity is the popularization of manhole covers. The most famous question that Microsoft asks during job interviews of geeks is probably, “Why are manhole covers round?” Supposedly the right answer is that if a manhole cover is round it can’t be dropped into the hole. See, for example, How Would You Move Mount Fuji? Microsoft’s Cult of the Puzzle – How the World’s Smartest Company Selects the Most Creative Thinkers. This book by William Poundstone is dedicated exclusively to Microsoft’s interview puzzles.

All we need, actually, is for the cover not to fit into the hole. For example, if the hole is small, the cover could be almost any shape, as long as the diameter of the cover is bigger than any straight segment that fits into the hole.

Rectangle Manhole Cover

Microsoft makes an implicit assumption that the cover is about the same shape and size as the hole; otherwise we would waste a lot of extra cover material.

Even with this assumption, there is a good deal of flexibility in possible shapes if our only concern is that the cover shouldn’t fit into the hole. It is sufficient for the cover to be any shape with a constant width.

Here are some additional answers to why the cover should be round. Microsoft accepts the answer that a round cover is easier to roll. I’m not sure why a cover would ever have to be moved away from its hole. But I agree that if kids try to steal a cover, it would be much easier to escape with a round one.

Painted Manhole Cover

Another answer that Microsoft supposedly accepts is that you do not need to rotate a round cover to align it with the opening when you are putting it back. This way if there is a lane divider painted on the cover it will point in a new random direction.

You can find many other explanations at the wiki article devoted to this subject. The most reasonable is that manhole covers are round because manholes are round. Duh!

Thanks to Microsoft there are now many websites with pictures of and discussions on the shape of manhole covers. For example, Manhole Covers Etc. or Manhole.ca or Manhole Covers of the World. As you can see many manhole covers are square or rectangular. They say that New Hampshire had triangular covers at some point.

But my favorite answer to this interview question was sent to me by Jorge Tierno:

Since manhole covers are not necessarily round, but you are asking why they are round, you are probably asking why round manhole covers are round. Round manhole covers are round by definition.

Now I have my own favorite question to ask you during a job interview: “Why are some manhole covers square?”

Share:Facebooktwitterredditpinterestlinkedinmail

Grand Tour Puzzles

Grand Tour Sample Problem

Grand Tour Sample Solution

I love Grand Tour puzzles more than I love Sudoku. You are given a graph, for example, a square grid like the one on the left. Some edges are highlighted. You need to find a closed path that visits each vertex exactly once and includes the highlighted edges as part of the path. Mathematically speaking you need to reconstruct a Hamiltonian circuit on a graph, once you are given a part of it. The highlighted edges are chosen to guarantee a unique solution to the puzzle.

On the left you can see a sample grand tour problem with its solution. This puzzle was designed by Glenn Iba. On Glenn’s Grand Tour Puzzle Page you can find many grand tour puzzles of varying levels of difficulty. The puzzles are playable. That is, you can click or unclick an edge. You can also branch out in a different color, which is especially useful for difficult puzzles when you want to test a hypothesis. I just want to warn you: these puzzles are addictive — I couldn’t stop playing until I solved all of them.

Below there is a simple grand tour puzzle from Glenn’s collection, but this time on a triangular grid:

Grand Tour Puzzle

You do not need a grid to construct a puzzle. But these puzzles look very natural on grids. I tried to analyze square grid puzzles a little bit. The first important point is that for square grids with odd number of vertices on each side of the square, Hamiltonian cycles do not exist. This point is easier to prove for directed Hamiltonian cycles. You can make a directed cycle from an undirected one by choosing a direction. If you have a directed cycle on a square grid, then the number of edges pointing up should be the same as the number of edges pointing down. We can say the same thing about edges on the cycle pointing left or right. Hence, the number of edges of a Hamiltonian cycle on a square grid should be even. At the same time, the number of edges of any Hamiltonian cycle equals the number of vertices.

I just proved that you need only consider square grids with an even number of vertices on each side. For square grids with two vertices on each side, there is only one Hamiltonian cycle, namely the border of the square. The only grand tour puzzle for this grid won’t have highlighted edges at all. For a square grid with four vertices on each side there are only two different Hamiltonian cycles up to isomorpshisms:

Hamiltonian Cycles

If we count all the reflections and rotations, we will get six Hamiltonian cycles. The next picture shows all 11 grand tour puzzles on this grid. If we count rotations and reflections, we will get 66 different grand tour puzzles.

Grand Tour Puzzles

Below are the sequences associated with this puzzle. Except for one case, I do not know if these sequences are in the Online Encyclopedia for Integer Sequences. I don’t know because I only counted two terms of each sequence, and this information is not sufficient to identify the sequence.

  • A003763 Number of Hamiltonian cycles on 2n by 2n square grid of points. The sequence starts 1, 6, 1072, ….
  • Number of Hamiltonian cycles up to isomorphism on 2n by 2n square grid of points. The sequence starts 1, 2, ….
  • Number of Grand Tour puzzles on 2n by 2n square grid of points. The sequence starts 1, 11, ….
  • Number of Grand Tour puzzles up to isomorphism on 2n by 2n square grid of points. The sequence starts 1, 66, ….
  • The smallest number of edges in a Grand Tour puzzle on 2n by 2n square grid of points. The sequence starts 0, 2, ….
  • The largest number of edges in a Grand Tour puzzle on 2n by 2n square grid of points. The sequence starts 0, 4, ….

If you look at Glenn Iba’s 6 by 6 square grid puzzles, you can see that the smallest number of edges is not more than 6. And the largest number of edges is no less than 12.

You can also make similar sequences for a triangular grid.

I invite you to calculate these sequences and submit them to the OEIS, if they are not already there.

Share:Facebooktwitterredditpinterestlinkedinmail

Genetics Paradox

Suppose N mothers live in a city. Half of them have one child and half of them have two children. That means that an average mother has 1.5 children.

Suppose we pick the sexual orientation of every child by rolling dice. Let’s assume that a child has a 10% probability of being homosexual.

The number of mothers with one child who is homosexual is 0.05N. The number of mothers with two children both of them homosexual is 0.005N. The number of mothers with two children with only the first child homosexual is 0.045N, which is the same as the number of mothers of two children with only the second child homosexual. The total number of mothers who have two children with at least one of them homosexual is 0.095N.

Let’s calculate the average fertility of a mother with at least one homosexual child. It is (1*0.05N + 2*0.095N)/(0.05N + 0.095N) = 0.24/0.145 = 1.66. The resulting number — 1.66 — is much bigger than 1.5, the average number of children for a mother.

This means there is a correlation between homosexuality and the fertility of mothers. This suggests that there is a gay gene which at the same time is responsible for female fertility.

But the model is completely random — there can’t be any correlation.

Where is the mistake?

Obviously, you can substitute homosexuality with having blue eyes or math ability or whatever, but I invented this paradox while I was working on my “Fraternal Birth Order Threatens Research into the Genetics of Homosexuality” post. Besides, there is some research on correlation between homosexuality and fertility.

I look forward to your solution to this puzzle.

Share:Facebooktwitterredditpinterestlinkedinmail