1. A certain brand of cereal has a toy in every box. There are 10 different toys and the toys are distributed among the boxes so that any box purchased is equally likely to contain any one of the 10 toys.
  1. A boy has collected 7 different toys. Find the probability that he will get the toys he needs to complete the set if he opens only three boxes. \[\frac{3}{10}*\frac{2}{10}*\frac{1}{10} = 0.006\] There is a 0.6% probability that he will get the toys he needs for his complete set if he opens only three boxes.
  2. Another boy only needs one toy to complete the set. Find the probability that he gets the remaining toy by opening no more than 5 boxes.
    \[1-(\frac{9}{10}^5) = 0.40951\]
    There is a 40.951% probability that that boy will get the remaining toy by opening no more than 5 boxes.
  1. Suppose that S is the sample space associated to a random process and that E,F are two subsets of S. Prove that if E???F then P(E)???P(F) using only the 3 axioms of probability.
    If E is a subset of F,
    \[ \begin{eqnarray*} F &=& E\cup(\bar{E} \cap F) \\ P(F) &=& P(E)+P(\bar{E} \cap F)\ \ \ \textrm{(by ax. 3)}\\ P(F) &\geq& P(E) \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textrm{(by ax. 1)} \\ P(E) &\leq& P(F) \end{eqnarray*} \]
  2. Suppose that 30% of all drivers stop at an intersection having flashing red lights when no other cars are visible. You decide to secretly monitor this intersection until two cars stop at the intersection when no other cars are visible. Let X denote the number of cars who fail to stop at the intersection while you are watching.
Px3=choose(4,3)*(.7^3)*(.3^2)
Px2=choose(3,2)*(.7^2)*(.3^2)
Px1=choose(2,1)*(.7^1)*(.3^2)
Px0=choose(1,0)*(.7^0)*(.3^2)
sum1=Px0+Px1+Px2+Px3
sum2=Px0+Px1+Px2
sum1
## [1] 0.47178
sum2
## [1] 0.3483
  1. negative binominal
pnbinom(3,2,0.3)
## [1] 0.47178
pnbinom(2,2,0.3)
## [1] 0.3483
  1. A child’s game includes a spinner with four colors on it. Each color is one quarter of the circle. You spin the spinner 5 times and record the number X of blues.
  1. \[ H_o : \pi= \frac{1}{4} \ \ \ \ \ \ \text{The spinner is fair}\\ H_a : \pi\neq\frac{1}{4} \ \ \ \ \ \ \text{The spinner is not fair}\\ \]

\[ X = \text{# of blue spins out of 5}\\ X = 4 \] p-value = 0.0156165, reject null hypothesis

Failing to reject the null hypothesis, if the spinner was not fair would be a Type II error.

  1. A discrete uniform random variable X with values 1 through n has a probability mass function of the form
    f(x)={1/n if x=1,2,3,.,n otherwise
    f(x)={0 if otherwise
    Find the expected value and variance of this discrete random variable when n=5. Justify your answer.
Ex = 1*(1/5) + 2*(1/5) + 3*(1/5) + 4*(1/5) + 5*(1/5) 
Ex
## [1] 3
Vx = (1-3)^2 * (1/5) + (2-3)^2 * (1/5) + (3-3)^2 * (1/5) + (4-3)^2 * (1/5) + (5-3)^2 * (1/5)
Vx
## [1] 2

The expected value of a random variable x with the same probabilities for all values 1-n, will be 3, the median value.
The variance of a random variable x with the same probabilities for all values 1-n, will be 2, the spread of possible values from the expected value.

  1. Assume that there are 365 days in a year and that all birthdays are equally likely.
  1. If ten people are selected at random, what is the probability that (at least) two of them have the same birthday?
uniqueBDay= (1*(364/365)*(363/365)*(362/365)*(361/365)*(360/365)*(359/365)*(358/365)*(357/365)*(356/365))
sameBDay = 1-uniqueBDay
uniqueBDay
## [1] 0.8830518
sameBDay
## [1] 0.1169482

There is a 11.6% probability that at least two people will have the same birthday
b. Find the smallest number n such that a random group of n people has a greater than 50% chance that two (or more) people in the group share a common birthday.
by pluging n= 11, 12,.. into 1-(365! / ((365-n)! * 365^n)), n=23 gives us 50.7% prob. so a group of 23 people hasa greater than 50% chance that two (or more) people in the group share a common birthday.