Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

KOÇ UNIVERSITY

COLLEGE OF ENGINEERING

ENG 200 - PROBABILITY AND STATISTICAL METHODS FOR


ENGINEERS
FALL 2021
MIDTERM EXAM
TIME ALLOWED: 120 MINUTES

Name:
Student Number:

I PLEDGE ON MY HONOR THAT I HAVE NEITHER GIVEN NOR RECEIVED UNAUTHO-


RIZED ASSISTANCE OF THE EXAM.

SIGNATURE:

Question Maximum points


1
2
3
4
Total 100

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:

a) Is the color of the ball independent of which box is chosen? Explain.

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?

Apply Bayes’ again:

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.

P (X = 0) = P (no post) + P (number of likes=0|post)P (post)

P (X = 0) = 0.2 + 0.8 (0.4)4




(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 .

Solution 4. (30 points)


(a) To find P (X1 ≥ X2 ) we should calculate P (X1 = 1, X2 = 1), P (X1 = 1, X2 = 0), and
P (X1 = 0, X2 = 0). For this purpose, it is better to find joint pmf of X1 and X2 :

P (X2 = 0, X1 = 0) = P (X2 = 0|X1 = 0)P (X1 = 0)

P (X2 = 0, X1 = 1) = P (X2 = 0|X1 = 1)P (X1 = 1)


P (X2 = 1, X1 = 0) = P (X2 = 1|X1 = 0)P (X1 = 0)
P (X2 = 1, X1 = 1) = P (X2 = 1|X1 = 1)P (X1 = 1)
Now, lets calculate them:
5 6 30 5
P (X2 = 0, X1 = 0) = P (X2 = 0|X1 = 0)P (X1 = 0) = . = =
9 10 90 15
6 4 24 4
P (X2 = 0, X1 = 1) = P (X2 = 0|X1 = 1)P (X1 = 1) = . = =
9 10 90 15
4 6 24 4
P (X2 = 1, X1 = 0) = P (X2 = 1|X1 = 0)P (X1 = 0) = . = =
9 10 90 15
3 4 12 2
P (X2 = 1, X1 = 1) = P (X2 = 1|X1 = 1)P (X1 = 1) = . = =
9 10 90 15
So, the joint pmf table is as below:

X2 = 0 X2 = 1
X1 = 0 5/15 4/15

X1 = 1 4/15 2/15

So, for X1 ≥ X2 the events should be (X1 = 1, X2 = 1) or (X1 = 1, X2 = 0) or (X1 =


0, X2 = 0):

P (X1 ≥ X2 ) = P (X1 = 1, X2 = 1) + P (X1 = 1, X2 = 0) + P (X1 = 0, X2 = 0)


2 4 5 11
= + + =
15 15 15 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

(c) According to the joint pmf of X1 and X2 , marginal pmf of X2 is as below:


5 4 9 3


 + = = , if X2 = 0
 15 15
 15 5
P (X2 ) = (1)
 4 + 2 = 6 = 2 , if X2 = 1



15 15 15 5

(d) To calculate E[X1 X2 ]: X


E[X1 X2 ] = (X1 X2 )P (X1 , X2 )
= ((X2 = 0 × X1 = 0) × P (X2 = 0, X1 = 0)) + ((X2 = 0 × X1 = 1) × P (X2 = 0, X1 = 1))
+((X2 = 1 × X1 = 0) × P (X2 = 1, X1 = 0)) + ((X2 = 1 × X1 = 1) × P (X2 = 1, X1 = 1))
5 4 4 2 2
= (0 × ) + (0 × ) + (0 × ) + (1 × ) =
15 15 15 15 15

(e) Possible values for Y :



1,
 if X1 = 1, X3 = 0
Y = 0, if X1 = 1, X3 = 1 OR X1 = 0, X3 = 0 (2)

−1, if X1 = 0, X3 = 1

6
So:

P (Y = 1) = P (X1 = 1, X3 = 0) = P (X1 = 1, X2 = 0, X3 = 0)+P (X1 = 1, X2 = 1, X3 = 0)


1 1 4
= + =
6 10 15

P (Y = 0) = P (X1 = 1, X3 = 1)+P (X1 = 0, X3 = 0) = P (X1 = 1, X2 = 0, X3 = 1)+P (X1 = 1, X2 = 1, X3 = 1)


+P (X1 = 0, X2 = 0, X3 = 0) + P (X1 = 0, X2 = 1, X3 = 0)
1 1 1 1 7
= + + + =
10 30 6 6 15

P (Y = −1) = P (X1 = 0, X3 = 1) = P (X1 = 1, X2 = 0, X3 = 1)+P (X1 = 0, X2 = 1, X3 = 1)


1 1 4
= + =
6 10 15
Then pmf of Y is as below: 
4

 , if y = 1
15







7

P (Y ) = , if Y = 0 (3)


 15




 4
 , if Y = −1

15

You might also like