# Mastermind puzzle: 3548 has 2 correct, one in right place [closed]

Hints:
3548 - 2 correct digits, but only 1 in the right place
4860 - 1 correct digit, but in the wrong place
2356 - 3 correct digits, but only 1 in the right place
2584 - 2 correct digits and in their place

• Welcome to Puzzling! Could you add the source of the puzzle? – Ak. May 18 at 13:02
• Hello Ak, found it on internet and tried to get the result. it was on a FB page :) – Giorgian Ciocodeica May 18 at 13:06
• Could you provide a link to/the name of the FB page? – bobble May 18 at 13:51

Hints: 3548 - 2 correct digits, but only 1 in the right place 4860 - 1 correct digit, but in the wrong place 2356 - 3 correct digits, but only 1 in the right place 2584 - 2 correct digits and in their place

I like to tackle these by picking a starting assumption and running with it. 5 shows up in position 2 in top and bottom, so let’s start by assuming the number is _ 5 _ _. This means that only one of 2, 8, 4 is also in the right place (from 2584), and additionally only one of 3, 4, 8 are in the number but in the wrong place (from 3548). If 2 is in its correct place, then 8 and 4 are not in the number. This means that 3 is in the number. From 2356, it would follow that 2 is the correct digit in the correct place, and 3,5 are the digits in the wrong place. So our assumptions take us to 2 5 _ _ with a 3 in the last two numbers. Further, from 2356 if 2,3,5 are correct digits, then 6 is not in the number. From before, 4,8 are also not in the number, so using 4860, the 0 must be the correct digit in the wrong place. Since there are only 2 places left, the 0 must be the 3rd digit, and the 3 must be the last digit.

One possible number is therefore

2503.

By logical deduction without guessing:

From clues 1 and 2:

4 and 8 can't be the 2 correct digits from 3548, because 4860 only has one correct. So for 3548 either (i) 3 and 5 are both correct, or (ii) one from 3/5 and one from 4/8.

Clue 3:

Taking option (ii) from above, if only 1 of 3/5 is correct, then 2 and 6 are the other two correct digits from 2356. So we now have 2, 6, one from 3/5 and one from 4/8. But that gives us a contradiction, because that would require that two digits from 4860 are correct. So option (ii) is not possible.

So we now have:

3 and 5 are correct (clue #1). 4 and 8 are out, so one of 6/0 is correct (clue #2), and one of 2/6 is correct (clue #3).

Clue #4:

If 4 and 8 are out, then 2 and 5 must be the correct digits, so the answer is 25xx. If only one of 2/6 is correct, obviously that's now 2, so 6 is out leaving 0 as the correct digit from clue 2. Since that's in the wrong place there, then the answer is 250x, and we already know three is correct, so the answer is 2503.

Frequency approach

The numbers 0-9 have frequency 1,0,2,2,3,3,2,0,3,0
Those can add to up to the number of correct digits (8) in only 2 ways
3+3+2+0 or 3+2+2+1

Option 1 requires 2 of the numbers 4,5,8. With this:
the 1st guess excludes 3
the 4th guess excludes 2
the 3rd guess needsat least on one of those -> contradiction

Option 2 requires 0 (the only one with frequency 1).
With this guess 2 excludes 4,6 and 8, which means (due to guess 3) that 2,3,5 are needed
with the numbers known:
guess 4 gives the position of 2 and 3 and then guess 2 the position of 0
-> (only) solution: 2503

The same answer as El-Guest, but with a different approach:

Consider the second assumption. if 4 is the correct digit, then 6 can't appear in the solution. The third assumption would then prove that 2,3 and 5 are all correct digits, making the solution a permutation of 2345. However, the first assumption would then be false. Hence 4 is not a correct digit.

Exactly the same reasonning proves that:

8 is not a correct digit either.

As a consequence

The correct digits is the fourth assumption are 2 and 5. From there, direct deductions show that 3 is part of the solution (from first assumption), that 6 isn't (third assumption), that 0 is a correct digit and that it stand in third position (second assumption).

Finally, the unique solution is:

2503

Another way:

If 6 in 2356 is correct, then either of 2, 3, 5 must be wrong (since 2356 has only 3 correct digits). But (from 3548 and 2584) we can say that either 4 or 8 should be correct (since at least one of the "35" and "25" groups contains a wrong digit, so to get 2 correct digits in 2584 and 3548, one of the 4 and 8 should be correct). But we get a contradiction since 4860 now contains 2 correct digits (6 and at least one of 4 and 8).
So, 6 is wrong, and 2, 3, 5 are all correct. Now we can say that 4 and 8 are wrong, since we already reached the limit of right digits in 2548/3584. So, 0 is correct since it is the only remaining "unknown" digit of 4860.
From 2584, 2 and 5 are in the right places (we now have 25xx), 0 is in the wrong place from 4860 (we have 250x - only remaining place for the 0), and the last place should be occupied by the 3 (the final correct digit). So, the final answer is 2503.