Download ECE302 Solution to Exam 1 Version B March 5, 2015 1 Name

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

History of statistics wikipedia , lookup

Statistics wikipedia , lookup

Birthday problem wikipedia , lookup

Ars Conjectandi wikipedia , lookup

Probability interpretations wikipedia , lookup

Probability wikipedia , lookup

Transcript
ECE302
Solution to Exam 1 Version B
Name:
March 5, 2015
Solution
Score:
1
/100
This exam is closed-book.
• You must show ALL of your work for full credit.
– Please read the questions carefully.
– Please check your answers carefully.
• Calculators may NOT be used.
– Please leave fractions as fractions, but simplify them, etc.
– I do not want the decimal equivalents.
• Cell phones and other electronic communication devices must be turned off and
stowed under your desk.
• Please do not write on the backs of the exam or additional pages.
– The instructor will grade only one side of each page.
– Extra paper is available from the instructor.
• Please write your name on every page that you would like graded.
1
2
3
4
5
6
7
8
ECE302
Solution to Exam 1 Version B
March 5, 2015
2
1. (15 points) Answer the following questions:
(a) Is the following a valid PMF? Justify your answer!

 1/8 x ∈ {0, 1, 2}
1/4 x ∈ {3, 4}
PX (x) =

0
otherwise
P
Here, the requirement that x∈SX PX (x) = 1 is violated. SX = {0, 1, 2, 3, 4}.
X
PX (x) = 3(1/8) + 2(1/4) = 7/8 6= 1.
x∈SX
(b) Is the following a valid CDF? Justify your answer!

0
x≤0




1/5
0
<x≤1

2/5 2 < x ≤ 3
FX (x) =


3/5 3 < x ≤ 4



1
x>3
There are three problems with this CDF. The first is that the range 1 < x ≤ 2
is missing. The second is that the value 1 should correspond to the case x > 4
rather than x > 3. The third is that the strict inequality should be at the end of
the interval instead of the start of the interval. Citing any one of these three
problems suffices to show that the indicated expression for FX (x) is not a CDF.
In fact, it is not even a function because it is not well defined on the interval
(3, 4].
(c) Assuming that the CDF given above is valid, find the PMF. Is it a valid PMF?
Justify your answer!
Without making at least two corrections, it is hard to follow this instruction.
If we redefine FX (x) as

0
x<0




 1/5 0 ≤ x < p
2/5 p ≤ x < 3
FX (x) =


3/5 3 ≤ x < 4



1
4≤x
for either p = 1 or p = 2, then by

1/5




 1/5
1/5
PX (x) =


2/5



0
identifying the discontinuities we obtain
x=0
x=p
x=3
x=4
otherwise.
(1/5 − 0)
(2/5 − 1/5)
(3/5 − 2/5)
(1 − 3/5)
ECE302
Solution to Exam 1 Version B
2. (15 points)
March 5, 2015
3
Consider the random variable X having a geometric distribution.
(a) Write the PMF for X.
A geometric random variable describes the probability that the xth Bernoulli
trial constitutes the first success where the probability of success is p. The
PMF is
p(1 − p)x−1 x = 1, 2, . . .
PX (x) =
0
otherwise
where p ∈ (0, 1).
(b) Find the CDF of X. You may find it helpful to recall the fact that (1 − x)(1 +
x + · · · + xn ) = 1 − xn+1 ,
For positive integers x,
FX (x) =
x
X
i−1
p(1 − p)
=p
i=1
x−1
X
(1 − p)i = p
i=0
1 − (1 − p)x
= 1 − (1 − p)x .
1 − (1 − p)
Thus
FX (x) =
0
x<1
bkc
1 − (1 − p)
k ≤ x < k + 1,
k = 1, 2, . . .
Note that FX (x) −→ 1 as x −→ ∞ but FX (x) never actually reaches 1.
(c) Find the expected value E[X].
The expected value is
E[X] =
=
∞
X
x=1
∞
X
xPX (x)
x−1
xp(1 − p)
x=1
= p lim
x→∞
=p
∞
X
x(1 − p)x−1
x=1
x
X
k(1 − p)k−1
k=0
x
d X
= p lim (−1)
(1 − p)k
x→∞
dp k=0
d
1 − (1 − p)k+1
lim
dp x→∞ 1 − (1 − p)
d 1
= −p
dp p
−1
= −p
p2
1
=
.
p
= −p
ECE302
Solution to Exam 1 Version B
March 5, 2015
4
3. (20 points) Consider a fair 4-sided die with sides labelled 1, 2, 3, and 4.
(a) If the die is rolled twice, what is the sample space?
The sample space is S = {(x, y) : x ∈ [4], y ∈ [4]} where [4] = {1, 2, 3, 4}.
(b) If the random variable M takes the sum of the two value rolled, what is the
PMF of M ?
First, let’s find the range SM of M . We have
2
3
4
5
6
7
8
=
=
=
=
=
=
=
1+1
1+2=2+1
1+3=2+2=3+1
1+4=2+3=3+2=4+1
2+4=3+3=4+2
3+4=4+3
4+4
so SM = {2, 3, 4, 5, 6, 7, 8} and there is one way to obtain each of 2 and 8, there
are two ways to obtain 3 and 7, there are three ways to obtain 4 and 6, and
there are four ways to obtain 5. Since the die is fair, the values each roll can
take are equiprobable and the rolls are independent, thus the elements of the S
are equiprobable. Accordingly,

1/16 m ∈ {2, 8}




 1/8 m ∈ {3, 7}
3/16 m ∈ {4, 6}
PM (m) =


1/4 m = 5



0
otherwise.
(c) Find E[M ].
E[M ] =
X
mPM (m) = 1/16(2 + 8) + 2/16(3 + 7) + 3/16(4 + 6) + 4/16(5)
m∈SM
= (10 + 2(10) + 3(10) + 20)/16 = 80/16 = 5.
ECE302
Solution to Exam 1 Version B
March 5, 2015
(d) Find Var[M ].
Var[M ] = E[M 2 ] = (E[M ])2
E[M 2 ] =
X
m2 PM (m)
m∈SM
= 1/16(22 + 82 ) + 2/16(32 + 72 ) + 3/16(42 + 62 ) + 4/16 ∗ 52
= (68 + 2(58) + 3(52) + 4(25)) /16 = 440/16 = 55/2.
so
Var[M ] = 55/2 − 25 = (55 − 50)/2 = 5/2.
5
ECE302
Solution to Exam 1 Version B
March 5, 2015
6
4. (15 points) Consider again the 4-sided die with sides labelled 1, 2, 3, and 4.
(a) What is the PMF of Q, the number of odd rolls in 4 rolls of the die?
Q has a binomial(4,1/2) distribution so
 q 4−q
4
1
1



q ∈ {0, 1, 2, 3, 4, }
q
2
2
PQ (q) =



0
otherwise.
(b) Let K3 be the value of the third roll. What is the probability of the event that
the third roll is 3 given that Q = 3?
There are four ways to achieve Q = 3. Either the first, second, third, or fourth
roll is even and the others are odd, so
4
P [Q = 3] =
(1/2)4 = 1/4.
3
If the third roll is even, the probability that K3 = 3 is zero, so we cannot assume
that Q and K3 are independent because
P [{Q = 0} ∧ {K3 = 3}] = 0 6= (1/2)4 (1/4) = P [Q = 0]P [K3 = 3].
However, the value of each roll of the die is independent of the values of the
others, so
P [K3 = 3] = 1/4.
Next we note that the probability that Q = 3 given that K3 = 3 is the probability
that exactly two of the other three rolls are odd, so
3
P [Q = 3|K3 = 3] =
(1/2)3 = 3/8.
2
By the definition of conditional probability
P [{Q = 0} ∧ {K3 = 3}] = P [Q = 3|K3 = 3]P [K = 3] = 3/8 (1/4) = 3/32.
Thus
P [K3 = 3|Q = 3] =
3/32
P [K3 = 3 ∧ Q = 3]
=
= 3/8.
P [Q = 3]
1/4
ECE302
Solution to Exam 1 Version B
March 5, 2015
7
(c) Let R be the number of the first roll that is odd. What is the PMF of R?
If we allow infinitely many rolls, R is a geometric(1/2) random variable with
PMF
1/2(1 − 1/2)r−1 r = 1, 2, . . .
PR (r) =
0
otherwise.
Since we are only rolling the die four times, we must define a value for R for
the case that none of the rolls are odd. If we set R equal zero when none of the
rolls are odd we have

(1/2)5 r = 0




1/2
r=1



(1/2)2 r = 2
PR (r) =
(1/2)3 r = 3




(1/2)4 r = 4



0
otherwise.
ECE302
Solution to Exam 1 Version B
March 5, 2015
8
5. (10 points) For each of the following sets of subsets of set S = {1, 2, 5, 10, 11, 12},
indicate why the set of subsets is or is not a partition of S.
(a) Set {A1 , A2 , A3 } where
A1 = {1, 2, 5}
A2 = {10, 11}
A3 = {12}
This set is a partition because the Ai are mutually exclusive (A1 ∩ A2 = A1 ∩
A3 = A2 ∩ A3 = ∅) and collectively exhaustive (A1 ∪ A2 ∪ A3 = S).
(b) Set {B1 , B2 , B3 } where
B1 = {1, 11}
B2 = {2, 12}
B3 = {3, 5, 10}
This set is not a partition because 3 ∈ B3 and 3 6∈ S.
(c) Set {C1 , C2 , C3 } where
C1 = {1, 2, 3}
C2 = {10, 11}
C3 = {12}
This set is not a partition for two reasons: first because 5 6∈ C1 ∪ C2 ∪ C3 so
the set is not collectively exhaustive, and second because 3 ∈ C1 but 3 6∈ S.
(d) Set {D1 , D2 , D3 } where
D1 = {1, 2}
D2 = {10, 11}
D3 = {12}
This set is not a partition because it is not collectively exhaustive. 5 ∈ S but
5 6∈ D1 ∪ D2 ∪ D3 .
ECE302
Solution to Exam 1 Version B
March 5, 2015
9
6. (10 points) The American dog tick can carry both Tularemia and Rocky Mountain
Spotted Fever (R). Suppose that 25% of ticks carry Tularemia, that 20% carry R,
and that 10% of the ticks that carry Tularemia carry both diseases.
(a) What is the probability that a dog tick carries both diseases?
Applying the definition of conditional probability,
P [RT ] = P [R|T ]P [T ] = 1/10(1/4) = 1/40.
(b) What is the conditional probability that a tick has Tularemia given that it has
Rocky Mountain Spotted Fever?
Applying the definition of conditional probability,
P [T |R] =
P [RT ]
1/40
1
=
= .
P [R]
1/5
8
(c) What is the conditional probability that a tick has R given that it has Tularemia?
We are given that P [R|T ] = 1/10.
ECE302
Solution to Exam 1 Version B
March 5, 2015
10
7. (10 points) Answer the following questions, clearly indicating your reasoning:
(a) Let A and C be mutually exclusive. Are they independent?
If A and C are mutually exclusive, then A ∩ C = ∅. Thus P [A ∩ C] = 0. The
definition of independence requires that if A and C are independent, then
P [A ∩ C] = P [A] P [C].
But unless either A or C is empty, P [A]P [C] 6= 0 so mutually exclusive events
are not, in general, independent.
(b) Consider an event A. Are A and Ac independent?
We know that
P [A ∩ Ac ] = P [∅] = 0,
The definition of independence requires that if A and Ac are independent,
P [A ∩ Ac ] = P [A] P [Ac ].
But since A ∩ Ac = ∅, this will be true only if 0 = P [A]P [Ac ], which is true iff
either P [A] = 0 or P [Ac ] = 0. Thus, so long as A is neither empty nor all of
the sample space, A and Ac are not independent.
(c) Let B ⊂ A. Are A and B independent?
One of the properties of a probability measure is that
if B ⊂ A, then P [B] ≤ P [A].
Because B ⊂ A, P [A ∩ B] = P [B]. OTOH, because P [A] ∈ [0, 1], unless
P [A] = 1 or P [B] = 0,
P [A] P [B] < P [B].
So, unless B is empty or A is the whole sample space, A and B are not independent.
ECE302
Solution to Exam 1 Version B
March 5, 2015
11
8. (10 points) Suppose your friend has gone to the store and has bought apples, bananas, lemons, and melons. Let A be the number of apples, B be the number of
bananas, L be the number of lemons, and M be the number of melons.
(a) If you know that your friend bought 7 pieces of fruit, including 3 apples, how
many different values could the triple (B, L, M ) take? It is sufficient to write
an expression for the number. You do not have to evaluate the expression.
This question was ambiguous. I meant to say A = 3, or equivalently, “there
are exactly 3 apples”. Since I did not, there are two possible answers.
i. If there are exactly 3 apples, then each of the remaining four pieces must
be either a banana, a lemon, or a melon. The ways to partition 4 into 3
parts are
(4, 0, 0), (0, 4, 0), (0, 0, 4),
(3, 0, 1), (3, 1, 0), (1, 3, 0), (1, 0, 3), (0, 1, 3), (0, 3, 1),
(2, 2, 0), (2, 0, 2), (0, 2, 2),
(2, 1, 1), (1, 2, 1), (1, 1, 2).
We can count these options directly, there
are 15, or we can reason (following the same order) that there are 31 ways to choose the type of which
we have four,
or 3(2) ways to choose the types of which we have three
and
3
3
zero, or 1 ways to choose the type of which we have none, or 1 ways
to choose the types of which we have two. Thus we have 3 31 + 3(2) = 15
options.
ii. If there are at least 3 apples, then we have more options. We could have
any number between zero and 4 pieces of non-apples. We could have zero of
each, or one of each. There are twice 31 ways tochoose either one or two
of just one type of non-apple. There are twice 31 ways to choose the type
of which we have zero or two when we have one of each each of the other
two types. There are 31 ways to choose the types of which we have two
while we have none of the third type. There are twice 3(2) ways to choose
the types of which we have either 3 and 1 or 2 and 1 while we have none
of the third type. The total is then 1 + 1 + 2(3) + 2(3) + 3 + 2(3(2)) = 29.
The options are
(0, 0, 0), (1, 1, 1)
(1, 0, 0), (0, 1, 0), (0, 0, 1), (2, 0, 0), (0, 2, 0), (0, 0, 2),
(1, 1, 0), (1, 0, 1), (0, 1, 1), (2, 1, 1), (1, 2, 1), (1, 1, 2),
(2, 2, 0), (2, 0, 2), (0, 2, 2),
(2, 0, 1), (2, 1, 0), (1, 2, 0), (1, 0, 2), (0, 1, 2), (0, 2, 1),
(3, 0, 1), (3, 1, 0), (1, 3, 0), (1, 0, 3), (0, 1, 3), (0, 3, 1),
ECE302
Solution to Exam 1 Version B
March 5, 2015
12
(b) Assuming you do not know the number of apples, if your friend bought at least
one of each type of fruit, what is the probability there are 2 melons?
This question was ambiguous. I meant to say M = 2, or equivalently, “there
are exactly 2 melons”. Since I did not, there are two possible answers.
i. The probability that there are exactly 2 melons can be determined as follows:
We already have one melon, so the probability that we have exactly two is
the probability that exactly one of the three pieces remaining is a melon.
P [ one melon and two non-melons ] = p(1 − p)2
where, since we were not told otherwise, we assume the options are equally
likely, i.e. p = P [ melon ] = 1/4. Thus
P [ one melon and two non-melons ] = 1/4(3/4)2 = 9/64.
ii. OTOH, the probability that there are at least 2 melons is the probability
that among the remaining three pieces of fruit, there are either one, two,
or three melons. Thus,
P [ at least one melon ] =
3
X
k=1
pi (1 − p)3−i = 32 /64 + 3/64 + 1/64 = 13/64.