Hi, do you guys know a algorithm to genarate a binary output based on the input probability? I mean how the function randint, rand, randn in Matlab works.
- approximate the needed probability "p(0)" with "n/(2^m)"
- define a binary function F of "m" binary variables as a table with exactly "n" rows at "0" (raws in random positions in the table)
- start "m" independent uniform (unbiased) binary generators g1, g2, ..., gm
- bit(t) = F(g1(t), g2(t), ..., gm(t))