Docsity

Solutions to Midterm 2 of CSE21, Winter 2005: Probability and Random Variables, Exams of Computer Science

Toggle sidebar
bg1
Midterm 2 Solutions, CSE21, Winter 2005
1 Multiple Choice
You do not need to justify your answers to the following problems.
1. If P(A)=1
2and P(B)=1
2then P(A∩B)=
(a) 1
4,always
(b) 1
4,ifAand Bare independent
(c) 1
2,always
(d) 1
2,ifAand Bare independent
(e) none of the above
Solution When Aand Bare independent it is P(A∩B)=P(A)P(B)=
1
2
1
2=1
4
2. If P(A)=1
2and P(B)=1
2then P(A∪B)=
(a) 1
2
(b) 3
4
(c) 1
(d) cannot be determined
(e) none of the above
Solution In the general case it is P(A∪B)=P(A)+P(B)−P(A∩B).
In the absence of information about P(A∩B) we cannot determine
P(A∪B).
3. Consider the universal set Uand two events Aand Bsuch that A∩B=
∅and A∪B=U. We know that P(A)=1
3.ThenP(B)=
(a) 2
3
1
pf3
pf4
pf5

Partial preview of the text

Download Solutions to Midterm 2 of CSE21, Winter 2005: Probability and Random Variables and more Exams Computer Science in PDF only on Docsity!

Midterm 2 Solutions, CSE21, Winter 2005

1 Multiple Choice

You do not need to justify your answers to the following problems.

  1. If P (A) = 12 and P (B) = 12 then P (A ∩ B) =

(a) 14 , always (b) 14 , if A and B are independent (c) 12 , always (d) 12 , if A and B are independent (e) none of the above

Solution When A and B are independent it is P (A∩B) = P (A)P (B) = 1 2

1 2 =^

1 4

  1. If P (A) = 12 and P (B) = 12 then P (A ∪ B) =

(a) (^12) (b) (^34) (c) 1 (d) cannot be determined (e) none of the above

Solution In the general case it is P (A∪B) = P (A)+P (B)−P (A∩B). In the absence of information about P (A ∩ B) we cannot determine P (A ∪ B).

  1. Consider the universal set U and two events A and B such that A∩B = ∅ and A ∪ B = U. We know that P (A) = 13. Then P (B) =

(a) (^23)

(b) (^13) (c) (^49) (d) cannot be determined (e) none of the above

Solution 1 = P (U) = P (A ∪ B) = P (A) + P (B) − P (A ∩ B) = 1 3 +^ P^ (B) + 0^ ⇒^ P^ (B) =^

2 3.^ An alternative justification comes from the observation that B = Ac. Hence P (B) = 1 − P (A).

2 Conditional Probability

Show the tree diagram outlining the outcomes in each step of the sequence of events and use it to justify your answers. Write on the tree diagram all probabilities that matter to the following questions. You do not have to write probabilities that are not important to the question. In the first step, Joe draws a hand of 5 cards from a deck of 52 cards.

  1. What is the probability that Joe has exactly one ace?

Solution P (1A) = C(4, C1)(52×C,5)(48,4)

  1. What is the probability that Joe has no aces?

Solution P (0A) = C C(48(52,,5)5)

In the second step, if he has 4 aces, he does nothing. If he has 3 aces or fewer, he throws away two cards that are not aces and he picks two cards from the remaining deck. (After Joe has picked the first five cards there are 47 cards in the remaining deck.)

  1. What is the probability that after the second step Joe has exactly one ace?

Solution

P (0A| 2 B) =

P (2B and 0 A) P (2B)

P (2B| 0 A)P (0A)

P (2B)

P (0A| 2 B) =

C(4,2) C(47,2)

C(48,5) C(52,5) C(4,2) C(47,2)

C(48,5) C(52,5) +^

C(3,1)C(44,1) C(47,2)

C(4,1)C(48,4) C(52,5) +^

C(43,2) C(47,2)

C(4,2)C(48,3) C(52,5)

3 Counting

The CSE21 class plans to randomly elect a committee that will have one president and four members. The class has 135 students; 30 female students and 105 male students. What is the probability that the president of the committee is male, two members are female and the other two members are male?

Solution The total number of committees is C(135, 1) × C(134, 4), where C(135, 1) is the number of ways to choose the president and C(134, 4) is the number of ways to choose the four members. The total number of committees where the president of the committee is male, two members are female and the other two members are male is C(105, 1) × C(104, 2) × C(30, 2). Hence the asked probability is

C(105, 1) × C(104, 2) × C(30, 2) C(135, 1) × C(134, 4)

4 Random Variables

A fair die is tossed. If it turns out to be

  • 6, you win $
  • 5, you win $
  • 3 or 4, you do not win and you not lose
  • 1 or 2, you lose $

Let X be the random variable that describes the number of dollars won or lost when the die is tossed. Obviously, positive numbers correspond winning and negative to losing.

  1. Provide the distribution fX of X.

Solution The universal set U consists of the outcomes { 1 , 2 , 3 , 4 , 5 , 6 }. The image of X (i.e., set of possible values) is {− 2 , 0 , 1 , 2 }.

fX (−2) = P (X = −2) = P ({ 1 , 2 }) = (^26) fX (0) = P (X = 0) = P ({ 3 , 4 }) = (^26) fX (1) = P (X = 1) = P ({ 5 }) = (^16) fX (2) = P (X = 2) = P ({ 6 }) = (^16)

  1. Compute E(X).

Solution

E(X) = fX (−2) × (−2) + fX (0) × 0 + fX (1) × 1 + fX (2) × 2 = −

  1. Compute V ar(X).

Solution We denote μ = E(X)

V ar(X) = fX (−2) × [(−2) − μ]^2 + fX (0) × [0 − μ]^2 + fX (1) × [1 − μ]^2 + fX (2) × [2 − μ]^2 = 2 6 (−

11 6 )

1 6 )

7 6 )

13 6 )

216

Let Y be the random variable that maps each outcome of the tossing to the corresponding number, i.e., when the die turns out 6 the r.v. Y is 6, when the die turns out 5 the r.v. Y is 5, and so on.

  1. Provide the distribution fY of Y.

Solution Since we have already computed E(XY ), E(X) and E(Y ), we can quickly compute Cov(X, Y ) as follows:

Cov(X, Y ) = E(XY ) − E(X)E(Y ) =