Yourturnmyturn.com
Forum of yourturnmyturn.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Reply to topic
View previous topic :: View next topic  
Author Message
Faux
PostPosted: Tue Apr 01, 2014 11:19    Post subject: Best First Move Reply with quote

Hey all, I see there hasn't been a post in like 4 years, so I'm going to reset that timer real quick Razz

In case anyone was wondering, there is a best first move in this game. Lets say that you can make any of the following where A,B,C,D,E are different colors:

A B C D E
A A B C D
A A B B C
A A A B C
A A A B B
A A A A B
A A A A A

The best first move would be: A A B B C, so pick three colors and for two of them, choose that color twice in your first move.

---------- The rest of this is for anyone curious to see the numbers behind this

This is the case since there are 21 types of responses for a guess in this game: [0 0 0 0 0] [0 0 0 0 1] [0 0 0 0 2] [0 0 0 1 1] [0 0 0 1 2] [0 0 0 2 2] [0 0 1 1 1] [0 0 1 1 2] [0 0 1 2 2] [0 0 2 2 2] [0 1 1 1 1] [0 1 1 1 2] [0 1 1 2 2] [0 1 2 2 2] [0 2 2 2 2] [1 1 1 1 1] [1 1 1 1 2] [1 1 1 2 2] [1 1 2 2 2] [1 2 2 2 2] [2 2 2 2 2] where 0=blank, 1=white, 2=black

There is a certain number of possible guesses that can be made depending on which response you are given to your original guess. I'll skip the tables and charts, but the expected number of possible choices after a first guess is:

A B C D E = 973.0 expected possible choices
A A B C D = 888.7 expected possible choices
A A B B C = 856.5 expected possible choices
A A A B B = 980.4 expected possible choices
A A A A B = 1210.2 expected possible choices
A A A A A = 2720.8 expected possible choices

... out of 7776 possible starting choices (6^5).

If anyone cares to verify on their own, the formula to do so is the sum of (the number of possible choices per guess response given back divided by the possible number of different choices all multiplied by the number of possible choices per guess response given back)... or sum of E(x) over the set of partitions where E(x) = P(x) * #x... and P(x) = #x/7776...

... which comes out to a pretty straight-forward formula of [sum(#x^2)]/(21*7776) -- from which you'll get the partition values above.

And to come full circle, you want your first guess to eliminate as many wrong answers as possible, so the combination that has the lowest expected possible choices will put you closest to the correct answer more often than the rest... which is A A B B C.

I hope that helps anyone who may have been curious about this. Generally I don't advocate discussion "best of" sorts of strategies, but since this is a game based off Mastermind - which itself has been thoroughly explored in the hopes of finding a God Algorithm - I felt it wouldn't hurt to shed some light on this counterpart.
Back to top
The_BurglarOffline
Avatar

Joined: 17 Mar 2009
Total posts: 110
Location: Sutton Coldfield
Gender: Male
Uk
PostPosted: Sat Oct 11, 2014 17:17    Post subject: Reply with quote

worst case (c++) runs for 7 guess1's (bw)=most combinations left
further guess'es are a possible (using an impossible may split better)

guess1 com bw guess2 com bw guess3 com bw guess4 com

11111 3125 (00) 22334 510 (12) 25452 72 (11) 45343 8

11112 1732 (01) 22334 276 (11) 25256 36 (11) 42466 5

11122 1384 (11) 23423 197 (11) 25145 26 (11) 46113 5

11123 1444 (11) 22443 214 (11) 12255 30 (11) 31345 5

11223 1360 (11) 24453 199 (02) 62265 22 (02) 15614 4
11223 1360 (11) 24453 199 (02) 62265 22 (12) 51562 4

11234 1303 (02) 25325 202 (11) 22646 23 (02) 54165 4
11234 1303 (02) 25325 202 (11) 22646 23 (11) 45156 5

12345 1560 (03) 23166 240 (12) 21233 38 (11) 31461 4

conclusions

11111 is bad any other guess with worst case results every time will get you to 4 or 5 combinations after 4 guesses

11 result is a common worst [great for an unfriendly game]
if you respond well to 11 then maybe start with 11122 or 11123

would need to add a statistical assessment for a better judgement
Back to top
View user's profile 
The_BurglarOffline
Avatar

Joined: 17 Mar 2009
Total posts: 110
Location: Sutton Coldfield
Gender: Male
Uk
PostPosted: Tue Oct 14, 2014 3:51    Post subject: Reply with quote

worst case with lower second worst case etc for above has following small improvement (maybe due to better splitting and maybe less average guesses required)

guess1 com bw guess2 com bw guess3 com bw guess4 com

11123 1444 (11) 22443 214 (11) 12255 30 (11) 31435 5

11234 1303 (02) 25325 202 (11) 22646 23 (02) 64155 4
11234 1303 (02) 25325 202 (11) 22646 23 (11) 56145 5

12345 1560 (03) 23466 240 (12) 43224 37 (02) 65433 4

conclusions

any system can be rated by total guesses required for every combination

estimate best system is 35000 (average of 4.5 guesses)
Back to top
View user's profile 
The_BurglarOffline
Avatar

Joined: 17 Mar 2009
Total posts: 110
Location: Sutton Coldfield
Gender: Male
Uk
PostPosted: Sun Oct 19, 2014 3:02    Post subject: Reply with quote

lowest (all 7776 targets)
first guesses average
11223 36971 4.75
11234 37170 4.78
11123 37229 4.79 (good estimate)
11122 37427 4.81 (good estimate)
12345 38056 4.89
11112 38478 4.94 (good estimate)
11111 41524 5.34 (high estimate {bw=00 & 10 =3125 valids})

produced using c++
main recursive routine counts minimum guesses required from a list of valid codes

speed improvement :- remember all compared codes [7776][7776] xy=yx
Back to top
View user's profile 
The_BurglarOffline
Avatar

Joined: 17 Mar 2009
Total posts: 110
Location: Sutton Coldfield
Gender: Male
Uk
PostPosted: Mon Oct 20, 2014 19:49    Post subject: Reply with quote

change (others are okey)
11112 38442 4.92
Back to top
View user's profile 
The_BurglarOffline
Avatar

Joined: 17 Mar 2009
Total posts: 110
Location: Sutton Coldfield
Gender: Male
Uk
PostPosted: Mon Oct 27, 2014 19:56    Post subject: Reply with quote

test run for 11223 starter produces 36920 guesses for 7776 codes (still 4.75 but out by 51!)
Back to top
View user's profile 
The_BurglarOffline
Avatar

Joined: 17 Mar 2009
Total posts: 110
Location: Sutton Coldfield
Gender: Male
Uk
PostPosted: Thu Oct 30, 2014 1:13    Post subject: Reply with quote

tested runs for all 7776 combinations

1st total average

11223 36920 4.75
11234 37171 4.78
11123 37230 4.79
11122 37428 4.81
12345 38057 4.89
11112 38478 4.94 (estimate)
11111 41524 5.34 (estimate)
Back to top
View user's profile 
The_BurglarOffline
Avatar

Joined: 17 Mar 2009
Total posts: 110
Location: Sutton Coldfield
Gender: Male
Uk
PostPosted: Thu Oct 30, 2014 23:26    Post subject: Reply with quote

11112 38443. Av=4.94
Back to top
View user's profile 
The_BurglarOffline
Avatar

Joined: 17 Mar 2009
Total posts: 110
Location: Sutton Coldfield
Gender: Male
Uk
PostPosted: Wed Nov 05, 2014 16:55    Post subject: Crack the colours Reply with quote

to find one of the 252 combinations of colours only

start guesses
11122 1147 average=4.55
11223 1154
11123 1162
11112 1170
11234 1189
11111 1222
12345 1246 (not expected this to be last)

the above results seem to lead to an optimistic feedback system which is more driven by what is not picked (eg 3,4,5 & 6's in the best case)

11122 colours book (only 145 lines)

11122 0c 33344 0c 55555 0c 66666
11122 0c 33344 0c 55555 1c 56666
11122 0c 33344 0c 55555 2c 55666
11122 0c 33344 0c 55555 3c 55566
11122 0c 33344 0c 55555 4c 55556
11122 0c 33344 1c 35555 0c 46666
11122 0c 33344 1c 35555 1c 36666 3c 45666
11122 0c 33344 1c 35555 2c 35666 3c 45566
11122 0c 33344 1c 35555 3c 35566 3c 45556
11122 0c 33344 1c 35555 4c 35556 3c 45555
11122 0c 33344 2c 33555 0c 44444 2c 44666
11122 0c 33344 2c 33555 0c 44444 3c 44466
11122 0c 33344 2c 33555 0c 44444 4c 44446
11122 0c 33344 2c 33555 1c 34666 1c 44445
11122 0c 33344 2c 33555 1c 34666 2c 44456
11122 0c 33344 2c 33555 1c 34666 3c 44566
11122 0c 33344 2c 33555 2c 33666 0c 44455
11122 0c 33344 2c 33555 2c 33666 1c 44556
11122 0c 33344 2c 33555 2c 33666 3c 34566
11122 0c 33344 2c 33555 3c 33566 1c 44555
11122 0c 33344 2c 33555 3c 33566 3c 34556
11122 0c 33344 2c 33555 4c 33556 3c 34555
11122 0c 33344 3c 33355 1c 34444 3c 34466
11122 0c 33344 3c 33355 1c 34444 4c 34446
11122 0c 33344 3c 33355 2c 33466 2c 34445
11122 0c 33344 3c 33355 2c 33466 3c 34456
11122 0c 33344 3c 33355 3c 33333 1c 34455
11122 0c 33344 3c 33355 3c 33333 2c 33456
11122 0c 33344 3c 33355 3c 33333 3c 33366
11122 0c 33344 3c 33355 3c 33333 4c 33336
11122 0c 33344 3c 33355 4c 33335 3c 33455
11122 0c 33344 3c 33355 4c 33335 4c 33356
11122 0c 33344 4c 33345 3c 33444 4c 33446
11122 0c 33344 4c 33345 4c 33334 3c 33445
11122 0c 33344 4c 33345 4c 33334 4c 33346
11122 1c 13334 0c 25555 1c 26666
11122 1c 13334 0c 25555 2c 25666
11122 1c 13334 0c 25555 3c 25566
11122 1c 13334 0c 25555 4c 25556
11122 1c 13334 1c 15555 0c 23666 1c 24444
11122 1c 13334 1c 15555 0c 23666 2c 24446
11122 1c 13334 1c 15555 0c 23666 3c 24466
11122 1c 13334 1c 15555 0c 23666 4c 24666
11122 1c 13334 1c 15555 1c 24445 0c 16666
11122 1c 13334 1c 15555 1c 24445 2c 23566
11122 1c 13334 1c 15555 1c 24445 3c 24566
11122 1c 13334 1c 15555 1c 24445 4c 24456
11122 1c 13334 1c 15555 2c 23556 2c 15666
11122 1c 13334 1c 15555 2c 23556 3c 24455
11122 1c 13334 1c 15555 2c 23556 4c 24556
11122 1c 13334 1c 15555 3c 23555 2c 15566
11122 1c 13334 1c 15555 3c 23555 4c 24555
11122 1c 13334 1c 15555 4c 15556
11122 1c 13334 2c 14444 0c 23355 3c 23366
11122 1c 13334 2c 14444 0c 23355 4c 23356
11122 1c 13334 2c 14444 1c 13555 1c 23466
11122 1c 13334 2c 14444 1c 13555 2c 13666 2c 23456
11122 1c 13334 2c 14444 1c 13555 3c 13566 2c 23455
11122 1c 13334 2c 14444 1c 13555 4c 13556
11122 1c 13334 2c 14444 2c 14555 1c 23446
11122 1c 13334 2c 14444 2c 14555 2c 14666 1c 23445
11122 1c 13334 2c 14444 2c 14555 3c 14566
11122 1c 13334 2c 14444 2c 14555 4c 14556
11122 1c 13334 2c 14444 3c 14455 2c 23444
11122 1c 13334 2c 14444 3c 14455 3c 14466
11122 1c 13334 2c 14444 3c 14455 4c 14456
11122 1c 13334 2c 14444 4c 14445 4c 14446
11122 1c 13334 3c 13455 1c 23333 4c 23336
11122 1c 13334 3c 13455 2c 23344 2c 13366
11122 1c 13334 3c 13455 2c 23344 3c 23335
11122 1c 13334 3c 13455 2c 23344 4c 23346
11122 1c 13334 3c 13455 3c 13444 2c 13356 3c 23345
11122 1c 13334 3c 13455 3c 13444 3c 13466
11122 1c 13334 3c 13455 3c 13444 4c 13446
11122 1c 13334 3c 13455 4c 13445 3c 13355
11122 1c 13334 3c 13455 4c 13445 4c 13456
11122 1c 13334 4c 13335 3c 13344 3c 23334
11122 1c 13334 4c 13335 3c 13344 4c 13346
11122 1c 13334 4c 13335 4c 13333 3c 13345
11122 1c 13334 4c 13335 4c 13333 4c 13336
11122 2c 11334 0c 22222 2c 22555 2c 22666
11122 2c 11334 0c 22222 2c 22555 3c 22566
11122 2c 11334 0c 22222 2c 22555 4c 22556
11122 2c 11334 0c 22222 3c 22255 3c 22266
11122 2c 11334 0c 22222 3c 22255 4c 22256
11122 2c 11334 0c 22222 4c 22225 4c 22226
11122 2c 11334 1c 12556 1c 22223 2c 22444
11122 2c 11334 1c 12556 1c 22223 3c 22244
11122 2c 11334 1c 12556 1c 22223 4c 22224
11122 2c 11334 1c 12556 2c 22235 2c 22446 4c 22466
11122 2c 11334 1c 12556 2c 22235 3c 22366 2c 22445
11122 2c 11334 1c 12556 2c 22235 3c 22366 3c 22246
11122 2c 11334 1c 12556 2c 22235 4c 22236 3c 22245
11122 2c 11334 1c 12556 3c 22355 1c 12666
11122 2c 11334 1c 12556 3c 22355 3c 22456
11122 2c 11334 1c 12556 3c 22355 4c 22356 3c 22455
11122 2c 11334 1c 12556 4c 12555 3c 12566
11122 2c 11334 2c 11556 0c 22233 3c 22344
11122 2c 11334 2c 11556 0c 22233 4c 22234 3c 22333
11122 2c 11334 2c 11556 1c 22335 1c 12444
11122 2c 11334 2c 11556 1c 22335 3c 22346
11122 2c 11334 2c 11556 1c 22335 4c 22336 3c 22345
11122 2c 11334 2c 11556 2c 12366 2c 12445
11122 2c 11334 2c 11556 2c 12366 3c 12446
11122 2c 11334 2c 11556 2c 12366 4c 12466
11122 2c 11334 2c 11556 3c 12355 1c 11666
11122 2c 11334 2c 11556 3c 12355 3c 12456
11122 2c 11334 2c 11556 3c 12355 4c 12356 3c 12455
11122 2c 11334 2c 11556 4c 11555 3c 11566
11122 2c 11334 3c 11455 1c 12333 3c 22334
11122 2c 11334 3c 11455 1c 12333 4c 12336
11122 2c 11334 3c 11455 2c 12344 2c 11366
11122 2c 11334 3c 11455 2c 12344 3c 12335
11122 2c 11334 3c 11455 2c 12344 4c 12346
11122 2c 11334 3c 11455 3c 11444 2c 11356 3c 12345
11122 2c 11334 3c 11455 3c 11444 3c 11466
11122 2c 11334 3c 11455 3c 11444 4c 11446
11122 2c 11334 3c 11455 4c 11445 3c 11355
11122 2c 11334 3c 11455 4c 11445 4c 11456
11122 2c 11334 4c 11335 3c 11344 3c 12334
11122 2c 11334 4c 11335 3c 11344 4c 11346
11122 2c 11334 4c 11335 4c 11333 3c 11345
11122 2c 11334 4c 11335 4c 11333 4c 11336
11122 3c 11134 1c 12222 3c 12255 3c 12266
11122 3c 11134 1c 12222 3c 12255 4c 12256
11122 3c 11134 1c 12222 4c 12225 4c 12226
11122 3c 11134 2c 11256 2c 12223 3c 12244
11122 3c 11134 2c 11256 2c 12223 4c 12224 3c 12233
11122 3c 11134 2c 11256 3c 12235 3c 12246
11122 3c 11134 2c 11256 3c 12235 4c 12236 3c 12245
11122 3c 11134 2c 11256 4c 11255 3c 11266
11122 3c 11134 3c 11115 1c 12234
11122 3c 11134 3c 11115 2c 11233 3c 11244 4c 11246
11122 3c 11134 3c 11115 2c 11233 4c 11236
11122 3c 11134 3c 11115 3c 11235 2c 11166
11122 3c 11134 3c 11115 3c 11235 4c 11245
11122 3c 11134 3c 11115 4c 11111 3c 11155 4c 11156
11122 3c 11134 3c 11115 4c 11111 4c 11116
11122 3c 11134 4c 11113 3c 11144 3c 11234
11122 3c 11134 4c 11113 3c 11144 4c 11145 4c 11146
11122 3c 11134 4c 11113 4c 11133 3c 11114
11122 3c 11134 4c 11113 4c 11133 4c 11135 4c 11136
11122 4c 11123 3c 11222 4c 11224 4c 11225 4c 11226
11122 4c 11123 4c 11112 3c 11223
11122 4c 11123 4c 11112 4c 11124 4c 11125 4c 11126
Back to top
View user's profile 
WithoutPantsOffline
Joined: 13 Oct 2014
Total posts: 12
Gender: Unknown
Tunisia
PostPosted: Tue Mar 24, 2015 0:36    Post subject: Reply with quote

Is anyone supposed to understand anything what you guys are talking about? Razz
Im not Wink
Back to top
View user's profile 
The_BurglarOffline
Avatar

Joined: 17 Mar 2009
Total posts: 110
Location: Sutton Coldfield
Gender: Male
Uk
PostPosted: Fri May 08, 2015 17:28    Post subject: Reply with quote

Very Happy yes maybe answer too abstract

too find the best first guess, I assumed the answer would be random (should really exclude patterns such as 11111 and 11112 because they can be found quickly), also assumed that using only valid guesses would be quickest (quicker to run program){not tested for trueness}

so a good way to compare each was to sum the total guesses required for every possible answer, and then average it

the program to create data, at each guess uses the minimum total returned for each possible valid code (+1 for self)

the slowest part of program was comparing two codes (hence big table where [x][y]=[y][x] {did not try x<=y})

was tested (maybe 3 times) using a spreadsheet and fixed prog errors
Back to top
View user's profile 
widepiOffline
Joined: 21 Apr 2020
Total posts: 1
Age: 30
Gender: Male
Netherlands
PostPosted: Tue Apr 21, 2020 11:01    Post subject: Reply with quote

WithoutPants wrote:
Is anyone supposed to understand anything what you guys are talking about? Razz
Im not Wink

++ Laughing
Back to top
View user's profile Visit poster's website 
Display posts from previous:   
Reply to topic All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group