This program will allow you to produce fair or unfair coin tosses using ANY unfair coin. So for example you can have a coin that lands on tails 25% of the time. Using that coin and this program you can emulate a fair coin (50% tails) or even a coin that brings 33% tails, or any other unfair coin! Pretty cool huh?
Just make sure that your unfair coin is actually a proper coin. Each flip should be uncorrelated to previous flips. Real coins, even unfair coins, have no memory. If your coin has memory (e.g. brings tail more often after a tail and head more often after a head) then this program will not work properly.
I don't remember where I learned the technique but I think it was from here: https://amakelov.wor...xpected-tosses/
"SIMULATED PROB"?P Lbl 0 1➔I Lbl 1 Do "COIN TOSS"?➔A "COIN TOSS"?➔B LpWhile A=B If A:Then Frac(Intg(Px2^(I))÷2)x2➔D "SIMULATED TOSS:":D◢ Goto 0 IfEnd I+1➔I Goto 1