logoalt Hacker News

skulktoday at 1:06 AM1 replyview on HN

Not really. You can simulate a probability of 1/x by expanding 1/x in binary and flipping a coin repeatedly, once for each digit, until the coin matches the digit (assign heads and tails to 0 and 1 consistently). If the match happened on 1, then it's a positive result, otherwise negative. This only requires arbitrary but finite precision but the probability is exactly equal to 1/x which isn't rational.


Replies

jibaltoday at 3:59 AM

No, it isn't ... an infinite expansion isn't possible.