# random deviates

• Feb 23rd 2008, 03:23 AM
Jason Bourne
random deviates
Suppose you have a standard die. Explain how you would generate a random dviate from
1) A Bernoulli distribution with probability of success $\displaystyle p = \frac{1}{3}$
2) A discrete uniform distribution, with $\displaystyle P[X=i] = \frac{1}{4}$ for $\displaystyle i=1,2,3,4$
3) A binomial distribution with $\displaystyle n=20$ and $\displaystyle p=\frac{1}{36}$
• Feb 23rd 2008, 04:38 AM
CaptainBlack
Quote:

Originally Posted by Jason Bourne
Suppose you have a standard die. Explain how you would generate a random dviate from
1) A Bernoulli distribution with probability of success $\displaystyle p = \frac{1}{3}$

Throw the die, count a 1 or 2 as a success and 3, 4, 5 and 6 as fail.

RonL
• Feb 23rd 2008, 04:43 AM
CaptainBlack
Quote:

Originally Posted by Jason Bourne
Suppose you have a standard die. Explain how you would generate a random dviate from 2) A discrete uniform distribution, with $\displaystyle P[X=i] = \frac{1}{4}$ for $\displaystyle i=1,2,3,4$

Throw the die two times.

If first die shows 1, 2, 3 and the second shows 1, 2,or 3 result is 1.
If first die shows 1, 2, 3 and the second shows 4, 5,or 6 result is 2.

If first die shows 4, 5, 6 and the second shows 1, 2,or 3 result is 3.
If first die shows 4, 5, 6 and the second shows 4, 5,or 6 result is 4.

RonL
• Feb 23rd 2008, 04:47 AM
CaptainBlack
Quote:

Originally Posted by Jason Bourne
Suppose you have a standard die. Explain how you would generate a random dviate from

3) A binomial distribution with $\displaystyle n=20$ and $\displaystyle p=\frac{1}{36}$

Throw the die twice, if two 6's show count this as a success. Now repeat 20 times.

RonL