• Home
  • Textbooks
  • Probability and Computing
  • Events and Probability

Probability and Computing

Michael Mitzenmacher , Eli Upfal

Chapter 1

Events and Probability - all with Video Answers

Educators


Chapter Questions

View

Problem 1

We flip a fair coin ten times. Find the probability of the following events.
(a) The number of heads and the number of tails are equal.
(b) There are more heads than tails.
(c) The $i$ th flip and the $(11-i)$ th flip are the same for $i=1, \ldots, 5$.
(d) We flip at least four consecutive heads.

Rashmi Sinha
Rashmi Sinha
Numerade Educator
00:58

Problem 2

We roll two standard six-sided dice. Find the probability of the following events, assuming that the outcomes of the rolls are independent.
(a) The two dice show the same number.
(b) The number that appears on the first die is larger than the number on the second.
(c) The sum of the dice is even.
(d) The product of the dice is a perfect square.

Hossam Mohamed
Hossam Mohamed
Numerade Educator
02:54

Problem 3

We shuffle a standard deck of cards, obtaining a permutation that is vniform over all $52 !$ possible permutations. Find the probability of the following events.
(a) The first two cards include at least one ace.
(b) The first five cards include at least one ace.
(c) The first two cards are a pair of the same rank.
(d) The first five cards are all diamonds.
(e) The first five cards form a full house (three of one rank and two of another rank).

Aman Gupta
Aman Gupta
Numerade Educator
01:18

Problem 4

We are playing a tournament in which we stop as soon as one of us wins $n$ games. We are evenly matched, so each of us wins any game with probability $1 / 2$, independently of other games. What is the probability that the loser has won $k$ games when the match is over?

Lauren Shelton
Lauren Shelton
Numerade Educator
08:53

Problem 5

After lunch one day, Alice suggests to Bob the following method to determine who pays. Alice pulls three six-sided dice from her pocket. These dice are not the standard dice, but have the following numbers on their faces:
- $\operatorname{die} A-1,1,6,6,8,8 ;$
- die B $-2,2,4,4,9,9$
- die C $-3,3,5,5,7,7$.
The dice are fair, so each side comes up with equal probability. Alice explains that Alice and Bob will each pick up one of the dice. They will each roll their die, and the one who rolls the lowest number loses and will buy lunch. So as to take no advantage, Alice offers Bob the first choice of the dice.
(a) Suppose that Bob chooses die A and Alice chooses die B. Write out all of the possible events and their probabilities, and show that the probability that Alice wins is greater than $1 / 2$.
(b) Suppose that Bob chooses die B and Alice chooses die C. Write out all of the possible events and their probabilities, and show that the probability that Alice wins is greater than $1 / 2$.
(c) Since die A and die B lead to situations in Alice's favor, it would seem that Bob should choose die C. Suppose that Bob does choose die C and Alice chooses die A. Write out all of the possible events and their probabilities, and show that the probability that Alice wins is still greater than $1 / 2$.

Lourence Gonhovi
Lourence Gonhovi
Numerade Educator
02:07

Problem 6

Consider the following balls-and-bin game. We start with one black ball and one white ball in a bin. We repeatedly do the following: choose one ball from the bin uniformly at random, and then put the ball back in the bin with another ball of the same color. We repeat until there are $n$ balls in the bin. Show that the number of white balls is equally likely to be any number between 1 and $n-1$.

Nick Johnson
Nick Johnson
Numerade Educator
02:28

Problem 7

(a) Prove Lemma 3, the inclusion-exclusion principle.
(b) Prove that, when $\ell$ is odd,
$$
\begin{aligned}
\operatorname{Pr}\left(\bigcup_{i=1}^{n} E_{i}\right) \leq & \sum_{i=1}^{n} \operatorname{Pr}\left(E_{i}\right)-\sum_{i<j} \operatorname{Pr}\left(E_{i} \cap E_{j}\right) \\
&+\sum_{i<j<k} \operatorname{Pr}\left(E_{i} \cap E_{j} \cap E_{k}\right) \\
&-\cdots+(-1)^{\ell+1} \sum_{i_{1}<_{i}<\cdots<i \ell} \operatorname{Pr}\left(E_{i_{1}} \cap \cdots \cap E_{i_{\ell}}\right)
\end{aligned}
$$
(c) Prove that, when $\ell$ is even,
$$
\begin{aligned}
\operatorname{Pr}\left(\bigcup_{i=1}^{n} E_{i}\right) \geq \sum_{i=1}^{n} \operatorname{Pr}\left(E_{i}\right)-\sum_{i<j} \operatorname{Pr}\left(E_{i} \cap E_{j}\right) & \\
&+\sum_{i<j<k} \operatorname{Pr}\left(E_{i} \cap E_{j} \cap E_{k}\right) \\
&-\cdots+(-1)^{\ell+1} \sum_{i_{1}<i_{2}<\cdots<i_{t}} \operatorname{Pr}\left(E_{i_{1}} \cap \cdots \cap E_{i_{\ell}}\right)
\end{aligned}
$$

Aman Gupta
Aman Gupta
Numerade Educator
00:44

Problem 8

I choose a number uniformly at random from the range $[1,1,000,000]$. Using the inclusion-exclusion principle, determine the probability that the number chosen is divisible by one or more of 4,6, and $9 .$

AG
Ankit Gupta
Numerade Educator
02:24

Problem 9

Suppose that a fair coin is flipped $n$ times. For $k>0$, find an upper bound on the probability that there is a sequence of $\log _{2} n+k$ consecutive heads.

Amany Waheeb
Amany Waheeb
Numerade Educator
00:44

Problem 10

I have a fair coin and a two-headed coin. I choose one of the two coins randomly with equal probability and flip it. Given that the flip was heads, what is the probability that I flipped the two-headed coin?

Sheryl Ezze
Sheryl Ezze
Numerade Educator
02:23

Problem 11

1 am trying to send you a single bit, either a 0 or a 1 . When I transmit the bit, it goes through a series of $n$ relays before it arrives to you. Each relay flips the bit independently with probability $p$.
(a) Argue that the probability you receive the correct bit is
$$
\sum_{k=0}^{\lfloor n / 2\rfloor}\left(\begin{array}{c}
n \\
2 k
\end{array}\right) p^{2 k}(1-p)^{2 k}
$$ (b) We consider an alternative way to calculate this probability. Let us say the relay has bias $q$ if the probability it flips the bit is $(1-q) / 2$. The bias $q$ is therefore a real number in the range $[-1,1]$. Prove that sending a bit through two relays with bias $q_{1}$ and $q_{2}$ is equivalent to sending a bit through a single relay with bias $q_{1} q_{2}$.
(c) Prove that the probability you receive the correct bit when it passes through $n$ relays as described before (a) is
$$
\frac{1+(2 p-1)^{n}}{2}
$$

Nick Johnson
Nick Johnson
Numerade Educator
02:47

Problem 12

The following problem is known as the Monty Hall problem, after the host of the game show "Let's Make a Deal". There are three curtains. Behind one curtain is a new car, and behind the other two are goats. The game is played as follows. The contestant chooses the curtain that she thinks the car is behind. Monty then opens one of the other curtains to show a goat. (Monty may have more than one goat to choose from; in this case, assume he chooses which goat to show uniformly at random.) The contestant can then stay with the curtain she originally chose or switch to the other unopened curtain. After that, the location of the car is revealed, and the contestant wins the car or the remaining goat. Should the contestant switch curtains or not, or does it make no difference?

James Kiss
James Kiss
Numerade Educator
01:52

Problem 13

A medical company touts its new test for a certain genetic disorder. The false negative rate is small: if you have the disorder, the probability that the test returns a positive result is $0.999$. The false positive rate is also small: if you do not have the disorder, the probability that the test returns a positive result is only $0.005$. Assume that $2 \%$ of the population has the disorder. If a person chosen uniformly from the population is tested and the result comes back positive, what is the probability that the person has the disorder?

Kratika Bhadauria
Kratika Bhadauria
Numerade Educator
08:16

Problem 14

I am playing in a racquetball toumament, and I am up against a player I have watched but never played before. I consider three possibilities for my prior model: we are equally talented, and each of us is equally likely to win each game; I am slightly better, and therefore I win each game independently with probability $0.6$; or he is slightly better, and thus he wins each game independently with probability $0.6$. Before we play, I think that each of these three possibilities is equally likely.

In our match we play until one player wins three games. I win the second game, but he wins the first, third, and fourth. After this match, in my posterior model, with what probability should I believe that my opponent is slightly better than I am?

Christine Anacker
Christine Anacker
Numerade Educator
01:41

Problem 15

Suppose that we roll ten standard six-sided dice. What is the probability that their sum will be divisible by 6 , assuming that the rolls are independent? (Hint; Use the principle of deferred decisions, and consider the situation after rolling all but one of the dice.)

Nick Johnson
Nick Johnson
Numerade Educator
09:44

Problem 16

Consider the following game, played with three standard six-sided dice. If the player ends with all three dice showing the same number, she wins. The player starts by rolling all three dice. After this first roll, the player can select any one, two, or all of the three dice and re-roll them. After this second roll, the player can again select any of the three dice and re-roll them one final time. For questions (a) - (d), assume that the player uses the following optimal strategy: if all three dice match, the player stops and wins; if two dice match, the player re-rolls the die that does not match; and if no dice match, the player re-rolls them all.
(a) Find the probability that all three dice show the same number on the first roll.
(b) Find the probability that exactly two of the three dice show the same number on the first roll.
(c) Find the probability that the player wins, conditioned on exactly two of the three dice showing the same number on the first roll.
(d) By considering all possible sequences of rolls, find the probability that the player wins the game.

RC
Reagan Chuang
Numerade Educator
01:47

Problem 17

In our matrix multiplication algorithm, we worked over the integers modulo 2. Explain how the analysis would change if we worked over the integers modulo $k$ for $k>2$.

Jacob Denson
Jacob Denson
Numerade Educator
02:39

Problem 18

We have a function $F:\{0, \ldots, n-1\} \rightarrow\{0, \ldots, m-1\} .$ We know that, for $0 \leq x, y \leq n-1, F((x+y) \bmod n)=(F(x)+F(y)) \bmod m$. The only way we have for evaluating $F$ is to use a lookup table that stores the values of $F$. Unfortunately, an Evil Adversary has changed the value of $1 / 5$ of the table entries when we were not looking.

Describe a simple randomized algorithm that, given an input $z$, outputs a value that equals $F(z)$ with probability at least $1 / 2$. Your algorithm should work for every value of $z_{*}$ regardless of what values the Adversary changed. Your algorithm should use as few lookups and as little computation as possible.

Suppose I allow you to repeat your initial algorithm three times. What should you do in this case, and what is the probability that your enhanced algorithm retums the correct answer?

Lourence Gonhovi
Lourence Gonhovi
Numerade Educator
01:34

Problem 19

Give examples of events where $\operatorname{Pr}(A \mid B)<\operatorname{Pr}(A), \operatorname{Pr}(A \mid B)=$ $\operatorname{Pr}(A)$, and $\operatorname{Pr}(A \mid B)>\operatorname{Pr}(A) .$

Christopher Stanley
Christopher Stanley
Numerade Educator
03:41

Problem 20

Show that, if $E_{1}, E_{2}, \ldots, E_{n}$ are mutually independent, then so are $\bar{E}_{1}, \bar{E}_{2}, \ldots, \bar{E}_{n}$

Ivan Kochetkov
Ivan Kochetkov
Numerade Educator
01:06

Problem 21

Give an example of three random events $X, Y, Z$ for which any pair are independent but all three are not mutually independent.

Harsh Gadhiya
Harsh Gadhiya
Numerade Educator
03:31

Problem 22

(a) Consider the set $\{1, \ldots, n\}$. We generate a subset $X$ of this set as follows: a fair coin is flipped independently for each element of the set; if the coin lands heads then the element is added to $X$, and otherwise it is not. Argue that the resulting set $X$ is equally likely to be any one of the $2^{n}$ possible subsets. (b) Suppose that two sets $X$ and $Y$ are chosen independently and uniformly at random from all the $2^{n}$ subsets of $\left\{1_{+} \ldots, n\right\} .$ Determine $\operatorname{Pr}(X \subseteq Y)$ and $\operatorname{Pr}(X \cup Y=$ $\{1, \ldots, n\})$. (Hint: Use the part (a) of this problem.)

Manisha Sarker
Manisha Sarker
Numerade Educator
02:14

Problem 23

There may be several different min-cut sets in a graph. Using the analysis of the randomized min-cut algorithm, argue that there can be at most $n(n-1) / 2$ distinct min-cut sets.

Adriano Chikande
Adriano Chikande
Numerade Educator
00:36

Problem 24

Generalizing on the notion of a cut-set, we define an $r$-way cut-set in a graph as a set of edges whose removal breaks the graph into $r$ or more connected components. Explain how the randomized min-cut algorithm can be used to find minimum $r$-way cut-sets, and bound the probability that it succeeds in one iteration.

WZ
Wen Zheng
Numerade Educator
06:59

Problem 25

To improve the probability of success of the randomized min-cut algorithm, it can be run multiple times.
(a) Consider running the algorithm twice. Determine the number of edge contractions and bound the probability of finding a min-cut.
(b) Consider the following variation. Starting with a graph with $n$ vertices, first contract the graph down to $k$ vertices using the randomized min-cut algorithm. Make copies of the graph with $k$ vertices, and now run the randomized algorithm on this reduced graph $\ell$ times, independently. Determine the number of edge contractions and bound the probability of finding a minimum cut.
(c) Find optimal (or at least near-optimal) values of $k$ and $\ell$ for the variation in (b) that maximize the probability of finding a minimum cut while asing the same number of edge contractions as running the original algorithm twice.

Chris Trentman
Chris Trentman
Numerade Educator
07:10

Problem 26

Tic-tac-toe always ends up in a tie if players play optimally. Instead, we may consider random variations of tic-tac-toe.
(a) First variation: Each of the nine squares is labeled either $\mathrm{X}$ or $\mathrm{O}$ according to an independent and uniform coin flip. If only one of the players has one (or more) winning tic-tac-toe combinations, that player wins. Otherwise, the game is a tie. Determine the probability that $\mathrm{X}$ wins. (You may want to use a computer program to help run through the configurations.)
(b) Second variation: $\mathrm{X}$ and $\mathrm{O}$ take tums, with the $\mathrm{X}$ player going first. On the $\mathrm{X}$ player's turn, an $\mathrm{X}$ is placed on a square chosen independently and uniformly at random from the squares that are still vacant; O plays similarly. The first player to bave a winning tic-tac-toe combination wins the game, and a tie occurs if neither player achieves a winning combination. Find the probability that each player wins. (Again, you may want to write a program to help you.)

Morgan Cheatham
Morgan Cheatham
Numerade Educator