A, B are to play heads or tails for $N$ rounds. They win a round if both guess correctly.
- A and B are allowed to communicate their strategy before the game starts.
- A knows the full sequence of $N$ results right after the game starts, before making the first guess.
- A and B make their guesses simultaneously, and know each others' previous guesses, as well as the correct results of previous rounds.
How to design an algorithm that maximizes the expected number of correct guesses in this game? An obvious solution that's better than random guessing would be for A to spend the first $\lceil{N/2}\rceil$ rounds communicating the results of the last half of the game to B, giving an expected $N/2\times (1/2)^2+N/2=5N/8$ wins. Would there be better solutions?
Here is a provable improvement inspired by the answer by @leonbloy (which for a shorthand I will call the $LB$ strategy - hope you don't mind!) I haven't calculated the exact success rate but my guess is slightly over $70$%.
The way I understood the $LB$ strategy, the key idea is that $A$ knows what $B$ will say every timeslot (obviously except the initial timeslot), so $A$ already knows if $B$ will be right or wrong at timeslot $t$. If $B$ will be right, $A$ helps them score. If $B$ will be wrong, then $A$ might as well tell $B$ the next coin. This works for $B$ because $B$ can also tell what $A$ was thinking. This fits the standard concept of "if we're gonna be wrong, lets be 'maximally' wrong together" for this type of game.
My improvement is based on blocks of $3$ coins. In each block, there will be a majority, and that is what $A$ tells $B$. So:
Step $1: A$ tells $B$ the majority in the next block.
Step $2:$ Within each block, $B$ guesses the majority every time.
Step $3a:$ If all $3$ coins are the same, $A$ helps them score $3$ times. At the end of which, they are back to the state of knowledge at the beginning of the game, so go back to Step $1$ for the next coin.
Step $3b:$ If only $2$ of the $3$ coins are the same, $A$ helps them score those $2$ timeslots. For the remaining timeslots (the "bad" coin), $A$ knows $B$ will be wrong, so $A$ tells $B$ the majority of the next block. Then go to Step $2$.
The analysis is easier if we start from Step $2$:
In case of $3b$ (which happens with prob $3/4$), they score $2$ coins in a block of $3$.
In case of $3a$ (which happens with prob $1/4$), they score all $3$ coins in the block (say timeslots $T, T+1, T+2$), but has to spend the next timeslot ($T+3$) just for $A$ to tell $B$ the majority in the next block ($T+4, T+5, T+6$). There is a $1/4$ chance they got $T+3$ right by sheer luck. So among $[T, T+3]$, they score $3$ for sure and an additional $1/4$ by expectation, for a total expected value of ${13 \over 4} = 3.25$ out of $4$.
Since ${3.25 \over 4} > {2 \over 3}$, this is strictly better than the $LB$ strategy in the average case.
In fact it is also strictly better in the worst (adversarial) case. My worst case is $2/3$ for the sequence $THHTHHTHHT...$ while for $LB$ the worst case is $1/2$ for the sequence $THTHTHT...$
The exact time-average analysis is a bit messy: Because the two analysis cases $3a, 3b$ require different amounts of time ($4$ vs $3$ timeslots), I don't think I can simply say the time-average is ${3 \over 4} {2 \over 3} + {1 \over 4} {3.25 \over 4} = {1\over 2} + {13 \over 64} = {45 \over 64} = 0.703125.$ But it should be pretty close (and my guess: slightly higher).
In my head I can model this as a $5$-state Markov Chain, but I haven't gone to the trouble of actually solving it. My guess is that the time-average is a weighted average of the form $b {2 \over 3} + a {3.25 \over 4}$ where $a+b=1$, and they represent fraction of time spent in each case. Although $1/4$ of the cases are type $3a$, we actually spend $a > 1/4$ fraction of time there because each case $3a$ is really $4$ timeslots long - and this is why I'm guessing the correct exact answer $> 45/64$. I.e. instead of $a:b = 1 : 3$ (proportion of each case), we need some more rescaling to account for the different time lengths, e.g. $a:b = 1 \times 4 : 3 \times 3 = 4:9.$ For this guess (which is just a guess!) the time-average $\approx 0.712$.
This idea can also be generalized. E.g. if we use blocks-of-$5$, then in the best case we score ${5.25 \over 6}$ (prob $1/16$), in the second best case we score ${4 \over 5}$ (prob $5/16$), and in the last case we score ${3 \over 5}$ and have $2$ timeslots to talk - what a luxury! I have no idea how best to use so much "bandwidth"! :) If we don't use the second bad coin well, the time-average is dragged down by the ${3 \over 5}$ case, but I'd think there is a way to use it e.g. to give more info about the next block or even the next next block. I haven't yet figured out a way to make this better than the block-of-$3$ case.