View Single Post
Old 2021-06-06, 00:36   #20
R. Gerbicz
 
R. Gerbicz's Avatar
 
"Robert Gerbicz"
Oct 2005
Hungary

149310 Posts
Default

An offline version of the puzzle, where you need to give all of your guesses in advance,
so you can profit nothing from the previous answers.
For n=10 here it is a solution that is using "only" 23 guesses, which is quite good if you compare this to log2(10!)=21.79
( proving nothing, so we could get even better than log2(n!) ).
Hence there is no two different permutations of 1..10 where you give the same 23 answers.
Code:
P=[[3,10,6,4,8,9,2,7,5,1],\
[3,10,1,7,9,6,5,2,4,8],\
[5,3,6,2,4,10,7,8,1,9],\
[2,6,5,8,7,1,9,4,3,10],\
[8,10,3,7,1,5,4,9,6,2],\
[6,5,10,8,4,2,3,1,7,9],\
[3,8,7,2,4,5,6,10,9,1],\
[4,1,7,5,2,3,10,9,8,6],\
[8,4,10,5,1,2,3,6,7,9],\
[10,9,8,2,5,3,6,1,4,7],\
[4,9,7,2,8,6,3,1,5,10],\
[4,5,1,9,3,10,8,7,6,2],\
[3,9,7,10,4,2,5,8,6,1],\
[1,4,2,6,10,8,5,7,3,9],\
[3,4,6,9,7,1,8,10,2,5],\
[2,10,9,4,6,1,5,8,7,3],\
[1,9,8,6,5,10,7,4,3,2],\
[1,10,3,2,9,8,4,7,5,6],\
[7,3,8,4,2,10,6,5,1,9],\
[1,5,10,8,9,6,7,3,4,2],\
[7,3,5,4,6,1,9,10,2,8],\
[9,6,2,1,4,3,7,5,8,10],\
[7,2,9,8,6,1,4,10,3,5]];
R. Gerbicz is offline   Reply With Quote