Generate true with probability p, in [0, 1], and false otherwise, shrinking toward false. A p outside that range throws.
true
p
[0, 1]
false
Generate
truewith probabilityp, in[0, 1], andfalseotherwise, shrinking towardfalse. Apoutside that range throws.