Answer to April 27, 1998 Problem

YES or NO Logic Problem
In order to join the math club at Handley High, potential members must guess a secret whole number from 1 to 50, by asking yes-or-no questions only. Matt E. Matics, an excellent logician, wanted to join, and he tried the following four questions:

  1. Is the number greater than 25?
  2. Is the number evenly divisible by 2?
  3. Is the number evenly divisible by 3?
  4. Is the number evenly divisible by 5?
After he was told the answers, he did some figuring and said, "I still don't have enough information. Is the number a perfect square?" When he got the reply "NO," Matt knew what the number was. Can you determine what the number was?

Answer: The secret number is 5.
From the August 1996 issue of Games magazine.

The key to the problem was that Matt was not able to answer the problem after getting the answers to the first four questions. He asked the fifth question to differentiate between perfect squares and numbers which were not perfect squares.

Look at all the possible combinations of yes or no answers to the four questions to see which one would require a fifth question(there are 16 possibilities).

If q1=N q2=Y q3=Y q4=Y
There are no numbers which fall in this category.

If q1=N q2=Y q3=Y q4=N
There are four possible numbers: 6, 12, 18, and 24.
But asking the 5th question does not help because there are more than 2 numbers which are not squares.

If q1=N q2=Y q3=N q4=Y
There are two numbers: 10 and 20.
But asking the 5th question does not help because there are more than 2 numbers which are not squares.

If q1=N q2=Y q3=N q4=N
There are 6 numbers: 2, 4, 8, 14, 16, and 22.
But asking the 5th question does not help because there are more than 2 numbers which are not squares.

If q1=N q2=N q3=Y q4=Y
There is only one number: 15.
Therefore, you would not need to ask the fifth question.

If q1=N q2=N q3=Y q4=N
There are three numbers: 3, 9, and 21.
But asking the 5th question does not help because there are more than 2 numbers which are not squares.

If q1=N q2=N q3=N q4=Y
There are two numbers: 5 and 25.
Asking the 5th question tells you that the number is 5 since it is not a perfect square.

If q1=N q2=N q3=N q4=N
There are seven numbers: 1, 7, 11, 13, 17, 19, 23.
But asking the 5th question does not help because there are more than 2 numbers which are not squares.

If q1=Y q2=Y q3=Y q4=Y
There is only one number: 30.
Therefore, you would not need to ask the fifth question.

If q1=Y q2=Y q3=Y q4=N
There are three numbers: 36, 42, and 48.
But asking the 5th question does not help because there are more than 2 numbers which are not squares.

If q1=Y q2=Y q3=N q4=Y
There are two numbers: 40 and 50.
But asking the 5th question does not help because there are more than 2 numbers which are not squares.

If q1=Y q2=Y q3=N q4=N
There are seven numbers: 26, 28, 32, 34, 38, 44, 46.
But asking the 5th question does not help because there are more than 2 numbers which are not squares.

If q1=Y q2=N q3=Y q4=Y
There is only one number: 45.
Therefore, you would not need to ask the fifth question.

If q1=Y q2=N q3=Y q4=N
There are three numbers: 27, 33, and 39.
But asking the 5th question does not help because there are more than 2 numbers which are not squares.

If q1=Y q2=N q3=N q4=Y
There is only one number: 35.
Therefore, you would not need to ask the fifth question.

If q1=Y q2=N q3=N q4=N
There are seven numbers: 29, 31, 37, 41, 43,47, 49.
But asking the 5th question does not help because there are more than 2 numbers which are not squares.


Correctly solved by:

1. Matt Leatherman Winchester, VA
2. Cory Lewis Winchester, VA
3. Bryan B. Rhodes Charlottesville, VA (JHHS '97)