Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1.4 (Binomial probabilities). Let X be the number of \"ones\" obtained in 12 rol

ID: 3219493 • Letter: 1

Question

1.4 (Binomial probabilities). Let X be the number of "ones" obtained in 12 rolls of a fair die. Then X has a Binomial n 12,p 1/3) distribution Compute a table of binomial probabilities for 0,1 12 by two methods a. Use the probability density formula http:// cran.at r-project.org/web/views/ReproducibleResearch.html 40 1 Introduction and vectorized arithmetic in R. Use 0:12 for the sequence of values and the choose function to compute the binomial coefficients (R) b. Use the dbinom function provided in R and compare your results using both methods.

Explanation / Answer

Part a

First of all we have to compute the binomial probabilities by using the formula. The formula is given as below:

P(X=k) = nCk*p^k*(1 – p)^(n – k)

We are given n = 12 and p = 1/3, so q = 1 – (1/3) = 2/3 (p = 0.33, q = 0.67)

P(X=0) = 12C0*0.33^0*0.66^12 = 0.008182719

P(X=1)= 12C1*0.33^1*0.66^11 = 0.048363533

P(X=2)= 12C2*0.33^2*0.66^10 = 0.131014644

P(X=3) =12C3*0.33^3*0.66^9 = 0.21509867

P(X=4) =12C4*0.33^4*0.66^8 = 0.238374272

P(X=5) =12C5*0.33^5*0.66^7 = 0.187853158

P(X=6) =12C6*0.33^6*0.66^6 = 0.107945471

P(X=7) =12C7*0.33^7*0.66^5 = 0.045571862

P(X=8) =12C8*0.33^8*0.66^4 = 0.014028652

P(X=9) =12C9*0.33^9*0.66^3 = 0.003070949

P(X=10) =12C10*0.33^10*0.66^2 = 0.000453767

P(X=11) =12C11*0.33^11*0.66^1 = 0.0000406

P(X=12) =12C12*0.33^12*0.66^0 = 0.00000167

X

Combination 12Cx

Probability

0

1

0.008182719

1

12

0.048363533

2

66

0.131014644

3

220

0.21509867

4

495

0.238374272

5

792

0.187853158

6

924

0.107945471

7

792

0.045571862

8

495

0.014028652

9

220

0.003070949

10

66

0.000453767

11

12

0.0000406

12

1

0.00000167

Part b

Now, we have to compute the above probabilities by using the R-software.

R commands and respective probabilities are given as below:

> x=c(0:12)

> p=0.33

> n=12

> dbinom(x,n,p)

[1] 8.182719e-03 4.836353e-02 1.310146e-01 2.150987e-01 2.383743e-01 1.878532e-01 1.079455e-01

[8] 4.557186e-02 1.402865e-02 3.070949e-03 4.537670e-04 4.063585e-05 1.667890e-06

X

Combination 12Cx

Probability

0

1

0.008182719

1

12

0.048363533

2

66

0.131014644

3

220

0.21509867

4

495

0.238374272

5

792

0.187853158

6

924

0.107945471

7

792

0.045571862

8

495

0.014028652

9

220

0.003070949

10

66

0.000453767

11

12

0.0000406

12

1

0.00000167