Archive for the ‘Puzzles’ Category.

Enemies and Friends

by Tanya Khovanova and Alex Ryba

The following problem appeared at the Gillis Math Olympiad organized by the Weizmann Institute:

A foreign government consists of 12 ministers. Each minister has 5 friends and 6 enemies amongst the ministers. Each committee needs 3 ministers. A committee is considered legitimate if all of its members are friends or all of its members are enemies. How many legitimate committees can be formed?

Surprisingly, this problem implies that the answer doesn’t depend on how exactly enemies and friends are distributed. This meta thought lets us calculate the answer by choosing an example. Imagine that the government is divided into two factions of six people. Within a faction people are friends, but members of two different factions dislike each other. Legitimate committees can only be formed by choosing all three members from the same faction. The answer is 40.

We would like to show that actually the answer to the problem doesn’t depend on the particular configuration of friendships and enmities. For this, we will count illegitimate committees. Every illegitimate committee has exactly two people that have one enemy and one friend in the committee. Let’s count all the committees from the point of view of these “mixed” people. Each person participates in exactly 5*6 committees as a mixed person. Multiply by 12 (the number of people), divide by 2 (each committee is counted twice) and you get the total 180. This gives an answer of 40 for the number of legitimate committees without using a particular example.

What interests us is the fact that the number of illegitimate, as well as legitimate, committees is completely defined by the degree distribution of friends. For any set of people and who are either friends or enemies with each other, the number of illegitimate committees can be calculated from the degree distribution of friends in the same way as we did above.

Any graph can be thought of as representing friendships of people, where edges connect friends. This cute puzzle tells us that the sum of the number of 3-cliques and 3-anti-cliques depends only on the degree distribution of the graph.

As a non mathematical comment, the above rule for legitimate committees is not a bad idea. In such a committee there is no reason for two people to gang up on the third one. Besides, if at some point in time all pairs of friends switch to enemies and vice versa, the committees will still be legitimate.

Share:Facebooktwitterredditpinterestlinkedinmail

A Math Exam’s Hidden Agenda

In 1976 I was about to become a student in the math department at Moscow State University. As an IMO team member I was accepted without entrance exams, but all of my other classmates had to take the exams. There were four exams: written math, oral math, physics, and an essay.

The written math exam was the first, and here are the problems. I want my non-Russian readers to see if they notice anything peculiar about this exam. Can you explain what is peculiar, and what might be the hidden agenda?

Problem 1. Solve the equation

Equation

Problem 2. Solve the inequality

Inequality

Problem 3. Consider a right triangle ABC with right angle C. Angle B is 30° and leg CA is equal to 1. Let D be the midpoint of the hypotenuse AB, so that CD is a median. Choose F on the segment BC so that the angle between the hypotenuse and the line DF is 15°. Find the area of CDF. Calculate its numeric value with 0.001 precision.

Problem 4. Three balls, two of which are the same size, are tangent to the plane P, as well as to each other. In addition, the base of a circular cone lies on the plane P, and its axis is perpendicular to the plane. All three balls touch the cone from the outside. Find the angle between a generatrix of the cone and the plane P, given that the triangle formed by the points of tangency of the balls and the plane has one angle equal to 150°.

Problem 5. Let r < s < t be real numbers. If you set y equal to any of the numbers r, s or t in the equation x2 − (9 − y)x + y2 − 9y + 15 = 0, then at least one of the other two numbers will be a root of the resulting quadratic equation. Prove that −1 < r < 1.

Let me describe some background to this exam. Applicants who solve fewer than two problems fail the exam and are immediately rejected. People who solve two or three problems are given 3 points. Four problems earn 4 points, and five problems earn 5 points.

If you still do not see the hidden agenda, here is another clue. People who get 5 points on the first exam and, in addition, have a gold medal from their high school (that means all As) are admitted right after the first exam. For the others, if they do not fail any of the exams, points are summed up with their GPAs to compute their scores. The so-called half-passing score is then calculated. Scores strictly higher than the half-passing score qualify applicants for admission. However, there are too many applicants for the available openings with at least the half-passing score. As a result only some people with exactly the half-passing score are accepted, at the discretion of the department.

Now my readers have enough information to figure out the hidden agenda behind that particular exam.

Share:Facebooktwitterredditpinterestlinkedinmail

A Son Named Luigi

Suppose that we choose all families with two children, such that one of them is a son named Luigi. Given that the probability of a boy to be named Luigi is p, what is the probability that the other child is a son?

Here is a potential “solution.” Luigi is a younger brother’s name in one of the most popular video games: Super Mario Bros. Probably the parents loved the game and decided to name their first son Mario and the second Luigi. Hence, if one of the children is named Luigi, then he must be a younger son. The second child is certainly an older son named Mario. So, the answer is 1.

The solution above is not mathematical, but it reflects the fact that children’s names are highly correlated with each other.

Let’s try some mathematical models that describe how the parents might name their children and see what happens. It is common to assume that the names of siblings are chosen independently. In this case the first son (as well as the second son) will be named Luigi with probability p. Therefore, the answer to the puzzle above is (2-p)/(4-p).

The problem with this model is that there is a noticeable probability that the family has two sons, both named Luigi.

As parents usually want to give different names to their children, many researchers suggest the following naming model to avoid naming two children in the same family with the same name. A potential family picks a child’s name at random from a distribution list. Children are named independently of each other. Families in which two children are named the same are crossed out from the list of families.

There is a problem with this approach. When we cross out families we may disturb the balance in the family gender distributions. If we assume that boys’ and girls’ names are different then we will only cross out families with children of the same gender. Thus, the ratio of different-gender families to same-gender families will stop being 1/1. Moreover, it could happen that the number of boy-boy families will differ from the number of girl-girl families.

There are several ways to adjust the model. Suppose there is a probability distribution of names that is used for the first son. If another son is born, the name of the first son is crossed out from the distribution and following that we proportionately adjust the probabilities of all other names for this family. In this model the probability of naming the first son by some name and the second son by the same name changes. For example, the most popular name’s probability decreases with consecutive sons, while the least popular name’s probability increases.

I like this model, because I think that it reflects real life.

Here is another model, suggested by my son Alexey. Parents give names to their children independently of each other from a given distribution list. If they give the same name to both children the family is crossed-out and replaced with another family with children of the same genders. The advantage of this model is that the first child and the second child are named independently from each other with the same probability distribution. The disadvantage is that the probability distribution of names in the resulting set of families will be different from the probability distribution of names in the original preference list.

I would like my readers to comment on the models and how they change the answer to the original problem.

Share:Facebooktwitterredditpinterestlinkedinmail

The Cookie Monster Problem

by Olivier Bernardi and Tanya Khovanova

The Cookie Monster is a peculiar creature that appeared in The Inquisitive Problem Solver (Vaderlind, Guy & Larson, MAA, P34). Presented with a set of cookie jars, the Cookie Monster will try to empty all the jars with the least number of moves, where a move is to select any subset of the jars and eat the same number of cookies from each jar in the subset.

Even an untalented Cookie Monster would be able to empty n jars in n moves: to fulfill this strategy the Monster can devour all the cookies of one jar at a time. If the Monster is lucky and some jars have the same number of cookies, the Monster can apply the same eating process to all these identical jars. For example, if all the jars have the same number of cookies, the Monster can gulp down all of them in one swoop.

Now, let us limit our discussion to only cases of n non-empty jars that contain distinct numbers of cookies. If indeed all the numbers are distinct, can the Monster finish eating faster than in n moves?

The answer depends on the actual number of cookies in each jar. For example, if the number of cookies in jars are different powers of 2, then even the most talented Monsters can’t finish faster than in n steps. Indeed, suppose the largest jar contains 2N cookies. That would be more than the total number of cookies in all the other jars together. Therefore, any strategy has to include a step in which the Monster only takes cookies from the largest jar. The Monster will not jeopardize the strategy if it takes all the cookies from the largest jar in the first move. Applying the induction process, we see that we need at least n steps.

On the other hand, sometimes the Monster can finish the jars faster. If 2k−1 jars contain respectively 1, 2, 3, …, 2k−1 cookies, the Cookie Monster can empty them all in k steps. Here is how. For its first move, the Monster eats 2k-1 cookies from each of the jars containing 2k-1 cookies or more. What remains are 2k-1−1 pairs of identical non-empty jars containing respectively 1, 2, 3, …, 2k-1−1 cookies. The Monster can then continue eating cookies in a similar fashion, finishing in k steps. For instance, for k=3 the sequences of non-empty jars are: 1,2,3,4,5,6,7 → 1,1,2,2,3,3 → 1,1,1,1 → all empty.

Now we would like to prove a theorem that shows that the example above is the lowest limit of moves even for the most gifted Cookie Monsters.

Theorem. If n non-empty jars contain distinct numbers of cookies, the Cookie Monster will need at least ⌈log2(n+1)⌉ steps to empty them all.

Proof. Suppose that n jars contain distinct numbers of cookies and let f(n) be the number of distinct non-empty jars after the first move of the Cookie Monster. We claim that n ≤ 2f(n)+1. Indeed, after the first move, there will be at least n − 1 non-empty jars, but there cannot be three identical non-empty jars. That means, the number of jars plus 1 can’t decrease faster than twice each time.

Now here is something our readers can play with. Suppose a sequence of numbers represents the number of cookies in the jars. Which sequences are interesting, that is, which can provide interesting solutions for the Cookie Monster problem?

Share:Facebooktwitterredditpinterestlinkedinmail

How Many Hats Can Fit on Your Head?

Lionel Levine invented a new hat puzzle.

The sultan decides to torture his hundred wise men again. He has an unlimited supply of red and blue hats. Tomorrow he will pile an infinite, randomly-colored sequence of hats on each wise man’s head. Each wise man will be able to see the colors of everyone else’s hats, but will not be able to see the colors of his own hats. The wise men are not allowed to pass any information to each other.
At the sultan’s signal each has to write a natural number. The sultan will then check the color of the hat that corresponds to that number in the pile of hats. For example, if the wise man writes down “four,” the sultan will check the color of the fourth hat in that man’s pile. If any of the numbers correspond to a red hat, all the wise men will have their heads chopped off along with their hats. The numbers must correspond to blue hats. What should be their strategy to maximize their chance of survival?

Suppose each wise man writes “one.” The first hat in each pile is blue with a probability of one-half. Hence, they will survive as a group with a probability of 1 over 2100. Wise men are so wise that they can do much better than that. Can you figure it out?

Inspired by Lionel, I decided to suggest the following variation:

This time the sultan puts two hats randomly on each wise man’s head. Each wise man will see the colors of other people’s hats, but not the colors of his own. The men are not allowed to pass any info to each other. At the sultan’s signal each has to write the number of blue hats on his head. If they are all correct, all of them survive. If at least one of them is wrong, all of them die. What should be their strategy to maximize their chance of survival?

Suppose there is only one wise man. It is clear that he should write that he has exactly one blue hat. He survives with the probability of one-half. Suppose now that there are two wise men. Each of them can write “one.” With this strategy, they will survive with a probability of 1/4. Can they do better than that? What can you suggest if, instead of two, there is any number of wise men?

Share:Facebooktwitterredditpinterestlinkedinmail

Subtleties of Lies

In a puzzle book by Mari Berrondo (in Russian), I found the following logic problem:

Alfred, Bertran and Charles are asked about their profession. One of them always lies; another one always tells the truth; and the third one [who I will refer to as a “half-liar”] sometimes lies and sometime tells the truth. Here are their answers:

Bertran: I am a painter, Alfred is a piano-tuner, Charles is a decorator.
Alfred: I am a doctor, Charles is an insurance agent. Concerning Bertran, if you ask him, he will tell you that he is a painter.
Charles: Alfred is a piano-tuner. Bertran is a decorator, and I am an insurance agent.
What is the profession of the half-liar?

The solution in the book is the following. As Alfred is right about what Bertran would say, Alfred can’t be a liar. If Alfred is a half-liar then the other two people would give the opposite statements, since one will be a truth-teller and the other a liar. But they both say that Alfred is a piano-tuner, therefore Alfred must be a truth-teller. Hence, Alfred’s statement about everyone’s profession must be the truth. Now we know that Charles is an insurance agent. As Charles confirms that, thus telling the truth in this instance, we recognize that he must be a half-liar. The answer to the problem is that the half-liar is an insurance agent.

But I have a problem with this problem. You see, a liar can say many things. He can say that he is a conductor, a mathematician, a beekeeper or whatever. So there is no way of knowing what a person who decides to lie can say. Let’s just analyze the statement by Alfred: “Concerning Bertran, if you ask him, he will tell you that he is a painter.”

If Alfred tells the truth about what Bertran would say, he needs to know for sure that Bertran will say that he is a painter. Hence, Bertran must be a truth-teller and a painter. If Alfred lies, he needs to be sure that Bertran won’t say that he is a painter. So Bertran must be either a truth-teller and not a painter, or a liar and a painter. Bertran can’t be a half-liar, because a half-liar can say that he is a painter as well as he can say something else, no matter what his real profession.

There is one interesting aspect of this that many people overlook. There are different types of people who are half-liars. In some books half-liars are introduced as people who, before making a statement, flip a coin to decide whether to lie or to tell the truth. Such a person needs to know in advance exactly what other people are saying, in order to construct a statement about what those people might say that corresponds to the coin flip. On the other hand, other types of half-liars exist. One half-liar can say something and then see later whether it is true. If Alfred is a half-liar who doesn’t care in advance about the truth of his statement, he can say that Bertran will claim that he is a painter.

I leave it to my readers to finish my analysis and see that the problem doesn’t have a solution. To end my essay on a positive note, I decided to slightly change the problem, so that there is no contradiction. In the same setting:

Bertran: I am a painter, Alfred is a piano-tuner, Charles is a decorator.
Alfred: I am a doctor, Charles is an insurance agent. Concerning Bertran, if you ask him, he will tell you that he is not a painter.
Charles: Alfred is a piano-tuner. Bertran is a decorator, and I am an insurance agent.
What is the profession of the half-liar?

Share:Facebooktwitterredditpinterestlinkedinmail

The Horsemen Sequences

33 horsemen are riding in the same direction along a circular road. Their speeds are constant and pairwise distinct. There is a single point on the road where the horsemen can pass one another. Can they ride in this fashion for an arbitrarily long time?

The puzzle appeared at the International Tournament of the Towns and at the Moscow Olympiad. Both competitions were held on the same day, which incidentally fell on Pi Day 2010. Just saying: at the Tournament the puzzle was for senior level competitors; at the Moscow Olympiad it was for 8th graders.

Warning: If you want to solve it yourself first, pause now, because here is the solution I propose.

First, consider two horsemen who meet at that single point. The faster horseman passes the slower one and gallops ahead and the slower one canters along. The next meeting point should be at the same place in the circle. Suppose the slower horseman rides n full circles before the next meeting, then the second horseman could not have passed the first in between, so he has to ride n+1 full circles. That means their speeds should have a ratio of (n+1)/n for an integer n. And vice versa, if their speeds have such a ratio, they will meet at the same location on the circle each time. That means that to solve the problem, we need to find 33 different speeds with such ratios.

As all speed ratios are rational numbers, we can scale speeds so that they are relatively prime integers. The condition that two integers have a ratio (n+1)/n is equivalent to the statement that two integers are divisible by their difference. So the equivalent request to the problem is to find a set of 33 positive integers (or prove non-existence), such that every two integers in the set are divisible by their difference.

Let’s look at examples with a small number of horsemen. For two riders we can use speeds 1 and 2. For three riders, speeds 2, 3 and 4.

Now the induction step. Suppose that we found positive integer speeds for k horsemen. We can add one more horseman with zero speed who quietly stays at the special point and everyone else passes him. The difference condition is satisfied. We just need to tweak the set of speeds so that the lazy horseman starts moving.

We can see that if we add the least common multiple to every integer in a set of integers such that every two numbers in a pair are divisible by their difference, then the condition stays satisfied. So by induction we can find 33 horsemen. Thus, the answer to the problem is: Yes they can.

Now I would like to apply that procedure from the solution to calculate what kind of speeds we get. If we start with one rider with the speed of 1, we add the second rider with speed 0, then we add 1 to both speeds, getting the solution for two riders: 1 and 2. Now that we have a solution for two riders, we add a third rider with speed 0 then add 2 to every speed, getting the solution for three horsemen: 2, 3 and 4. So the procedure gave us the solutions we already knew for two and three horsemen.

If we continue this, we’ll get speeds 12, 14, 15 and 16 for four riders. Similarly, 1680, 1692, 1694, 1695, and 1696 for five riders.

We get two interesting new sequences out of this. The sequence of the fastest rider’s speed for n horsemen is: 1, 2, 4, 16, 1696. And the sequence of the least common multiples for n−1 riders — which is the same as the lowest speed among n riders — is: 1, 1, 2, 12, 1680, 343319185440.

The solution above provides very large numbers. It is possible to find much smaller solutions. For example for four riders the speeds 6, 8, 9 and 12 will do. For five riders: 40, 45, 48, 50 and 60.

I wonder if my readers can help me calculate the minimal sequences of the fastest and slowest speeds. That is, to find examples where the integer speed for the fastest (slowest) horseman is the smallest possible.

Share:Facebooktwitterredditpinterestlinkedinmail

Puzzles for Lawyers

One day we may all face the necessity of hiring a lawyer. If the case is tricky the lawyer must be smart and inventive. I am collecting puzzles to give to a potential lawyer during an interview. The following puzzle is one of them. It was given at the second Euler Olympiad in Russia:

At a local Toyota dealership, you are allowed to exchange brand new cars. You can exchange three Camrys for one Prius and one Avalon, and three Priuses for two Camrys and one Avalon. Assuming an unlimited supply of cars at the dealership, can collector Vasya exchange 700 Camrys for 400 Avalons?

The beauty of this puzzle is that the answer I may find acceptable from a mathematician is not the same as I want from my future lawyer.

Have I intrigued you? Get to work and send me your solutions.

Share:Facebooktwitterredditpinterestlinkedinmail

Fermat’s Room

Most movies related to mathematics irritate me because of simplifications. I especially do not like when a movie pretends to be intelligent and then dumbs it down. I recently watched the Spanish movie Fermat’s Room, which, as you may guess, annoyed me several times. In spite of that I enjoyed it very much.

The movie opens with people receiving invitations to attend a meeting for geniuses. To qualify for the meeting they need to solve a puzzle. Within ten days, they must guess the order underlying the following sequence: 5, 4, 2, 9, 8, 6, 7, 3, 1. Right away, at the start of the movie, I was already annoyed because of the simplicity of the question. You do not have to be a genius to figure out the order, not to mention how easy it would be to plug this sequence into the Online Encyclopedia of Integer Sequences to find the order in five minutes.

The participants were asked to hide their real names, which felt very strange to me. All famous puzzle solvers compete in puzzle championships and mystery hunts and consequently know each other.

The meeting presumably targets the brightest minds and promises to provide “the greatest enigma.” During the meeting they are given seven puzzles to solve. All of them are from children’s books and the so-called “greatest enigma” could easily be solved by kids. Though I have to admit that these were among the cutest puzzles I know. For example:

There are three boxes: one with mint sweets, the second with aniseed sweets, and the last with a mixture of the two. The boxes are labeled, but all the labels are wrong. What is the minimum number of sweets you need to taste to correctly re-label all the boxes?

Another of the film’s puzzles includes a light bulb in a room and three switches outside, where you have to correctly find the switch that corresponds to the bulb, but you can only enter the room once. In another puzzle you need to get out of prison by deciding which of two doors leads to freedom. You are allowed to ask exactly one question to one of the two guards, one of whom is a truth-teller and the other is a liar.

The other four puzzles are similar to these three I have just described. To mathematicians they are not the greatest enigmas. They are nice material for a children’s math club. For non-mathematicians, they may be fascinating. Certainly it’s a good thing that such tasteful puzzles are being promoted to a large audience. But they just look ridiculous as “the greatest enigmas.”

So what is it about this film that I so enjoyed?

The intensity of the movie comes from the fact that the people are trapped in a room that starts shrinking when they take more than one minute to solve a puzzle.

I well remember another shrinking room from Star Wars: A New Hope. When Princess Leia leads her rescuers to a room, it turns out to be a garbage compactor. The bad guys activate the compactor and two opposite walls start moving in. In contrast, Fermat’s room is shrinking in a much more sophisticated way: all four walls are closing in. Each of the walls in the rectangular room is being pressured by an industrial-strength press. The walls in the corners do not crumble, but rather one wall glides along another. I was more puzzled by this shrinking room than I was by the math puzzles. I recommend that you try to figure out how this can be done before seeing the movie or its poster.

However, the best puzzle in the movie is the plot itself. Though I knew all the individual puzzles, what happened in between grabbed me and I couldn’t wait to see what would happen next. I saw the movie twice. After the first time, I decided to write this review, so I needed to check it again. I enjoyed it the second time even better than the first time. The second time, I saw how nicely the plot twists were built.

Maybe I shouldn’t complain about the simplicity and the familiarity of the puzzles. If they were serious new puzzles I would have started solving them instead of enjoying the movie. The film’s weakness might be its strength.

Share:Facebooktwitterredditpinterestlinkedinmail

The Wizards’ Hats

I collect hats puzzles. A puzzle about hats that I hadn’t heard before appeared on the Konstantin Knop’s blog (in Russian):

The sultan decides to test his hundred wizards. Tomorrow at noon he will randomly put a red or a blue hat — for both of which he has an inexhaustible supply — on every wizard’s head. Each wizard will be able to see every hat but his own. The wizards will not be allowed to exchange any kind of information whatsoever. At the sultan’s signal, each wizard needs to write down the color of his own hat. Every wizard who guesses wrong will be executed. The wizards have one day to decide on a strategy to maximize the number of survivors. Suggest a strategy for them.

I’ll start the discussion with a rather simple idea: Each wizard writes down a color randomly. In this case the expected number of survivors is 50. Actually, if each wizard writes “red”, then the expected number of survivors is 50, too. Can you find a better strategy, with a greater expected number of survivors or prove that such a strategy doesn’t exist?

As a bonus question, can you suggest a strategy that guarantees 50 survivors?

Now that you’ve solved that issue, here’s my own variation of the problem.

The wizards are all very good friends with each other. They decide that executions are very sad events and they do not wish to witness their friends’ deaths. They would rather die themselves. They realize that they will only be happy if all of them survive together. Suggest a strategy that maximizes the probability of them being happy, that is, the probability that all of them will survive.

Share:Facebooktwitterredditpinterestlinkedinmail