(Summary at the very bottom)
After many sleepless nights and much contemplation, I believe I have finally created a strategy to guarantee 9 out of 13 games.
I want to give credit to Joel Rondeau (who's strategy is the basis of my work), ffao who created the solution for winning 6 out of 9 games (improving on Joel's strategy). Credit is also due to Bennett Bernardoni who solved 8 out of 12 games and also showed that there can be "composite" deviations from Joel's strategy aside from the main 20 deviations you can typically find in a 9 of 13 game.
Before digging into my solution, I should clarify notation. As mentioned, my work is based on Joel's strategy which breaks the rounds into groups of three, starting with the second round (for a 9 of 13 game, the groups are 1 222 333 444 555: round 1 is in group 1; rounds 2,3 and 4 are in group 2; rounds 5,6 and 7 are in group 3; and so on). Sometimes I will need to describe a group by its form and for that I will be using A and B with X as a wild card (eg. saying group 3 is of the form ABA means that its rounds are either 101 or 010. Saying that group 2 is of the form AAX means it could be 110 or 111, 001, or 000).
I won't repeat the details of Joel's strategy in particular, but as shown by
ffao, there's two main ways to deviate from his strategy; either through signaling a minority number in the next set, or by purposely "throwing" a round you normally
would have won. To clarify, I consider "throwing a round" as Player A playing the opposite number when both player B and the casino are playing the same number. This is different to "signaling" where player A can "signal" either 0 or 1 when Player B and the casino are playing opposite numbers.
With that out of the way, let's get into the details of my solution.
Part 1:
We start by confirming that Joel's strategy with ffao`s modifications will guarantee 9 of 13 wins under either of the following conditions:
#1. If the casino plays a 0 on the first round.
#2. If the casino plays a triplet in any group (plays the same number in all three rounds of that group).
It is easy to prove condition #1 as playing 0 on round 1 will lead to a win for the players under Joel's strategy. The rest of the game effectively becomes an 8 of 12 game, which Joel's strategy with ffao's modifications can guarantee (as proven by Bennett Bernardoni). Thus in all future analysis from here on out, we can ignore the scenarios where the casino plays 0 on round 1.
Condition #2 is a bit tougher to prove:
- If the triplet is in group 5, Joel's strategy can be played as usual.
- If the triplet is in group 2, Joel's strategy can be played as usual for the first four rounds. Starting from round 5, the game effectively becomes a 6 of 9 game, which Joel's strategy with ffao's modifications can guarantee.
- if the triplet is in group 4, Joel's strategy will not work as by the time you finish round 10, the game effectively becomes a 2 of 3 game, which Joel's will loose against if, and only if, round 11 is not the same as the triplet and rounds 12 and 13 are either 01 or 10. We can account for these two possibilities by throwing either of round 9 or round 10. With this modification, Joel's strategy will guarantee victory if the triplet is in group 4.
- If the triplet is in round 3, Joel's strategy will again not work as by the time you finish round 7, the game effectively becomes a 4 of 6 game, which Joel's will loose against if, and only if; round 8 is not the same as round 7; rounds 9, 10, and 11 are of the form AAB, ABA or ABB; and rounds 12 and 13 are either 01 or 10. A total of 6 possible cases in which Joel's strategy will fail. If we apply ffao's modifications we can account for 2 of these 6 cases (throwing either round 9 or 10) and if we throw round 7 we can account for another 2 of these cases. To account for the last 2 cases, we have to throw round 6. However this throw in round 6 must force player B to play opposite what he normally would have played on round 7 (for reasons that will become apparent later).
We will call these deviation strategies "triplet modification strategies" to differentiate them from ffao's deviation strategies. To clarify, triplet modification strategies use elements of ffao's deviation, but only in very specific scenarios.
Part 2:
If we consider only the first 7 rounds of the game, then (given our previous analysis) there are only 9 possible combinations that we do not know for sure if Joel's strategy (with modifications) will work for:
1 AAB AAB XXX XXX
1 AAB ABA XXX XXX
1 AAB BAA XXX XXX
1 ABA AAB XXX XXX
1 ABA ABA XXX XXX
1 ABA BAA XXX XXX
1 BAA AAB XXX XXX
1 BAA ABA XXX XXX
1 BAA BAA XXX XXX
Before we can prove any of these combinations, we first need to determine what we need to prove them. and for that, we need to take a detour.
Part 3:
Based on the part 1 analysis, a new rule for player B can be established:
Rule 1: If ANY ffao deviation from Joel's basic strategy occurs in the first 3 groups, assume the last two groups are in the form of ABB.
Now let us consider a game where:
1. the players have just finished the 7th round,
2. player B has been signaled by player A the answer to round 8,
3. player A has made a deviation from Joel's basic strategy sometime in the first 7 rounds and,
4. they can afford to loose one more round (effectively a 5 of 6 game).
Because they have deviated from Joel's basic strategy, we know that the last two groups cannot be of the form AAA. This in conjunction with the new rule we just established results in the following:
Joel's strategy with the new rule applied AND with ffao's strategy applied to it will fail this situation if and only if neither group 4 nor group 5 has the form ABB.
A total of 16 cases fit this failure condition, 8 of which can be represented by either signaling on the 1st of the 6 games, or by using ffao's deviation on the 1st or 2nd of the 6 games. There are still 8 cases which require a unique signal for this strategy to succeed.
Going back to our 9 unproven combinations, we can say that a combination is proven to succeed with Joel's strategy (with modifications) if two conditions are met:
Condition 1: There is 1 unique deviation for player A to play in that combination such that, by the end of round 7; he has deviated from Joel's basic strategy; he has conveyed to player B the answer to round 8 and; he can afford to loose one more round (we will call this the Main Deviation for the given combination),
Condition 2: There are 8 other unique deviations from Joel's basic strategy such that they make it through the 7 rounds without going over the 4 loss limit (we will call these the 8 Side Deviations for the given combination).
In addition to these two requirements, we also need to be conscious of what signals and deviations we use for which combinations as using some signals for one combination may leave not enough to prove another combination.
Part 4:
Now all we need to do is prove that there is 1 main deviation and 8 side deviations (as defined in the previous section) for each of the 9 combinations.
For 1 AAB BAA XXX XXX, 1 ABA BAA XXX XXX and 1 BAA BAA XXX XXX:
Main Deviation:
We will use ffao's minority deviation to define our main deviation. That is, for round 1, player A will signal the minority number in group 2. Two rounds of group 2 will be lost lost, but this allows player A to use these loses to signal the majority number in group 3 and the answer to round 8. The following rule must be imposed on player B for this to work:
Rule 2: If a minority deviation occurred on round 1 and no throw occurred on round 2, then group 3 is of the form BAA.
Side Deviations:
For 4 of the 8 side deviations needed, we will use a minority deviation on round 1 followed by a throw on round 6 or 7. The other 4 side deviations can be obtained by not signaling a minority on round 1 and instead signal a minority deviation on the loosing round in group 2. This forces two lost rounds in group 3 where player A can signal 4 different deviations.
Now it should be mentioned that for all 9 of the unproven combinations, a minority signal in group 2 will always accommodate 4 side deviations and will never interfere in the signaling of any of the other 8 combinations. Thus going forward in our proving of the 9 combinations, we will assume that these are accounted for and will change our requirements such that only 1 main and 4 side deviations are required for any particular combination to be proven successful.
For 1 AAB ABA XXX XXX:
Main Deviation:
Another rule is required for player B to create a main deviation for this combination:
Rule 3: If group 2 is known to be of the form AAX and a throw occurred on the second round of group 2, then group 2 is of the form AAB and group 3 is of the form ABA.
Using this rule, player A can throw round 2 of group 2, and then signal on round 1 of group 3 the answer to round 8. Player B knows the form of group 3, so after the first round of group 3, he knows the answer for the second and third rounds of that group, allowing them to finish the first 7 rounds with knowledge of round 8, and having only lost 3 rounds, thus this is the main deviation for this combination.
Side Deviations:
Our 4 side deviations here can be defined by throwing on round 3 and signaling on round 4 (as you would for the main deviation), but then throwing on either round 6 or 7. (Again, The other 4 side deviations are obtained by a minority signal in group 2).
For 1 ABA ABA XXX XXX:
Main Deviation:
More rules needed for Player B:
Rule 4: If a throw occurred on round 2, then assume group 2 is of the form ABA.
Rule 5: If a throw occurred on round 2 and group 2 is of the form ABA, then assume group 3 is of the form ABA.
From here it is similar to 1 AAB ABA XXX XXX. Throw on round 2 and signal on round 1 of group 3.
Side Deviations:
The side deviations are also similar, only this time the throw is on round 2 instead of round 3.
For 1 BAA ABA XXX XXX:
Main Deviation:
We need to impose some rather specific rules on player B for this one:
Rule 6: if a throw occurred on round 2 and group 2 is of the form BAA, then group 3 is of the form ABA and the answer to round 8 is 0.
Rule 7: if a throw occurred on round 4 and group 2 is of the form BAA, then group 3 is of the form ABA and the answer to round 8 is 1.
If round 8 is 0, then Player A will signal a minority deviation on round 1, then throw round 2. Rule 4 dictates that Player B will play group 2 in the form of BAB which will loose on the last round of the group where Player A can signal the majority number of group 3, thereby finishing the first 7 rounds with only 3 losses.
If round 8 is 1, then Player A will instead play Joel`s basic strategy for the first three rounds and then throw on round 4. The lost round 2 will be the signal for the majority of group 3 in this case.
Side Deviations:
We have lots of options for side deviations. Following either path for the main deviation and then throwing on either round 6 or 7 will account for the 4 side deviations needed.
For 1 AAB AAB XXX XXX:
Main Deviation:
Playing Joel's normal strategy, but then throwing on either round 5 or 6 can signal the answer to round 8 while also leaving the players with only 3 losses by the end of round 7. The following rules must be applied to Player B for this main deviation to work:
Rule 4: If a throw on round 5 is the first deviation from Joel's basic strategy, then group 3 is of the form AAB.
Rule 5: If a throw on round 6 is the first deviation from Joel's basic strategy and group 3 is of the form AAX, then group 3 is of the form AAB.
It should be mentioned that Rule 5 does not interfere with the group 3 triplet strategy as outlined in part 1 (this is why player B needs to play opposite on round 7 during the group 3 triplet strategy)
Side Deviations:
2 of the 4 side deviations for this combination can be assigned to throwing round 7 after throwing either round 5 or 6. The other 2 can be assigned to throwing round 3. This signals to Player B (via rule 3) that group 3 is of the form ABA, which it actually isn't, but that's okay as by the time round 6 is over, they will know that group 3 is of the from AAB and can therefore finish round 7 without going over 4 losses.
For 1 ABA AAB XXX XXX:
Main Deviation:
The main deviation is the same as it was for 1 AAB AAB XXX XXX (round 5 or 6 throw).
Side Deviations:
Similarly, 2 of the 4 side deviations are assigned to throwing round 7 while the other two are assigned to throwing round 2, which via rules 4 and 5 will compel Player B to assume group 2 is of the form ABA (which it is) and group 3 is of the form ABA, which it isn't, but that's okay as by the time round 6 is over, they will know that group 3 is of the from AAB and can therefore finish round 7 without going over 4 losses.
For 1 BAA AAB XXX XXX:
Main Deviation:
The main deviation is the same as it was for 1 AAB AAB XXX XXX (round 5 or 6 throw).
Side Deviations:
Similarly, 2 of the 4 side deviations are assigned to throwing round 7 while the other two are assigned to throwing round 4, which via rule 7 will compel Player B to assume group 3 is of the form ABA, which it isn't, but that's okay as by the time round 5 is over, they will know that group 3 is of the from AAB and can therefore finish round 7 without going over 4 losses.
After all of that we are left with rough and crude strategies for Player A and Player B.
Summary of Player A Strategy:
If round 1 is 0, then play Joel's with ffao's modification.
If any group is of the form AAA, then play the relevant triplet strategy corresponding to the group that is the triplet. (see part 1 of my solution)
If the last 6 rounds are of the form ABBXXX, XXXBAA, ABAABA, or ABABAB, then play the main deviation of the combination defined by the casino numbers from the first 7 rounds (see part 2 and part 4 of my solution).
If the last 6 rounds are of the form ABAAAB, or ABABBA, then play the main deviation of the combination defined by the first 7 numbers, but invert the signal to player B that tells him the answer to round 8 (see part 2 and part 4 of my solution).
If the last 6 rounds are of the form AABABA or AABBAB, then play one of the four side deviations of the combination defined by the first 7 numbers (see part 2 and part 4 of my solution).
If the last 6 rounds are of the form AABAAB or AABBBA, then play a second round minority deviation.
Summary of Player B Strategy:
Begin by playing Joel's basic strategy.
After Round 2:
If a throw occurred on the 1st round of group 2, then assume group 2 is of the form ABA.
After Round 3:
If group 2 is known to be of the form AAX and a throw occurred on the 2nd round of group 2, then assume group 2 is of the form AAB and group 3 is of the form ABA.
After Round 4:
If a throw occurred on the 1st round of group 2 and group 2 is of the form BAA, then assume group 3 is of the form ABA and the answer to round 8 is 0.
If a throw occurred on the 3rd round of group 2 and group 2 is of the form BAA, then assume group 3 is of the form ABA and the answer to round 8 is 1.
If a throw occurred on the 1st round of group 2 and group 2 is of the form ABA, then assume group 3 is of the form ABA.
If a minority deviation occurred on round 1 and no throw occurred on round 2,then group 3 is of the form BAA.
After Round 5:
If the assumption from earlier that group 3 is of the form ABA is proven wrong, then group 3 is of the form AAB
If round 5 was thrown, and this is the first deviation from Joel's basic strategy, then assume group 3 is of the form AAB
After Round 6:
If the assumption from earlier that group 3 is of the form ABA is proven wrong, then group 3 is of the form AAB
If round 6 was thrown, group 3 is of the form AAX, and this is the first deviation from Joel's basic strategy, then assume group 3 is of the from AAB
After Round 7:
If a minority deviation was signaled in group 2 (Player A signaled the minority number of group 3), then the last 6 numbers are of the form AABAAB or AABBBA. Check the signals of the two lost rounds to determine which of the four possibilities it is.
If a Main Deviation has been played, it means player A has signaled the answer to round 8 in the first 7 rounds and the last 6 rounds are in the form of ABBXXX, XXXBAA, ABAABA, or ABABAB. Assume the remaining numbers are in the form ABBABB, play the round 8 number that Player A signaled, and then follow the remaining signals to determine which of the possibilities it really is.
If a Side Deviation has been played, then there is exactly one possibility for the last 6 numbers (which will always be in the form of AABABA or AABBAB). The exact answer will be dependent on what Player A and Player B agreed on before hand regarding which Side Deviation meant what.
If a triplet occurred in group 3, then check if round 6 was thrown and check if round 7 was thrown. Play according to the signals provided by Player A
After Round 8:
If a Main Deviation was played, and the answer to round 8 was the reverse of what Player A signaled, then the final 6 numbers are of the form ABAAAB or ABABBA. The number that Player A signaled on Round 8 will tell you which is the answer.
After Round 10:
If a triplet occurred in group 4, then check if round 9 was thrown and check if round 10 was thrown. Play accordingly.
Dear Lord I can't believe I typed all of that out. I don't know if 10 out of 14 games is possible, but I feel like I can confidently say 9 out of 13 games is possible. Feel free to critic my solution. There's a very good chance I've missed something or left some vagueness in my explanation. But at this point, I think I need to go rest my brain.