• Home
  • Textbooks
  • Probability and Computing
  • Moments and Deviations

Probability and Computing

Michael Mitzenmacher , Eli Upfal

Chapter 3

Moments and Deviations - all with Video Answers

Educators


Chapter Questions

01:00

Problem 1

Let $X$ be a number chosen uniformly at random from $[1, n]$. Find $\operatorname{Var}[X]$.

Nick Johnson
Nick Johnson
Numerade Educator
05:22

Problem 2

Let $X$ be a number chosen uniformly at random from $[-k, k]$. Find $\operatorname{Var}[X]$.

Sanchit Jain
Sanchit Jain
Numerade Educator
05:36

Problem 3

Suppose that we roll a standard fair die 100 times. Let $X$ be the sum of the numbers that appear over the 100 rolls. Use Chebyshev's inequality to bound $\operatorname{Pr}(|X-350| \geq 50)$.

Amany Waheeb
Amany Waheeb
Numerade Educator
01:23

Problem 4

Prove that, for any real number $c$ and any discrete random variable $X$, $\operatorname{Var}[c X]=c^{2} \operatorname{Var}[X] .$

Yingtai Xiao
Yingtai Xiao
Numerade Educator
01:51

Problem 5

Given any two random variables $X$ and $Y$, by the linearity of expectations we have $\mathbf{E}[X-Y]=\mathbf{E}[X]-\mathbf{E}[Y]$. Prove that, when $X$ and $Y$ are independent, $\operatorname{Var}[X-Y]=\operatorname{Var}[X]+\operatorname{Var}[Y] .$

Aman Gupta
Aman Gupta
Numerade Educator
15:03

Problem 6

For a coin that comes up heads independently with probability $p$ on each flip, what is the variance in the number of flips until the $k$ th head appears?

Mengchun Cai
Mengchun Cai
Numerade Educator
04:11

Problem 7

A simple model of the stock market suggests that, each day, a stock with price $q$ will increase by a factor $r>1$ to $q r$ with probability $p$ and will fall to $q / r$ with probability $1-p$. Assuming we start with a stock with price 1 , find a formula for the expected value and the variance of the price of the stock after $d$ days.

Amany Waheeb
Amany Waheeb
Numerade Educator
04:04

Problem 8

Suppose that we have an algorithm that takes as input a string of $n$ bits. We are told that the expected running time is $O\left(n^{2}\right)$ if the input bits are chosen independently and uniformly at random. What can Markov's inequality tell us about the worst-case running time of this algorithm on inputs of size $n$ ?

James Chok
James Chok
Numerade Educator
05:46

Problem 9

(a) Let $X$ be the sum of Bernoulli random variables, $X=\sum_{i=1}^{n} X_{1}$. The $X_{\imath}$ do not need to be independent. Show that
$$
\mathbf{E}\left[X^{2}\right]=\sum_{i=1}^{n} \operatorname{Pr}\left(X_{i}=1\right) \mathbf{E}\left[X \mid X_{i}=1\right]
$$
Hint: Start by showing that
$$
\mathbf{E}\left[X^{2}\right]=\sum_{i=1}^{n} \mathbf{E}\left[X_{i} X\right]
$$
and then apply conditional expectations.
(b) Use Eqn. (3.5) to provide another derivation for the variance of a binomial random variable with parameters $n$ and $p$.

Mengchun Cai
Mengchun Cai
Numerade Educator
02:33

Problem 10

For a geometric random variable $X$, find $\mathbf{E}\left[X^{3}\right]$ and $\mathbf{E}\left[X^{4}\right]$. (Hint: Use Lemma 2.5.)

Manik Pulyani
Manik Pulyani
Numerade Educator
01:33

Problem 11

Recall the Bubblesort algorithm of Exercise 2.22. Determine the variance of the number of inversions that need to be corrected by Bubblesort.

Lindsay El
Lindsay El
Numerade Educator
07:55

Problem 12

Find an example of a random variable with finite expectation and unbounded variance. Give a clear argument showing that your choice has these properties.

Bryan Lynn
Bryan Lynn
Numerade Educator
02:39

Problem 13

Find an example of a random variable with finite $j$ th moments for $1 \leq$ $j \leq k$ but an unbounded $(k+1)$ th moment. Give a clear argument showing that your choice has these properties.

SS
Sagar Singh
Numerade Educator
02:00

Problem 14

Prove that, for any finite collection of random variables $X_{1}, X_{2}, \ldots, X_{n}$,
$$
\operatorname{Var}\left[\sum_{i=1}^{n} X_{i}\right]=\sum_{i=1}^{n} \operatorname{Var}\left[X_{i}\right]+2 \sum_{i=1}^{n} \sum_{j>i} \operatorname{Cov}\left(X_{i}, X_{j}\right)
$$

Hunza Gilgit
Hunza Gilgit
Numerade Educator
02:00

Problem 15

Let the random variable $X$ be representable as a sum of random variables $X=\sum_{i=1}^{n} X_{i} .$ Show that, if $\mathbf{E}\left[X_{i} X_{j}\right]=\mathbf{E}\left[X_{i}\right] \mathbf{E}\left[X_{j}\right]$ for every pair of $i$ and $j$ with $1 \leq i<j \leq n$, then $\operatorname{Var}[X]=\sum_{i=1}^{n} \operatorname{Var}\left[X_{i}\right]$.

Hunza Gilgit
Hunza Gilgit
Numerade Educator
View

Problem 16

This problem shows that Markov's inequality is as tight as it could possibly be. Given a positive integer $k$, describe a random variable $X$ that assumes only nonnegative values such that
$$
\operatorname{Pr}(\boldsymbol{X} \geq k \mathbf{E}[X])=\frac{1}{k}
$$

Rashmi Sinha
Rashmi Sinha
Numerade Educator
View

Problem 17

Can you give an example (similar to that for Markov's inequality in Exercise 3.16) that shows that Chebyshev's inequality is tight? If not, explain why not.

Rashmi Sinha
Rashmi Sinha
Numerade Educator
03:22

Problem 18

Show that, for a random variable $X$ with standard deviation $\sigma[X]$ and any positive real number $t$ :
(a) $\operatorname{Pr}(X-\mathbf{E}[X] \geq t \sigma[X]) \leq \frac{1}{1+t^{2}}$
(b) $\operatorname{Pr}(|X-\mathbf{E}[X]| \geq t \sigma[X]) \leq \frac{2}{1+t^{2}}$.

SS
Sagar Singh
Numerade Educator
03:07

Problem 19

Let $Y$ be a nonnegative integer-valued random variable with positive expectation. Prove
$$
\frac{\mathbf{E}[Y]^{2}}{\mathbf{E}\left[Y^{2}\right]} \leq \operatorname{Pr}[Y \neq 0] \leq \mathbf{E}[Y] .
$$

Christopher Stanley
Christopher Stanley
Numerade Educator
01:56

Problem 20

(a) Chebyshev's inequality uses the variance of a random variable to bound its deviation from its expectation. We can also use higher moments. Suppose that we have a random variable $X$ and an even integer $k$ for which $\mathbf{E}\left[(X-\mathbf{E}[X])^{k}\right]$ is finite. Show that
$$
\operatorname{Pr}\left(|X-\mathbf{E}[X]|>t \sqrt[k]{\mathbf{E}\left[(X-\mathbf{E}[X])^{k}\right]}\right) \leq \frac{1}{t^{k}}
$$
(b) Why is it difficult to derive a similar inequality when $k$ is odd?

SS
Sagar Singh
Numerade Educator
06:44

Problem 21

A fixed point of a permutation $\pi:[1, n] \rightarrow[1, n]$ is a value for which $\pi(x)=x$. Find the variance in the number of fixed points of a permutation chosen uniformly at random from all permutations. (Hint: Let $X_{i}$ be 1 if $\pi(i)=i$, so that $\sum_{i=1}^{n} X_{i}$ is the number of fixed points. You cannot use linearity to find $\operatorname{Var}\left[\sum_{i=1}^{n} X_{i}\right]$, but you can calculate it directly.)

Bryan Lynn
Bryan Lynn
Numerade Educator
02:22

Problem 22

Suppose that we flip a fair coin $n$ times to obtain $n$ random bits. Consider all $m=\left(\begin{array}{l}n \\ 2\end{array}\right)$ pairs of these bits in some order. Let $Y_{i}$ be the exclusive-or of the $i$ th pair of bits, and let $Y=\sum_{i=1}^{m} Y_{i}$ be the number of $Y_{i}$ that equal 1 .
(a) Show that each $Y_{i}$ is 0 with probability $1 / 2$ and 1 with probability $1 / 2 .$
(b) Show that the $Y_{t}$ are not mutually independent.
(c) Show that the $Y_{t}$ satisfy the property that $\mathbf{E}\left[Y_{i} Y_{j}\right]=\mathbf{E}\left[Y_{i}\right] \mathbf{E}\left[Y_{j}\right]$.
(d) Using Exercise 3.15, find $\operatorname{Var}[Y]$.
(e) Using Chebyshev's inequality, prove a bound on $\operatorname{Pr}(|Y-\mathbf{E}[Y]| \geq n)$.

Hunza Gilgit
Hunza Gilgit
Numerade Educator
02:58

Problem 23

Generalize the median-finding algorithm for the case where the input $S$ is a multi-set. Prove that your resulting algorithm is correct, and bound its running time.

James Chok
James Chok
Numerade Educator
05:29

Problem 24

Generalize the median-finding algorithm to find the $k$ th largest item in a set of $n$ items for any given value of $k$. Prove that your resulting algorithm is correct, and bound its running time.

Narayan Hari
Narayan Hari
Numerade Educator
04:48

Problem 25

The weak law of large numbers states that, if $X_{1}, X_{2}, X_{3}, \ldots$ are independent and identically distributed random variables with mean $\mu$ and standard deviation $\sigma$, then for any constant $\varepsilon>0$ we have
$$
\lim _{n \rightarrow \infty} \operatorname{Pr}\left(\left|\frac{X_{1}+X_{2}+\cdots+X_{n}}{n}-\mu\right|>\varepsilon\right)=0 \text {. }
$$
Use Chebyshev's inequality to prove the weak law of large numbers.

Abhirup Pal
Abhirup Pal
Numerade Educator