STAT400 Midterm 1
Suppose a restaurant menu has 8 different appetizers, 6 different entrees, and 6 different dessert options. A meal consists of two appetizers, two entrees, and three desserts. Calculate the total number of meals possible if: (a) if we are allowed to repeat any of the items on the list, and if the order in which the appetizers and entrees are consumed matter, and the order in which the desserts are consumed does not matter. (b) if we are not allowed to repeat any of the items on the list, if the order which we consume the appetizers, the entrees, and the desserts does not matter.
(a) The total number of possible meals is: 8^2×6^2×6^3 (b) C(8,2) * C(6,2) * C(6,3) which comes out to 28 * 15 * 20 recall C(n,k) = n!/k!(n-k)!
Suppose a bag contains 7 coins, 2 coins are fair, 2 coins are unfair with P(H) = 0.2, and the other three coins are two-headed coins (heads on both sides). (a) Suppose Amy randomly selects a coin from the bag, and tosses the selected coin two times (independently). Given that the coin lands H on both tosses, what is the probability that Amy tossed a fair coin? (b) Suppose Amy randomly selects a coin from the bag, and tosses the selected coin three times (independently). Given that the coin lands H on all three tosses, what is the probability that Amy tossed a fair coin?
1. Draw tree diagram (3 possibilities on first step, each having 2 possibilities in the second step) 2. Apply Bayes' Theorem Recall: BT is P(A|B) = P(B|A)*P(A)/P(B) a) P(F|HH) = P(H intersect H | F) * P(F)/P(H instersect H) know that P(H intersect H) = P(H intersect H | all 3 outcomes) (multiplied by P(F) and summed together) ans ~ .062 same intuition for b
Roll 6-sided fair die with: no six = success X is r.v that counts # failures until 3 successes a) Distribution of X? b) Formula for P(4<= x <= 6) recall pmf is C(x+r-1, r-1) * p^r * (1-p)^x
Recall this is a X ~ NegBinom (r = 3, p = P(success)) a) p = (not getting 6) = 1-p(getting six) = 1-1/6 = 5/6 Thus, X ~ NegBinon(r = 5, p = 5/6) b) P(x = 4) + P(x=5) + p(x=6) = (6 choose 2) * (5/6)^3 * (1/6)^4 + (7 choose 2) * (5/6)^3 * (1/6)^5 + (8 choose 2) * (5/6)^3 * (1/6)^6
Suppose X ~ Pois(lamda = 5). Calculate: a) P(X <= 3), P(X > 3) b) pmf of Y = 3^X c) E(4X+1), E(3^X) d) V(4X+2) Recall: Pois dist pmf = e^(-lamda) * ((lamda)^k)/(k!) for k = 0,1,2,...
Recall: E(ax+b) = aE(X) + b) E(x) = lamda = V(x) E(g(x)) = Sum{x in X, ;} g(x) * P(x) a) P(X <=3) = P(X = 0) + P(X = 1) + P(X = 2) + P(X = 3) = e^-5 (1 + 5 + 5^2/2 + 5^3/6) P(X > 3) = 1 - P(X <= 3) = 1 - (plug in answer from a) b) P(3^x) = P(Y = 3^k) = P(3^x = 3^k) = P(X = k) = e^-5 * 5^k/k! c) E(4X+1) = 4E(x) + 1 = 4 * 5 + 1 = 21 E(3^X) = Sum{x in X, ;} 3^x * P(x) = e^-lamda * e^3lamda * Sum{k=0, infinity} e^-3lamda * (3lamda)^k/k! Thus, E(3^x) = e^-5 * e^3*5 = e^10 refer to notes for math d) V(4X+2) = 4^2 * V(X) = 80
X ~ Binom(n = 10, p = .5) a) If Y = (-1)^x, calculate pmf of Y and E(Y) b) If Z = 2^x, calculate pmf of Z and E(Z) Recall binom dist: (n choose k) p^k * q^n-k
Recall: Binom dist takes values {1,...,n} a) Values of Y are {1, -1} Py(Y = 1) for k = 0,2,4,6,8 = C(10,k) * .5^k * 10^-k for all k in even (get summation) Py(Y=-1) for k = 1,3,5,7,9 = " " " " " " for all k in odd (get summatiion) E(y) = -1*P(Y=-1) + 1 * P(y=1) from part a.a b) values of Z are {1,2,2^2,...,2^n) Pz(Z) = P(Z = 2^k) = P(x = k) = (n choose k)p^k * (1-p)^n-k = (10 choose k) * (1/2)^10 E(Z) = Sum{k = 0, n} 2^k * (n choose k) * p^k * (1-p)^n-k = " " (n choose k)(2p)^k * (1-p)^n-k = Sum{k = 0, n} 2^k * P(Z = 2^k) (get summation for all k)
Suppose an experiment consists of rolling a fair six sided die three times. (a) We say we have a success if the max of the three rolls is a 6. What is P(success)? (b) If we perform this experiment 10 times independently, what is the probability that the number of successes are between 4 and 6 (inclusive). (c) If we perform this experiment 100 times, what is the expected number of successes?
Recall: binom dist (n choose k) p^k * q^n-k E(x) = np a) P(success) = P(6 shows up in 3 rolls) {1,2,3,4,5,6} S = {(x,y,z)} , |S| = 6^3 E = {max of 3 rolls = 6} Since every outcome is equally likely, P(E) = n(E)/n(S) = n(e)/6^3 n(E) = 1 - E^c E^c = {no 6 in 3 rolls} = 5 * 5 * 5 = 5^3 n(E) = 1 - (5/6)^3 Therefore, P(success) = 1- (5/6)^3 b) X = # successes in 10 trials X ~ Binom(10,p) Answer will be P(x=4) + P(x=5) + P(x=6) from the pdf c) E(x) = expected num of successes = n * p = 100 * p
Suppose X ∼ Geom(p = 0.4). (a) Calculate the formula for the cdf of X. (b) Show that X has the memoryless property - P(X > t|X > s) = P(X > t − s)
a) recall: cdf P(x <=x) if (x <= n) p * summation{i = 0, n-1}(1-p)^i and that sum{i=0, n} r^n = (1-r)^n+1/1-r Thus, 1-(1-p)^n b) P(x > t, x > s)/p(x>s) = 1-p(x <=t , x <=s)/1-p(x<=s) = 1 - fx(t,s)/1-fx(s) = 1-(1-p)^t+s/1-(1-p)^s = p(x>t)
Suppose a random variable X has the following distribution table x {0,2,4,6,8,10,12,14} pxx{.1, .2, .1, .1, .1, .2, .1, .1} (a) Calculate E(X), E(5X), and E(3X + 2). (b) Suppose we know that E(X2 ) = 66.4, calculate V (X) and V (3X + 2) (c) Calculate P(3 ≤ X ≤ 10), P(X ≥ 1.5), P(|X − 7| > 2).
a) 6.8, 34, 22.4 respectively use e(x) = 0 * 0.1 + 2 * 0.2 + ... + 14 * .1 use e(5x) = 5*e(x) e(3x+2)= 3 e(x)+2 b)use e(x^2) - (e(x))^2 c) p(3 <= x < =10) = p(x<=10) -p(x<3) = .8 p(x >= 1.5) = 1-p(x < 1.5) = 1-.1 = .9 x-7 > 2 = x > 9 = .2+.1+.1=.4 p(x < 5) = .1 + .2 + .1 = .4 .4 + .4 = .8
Let X ∼ Pois(λ = 5), Y ∼ Hyper(N = 30, M = 10, n = 5), and Z ∼ NegBinom(r = 5, p = 0.4). (a) Calculate E(4X^2 + 2X + 1) 1 (b) Calculate E(Y^2 + 3Y ). (c) Calculate E(Z(Z + 2) − 3Z^2 ). recall: distribution expected values
a) E(4X2+2X+1)=4E(X2)+2E(X)+E(1) and e(x) = lamda so 4 * 30 + 2 * 5 + 1 = 131 b) = e(y^2) + 3e(y) e(y) = n * m/n = 5 * 10/30 = 5/3 and e(y^2) = nM(m-1)/N(N-1) + n(M/N)^2 ~~ 2.5862 plug in and solve c) = -2e(z^2) + 2e(z) find neg binom values and plug in
Suppose X ∼ Geom(p). (a) Calculate the E(X). (b) Calculate E(X2 ). (c) Calculate V (X).
a) E(x) = 1/p given b) e(x^2) = sum{k = 1, infinity} k^2 * (1-p)^k-1 * p = p * 1/(1-(1-p))^2 = 1/p by derivatives and geometric series c) v(x) = 1-p/p^2
Check if the following are true/false. Justify your answers. (a) (5 pts) If two events A and B are independent, and P(A) > 0, P(B) > 0, then we must have that P(A|B) = P(B|A) . (b) (5 pts) Suppose fX(x) is the pdf of the random variable X, then 2fX(x) is the pdf of the random variable 2X. (c) (5 pts) Suppose we know that P(A) = 0.5, P(B) = 0.8 and that A ∪ B is the entire sample space. Then P(A ∩ Bc ) = 0.2. (d) (5pts) Suppose X has the Poison distribution Pois(λ = 5) then P(−20 < X < 10) = P(0 < X < 10).
a) false. p(a intersect b) = p(a) * p(b) but doesnt imply the given expression b) false. pdf of 2X would be 1/2fx(x/2) c) true. p(a intersect b^c) = p(a) - p(a intersect b) = .5 -.3 = .2 d) true poisson distribution defined for non-neg intergers and if it is less than 0 then it is just 0.
Let X be the random variable that tracks the winnings of a gambler. The distribution of X is given by x{0,2,4,6,8} px(x) {.3, .1, .3, .1, .2} respectively Suppose it costs 4 dollars for the gambler to play the game. (a) Calculate the expected earnings of the gambler. What is the variance in the earnings of the gambler. (b) A trial consists of the gambler playing the game two times independently. The gambler considers a trial a success, if she does not lose money at the end of the trial. Calculate the probability of trial becoming a success.
a) know: y = earnings, Y = X-4 E(y) = E(x) - 4 E(x) = 0 * .3 + 2 * .1 + 4 * .3 + 6 * .1 + 8 * .2 = ans b) want: p(gambler doesnt lose money) = P(y >= 0) know: y = {-4, -2, 0, 2, 4} ( from y = x-4) thus, get the values where y1+y2 in the dist table >= 0
Suppose we roll a six sided fair die two times. Calculate the sample space for this experiment (note it is of the form {(x, y)|x, y = 1, 2, 3, 4, 5, 6}). (a) Suppose X(ω) = sum of the numbers in ω. Calculate X . For each x ∈ X calculate the set {X = x}. Use this information to calculate the probability mass function of X. (b) Suppose X(ω) = maximum of the numbers in ω?. Calculate X . For each x ∈ X calculate the set {X = x}. Use this information to calculate the probability mass function of X. (c) Suppose X(ω) = first number minus the second number in ω?. Calculate X . For each x ∈ X calculate the set {X = x}. Use this information to calculate the probability mass function of X.
s = {(1,1),...,(6,6)} a) p(x=k) for k in 2,3,4,5,6,7,8,9,10,11,12 (sums) e.g. p(x=2) = p(1,1) = 1/36 (each outcome being 1/36 prob.) pmf can be shown in table b)p(x=k) for x in 1,2,3,4,5,6 (max nums) e.g. p(x = 1) = p(1,1) = 1/36 c) " " " -5,-4,-3,...,3,4,5 (x-y) e.g. p(x=3) = p(4,1) + p(5,2) + p(6,3)
Suppose we toss a coin with P(H) = 0.8 four times. Calculate the sample space for this experiment. (a) Suppose X(ω) = the number of heads in ω. Calculate X . For each x ∈ X calculate the set {X = x}. Use this information to calculate the probability mass function of X. (b) Suppose X(ω) = are there more heads than tails in ω?. Calculate X . For each x ∈ X calculate the set {X = x}. Use this information to calculate the probability mass function of X. (c) Suppose X(ω) = the number of tails in ω. Calculate X . For each x ∈ X calculate the set {X = x}. Use this information to calculate the probability mass function of X.
s = {HHHH, HHHT, HHTT,..., TTTT} |S| = 17 a) x(w) = num of heads in w x = {0,1,2,3,4} find p(x = k) for k = 0,1,2,3,4 e.g. p(x=0) = p(tttt) = .2^4 = .0016 b) x = more h than t? x = {1,0} find p(x = k) for k = 1,0 e.g. p(x = 0) = p(tttt) + 4 * P(httt) + 6 * p(hhtt) = ans c) same intuition
Suppose Urn1 contains three white balls and one black ball, while Urn2 contains two white balls and five black balls. One ball is drawn at random from Urn1 and placed in Urn2. A ball is then drawn from Urn2. If the ball drawn from Urn2 is white, what is the probability that the transferred ball was white? Make sure to describe the setup using a tree diagram.
want: P(w1 | w2) draw tree diagram for w1, b1, w2, b2 and find p(w1 | w2) which = p(w1 intersect w2) / p(w2) by conditional prob ~ .81