Problem 1. Marbles

54 R, 9 W, and 75 B marbles. Select marble manually. P(R or B)? \(P(A \cup B)=P(A)+P(B)-P(A \cap B)\)

print(round((54+75-0)/(54+9+75),4)) #P(AB)=0, special rule of addition
## [1] 0.9348

Problem 2. Mini-Golf

A ball machine has 19 G balls, 20 R balls, 24 B balls, 17 Y balls. Random. P(R)?

print(round(20/(19+20+24+17),4)) #marginal probability
## [1] 0.25

Problem 3. Pizza Company

R&D gathered data from N=1399 customers (see Table), \(P(M^C \cap Parents^C)\)

M F
Apt 81 228
Dorm 116 79
Parents 215 252
Sor/Frat House 130 97
Other 129 72
round((sum(p3[,])-p3[3,1])/sum(p3[,]),4) #Subtract intersection of 2, which is 215/1399
## [1] 0.8463

Problem 4. Gym

Determine if the following events are independent.Going to the gym. Losing weight.

While not linear, there is likely a relationship of some sort. Not independent.

Problem 5. Veggie Wrap

Wrap = 3 V, 3 C, 1 T with all elements different. Possible = 8V, 7C, 3T. How many wraps possible? t

choose(8,3)*choose(7,3)*choose(3,1) #order does not matter
## [1] 5880

Problem 6. Gas

Jeff runs out of gas on the way to work. Liz watches the evening news. Independent?

Probably independent until we find out that Jeff is going to work to avoid his wife Liz.

Problem 7. President’s Cabinet

8 cabinet spots. 14 candidates. Rank matters. How many ways?

comma(choose(14,8)*factorial(8),0) #permutation
## [1] NA

Problem 8. Jellybeans

9R, 4O, 9G jellies. P(R=0, O=1, G=3)

round(choose(9,0)*choose(4,1)*choose(9,3)/choose(22,4),4)  #multivariate hypergeometric
## [1] 0.0459

Problem 9. Permutation

Evaluate the following expression: \(\frac{11!}{/7!}\)

choose(11,4)*factorial(4) #P(11,4)
## [1] 7920

Problem 10. Complement

Describe the complement of the given event. 67% of subscribers to a fitness magazine are over the age of 34.

The 33% of subscribers of a fitness magazine who are not over the age of 34

Problem 11. Game

Exactly 3 out of 4 heads: win $97. else: lose $30. Find \(E(X_1)\) and \(E(X_{559})\)

c(dbinom(3,4,.5)*97-30*(1-dbinom(3,4,.5)), 559*(dbinom(3,4,.5)*97-30*(1-dbinom(3,4,.5))))
## [1]   1.75 978.25

Problem 12. Game 2

Flip coin 9 x. <=4 tails = win $23. Else:- $26. Find \(E(X_1)\) and \(E(X_{994})\)

c(pbinom(4,9,.5)*23-26*(1-pbinom(4,9,.5)), 994*(pbinom(4,9,.5)*23-26*(1-pbinom(4,9,.5))))
## [1]    -1.5 -1491.0

Problem 13a. Polygraph.

The sensitivity and specificity of the polygraph has been a subject of study and debate for years. A 2001 study of the use of polygraph for screening purposes suggested that the probability of detecting a liar was .59 (sensitivity) and that the probability of detecting a “truth teller” was .90 (specificity). We estimate that about 20% of individuals selected for the screening polygraph will lie. \(P(A|B)=\frac{P(B|A)P(A)}{P(B)}\))$, A==Liar, B==Positive, AB=Liar and Positive. P(A|B)?

.59*.20/(.59*.20+.1*.8) 
## [1] 0.5959596

Problem 13b. Polygraph.

P(Not Liar | -). \(P(A^c|B^c)=\frac{P(B^c|A^c)P(A^c)}{P(B^c)}\))$

.9*.8/(.9*.8+.41*.2)
## [1] 0.8977556

Problem 13c. Polygraph.

P(Liar or +) = \(P(A \cup B)=P(A)+P(B)-P(A \cap B)\)

.2 +.591*.2+.1*.8-.5959596*.2
## [1] 0.2790081