6 ms·
For anyone else interested, the way this was explained to me a while ago was to look at the failure mode after an H. For Alice, her failure for HT is HH, theref
by vegizombie 7y ago
For anyone else interested, the way this was explained to me a while ago was to look at the failure mode after an H. For Alice, her failure for HT is HH, therefore her next flip can land on T, completing the sequence. For Bob, his failure mode is HT, so he now needs to flip a H before he can try for the 2nd H.
- boi4 7y agoRelated: https://en.wikipedia.org/wiki/Knuth–Morris–Pratt_algorithm https://en.wikipedia.org/wiki/Knuth–Morris–Pratt_algorithm
- natmaka 7y agoRelated and well-known by software developers: https://en.wikipedia.org/wiki/Boyer%E2%80%93Moore_string-search_algorithm https://en.wikipedia.org/wiki/Boyer%E2%80%93Moore_string-sea...