统计代写-OMEWORK 4
时间:2022-02-22
HOMEWORK 4
PSTAT 120A – Winter 2022
Instructor: Dr. Mouti
Assisted by: Ethan Marzban
Some Guidance on Self-Grading: When grading and providing feedback on your work, please
ask yourself the following questions:
• Was my notation clear? Did I define all events/random variables/relevant quantities?
• Does the flow of my logic make sense? Would another reader be able to follow my arguments
easily?
• Did I correctly identify the main topics being tested in these problems?
Next, assign yourself a grade (for each part of each problem) based on the following scale:
• 2pts: Fully correct
• 1pts: Correct approach, but with major pitfalls/errors
• 0pts: Not attempted, or completely incorrect approach
Note that each part of a question is worth 2 points. Thus, since there are 19 parts in total on this
homework, the maximum score you can receive is 48 points. Do not include your score on
problem 6(c) in your total calculation.
Finally, please add up your scores on the individual parts and write your total score
on the front page.
1. Write half a page with the main results of the chapter.
2.[ ] Suppose that the distribution function of X is given by
FX(b) =

0 b < 0
1/2 0 ≤ b < 1
3/5 1 ≤ b < 2
4/5 2 ≤ b < 3
9/10 3 ≤ b < 3.5
1 b ≥ 3.5
(a) What is the state space of X?
Solution:
SX = {0, 1, 2, 3, 3.5}
(b) Calculate the probability mass function of X.
Solution:
k pX(k)
0 1/2
1 1/10
2 1/5
3 1/10
3.5 1/10
3.[ ] Let X have possible values {1, 2, 3, 4, 5} and probability mass function
x 1 2 3 4 5
pX(x) 1/7 1/14 3/14 2/7 2/7
(a) Calculate P(X ≤ 3).
Solution: The random variable X takes the values 1, 2, 3, 4 and 5. Collecting the
probabilities corresponding to the values that are at most 3 we get
P(X ≤ 3) = P(X = 1) + P(X = 2) + P(X = 3)
= pX(1) + pX(2) + pX(3) =
1
7
+
1
14
+
3
14
=
3
7
(b) Calculate P(X < 3).
Solution: Now we have to collect the probabilities corresponding to the values which
are less than 3:
P(X < 3) = P(X = 1) + P(X = 2) = pX(1) + pX(2) =
1
7
+
1
14
=
3
14
(c) Calculate P(X < 4.12 | X > 1.638).
Solution: First we use the definition of conditional probability to get
P(X < 4.12 | X > 1.638) = P(X < 4.12 and X > 1.638)
P(X > 1.638)
We have P(X < 4.12andX > 1.638) = P (l.638 < X < 4.12). The possible values of X
between 1.638 and 4.12 are 2, 3 and 4. Thus
P(X < 4.12 and X > 1.638) = pX(2) + pX(3) + pX(4) =
1
14
+
3
14
+
2
7
=
4
7
Page 2
Similarly,
P(X > 1.638) = pX(2) + pX(3) + pX(4) + pX(5) =
1
14
+
3
14
+
2
7
+
2
7
=
6
7
From this we get
P(X < 4.12 | X > 1.638) =
4
7
6
7
=
2
3
4.[ ] At the fair, you find a carnival game that interests you. It is a dart and balloon game (sometimes
called Balloon Darts) with 6 balloons: 3 green, 2 blue, 1 red. During each round, you throw 3
darts and pop 3 balloons. Each popped green balloon is worth 2 points; each blue balloon is worth
3 points; and the red balloon is worth 4 points. You decide to play.
(a) Given this “experiment” of popping three balloons, what is a reasonable sample space?
Solution: Let G be a green balloon is popped, B a blue balloon is popped, and R a red
balloon is popped. Then, a reasonable sample space is
Ω = {GGG,GGB,GGR,GBB,GBR,BBR}
(b) Let X be the (random variable representing the) number of points earned during one round
of the game. What is the state space of X?
Solution: Recall that the state space is the range of X. That is, the state spaces is the
set of all of the values that X is equal to. If X equals the number of points earned during
one round, then GGG is 2 + 2 + 2 = 6 points; GGB is 2 + 2 + 3 = 7 points; GGR is
2 + 2 + 4 = 8 points; GBB is 2 + 3 + 3 = 8 points; GBR is 2 + 3 + 4 = 9 points; and
BBR is 3 + 3 + 4 = 10 points.
Thus, the state space is
SX = {6, 7, 8, 9, 10}
(c) Let X be the random variable from the previous part and assume that each balloon is equally
likely to be popped. Find the probability mass function of X.
Solution:
Page 3
k pX(k) = P (X = k)
6 P (X = 6) = P (GGG) =
(
3
3
)(
6
3
) = 1
20
7 P (X = 7) = P (GGB) =
(
3
2
)(
2
1
)(
6
3
) = 6
20
8 P (X = 8) = P (GGR) + P (GBB) =
(
3
2
)(
1
1
)(
6
3
) + (31)(22)(6
3
) = 6
20
9 P (X = 9) = P (GBR) =
(
3
1
)(
2
1
)(
1
1
)(
6
3
) = 6
20
10 P (X = 10) = P (BBR) =
(
2
2
)(
1
1
)(
6
3
) = 1
20
(d) Compute FX(11.2).
Solution:
FX(11.2) = P (X ≤ 11.2) =
10∑
k=6
pX(k) = 1
(e) If during a round you gain at least 10 points, you will win a mega cheese burger (MCB)
(with vegan option); otherwise, you are awarded a glass of water. Assume that the outcome
of consecutive rounds are independent and that you can not carry points between rounds.
What is the probability that within 5 rounds of play, you win at least 2 MCBs?
Solution: Let Y be the number of MCB. Then, we want to find P (Y ≥ 2).
We can view winning a bowl of MCB on one round as a success and view getting a glass
of water on one round as failure. Then, Y = Bin(5, p) where
p = P (winning MCB) = P (X ≥ 10) = P (X = 10) = 1/20.
Then,
P (Y ≥ 2) = 1− P (Y < 2)
= 1− (P (X = 0) + P (X = 1))
= 1−
((
5
0
)
(1/20)0(1− 1/20)5 +
(
5
1
)
(1/20)1(1− 1/20)4
)
= 1− (195 + 5 · 194)/205
Page 4
5.[ ] Consider the random variable X with state space SX = N ∪ {0} and probability mass function
(p.m.f.) given by
P(X = k) = c
(
1
3
)k
; k = 0, 1, 2, 3, . . .
where c is an as-of-yet undetermined constant.
(a) Identify the value of c that ensures that the function above is a valid p.m.f.
Solution: We can see that (1/2)k is nonnegative for all values of k; thus, all we need is
to ensure that

k∈SX P(X = k) = 1. That is,
∞∑
k=0
c
(
1
3
)k
= c · 1
1− 1/3 =
3
2
c
!
= 1
meaning c = 2/3 .
(b) Find a closed-form expression for FX(x), the cumulative distribution function (c.d.f.) of X.
Solution: We could use a direct computation:
FX(x) := P(X ≤ x) =
x∑
k=0
P(X = k)
=
x∑
k=0
(
2
3
)
·
(
1
3
)x
=
2
3
· 1− (
1/3)x+1
1− 3/2 = 1−
(
1
3
)x+1
Alternatively, if you did not remember the formula for the partial sums of the geometric
series we can actually use the complement rule:
FX(x) := P(X ≤ x) = 1− P({X ≤ x}∁)
= 1− P(X > x) = 1− P(X ≥ x+ 1)
= 1−
∞∑
k=x+1
(
2
3
)
·
(
1
3
)x
= 1− 2
3
· (
1/3)x+1
1− 1/3 = 1−
(
1
3
)x+1
Either way, we find
FX(x) = 1−
(
1
3
)x+1
Now, one (perhaps not-so-small) technical note: we know that c.d.f.’s of discrete random
variables should be piecewise defined. Thus, our expression above isn’t quite correct as it
assumes x is an integer. But this can be fixed using floor/ceiling functions; we just need
t o figure out which one we need to use. We can do so by examining a test value for x:
for instance, FX(1/2) = P(X < 1/2) = P(X = 0) = 2/3. Thus, we see that we should
use the floor function, as opposed to the ceiling function:
FX(x) = 1−
(
1
3
)⌊x⌋+1
Page 5
6.[ ] Suppose that the number of Bigfoot sightings per year in the Northwestern US is well-modeled
by a Poisson random variable with an average of 3 sightings occurring per year. Calculate the
probability that in a given year there are at least 4 sightings in this region, given that there are
at least 2 sightings.
Solution: Let X be the number of Bigfoot sightings. Then, X = Pois(3).
P(X ≥ 4 | X ≥ 2) = P(X ≥ 4)
P(X ≥ 2)
=
1− 13e−3
1− 4e−3
7.[ ] Every month, there are 1000 independent TIE fighter flights, and each TIE fighter flight crashes
with a probability of 0.0035.
(a) What is the probability that at least 2 crashes occur in the next month? You do not need to
evaluate the sum you write down.
Solution: Let X be the number of crashes that occur within the next month. Then, we
want to find P (X ≥ 2). X is a random variable where we have 1000 independent trials
(flights) with a probability of success (crash) being 0.035. Thus, X = Bin(1000, 0.0035),
and
P (X ≥ 2) = 1− P (X < 2)
= 1− (P (X = 0) + P (X + 1))
= 1−
((
1000
0
)
(.0035)0(1− .0035)1000 +
(
1000
1
)
(.0035)1(1− .0035)999
)
Alternatively, we could have wrote
P (X ≥ 2) =
1000∑
k=2
(
1000
k
)
(.0035)k(1− .0035)1000−k
(b) The sum you wrote in Part (a) is ridiculous to evaluate. Instead, approximate the value by
using a Poisson distribution. Do not leave your answer as an infinite sum here.
Solution: Let X ≈ Pois(λ) where
λ = np = 1000(0.0035) = 3.5 = E[X]
Recall that the pmf of a Poisson R.V. is pX(k) =
λk
k! e
−λ.
Then, with X = Pois(3.5),
P (X ≥ 2) = 1− P (X < 2)
= 1− (P (X = 0) + P (X = 1))
Page 6
= 1−
(
(3.5)0
0!
e−3.5 +
(3.5)1
1!
e−3.5
)
= 1− 4.5e−3.5
(c) Briefly explain why a Poisson distribution here is a good choice for approximation.
Solution: We can use a Poisson distribution to approximate a Binomial r.v. if the fol-
lowing hold:
1) n is large.
2) np is relatively small compared to n
In our case, n = 1000 and np = 1000 · 0.0035 = 3.5 which is relatively small compared to
n = 1000.
8.[ ] A Zombie Plague has affected the greater Santa Barbara Area! Thankfully, the disease has only
infected 5% of the population (for now...) Additionally, there exists a medical test to determine
whether someone has been infected by the plague; unfortunately, the test is not very good. The
test incorrectly classifies healthy people as diseased 20% of the time, and the test incorrectly clas-
sifies diseased people as healthy 15% of the time.
Head TA Ethan is a bit worried that he might be infected. To be cautious, he goes and takes 3
independent tests; two of these tests indicate he is healthy, but one of them indicates he is not.
With this information, what is the probability that Ethan is healthy (aside from a mild hankering
for brains...)?
Solution: Let H denote the event “Ethan is healthy” and T2 denote the event “two of the
tests were negative but one was positive.” With this notation, we wish to compute P(H | T2)
which, by Bayes’ Rule, is computed as
P(H | T2) = P(T2 | H) · P(H)
P(T2)
Since only 5% of the population is currently infected, we know that P(H) = 1− 0.05 = 0.95.
Now let’s examine P(T2 | H). Once we condition on the fact that Ethan is “healthy,” we
know that any randomly selected test will return a “healthy” result 80% of the time [1 - 20%
= probability that a healthy person is incorrectly classified as diseased]. Therefore, the event
(T2 | H) effectively boils down to computing the probability of 2 successes and 1 failure in 3
independent trials, where the probability of success is 0.80. The answer to this is
(
3
2
)
(0.8)2(0.2);
thus, we have
P(T2 | H) =
(
3
2
)
(0.80)2(0.20)
For the denominator of Bayes’ Rule, we use the Law of Total Probability to write
P(T2) = P(T2 | H) · P(H) + P(T2 | H∁) · P(H∁)
Page 7
The first term in the sum is one we have already computed. To compute the second term, we
utilize a similar logic; after conditioning on the fact that Ethan is not healthy, we know that
a “success” (i.e. a randomly selected test returning a “healthy” result) is 0.15 [as stated in
the problem]. Thus, we find
P(T2) = P(T2 | H) · P(H) + P(T2 | H∁) · P(H∁)
=
(
3
2
)
(0.80)2(0.20) · (0.95) +
(
3
2
)
(0.15)2(0.85) · (0.05)
and so, combining everything,
P(H | T2) =
(
3
2
)
(0.80)2(0.20) · (0.95)(
3
2
)
(0.80)2(0.20) · (0.95) + (32)(0.15)2(0.85) · (0.05) ≈ 0.9921
9.[ ] A bag contains 12 red marbles and 10 blue marbles. A friend reaches in and selects 5 balls at
random, with replacement. For each red marble drawn you win $1; for each blue marble you lose
$1. Let X denote your net winnings.
(a) Find the probability mass function (p.m.f.) of X.
Solution: Let N denote the number of red marbles drawn in a lot of 5; then N ∼
Bin(5, 12/22). What we see is that
{N = 0}⇐⇒{X = −5}
{N = 1}⇐⇒{X = −3}
{N = 2}⇐⇒{X = −1}
{N = 3}⇐⇒{X = 1}
{N = 4}⇐⇒{X = 3}
{N = 5}⇐⇒{X = 5}
This allows us to easily identify the state space of X as
SX = {−5, −3, −1, 1, 3, 5}
Additionally,
P(X = −5) = P(N = 0) =
(
5
0
)(
12
22
)0(10
22
)5
P(X = −3) = P(N = 1) =
(
5
1
)(
12
22
)1(10
22
)4
P(X = −1) = P(N = 2) =
(
5
2
)(
12
22
)2(10
22
)3
P(X = 1) = P(N = 3) =
(
5
3
)(
12
22
)3(10
22
)2
P(X = 3) = P(N = 4) =
(
5
4
)(
12
22
)4(10
22
)1
Page 8
P(X = 5) = P(N = 5) =
(
5
5
)(
12
22
)5(10
22
)0
(b) Suppose that instead of drawing with replacement your friend now draws 5 marbles without
replacement. Find the modified p.m.f. of X, under this new situation.
Solution: We can once again define N to be the number of red marbles in our sample
of 5; now, however, N follows the Hypergeometric(N = 50, G = 12, n = 5) distribution.
Once again the support of N is {0, 1, 2, 3, 4, 5} and so
SX = {−5, −3, −1, 1, 3, 5}
Now, however, our p.m.f. computations are slightly different from those in part (a):
P(X = −5) = P(N = 0) =
(
12
0
)(
10
5
)(
22
5
)
P(X = −3) = P(N = 1) =
(
12
1
)(
10
4
)(
22
5
)
P(X = −1) = P(N = 2) =
(
12
2
)(
10
3
)(
22
5
)
P(X = 1) = P(N = 3) =
(
12
3
)(
10
2
)(
22
5
)
P(X = 3) = P(N = 4) =
(
12
4
)(
10
1
)(
22
5
)
P(X = 5) = P(N = 5) =
(
12
5
)(
10
0
)(
22
5
)
10.[ ] Madame Gourmande prepares cookies with raisins and chocolate chips. She mixes 600 raisins and
400 chocolate chips in the dough and bakes 500 cookies. As soon as the cookies are ready, Madame
Gourmande chooses one at random to taste.
(a) Calculate the probability that there are no raisins in the cookie.
(b) Calculate the probability that there are exactly 2 chocolate chips.
(c) Calculate the probability that there are at least 2 pieces (raisins or chocolate chips).
Solution: Let X be the random variable “number or raisins in the biscuit”, Y “number or
chocolate chips” and Z “number of raisins and chocolate chips”.
(a) The random variable X follows a binomial X ∼ Bin(600, 1500) that we can approach by a
Poisson Pois(λ = 600 × 1500 = 1.2). The probability that there will not be any raisin in
Page 9
the biscuit is
P (X = 0) = e−1.2
1.20
0!
≃ 0.3.
(b) Following the same reasoning, Y ∼ Pois(λ = 400× 1400 = 0.8). Therefore, the probability
there will be exactly 2 chocolate chips is
P (Y = 2) = e0.8
0.82
2!
≃ 0.14.
(c) Finally, the random variable Z also follows a Poisson with parameter λ1000 × 1500 = 2
and the probability of finding at least two pieces is
P (Z ≥ 2) = 1− P (Z < 2) = 1− e−2 2
0
0!
− e−2 2
1
1!
≃ 0.59.
11.[ ] If X ∼ Pois(λ), compute the quantity ∑∞k=0 k · P(X = k). [We will give this sum a special name
next week!]
Solution:
∞∑
k=0
k · P(X = k) =
∞∑
k=0
k · e−λ · λ
k
k!
=
∞∑
k=1
k · e−λ · λ
k
k!
(k = 0 contributes nothing to the sum)
= e−λ ·
∞∑
k=1
k
k!
· λk
= e−λ ·
∞∑
k=1
k
(k · k − 1)! · λ
k
= e−λ ·
∞∑
k=1
λk−1 · λ
(k − 1)! (λ
k = λk−1 · λ)
= e−λ · λ ·
∞∑
n=0
λn
n!
= e−λ · λ · eλ = λ
Page 10


essay、essay代写