The classic Mastermind

Logic Level 2

In the game Mastermind, I have to guess some permutation of five colors out of eight (being a permutation, all colors are different). I can submit a guess, and I receive a reply in the form of two numbers:

  • The blue number tells the number of colors in my guess that exist in the secret pattern, which are also correct in position.
  • The white number tells the number of colors in my guess that exist in the secret pattern, but which are incorrect in position.

When where there should be a number, it is empty instead, the number is assumed to be zero.

What is the secret pattern? Enter your answer in order from left to right, translating the color to a digit code according to this table:

Color Green Blue Yellow White
Code 1 2 3 4
Color Black Red Purple Orange
Code 5 6 7 8

As an example, if the answer is orange-blue-yellow-white-black, enter 82345 82345 .


The answer is 21847.

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

Let the bottom row be Row 1. Then,

  • Row 6: Shows that the correct 5 colors are O=8, B=2, G=1, P=7 and W=4, but they are all at wrong places.
  • Rows 1 and 6: P=7, which is a correct color but not at the Column 1 to 4, therefore, it must be at Column 5.
  • Rows 2: W=4 is the only correct color and at correct place, therefore, it must be either at Column 3 or 4.
  • Row 5: Since P=7 is at Column 5, O=8 is at the wrong place. From Row 6, B=2 is at the wrong place. Therefore, either G=1 is at Column 1 or W=4 is at Column 4.
  • Row 4: If G=1 is at Column 1, then W= 4 is at Column 4 which conflicts with the results of Row 5 above. Therefore, G1=1 is not at Column 1 and W=4 is at Column 4. Since W=4 and O=8 are not at the right places, and G=1 is not at Columns 1 and 5, G=1 must be at Column 2. Row 6: We have now G=1 at Column 2, W=4 at Column 4 and P=7 at Column 5, leaving Columns 1 and 3 for O=8 and B=2. Since O=8 is not at Column 1, B=2 is at Column 1 and O=8 is at Column 3.

Therefore, the matched guess is B G O W P = 21847 BGOWP = \boxed{21847}

So dumb. I typed 21647 becauze 8=orane wasnt showing on my interface and i thought their red was orange

J C - 5 years, 2 months ago

I just used the numbers in my zip code (not even close to this) 3 times at random!

Sara Flint - 5 years, 3 months ago

the puzzle is texted badly... please, look at the row #3... wee OBVIOUSLY see one color placed right (green on the 2nd pit) and wee see THREE colors (NOT TWO!!!) which are present in the required pattern and are placed wrong (purple, white and, again, GREEN!!!) IF we say that one green chip is placed right then we SHOULDN'T ignore the fact that two green chips are placed wrong!!!!! the "white number's" value of the row #3 should be in this case not 2, but 3!!! the same problem is with the row #6

DEAR AUTHOR! please, sort this issue out!!

Nik Gibson - 2 years, 9 months ago

Log in to reply

Actually the clues do not work this way. The standard version of the game allows you to set only one of each colour in the "solution". So if you have that colour in the correct position in the guess (supposing all the others are wrong colour) it gives you one blue and just ignores the rest of the guesses of the same colour. If all the guesses of that colour are in the wrong position then it will just consider it as one guess in the wrong position and ignore the others. So it will only give you one "blue" if any of the guesses is in the right place and ignores the others. If none is in the right place it will give you only one "white". In other versions you are allowed to set more than one of the same colour in the solution but the number of clues with regards to that colour will not exceed the number of that coloured peg in the solution.
Let's suppose there are 2 greens in the solution and 3 greens in guess. Now consider the possibilities.
1. All three are in wrong position. Only "two" whites
2. One is in the right position and two in the wrong. The clue will be one blue and one white.
3. Two are matching the ones in the solution. The clue will be two blues. Let's put it this way.
If the number of that colour in the guess is more than that in the solution then the total number of clues is equal to the number in the solution and never more than that.
If all the pegs of that colour in the solution are guessed correctly then there will be that many number of blue clues and the guess in wrong position will be ignored. If none of the guesses is in correct position then the clue will be only whites and number will be equal to the number in solution.
If some are in correct position and some in wrong then after counting the ones in the right position and giving that as the number of blue clues rest will be marked as white but the total number of blue and white clues should not exceed the total number of that colour in the guess.


Zahid Hussain - 1 year, 10 months ago

18427 also is a valid solution.

Zahid Hussain - 1 year, 10 months ago

Log in to reply

No it is not, my mistake.

Zahid Hussain - 1 year, 10 months ago

I chose 21647 instead of 21847, I'm not colorblind but how do you distinguish between red and orange

A Former Brilliant Member - 7 months, 2 weeks ago
Zahid Hussain
Aug 13, 2019

The top row tell us that purple is one of the colours and it is NOT in position 4. The bottom row confirms purple as correct colour and also tells us that it is not in position 1, 2 or 3.
So it is in position 5. ...Result A.
We also know from the top row that white is one of the colours and fifth row tells us that it is in 3rd or 4th position.
From the 2nd row we know that orange and purple are not in the right place (Result A). Neither is blue (No "blue" clue for row 1). So it leaves us with white and green. Let's assume it is green. In that case white cannot be in 4th position thus making it 3rd, but in that case the 3rd row should have two "blue" clues (one for white and one for green) but that is not the case, so the original assumption was wrong and the colour in correct position in 2nd row was green (Result B)
Now the 3rd row tells us that green can only be in 2nd position (Result C).
That leaves orange in 4th position (Result D)
and blue in 1st (Result E).
So the answer is BGOWP

27418 also works ...

Mark Wishart - 11 months, 3 weeks ago

Log in to reply

No. (27418) BPWGO would get 1-0 on test code PPPbb not 0-1 as given.

Robert DeLisle - 8 months ago

What is write answer

aditya chand - 11 months, 1 week ago

Log in to reply

The correct answer accepted by the website 21847 BGOWP

Robert DeLisle - 8 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...