CS 2800 - Mathematical Foundations of Computing
HW9: Probability I
Spring 2026
Due: 4/7/2025, 10:00pm
Collaborators:
Short-Answer Questions:
1.
(a) A team of five kids is randomly chosen from a class of 20 students. An outcome of the
selection process is the set of five kids selected. What is the size of the sample space?
(b) A group of seven kids line up in a random order. Each ordering of the kids is equally
likely. There are three girls and four boys in the group. What is the probability that all
the girls are ahead of all the boys? Round your answer to the nearest three decimals.
(c) A red die and a blue die are thrown. The dice are both equally likely to land on any of
their six sides. What is the probability that the numbers on the two dice are different?
Round your answer to the nearest three decimals.
(d) A fair coin is flipped 10 times. What is the probability that the first flip comes up heads
or exactly five flips come up heads (or both)? Round your answer to the nearest three
decimals.
(e) 5 students pick out of 10 possible research topics to write a paper on. Suppose they
are each equally likely to choose any topic, and that they make their choices independently of each other.
What is the probability that at least 2 of them picked the same topic? Round the
answer to the nearest three decimal places.
(f) A fair coin is flipped n ≥ 3 times. What is the probability that the resulting sequence
starts and ends with heads, has at least one tails, and all tails appear consecutively?
(In other words, the sequence starts with one or more heads, then has one or more
tails, and finally one or more heads).
n+2
◯
2n
n(n − 1)
◯
2n
n(n + 2)
◯
2n
◯
(n−1
)
2
2n
2. An experiment is performed and four events (A, B, C, and D) are defined over the set of all
possible outcomes. The probabilities of the four events and their intersections are given in
the table below.
Copyright held by the authors. All rights reserved. (Do not post this online.)
1
P r(A) = 13
P r(A ∩ B) = 16
1
P r(A ∩ B ∩ C) = 24
P r(B) = 21
1
P r(A ∩ C) = 12
P r(A ∩ B ∩ D) = 0
P r(C) = 41
P r(A ∩ D) = 91
1
P r(A ∩ C ∩ D) = 24
P r(D) = 13
P r(B ∩ C) = 81
P r(B ∩ C ∩ D) = 0
P r(B ∩ D) = 0
P r(A ∩ B ∩ C ∩ D) = 0
1
P r(C ∩ D) = 12
(a) What is Pr(A ∣ B)? (Round your answer to three decimals.)
What is Pr(B ∣ A)? (Round your answer to three decimals.)
(b) Which of the following pairs of events are independent?
A and C
A and D
B and C
B and D
B and C
B and D
(c) Which pairs of events are disjoint?
A and C
A and D
(d) Which of the following sets of events are pairwise independent?
A, B, C
A, B, D
A, C, D
B, C, D
None of the above
(e) Which of the following sets of events are mutually independent?
A, B, C
A, B, D
A, C, D
B, C, D
None of the above
3. A chip company has two manufacturing plants. Plant A produces 40% of the chips and
Plant B produces 60% of the chips produced by the company.
(a) Suppose the company knows that 2% of the chips produced by plant A are defective
and 1% of the chips produced by plant B are defective. What proportion of chips
produced by the company is defective?
Round your answer to three decimals.
(b) As in the previous part, suppose the company knows that 2% of the chips produced
by plant A are defective and 1% of the chips produced by plant B are defective. If a
randomly chosen chip produced by the company is defective, what is the probability
that the chip came from plant A? Round your answer to the nearest three decimals.
4. Suppose Erin is picking outfits. Erin only has red and blue shirts, and they are x times more
likely to pick a blue shirt than a red shirt. They are y times more likely to pick jeans if they
already chose the red shirt, than they are to pick jeans when they already chose the blue
shirt.
Copyright held by the authors. All rights reserved. (Do not post this online.)
2
(a) Let B be the event Erin picks the blue shirt, R the event Erin picks the red shirt, and J
the event Erin picks jeans. What set of equations models this information correctly?
◯ Pr(B) = xPr(R); Pr(J ∣ R) = yPr(J ∣ B)
◯ Pr(R) = xPr(B); Pr(J ∣ B) = yPr(B ∣ J)
◯ Pr(B) = xPr(R); Pr(R ∣ J) = yPr(B ∣ J)
◯ Pr(R) = yPr(B); Pr(J ∣ B) = xPr(B ∣ J)
(b) Continuing from the previous problem, suppose we know that Erin is wearing jeans.
Which choice for x and y ensure that probability that Erin is wearing a red shirt is
greater than 1/2?
◯x>y
5.
◯ x<y
◯ any choice of x and y
◯ no choice of x and y
(a) 10 indistinguishable balls are thrown into three distinguishable bins; each ball is equally
likely to go into any of the bins. Let Y be the random variable that indicates the number of balls in the middle bin. What is the probability that Y = 8? Round your answer
to three decimals.
(b) What is the name of the distribution of Y ?
◯ uniform
◯ geometric
◯ bernoulli
◯ binomial
(c) Indistinguishable balls are thrown into three distinguishable bins; each ball is equally
likely to go into any of the bins. Let Z be the random variable that indicates the
number of balls that you have thrown at the moment when you first get a ball in the
middle bin. What is the probability that Z = 8? Round your answer to three decimals.
(d) What is the name of the distribution of Z?
◯ uniform
◯ geometric
◯ bernoulli
◯ binomial
Long-Answer Questions:
In these problems, we care about your explanations at least as much as your answers. Make sure to
clearly define the events and probabilities of interest, and to clearly reference any application of the
definitions, properties, and lemmas we’ve seen in the lectures.
1. A 52-card deck is thoroughly shuffled and you are dealt a hand of 13 cards. You should
assume every possible hand of 13 cards is equally likely. You are hoping for a hand with
two aces.
Answer the following three questions, making sure to introduce appropriate notation, and
to clearly show how you computed your answer.
(a) What is the probability that you have at least two aces?
(b) Your friend peaks at your cards and tells you she sees an ace. Given this information,
what is the probability that you have at least two aces?
Copyright held by the authors. All rights reserved. (Do not post this online.)
3
(c) She now gives you the additional information that the ace she saw was the ace of
spades. Does this change the probability that you have at least two aces? Fully show
your reasoning.
2. You are monitoring traffic from five servers in a distributed system. The servers are labeled
1, 2, 3, 4, 5, and you know that four of the servers run correctly, but that one of them is
buggy, and tends to produce more malformed packets. However, you don’t know which
one is the buggy server.
Each server handles thousands of requests per minute, so based on historical logs you know
a good server produces malformed packets with probability 0.03, and a buggy server produces malformed packets with probability 0.15. You should assume the events that different
packets are malformed are mutually independent.
(a) Let Ai be the event that the i-th server is the buggy server. Give the prior probability
of A1 , A2 , . . . , A5 .
(b) You capture 10 packets from server 1, and find that 2 of them are malformed. Let’s
call this event B.
Use the Law of Total Probability to find Pr(B).
(c) Use Bayes’ rule to compute the posterior probability of A1 , A2 , . . . , A5 , given that
there were 2 malformed packets in the 10 packets captured from server 1. Which is
the most likely to be the buggy server?
(d) You capture 20 more packets from server 1, and found 0 malformed packets. Use
Bayes’ rule to update the posterior probability. Is server 1 still most likely to be the
buggy server?
(e) In Bayesian Inference, we often gather more observations (evidence) over time, and
want to repeatedly update our probability of an event A conditioned on the available
′
evidence. Suppose after observing B, we observe additional evidence B . There are
′
two ways of computing Pr(A ∣ B ∩ B ):
• By treating B̃ = B ∩ B as the “total evidence” and computing Pr(A ∣ B ∩ B )
as
′
Pr(B ∩ B ∣ A)
′
Pr(A ∣ B ∩ B ) = Pr(A)
Pr(B ∩ B ′ )
′
′
• After first observing B, we essentially “shrink your sample space” to only consider future Bayesian updates fully conditioned on B. That means we can also
′
compute P r(A ∣ B ∩ B ) as
Pr(B ∣ A ∩ B)
P r(A ∣ B ∩ B ) = Pr(A ∣ B)
Pr(B ′ ∣ B)
′
′
Which of these two methods did you use in (d)?
Optional: It should be helpful practice to compute the answer to (d) using the alternative method (you should get the same answer, but your work will look different).
Copyright held by the authors. All rights reserved. (Do not post this online.)
4
(f) Optional, extra practice.
Next, you capture 50 packets from server 2, and you find that 8 of them are malformed.
Compute updated posterior probabilities of A1 , A2 , . . . , A5 (and we recommend using
the second method from (e)); which server is most likely to be the buggy server?
Copyright held by the authors. All rights reserved. (Do not post this online.)
5