pengvado comments on Open Thread, July 1-15, 2013 - Less Wrong
You are viewing a comment permalink. View the original post to see all comments and the full post content.
You are viewing a comment permalink. View the original post to see all comments and the full post content.
Comments (342)
In this model, a simulator can exactly match the desired probability in O(1) expected time per sample. (The distribution of possible running times extends to arbitrarily large values, but the L1-norm of the distribution is finite. If this were a decision problem rather than a sampling problem, I'd call it ZPP.)
Algorithm:
1. Start with an empty string S.
2. Flip a coin and append it to S.
3. If S is exactly equal to the corresponding-length prefix of your probability tape P, then goto 2.
4. Compare (S < P)
D'oh! Of course - thanks!