Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Master Mind from Journeyman project

232 views
Skip to first unread message

Anton Shepelev

unread,
Mar 7, 2021, 1:02:42 PM3/7/21
to
Hello, all

I am stuck at the Master-Mind-like puzzle from Journeyman
Project, where the player must find a sequence of three
*different* colors out of five available, in five attempts,
so that there are 60 combinations to choose from. In re-
sponse to each guess, he receives the number of matching
items, which have the right color at the right position. To
complicate matters, the puzzle has to be solved within a
very short time limit.

Has anybody an idea how to make it honestly, without the as-
sistance of a computer program that keeps track of exlcuded
combinations and suggests a next attempt that efficiently
narrows-down the remaning possiblities? I can't find a
strategy simple enough to employ in mind & memory.

--
() ascii ribbon campaign -- against html e-mail
/\ http://preview.tinyurl.com/qcy6mjc [archived]

leflynn

unread,
Mar 10, 2021, 7:57:13 PM3/10/21
to
Anton,
Let’s start with five colors represented by a, b, c, d and e.
There are 10 possible choices for the three colors not counting positioning.
I would list the ten cases and then cross them off when they are eliminated.

How can we find the colors? (I’ll talk about position strategies in another post.)
If we give some version of (abc) for Guess 1,
Case 1: three correct colors - the colors are (abc).
Case 2: one correct color - the colors are (ade), (bde) or (cde).
Case 3: two correct colors - the colors are
(abd), (abe), (acd), (ace), (bcd) or (bce).

For Case 1, you have the colors and one set of position information. I think you know how solve this one for positions too.

For Case 2, you have three possible choices for the colors, you should know which one of the three it is after the third Guess. (Guess 2 (ade) if it is not (ade) then Guess 3 (bde) if it not (bde) then it is (cde).)

For Case 3, you have six possible choices for the colors. Guess 2 (abd)
Case 4: three correct colors – (abd) is the answer
Case 5: one correct color – the answer is (ace) or (bce). (Guess 3 (ace) if it is not then it is (bce))
Case 6: two correct colors – the answer is (abe), (acd) or (bcd). (Guess 3 (abe) if not then Guess 4 (acd) if not then (bcd).

So in every case we can get identify the three colors within five guesses.

L. Flynn

Anton Shepelev

unread,
Mar 12, 2021, 6:01:00 AM3/12/21
to
leflynn:

> LetТs start with five colors represented by a, b, c, d and
> e. There are 10 possible choices for the three colors not
> counting positioning. I would list the ten cases and then
> cross them off when they are eliminated.

Yes, finding a combination instead of a permutation is much
easier. I still, however, am at a loss about solving the
original problem as fast as the game requires.

--
() ascii ribbon campaign - against html e-mail
/\ http://preview.tinyurl.com/qcy6mjc [archived]
Message has been deleted

leflynn

unread,
Mar 14, 2021, 6:39:37 PM3/14/21
to
On Sunday, March 14, 2021 at 5:51:31 PM UTC-4, leflynn wrote:
I see finding a combination as part of the problem fortunately, you can do both at once.
When I play mastermind I keep a grid of the possible locations for the remaining colors.
It would start as
a a a
b b b
c c c
d d d
e e e
Rows would be removed or crossed out as colors were eliminated and x’s would be placed in positons that are not allowed. Some obvious results:
Guess results with one correct color either tell us where the three colors present in the guess may go or where they cannot go. For example if Guess 1 (abc) had one correct color and it was not in the correct positon, the position chart would become:
x a a
b x b
c c x
d d d
e e e



leflynn

unread,
Mar 14, 2021, 7:05:37 PM3/14/21
to
On Sunday, March 14, 2021 at 5:51:31 PM UTC-4, leflynn wrote:
> On Friday, March 12, 2021 at 6:01:00 AM UTC-5, Anton Shepelev wrote:
> I see finding a combination as part of the problem fortunately, you can do both at once.
>
> Here is a decision table. You'll need to view it with a fixed width font.
Well, that post turned into a mess...
_G1___G2___G3___G4___G5
(ABC)_
_3p0_(BCA)(CAB)
_3p1_(ACB)(BAC)(CBA)
_2p0_(BAD)
______3p1_(BDA)(DAB)
______2p0_(CDA)
___________3p0_(DCA)
___________2p0_(DCB)
___________2p2_(CDB)
______2p1_(BEA)
___________3p0_(EAB)
______2p2_(BAE)(BCD)(CAD)
______1p0_(CEA)_
___________3p1_(ECA)
___________2p0_(ECB)
___________2p2_(CEB)
______1p1_(CAE)(BCE)
_2p1_(ADB)
______3p0_(DBA)
______2p0_(CBD)
___________3p0_(BDC)
___________1p0_(DAC)
___________1p1_(EBA)_
______2p1_(ACD)
______2p2_(AEB)
______1p0_(BEC)
___________3p0_(CBE)
___________2p1_(EAC)
______1p1_(ACE)
_2p2_(ABD)
______2p2_(ABE)
______2p1_(ADC)(DBC)
______1p1_(AEC)(EBC)
_1p0_(DAE)
______3p0_(EDA)
______3p1_(DEA)(EAD)
______2p0_(BED)
___________3p0_(EDB)
___________3p1_(DEB)
___________2p0_(ECD)
___________2p2_(CED)
______2p1_(BDE)(CDE)
______2p2_(DCE)
_1p1_(ADE)_
______3p1_(AED)
______2p0_(DEC)(EBD)
______2p1_(DBE)(EDC)

> Is (DCE) in the correct place?
> Guess1(ABC) 1p0; Guess2(DAE) 2p2; Guess3 (DCE)
> Is (CAD) in the correct place?
> Guess1(ABC) 2p0; Guess2(BAD) 2p2; Guess3(BAE) 1P; Guess4(BCD) 2p1; Guess5(CAD)

Anton Shepelev

unread,
Mar 15, 2021, 7:41:19 AM3/15/21
to
leflynn:

> Well, that post turned into a mess...

Not at all: http://al.howardknight.net/?ID=161580839200
but I still wonder why anyone who knows about monospace
fonts should access Usenet via crippled GoogleGropus...

I have not yet studied your solution yet, but will do.

leflynn

unread,
Mar 15, 2021, 12:51:10 PM3/15/21
to
Anton,
The solution I gave picks from the available responses at each stage in alphabetical order. It’s not the way I would play a real game. When I play Mastermind, I keep piles of colors with information in my head.

For colors here, I start with A,B,C.
If all three are right, then good.
If one is right, then D and E are colors and one of A,B,C. My round two guesses for these cases use A,D,E.
(If your guess is always three distinct colors, then one color right always tells you that the other two are good colors. Once you know two for sure, every guess either tells you that one of the other three colors is right or wrong.)
If two are right, then I would have a pile of A,B,C and remember that my answer needs two of them and a pile of D,E and I need one of them.
My round two guess for these cases use A,B,D for colors.

For round three
If your A,B,D guess has one color right, then you know C and E and are correct and one A and B. I chose to check A,C,E first
If you’re A,B,D guess has two colors right, then you either need to swap A or B for C or you need to swap D for E. I chose to swap B for C and guess using A,C,D. You can tell right away by whether number of correct colors stayed the same, decreased or increased whether the B -> C swapped good for good (B,C is right and so is D), good for bad (A,B is right and so is E) or bad for good (A,C is right and so is D).

For positions, I just choose the first one alphabetically to go in the earliest correct position or not go in the earliest wrong position working through to the current guess, and then move on to the next color.

L. Flynn

Anton Shepelev

unread,
Mar 16, 2021, 1:55:06 PM3/16/21
to
leflynn:

> Here is a decision table.

If I understand your notation, xpy encodes a guess with x
correct colors and y colors at the correct position. I fear
it is not the feedback the player receives in the puzzle I
posted. Instead of two numbers, the machine answers to each
guess with a single number -- the quanitity of colors at
correct positions. It does not reveal how many colors in the
guess are present in the sought combination at incorrect po-
sitions. I wrote in my original post:

> In response to each guess, he receives the number of
> matching items, which have the right color at the right
> position.

I am sorry that my English was not clear enough. Perhaps a
screenshot would help:

https://freeshell.de/~antonius/img_host/colorpuzzle.png

The five avaialbe colors are present above label that reads
"possible color synapse nodes". The guess log is on the
right, with a single number annotating each of the four
spend guesses: 0,1,0,1. This is not a binary code, but the
nubmers of matching color-positions.

leflynn

unread,
Mar 16, 2021, 2:20:37 PM3/16/21
to
Ouch. Sorry, I've been solving the Mastermind problem, not yours.
L. Flynn
Message has been deleted

leflynn

unread,
Mar 17, 2021, 6:46:07 PM3/17/21
to
On Sunday, March 7, 2021 at 1:02:42 PM UTC-5, Anton Shepelev wrote:
I don't have one I would want to memorize but I have a table that wins 51/60 times for an individual puzzle.
It's essentially a printout of a computer program, so it doesn't even meet that limiting part of your request.
I see some patterns and choices but by the third round it's too messy.
G1 G2 G3 G4 G5
123
_0_231
____0_314
_______0_542
__________1_452
_______1_342
__________0_415
__________1_412 x512
__________2_345 x352
_______2_315
__________1_354 x514
__________2_312
____1_541
_______0_215
__________0_432
__________1_254 x435
__________2_214
_______1_531 x (only non-feasible guess)
__________0_245
__________1_351 x451
__________2_532 x534
_______2_341
____2_531
_______1_234
__________1_241 x251
__________2_235
_______2_431
_1_543
____0_425
_______0_134
__________1_152
__________2_132 x154
_______1_321
__________0_135
__________2_324
_______2_325
__________1_421
____1_253
_______0_524
__________0_142 x145
__________2_521
_______1_413
_______2_213
__________1_453
____2_513
_______1_243
_2_124
____1_523
_______1_143
__________2_153
_______2_423
____2_125


Anton Shepelev

unread,
Mar 21, 2021, 10:50:34 AM3/21/21
to
Lawrence E Flynn:

> Ouch. Sorry, I've been solving the Mastermind problem, not
> yours.

You indeed have.

> I don't have one I would want to memorize but I have a
> table that wins 51/60 times for an individual puzzle.
> It's essentially a printout of a computer program, so it
> doesn't even meet that limiting part of your request. I
> see some patterns and choices but by the third round it's
> too messy.

Thank you very much anyway. It helped me solve the puzzle
two times! It is randomly generated and the first time I
didn't save my game correctly. I will propose your decision
tree to for inclusion into an existing walkthrough, if I
find a way to do it, with due credits.

leflynn

unread,
Mar 21, 2021, 12:46:54 PM3/21/21
to
Anton,
The approach I gave is probably not optimal. It was not an exhaustive search.
One question, are you only allowed to make guesses with three different colors,
or could you guess, for example, (A,A,B)?
L. Flynn

Anton Shepelev

unread,
Mar 21, 2021, 1:38:24 PM3/21/21
to
Lawrence E Flynn:

> The approach I gave is probably not optimal. It was not an
> exhaustive search.

I suspected it, because the walkthrough gives a higher
chance of winning thatn 51/60.

> One question, are you only allowed to make guesses with
> three different colors, or could you guess, for example,
> (A,A,B)?

No, I am not, and nor are any other players :-)

I have thought of writing a program that at every step
chooses a guess that invalidates the most combinations, by
brutally trying every one of them.

leflynn

unread,
Apr 4, 2021, 10:06:01 AM4/4/21
to
Anton,
Part of the approach I used looks at trying to minimize the maximum number of possible choices in in each of the branches of possible answers (0, 1, 2, or 3 correct) from the current guess given the solution subset for the responses so far. It is usually the 0 and 1 sets that are competing in size, although, once we have a 2 response from then on it is the 1 and 2 sets that compete.
L. Flynn

leflynn

unread,
Apr 7, 2021, 9:30:00 PM4/7/21
to
Anton,
I have an improvement for the cases where the initial guess has zero hits. It only loses three of those 32 cases. It uses two guesses that are not in the possible solution set at the point they are used.
G1 G2 G3 G4 G5
123
_0_412
____0_235
_______0_354
__________0_541
__________1_341
__________2_351
_______1_241
__________0_534
__________1_254 x531 x345
__________2_251
_______2_134 (not a possible solution at this point)
__________0_245
__________1_231
__________2_234
____1_314
_______0_431
__________0_542
__________1_532
__________2_435 x451
_______1_142 (not a possible solution at this point)
__________0_215
__________1_352
__________2_342
_______2_214
__________1_315
__________2_514
____2_312
_______1_432
__________1_415
__________2_452
_______2_512

L. Flynn




leflynn

unread,
Apr 8, 2021, 12:59:33 AM4/8/21
to
And an improvement where the first guess has one hit that loses one out of 21.
G1 G2 G3 G4 G5
123
_1_134
____0_413
_______0_325
__________1_521
__________2_321
_______1_253
__________0_421 x425
__________1_543
__________2_243
_______2_213
__________1_453
__________2_513
____1_124 NP
_______1_145
__________1_152
__________2_142
_______2_324
__________2_524
____2_135
_______1_154
_______2_132

Anton Shepelev

unread,
Apr 9, 2021, 9:59:47 AM4/9/21
to
L. Flynn:

> Anton,
> I have an improvement for the cases where the initial
> guess has zero hits. It only loses three of those 32
> cases. It uses two guesses that are not in the possible
> solution set at the point they are used.
> [...]
> And an improvement where the first guess has one hit that
> loses one out of 21.

I have already solved the puzzle with the help of your initial
decision tree. If you will care to provide the entire
decision tree with these improvements, then I will update it
in the walkthrough on this WIKI:

https://strategywiki.org/wiki/The_Journeyman_Project:_Pegasus_Prime/Morimoto_Colony#Shield_Generator
https://pastebin.com/raw/NCnpAz3s

--
() ascii ribbon campaign - against html e-mail
/\ http://preview.tinyurl.com/qcy6mjc [archived]

leflynn

unread,
Apr 9, 2021, 1:52:26 PM4/9/21
to
An improved tree that gets to the answer 56/60 times. The ##Y and ##X are my checks on success or failure for the list of 60 possible answers in numerical order. The odds of winning all of the games in a five-game match is slightly over 70%. It gets to the answer for 30 of the cases with four or fewer guesses.
L. Flynn

____G1 G2 G3 G4 G5
01Y123
37Y_0_412
18Y____0_235
33Y_______0_354
58Y__________0_541
31Y__________1_341
34Y__________2_351
19Y_______1_241
57Y__________0_534
24Y__________1_254 55X531 36X345 28
22Y__________2_251
16Y_______2_231
21Y__________1_245
17Y__________2_234
26Y____1_314
43Y_______0_431
59Y__________0_542
56Y__________1_532
45Y__________2_435 46X451
35Y_______1_352
15Y__________0_215
32Y__________2_342
14Y_______2_214
27Y__________1_315
51Y__________2_514
25Y____2_312
44Y_______1_432
39Y__________1_415
47Y__________2_452
49Y_______2_512

05Y_1_134
38Y____0_413
30Y_______0_325
52Y__________1_521
28Y__________2_321
23Y_______1_253
40Y__________0_421 42X425
60Y__________1_543
20Y__________2_243
13Y_______2_213
48Y__________1_453
50Y__________2_513
09Y____1_145
29Y_______0_324
54Y__________2_524
10Y_______1_152
07Y_______2_142
06Y____2_135
12Y_______1_154
04Y_______2_132

02Y_2_124
53Y____1_523
08Y_______1_143
11Y__________2_153
41Y_______2_423
03Y____2_125

James Dow Allen

unread,
Apr 13, 2021, 4:16:42 PM4/13/21
to
On Monday, March 8, 2021 at 1:02:42 AM UTC+7, Anton Shepelev wrote:
> Hello, all
>
> I am stuck at the Master-Mind-like puzzle ...

Better yet, try this webpage:
https://james.fabpedigree.com/mmind/mmind.htm
Five pegs, seven colors. Pretty tough! How many guesses do you need?
Although details are little known, it's always possible to solve with six guesses.

At the webpage you can go for computer's secret, have it go for yours, or both concurrently.
Try it and tell me what you think.

> --
> () ascii ribbon campaign -- against html e-mail
> /\ http://preview.tinyurl.com/qcy6mjc [archived]

Dearest regards, jamesdowallen

Anton Shepelev

unread,
May 3, 2021, 6:23:06 AM5/3/21
to
L. Flynn:

> An improved tree that gets to the answer 56/60 times. The
> ##Y and ##X are my checks on success or failure for the
> list of 60 possible answers in numerical order. The odds
> of winning all of the games in a five-game match is
> slightly over 70%. It gets to the answer for 30 of the
> cases with four or fewer guesses.

Thanks for an improved solution. Hopefully I will get around
to updating the game's walkthrough.

--
() ascii ribbon campaign -- against html e-mail
/\ http://preview.tinyurl.com/qcy6mjc [archived]

leflynn

unread,
Jul 7, 2021, 3:31:52 PM7/7/21
to
On Friday, April 9, 2021 at 1:52:26 PM UTC-4, leflynn wrote:
> An improved tree that gets to the answer 56/60 times. The ##Y and ##X are my checks on success or failure for the list of 60 possible answers in numerical order. The odds of winning all of the games in a five-game match is slightly over 70%. It gets to the answer for 30 of the cases with four or fewer guesses.
> L. Flynn
Here is a version that is converted from colors 1-5 to colors YBGPR
G1 G2 G3 G4 G5
YBG
_0_PYB
____0_BGR
_______0_GRP
__________0_RPY
__________1_GPY
__________2_GRY
_______1_BPY
__________0_RGP
__________1_BRP RGY GPR
__________2_BRY
_______2_BGY
__________1_BPR
__________2_BGP
____1_GYP
_______0_PGY
__________0_RPB
__________1_RGB
__________2_PGR PRY
_______1_GRB
__________0_BYR
__________2_GPB
_______2_BYP
__________1_GYR
__________2_RYP
____2_GYB
_______1_PGB
__________1_PYR
__________2_PRB
_______2_RYB

_1_YGP
____0_PYG
_______0_GBR
__________1_RBY
__________2_GBY
_______1_BRG
__________0_PBY PBR
__________1_RPG
__________2_BPG
_______2_BYG
__________1_PRG
__________2_RYG
____1_YPR
_______0_GBP
__________2_RBP
_______1_YRB
_______2_YPB
____2_YGR
_______1_YRP
_______2_YGB

_2_YBP
____1_RBG
_______1_YPG
__________2_YRG
_______2_PBG
____2_YBR


Anton Shepelev

unread,
Jul 13, 2021, 12:35:24 PM7/13/21
to
L. Flynn:

> Here is a version that is converted from colors 1-5 to colors YBGPR

That makes more sense, thank you. I can use it now with less work.
0 new messages