2, 75 % of law school graduates pass Bar exam first time they take it. Use a Uni
ID: 3366972 • Letter: 2
Question
2, 75 % of law school graduates pass Bar exam first time they take it. Use a Uniform(0,1) random number generator to simulate a sample of size 5 from X ~ Binomial (n=12, p=.75) distribution. Note that you would need to use only a Uniform(0,1) generator and a calculator or software that has a built-in program for the CDF of Binomial. Do not use software directly to generate a random sample from Binomial distribution. Write the generated U(0,1) sample and explain how x values are computed. How would you interpret the generated values of X? (20 points)Explanation / Answer
I write R-code for this as below;
binom=function(n,p)
{
y={}
x={}
for(j in 1:n)
{
for(i in 1:n)
{
u=runif(1)
if(u<p){x[i]=1}else{x[i]=0}
x
}
y[j]=sum(x)
}
return(y)
}
binom(12,0.75)
Here my output is;
> binom(12,0.75)
[1] 6 9 10 11 9 10 8 8 10 8 11 11
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.