Pattern: PFlipFlop
flip a binary bit with some probability.
Example output
>>> p = PFlipFlop(0, 0.9, 0.5)
>>> p.nextn(16)
[1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1]
flip a binary bit with some probability.
>>> p = PFlipFlop(0, 0.9, 0.5)
>>> p.nextn(16)
[1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1]