Le Monde puzzle [#1155]
The weekly puzzle from Le Monde is another Sudoku challenge:
Anahera and Wiremu play a game for T rounds. They successively pick a digit between 1 and 3, never repeating the previous one, and sum these digits. The last to play wins if the sum is a multiple of 3. Who is the winner for an optimal strategy?
By a simple dynamic programming of the optimal strategy at each step
N=3 A=matrix(-1,20,N) A[1,1:N]=1:N for (T in 2:20) for (i in 1:N) A[T,i]=i+ifelse(!T%%2, #parity check max((i+A[T-1,-i])%%3), #avoid zero min((i+A[T-1,-i])%%3)) #seek zero
the first to play can always win the game. Not fun!
September 29, 2020 at 10:12 pm
To clarify the rules: you have to play at least “T” rounds before checking whether the sum is zero mod 3, right?
September 30, 2020 at 9:12 am
Yes, there are exactly T rounds.
September 28, 2020 at 2:02 am
[…] Le Monde puzzle [#1155] […]
September 27, 2020 at 8:11 am
[…] article was first published on R – Xi'an's Og, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here) […]
September 27, 2020 at 5:49 am
[…] article was first published on R – Xi’an’s Og, and kindly contributed to R-bloggers]. (You can report issue about the content on this page […]
September 26, 2020 at 9:49 am
[…] by data_admin [This article was first published on R – Xi’an’s Og, and kindly contributed to R-bloggers]. (You can report issue about the content on this page […]