Solution For Midterm1
Solution For Midterm1
COLLEGE OF ENGINEERING
Name:
Student Number:
SIGNATURE:
1
Question:1
There are two boxes: Box 1 and Box 2. Box 1 contains 4 red balls and 5 black balls. Box 2 has
12 red balls and 15 black balls. One of the two boxes is picked at random, and then a ball is
picked at random from that box.
SOLUTION:
Yes.
Let R be the event that a red ball is selected, B be the event that a black ball is selected, and
Bi , i = 1, 2 be the event that box i is selected. Then:
4 1
P (R | B1 ) = = P (R) = (4/9 + 4/9) = P (R | B1 ) P (B1 ) + P (R | B2 ) P (B2 )
9 2
5 1
P (B | B1 ) = = P (B) = (5/9 + 5/9) = P (B | B1 ) P (B1 ) + P (B | B2 ) P (B2 )
9 2
so color is independent of the Box.
b) What if instead there were 12 red balls and 14 black balls in Box 2? Explain.
No.
1
P (R | B1 ) = 4/9 ̸= P (R) = (4/9 + 6/13)
2
c) Suppose again that Box 1 contains 4 red balls and 5 black balls and Box 2 has 12 red balls
and 14 black balls. Given that a red ball is selected, what is the chance that it came from Box
1?
4
1 1 4 1 9
P (B1 | R) = P (R | B1 ) P (B1 ) = · · 1 = ≃ .491
P (R) 2 9 2 (4/9 + 6/13) 4/9 + 6/13
2
Question 2.
Joya has 4 apples, 2 oranges and 3 tangerines. She picks 5 fruits randomly. Let X represent the
number of tangerines taken.
a) Find E[2X + 3]
b) Find V ar(3X + 2)
Solution.
6
3
5 1
P (X = 0) = 0 =
9
5
21
6
3
4 5
P (X = 1) = 1 =
9
5
14
6
3
3 10
P (X = 2) = 2 =
9
5
21
6
3
2 5
P (X = 3) = 3 =
9
5
42
1 5 10 5 5
E[X] = 0 × +1× +2× +3× =
21 14 21 42 3
10 19
E[2X + 3] = 2E[X] + 3 = +3=
3 3
2 2 1 2 5 2 10 5 10
E[X ] = 0 × +1 × +2 × + 32 × =
21 14 21 42 3
2 2 5
V ar(X) = E[X ] − E[X] =
9
V ar(3X + 2) = 9V ar(X) = 5
3
Question:3
3. (35 pts) An Instagram user Banu posts a new picture on her instagram page on a given day
with probability 0.8 and does not post anything with probability 0.2. Assume that she never
posts more than one picture on a given day and that the probability of posting a picture on a
given day is independent from whether she posted or not on other days.
Assume that Banu has four followers on Instagram and if Banu posts a new picture on a given
day, each of her followers like it with probability 0.6 on the same day (independently of the
others).
Let X be the number of likes that Banu receives for her instagram pictures on a given day.
(a) (5 pts) What is the probability that X = 0? Note that X = 0 if she does not post a picture
or if she posts a picture and none of her friends likes it.
(b) (15 pts) Find the probability mass function of X, i.e., pX (x) . Specify the function for all
integers x.
First, we can write:
4
pX (x) = P (X = x) = 0.8 (0.6)x (0.4)4−x x = 1, 2, 3, 4.
x
Then:
4
0.2 +
0.8 (0.4) if x = 0
4
pX (x) = 0.8 (0.6)x (0.4)4−x if x = 1, 2, 3, 4
x
0 otherwise
(c) (5 pts) Let A be the event that Banu receives an even number of likes. Find P (A).
(d) (10 pts) Find the conditional PMF of X given that event A occurred, PX|A (x). Specify the
function for all integers x.
4
Question 4. (30 points)
Suppose that 3 balls are chosen in order and without replacement, from an urn consisting of
4 white and 6 black balls. Let Xi equal 1 if the i-th ball selected is white, and let it equal 0
otherwise.
(a) (5 points) Find P (X1 ≥ X2 ).
(b) (10 points) Find the joint probability mass function of (X1 , X2 , X3 ).
(c) (5 points) Find the marginal PMF of X2 .
(d) (5 points) What is the E[X1 X2 ]?
(e) (5 points) Let Y = X1 − X3 . Find the PMF of Y .
X2 = 0 X2 = 1
X1 = 0 5/15 4/15
X1 = 1 4/15 2/15
5
(b) To find joint pmf of X1 ,X2 , and X3 :
4 5 6 120 1
P (X3 = 0, X2 = 0, X1 = 0) = P (X3 = 0|X2 = 0, X1 = 0)P (X2 = 0, X1 = 0) = . . = =
8 9 10 720 6
5 6 4 120 1
P (X3 = 0, X2 = 0, X1 = 1) = P (X3 = 0|X2 = 0, X1 = 1)P (X2 = 0, X1 = 1) = . . = =
8 9 10 720 6
5 4 6 120 1
P (X3 = 0, X2 = 1, X1 = 0) = P (X3 = 0|X2 = 1, X1 = 0)P (X2 = 1, X1 = 0) = . . = =
8 9 10 720 6
6 3 4 72 1
P (X3 = 0, X2 = 1, X1 = 1) = P (X3 = 0|X2 = 1, X1 = 1)P (X2 = 1, X1 = 1) = . . = =
8 9 10 720 10
4 5 6 120 1
P (X3 = 1, X2 = 0, X1 = 0) = P (X3 = 1|X2 = 0, X1 = 0)P (X2 = 0, X1 = 0) = . . = =
8 9 10 720 6
3 6 4 72 1
P (X3 = 1, X2 = 0, X1 = 1) = P (X3 = 1|X2 = 0, X1 = 1)P (X2 = 0, X1 = 1) = . . = =
8 9 10 720 10
3 4 6 72 1
P (X3 = 1, X2 = 1, X1 = 0) = P (X3 = 1|X2 = 1, X1 = 0)P (X2 = 1, X1 = 0) = . . = =
8 9 10 720 10
2 3 4 24 1
P (X3 = 1, X2 = 1, X1 = 1) = P (X3 = 1|X2 = 1, X1 = 1)P (X2 = 1, X1 = 1) = . . = =
8 9 10 720 30
So, the joint pmf is:
X1 X2 X3 P
0 0 0 16⁄
0 0 1 16⁄
0 1 0 1⁄6
0 1 1 1⁄10
1 0 0 1⁄6
1 0 1 1⁄10
1 1 0 1⁄10
1 1 1 1⁄30
6
So: