how to make random binary bits with probability 0.5 for both zeros and
ones!?
how to make random binary bits!?
Started by ●December 10, 2005
Reply by ●December 12, 20052005-12-12
take samples from a uniform [0,1] distribution (using rand), and then set
=
0 if less than 0.5 and 1 if greater than 0.5 (using round).
Nandan
On 12/10/05, scguc <scguc@scgu...> wrote:
>
> how to make random binary bits with probability 0.5 for both zeros and
> ones!?
0 if less than 0.5 and 1 if greater than 0.5 (using round).
Nandan
On 12/10/05, scguc <scguc@scgu...> wrote:
>
> how to make random binary bits with probability 0.5 for both zeros and
> ones!?
Reply by ●December 13, 20052005-12-13
bit = round(rand(1,nBit))
2005/12/10, scguc <scguc@scgu...>:
>
> how to make random binary bits with probability 0.5 for both zeros and
> ones!?
>
2005/12/10, scguc <scguc@scgu...>:
>
> how to make random binary bits with probability 0.5 for both zeros and
> ones!?
>
Reply by ●December 14, 20052005-12-14
also
bits = randn(1,nBits)<0;
this would give you the bits as an array of logicals
--- arkkimede <arkkimede@arkk...> wrote:
> bit == round(rand(1,nBit))
>
> 2005/12/10, scguc <scguc@scgu...>:
> >
> > how to make random binary bits with probability 0.5 for both zeros and
> > ones!?
> >
bits = randn(1,nBits)<0;
this would give you the bits as an array of logicals
--- arkkimede <arkkimede@arkk...> wrote:
> bit == round(rand(1,nBit))
>
> 2005/12/10, scguc <scguc@scgu...>:
> >
> > how to make random binary bits with probability 0.5 for both zeros and
> > ones!?
> >
Reply by ●December 15, 20052005-12-15