2 ms·
For certain P, optimizations are possible. For example, with P=1/3, the general method discards TT (P=1/9) and HH (P=4/9) and repeats, while keeping HT and TH
by wildmanx 5y ago
For certain P, optimizations are possible.
For example, with P=1/3, the general method discards TT (P=1/9) and HH (P=4/9) and repeats, while keeping HT and TH (P=2/9 each). One could optimize this by only discarding TT while returning 0 for TT (P=4/9) and returning 1 for HT and TH (P=2/9 each, together also 4/9).
Generally we just want to partition the event space into three parts such that two are equally likely while the third one is used to "scratch that, just repeat". Keeping HT and TH guarantees that, but if you want to minimize retries, better solutions are possible.