Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Algorithm for binary random generator

Status
Not open for further replies.

vinhpq

Newbie level 6
Newbie level 6
Joined
Sep 13, 2004
Messages
14
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
89
Binary random generator!

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.
 

Re: Binary random generator!

One approach is:

- 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))
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top