Number Game Theory

Logic Level 4

Jonathan and Peter are playing the Number Game . It is a game where one of the players try to guess a four-digit number that is secretly written by a "number dealer" in the least number of guesses possible. There are a few rules to consider though.

  • No two digits can be equal.
  • None of the digits can take a zero value.
  • For every turn that a player tries to guess the four digit number, the number dealer will give the player two numbers. The first number gives the number of correct digits that are in the correct position, while the second number gives the number of correct digits in the wrong position.
  • The dealer cannot give any other information about the number (if it is odd/even, prime, perfect, etc.)

Jonathan dealt a four digit number to Peter. Peter guessed for the number four times, and obtained the following results:

What is the smallest number that Jonathan could have written?

Note: This problem is original.


The answer is 2841.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

2 solutions

Efren Medallo
Jun 5, 2015

I hope this solution is worth reading. :)

Let C ( x ) C(x) be the number of correct digits in the proper position (place value) for a four-digit number x x that satisfies the given criteria. In a similar fashion, let W ( x ) W(x) be the number of correct digits in the wrong position.

It is important to note that

C ( x ) + W ( x ) 4 C(x) + W(x) \leq 4 .

In the problem, C ( x ) = 2 C(x) = 2 when x = 6871 x = 6871 . Thus, there are ( 4 2 ) = 6 \binom{4}{2} = 6 possibilities with which two digits from this number are correct.

Enumerating these possibilities, we have

A = 68 p q A = \overline{68pq}

B = 6 p 7 q B = \overline{6p7q}

C = 6 p q 1 C = \overline{6pq1}

D = p 87 q D = \overline{p87q}

E = p 8 q 1 E = \overline{p8q1}

F = p q 71 F = \overline{pq71}

Now, we will determine the "eligibility" of each of the possibilities. For example, if the number we're looking for is of the form F F , then W ( 1736 ) = 2 W(1736) = 2 , which is a contradiction. Thus, the number we're looking for cannot be of the form F F .

The same thing would go for form B B , as if such is the case, then W ( 1736 ) = W ( 7265 ) = 2 W(1736)=W(7265) = 2 , which is false.

The same thing would go for form C C , as if such is the case, then W ( 1736 ) = 2 W(1736)= 2 , which, then again would be another contradiction.

And so we are left with three possibilities, namely A A , D D , and E E . Let us investigate each one.

If the number we're looking for is of the form A A , that is 68 p q \overline{68pq} , then it should satisfy both C ( x ) C(x) and W ( x ) W(x) for the four numbers guessed by Peter. By this we could determine what values p p and q q could assume.

For x = 1736 x = 1736 , W ( x ) = 1 W(x) = 1 and C ( x ) = 0 C(x) = 0 . Since 1736 1736 and 68 p q \overline{68pq} both have 6 6 in common, then we can assume that p p and q q cannot be 1 1 , 7 7 , and 3 3 .

In a similar way, for x = 7265 x = 7265 , it can be deduced that p p and q q cannot be 7 7 , 2 2 , and 5 5 .

Furthermore, for x = 3496 x = 3496 , it will be deduced that p p and q q cannot be 3 3 , 4 4 , and 9 9 .

Summing it up, if the number we're looking for is of the form A A , that is 68 p q \overline{68pq} , p p and q q can not assume any of these values { 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 } \left \{ 1,2,3,4,5,6,7,8,9 \right \} . Hence the number we're looking for is not of the form A A .

We have narrowed down our options to two possibilities, D D and E E .

If we check option D D for x = 1736 x=1736 , we find out that p p and q q cannot be 1 1 , 3 3 , and 6 6 .

On the other hand, if we check option D D for x = 7265 x=7265 , we find out that p p and q q cannot be 2 2 , 5 5 , and 6 6 .

Meanwhile, if we check option D D for x = 3496 x=3496 , we find out that no two digits coincide with D = p 87 q D = \overline{p87q} . Since p p and q q cannot be 3 3 or 6 6 , then either p p or q q could be 4 4 or 9 9 , but not both. This is because if p = 4 p = 4 , and q = 9 q= 9 or vice versa, then W ( 3496 ) = 2 W(3496) = 2 , which is false.

However, if p = 4 p = 4 or p = 9 p=9 , q q could not take any other value, thus eliminating option D D .

We have totally narrowed down our choice to option E E , whose form is E = p 8 q 1 E = \overline{p8q1} .

If we check option E E for x = 1736 x=1736 , we find out that p p and q q cannot be 3 3 , 6 6 , and 7 7 .

On the other hand, if we check option D D for x = 7265 x=7265 , we find out that p p and q q cannot be 6 6 and (\7), and that either p p or q q could be 2 2 or 5 5 , but not both.

Meanwhile if we check option E E for x = 3496 x=3496 , we find out that p p and q q cannot be 3 3 and 6 6 , and that either p p or q q could be 4 4 or 9 9 , but not both.

The number of values that p p and q q can assume is the number of ordered pairs that can be taken from this set { 2 , 4 , 5 , 9 } \left \{ 2,4,5,9 \right \} minus the ordered pairs ( 2 , 5 2,5 ),( 5 , 2 5,2 ),( 4 , 9 4,9 ), and ( 9 , 4 9,4 ).Thus, the total permutations for the values of p p and q q equals 4 P 2 4 = 8 _{4}P_{2} - 4 = 8 .

These 8 permutations give the numbers

2841 2841

2891 2891

4821 4821

4851 4851

5841 5841

5891 5891

9821 9821

9851 9851

So the answer to the question is 2841 \large \boxed {2841} .

Feel free to ask me questions. Thank you for reading!

Notice first that in the first number(1736), exactly one digit is correct and it is misplaced. Assume 3 is the correct digit, this means that all of 1,6,7 do not exist in the number. But from the last number(6871), we know that at least one of 1,6,7 should be present. This is a contradiction.

inference 1: 3 is not a part of the number.

inference 2: Exactly one of 1,6,7 must be present in the number.

inference 3: 8 is present in the second position.

Interestingly, if 6 is the correct digit, then we can see that it is impossible to form any four digit number satisfying the given conditions.(since 6 can't occur along with 1,2,3,4,5,7 or 9).

inference 2_{i}: Either 1 or 7 must be present.

Note that 7 cannot occur alongside 1,2,3,5 or 6. Which implies that it must occur alongside 4,8 and 9. But this isn't possible since 4 and 9 cannot be both present(since 3496).

inference 2_{ii}: 1 must be present in fourth position.

Now, 1 can legally occur along with 2,4,5,8 or 9. It is immediately clear that the first digit is 2. Then it easily follows that the third digit is 4. (4 and 2 can occur together).

Hence, the answer is: 2841 \boxed{2841} .

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...