Many parts of this book deal with discrete probabilities , namely with a finite or countably infinite set Ω of atomic events ω, each of which has a given probability Pr(ω), where
0 ≤ Pr( ω ) ≤ 1 and ∑ ω ∈ Ω Pr( ω ) \= 1. ( 1 )
This set Ω, together with the function Pr, is called a “probability space.” For example, Ω might be the set of all ways to shuffle a pack of 52 playing cards, with Pr(ω)= 1/52! for every such arrangement.
An event is, intuitively, a proposition that can be either true or false with certain probability. It might, for instance, be the statement “the top card is an ace,” with probability 1/13. Formally, an event A is a subset of Ω, namely the set of all atomic events for which the corresponding proposition A is true; and
Pr( A ) = ∑ ω ∈ A Pr( ω ) \= ∑ ω ∈ Ω Pr( ω )[ ω ∈ A ]. ( 2 )
A random variable is a function that assigns a value to every atomic event. We typically use uppercase letters for random variables, and lowercase letters for the values that they might assume; thus, we might say that the probability of the event X = x is Pr( X = x ) = ∑ ω∈Ω Pr( ω )[ X ( ω )= x ]. In our playing card example, the top card T is a random variable, and we have Pr( T = 𝓠♠) = 1/52. (Sometimes, as here, the lowercase-letter convention is ignored.)
The random variables X 1 , ... , X k are said to be independent if
Pr( X 1 \= x 1 and ⋅ ⋅ ⋅ and X k \= x k ) \= Pr ( X 1 \= x 1 ) . . . Pr( X k \= x k ) ( 3 )
for all ( x 1 ,..., x k ). For example, if F and S denote the face value and suit of the top card T , clearly F and S are independent. Hence in particular we have Pr( T = 𝓠♠) = Pr( F = 𝓠) Pr( S = ♠). But T is not independent of the bottom card, B ; indeed, we have Pr( T = t and B = b ) ≠ 1/52 2 for any cards t and b .
A system of n random variables is called k -wise independent if no k of its variables are dependent. With pairwise (2-wise) independence, for example, we could have variable X independent of Y , variable Y independent of Z , and variable Z independent of X ; yet all three variables needn’t be independent (see exercise 6 ). Similarly, k -wise independence does not imply ( k + 1)-wise independence. But ( k + 1)-wise independence does imply k -wise independence.
The conditional probability of an event A , given an event B , is
Pr ( A | B ) \= Pr( A ∩ B ) Pr( B ) \= Pr( A and B ) Pr( B ) , ( 4 )
when Pr( B ) > 0, otherwise it’s Pr( A ). Imagine breaking the whole space Ω into two parts, Ω′ = B and Ω " \= B ¯ \= Ω \ B , with Pr(Ω′) = Pr( B ) and Pr(Ω″) = 1 − Pr( B ). If 0 < Pr( B ) < 1, and if we assign new probabilities by the rules
we obtain new probability spaces Ω′ and Ω″, allowing us to contemplate a world where B is always true and another world where B is always false. It’s like taking two branches in a tree, each of which has its own logic. Conditional probability is important for the analysis of algorithms because algorithms often get into different states where different probabilities are relevant. Notice that we always have
Pr( A ) = Pr( A | B ) ⋅ Pr( B ) + Pr( A | B ¯ ) ⋅ Pr( B ¯ ). ( 5 )
The events A 1 , ... , A k are said to be independent if the random variables [ A 1 ], ... , [ A k ] are independent. ( Bracket notation applies in the usual way to events-as-statements, not just to events-as-subsets: [ A ] = 1if A is true, otherwise [ A ] = 0.) Exercise 20 proves that this happens if and only if
Pr ( ∩ j ∈ J A j ) \= ∏ j ∈ J Pr( A j ), for all J ⊆ { 1 , . . . , k } . ( 6 )
In particular, events A and B are independent if and only if Pr( A | B ) = Pr( A ).
When the values of a random variable X are real numbers or complex numbers, we’ve defined its expected value E X in Section 1.2.10: We said that
E X \= ∑ ω ∈ Ω X ( ω ) Pr ( ω ) \= ∑ x x Pr ( X \= x ) , ( 7 )
provided that this definition makes sense when the sums are taken over infinitely many nonzero values. (The sum should be absolutely convergent.) A simple but extremely important case arises when A is any event, and when X = [ A ] is a binary random variable representing the truth of that event; then
E[ A ] \= ∑ ω ∈ Ω [ A ] ( ω ) Pr ( ω ) \= ∑ ω ∈ Ω [ ω ∈ A ] Pr ( ω ) \= ∑ ω ∈ A Pr ( ω ) \= Pr ( A ) . ( 8 )
We’ve also noted that the expectation of a sum, E( X 1 + ··· + X k ), always equals the sum of the expectations, (E X 1 )+ ··· +(E X k ), whether or not the random variables X j are independent. Furthermore the expectation of a product, E X 1 ...X k , is the product of the expectations, (E X 1 ) ... (E X k ), if those variables do happen to be independent. In Section 3.3.2 we defined the covariance,
cover ( X , Y ) \= E ( ( X − E X ) ( Y − E Y ) ) \= E ( X Y ) − ( E X ) ( E Y ) , ( 9 )
which tends to measure the way X and Y depend on each other. The variance, var( X ), is covar( X, X ); the middle formula in ( 9 ) shows why it is nonnegative whenever the random variable X takes on only real values.
All of these notions of expected value carry over to conditional expectation ,
E ( X | A ) \= ∑ ω ∈ A X ( ω ) Pr ( ω ) Pr ( A ) \= ∑ x x Pr ( X \= x and A ) Pr ( A ) , ( 10 )
conditioned on any event A , when we want to work in the probability space for which A is true. (If Pr( A ) = 0, we define E( X | A ) = E X .) One of the most important formulas, analogous to ( 5 ), is
E X \= ∑ y E ( X | Y \= y ) Pr( Y \= y ) \= ∑ y ∑ x x Pr ( X \= x | Y \= y ) Pr( Y \= y ). ( 11 )
Furthermore there’s also another important kind of conditional expectation: When X and Y are random variables, it’s often helpful to write ‘E( X | Y )’ for “the expectation of X given Y .” Using that notation, Eq. ( 11 ) becomes simply
E X \= E(E ( X | Y )). ( 12 )
This is a truly marvelous identity, great for hand-waving and for impressing outsiders — except that it can be confusing until you understand what it means.
In the first place, if Y is a Boolean variable, ‘E( X | Y )’ might look as if it means ‘E( X | Y = 1)’, thus asserting that Y is true, just as ‘E( X | A )’ asserts the truth of A in ( 10 ). No; that interpretation is wrong, quite wrong. Be warned.
In the second place, you might think of E( X | Y ) as a function of Y . Well, yes; but the best way to understand E( X | Y ) is to regard it as a random variable . That’s why we’re allowed to compute its expected value in ( 12 ).
All random variables are functions of the atomic events ω . The value of E( X | Y ) at ω is the average of X ( ω ′) over all events ω ′ such that Y ( ω ′)= Y ( ω ):
E( X | Y )( ω ) = ∑ ω ′ ∈ Ω X ( ω ′ ) Pr ( ω ′ ) [ Y ( ω ′ ) ] / Pr ( Y \= Y ( ω ) ) . ( 13 )
Similarly, E( X | Y 1 ,..., Y r ) averages over events with Y j ( ω ′)= Y j ( ω ) for 1≤ j ≤ r .
For example, suppose X 1 through X n are binary random variables constrained by the condition that ν ( X 1 ... X n ) = X 1 + ···+ X n = m , where m and n are constants with 0 ≤ m ≤ n ; all ( n m ) such bit vectors X 1 ... X n are assumed to be equally likely. Clearly E X 1 = m/n . But what is E( X 2 | X 1 )? If X 1 = 0, the expectation of X 2 is m/ ( n − 1); otherwise that expectation is ( m − 1)/( n − 1); consequently E( X 2 | X 1 ) = ( m − X 1 )/( n −1). And what is E( X k | X 1 ,..., X k −1 )? The answer is easy, once you get used to the notation: If ν ( X 1 ... X k −1 ) = r , then X k ... X n is a random bit vector with ν ( X k ... X n ) = m − r ; hence the average value of X k will be ( m − r )/( n + 1 − k ) in that case. We conclude that
E X k | X 1 , . . . , X k − 1 \= m − v ( X 1 . . . X k − 1 ) n + 1 − k , for 1 ≤ k ≤ n . ( 14 )
The random variables on both sides of these equations are the same.
Inequalities
In practice we often want to prove that certain events are rare, in the sense that they occur with very small probability. Conversely, our goal is sometimes to show that an event is not rare. And we’re in luck, because mathematicians have devised several fairly easy ways to derive upper bounds or lower bounds on probabilities, even when the exact values are unknown.
We’ve already discussed the most important technique of this kind in Section 1.2.10. Stated in highly general terms, the basic idea can be formulated as follows: Let f be any nonnegative function such that f ( x ) ≥ s > 0 when x ∈ S. Then
Pr ( X ∈ S ) ≤ E f ( X ) / s , ( 15 )
provided that Pr( X ∈ S ) and E f ( X ) both exist. For example, f ( x ) = | x | yields
Pr ( | X | ≥ m ) ≤ E | X | / m ( 16 )
whenever m > 0. The proof is amazingly simple, because we obviously have
E f ( X ) ≥ Pr( X ∈ S ) ⋅ s + Pr( X ∉ S ) ⋅ 0. ( 17 )
Formula ( 15 ) is often called Markov’s inequality , because A. A. Markov discussed the special case f ( x ) = | x | a in
Imp . Akad. Nauk (6) 1 (1907), 707–714. If we set f ( x ) = ( x − E X ) 2 , we get the famous 19th-century inequality of Bienaymé and Chebyshev:
Pr(| X − E X | ≥ r ) ≤ var ( X ) / r 2 . ( 18 )
The case f ( x )= e ax is also extremely useful.
Another fundamental estimate, known as Jensen’s inequality [ Acta Mathematica 30 (1906), 175–193], applies to convex functions f ; we’ve seen it so far only as a “hint” to exercise 6.2.2–36(!). The real-valued function f is said to be convex in an interval I of the real line, and − f is said to be concave in I , if
f ( p x + q y ) ≤ p f ( x ) + q f ( y ) for all x , y ∈ I , ( 19 )
whenever p ≥ 0, q ≥ 0, and p + q = 1. This condition turns out to be equivalent to saying that f ″( x ) ≥ 0 for all x ∈ I , if f has a second derivative f ″. For example, the functions e ax and x 2 n are convex for all constants a and all nonnegative integers n ; and if we restrict consideration to positive values of x , then f ( x ) = x n is convex for all integers n (notably f ( x ) = 1/ x when n = −1). The functions ln(1/ x ) and x ln x are also convex for x > 0. Jensen’s inequality states that
f ( E X ) ≤ E f ( X ) ( 20 )
when f is convex in the interval I and the random variable X takes values only in I . (See exercise 42 for a proof.) For example, we have 1/ E X ≤ E(1/ X ) and ln E X ≥ Eln X and (E X )ln E X ≤ E( X ln X ), when X is positive, since the function ln x is concave for x > 0. Notice that ( 20 ) actually reduces to the very definition of convexity, ( 19 ), in the special case when X = x with probability p and X = y with probability q = 1 − p .
Next on our list of remarkably useful inequalities are two classical results that apply to any random variable X whose values are nonnegative integers:
Pr( X > 0 ) ≤ E X ; ( “ the first moment principle ” ) ( 21 )
Pr( X > 0 ) ≥ ( E X ) 2 / ( E X 2 ) . ( “ the second moment principle ” ) ( 22 )
Formula ( 21 ) is obvious, because the left side is p 1 + p 2 + p 3 + ··· when p k is the probability that X = k , while the right side is p 1 +2 p 2 +3 p 3 + ···.
Formula ( 22 ) isn’t quite so obvious; it is p 1 + p 2 + p 3 + ··· on the left and ( p 1 + 2 p 2 + 3 p 3 + ···) 2 /( p 1 + 4 p 2 + 9 p 3 + ···) on the right. However, as we saw with Markov’s inequality, there is a remarkably simple proof, once we happen to discover it: If X is nonnegative but not always zero, we have
E X 2 \= E ( X 2 | X > 0 ) Pr( X > 0 ) + E( X 2 | X \= 0 ) Pr( X \= 0 ) \= E ( X 2 | X > 0 ) Pr ( X > 0 ) ≥ ( E ( X | X > 0 ) ) 2 Pr ( X > 0 ) = (E X ) 2 / Pr( X > 0 ). ( 23 )
In fact this proof shows that the second moment principle is valid even when X is not restricted to integer values (see exercise 46 ). Furthermore the argument can be strengthened to show that ( 22 ) holds even when X can take arbitrary negative values, provided only that E X ≥ 0 (see exercise 47 ). See also exercise 118 .
Exercise 54 applies ( 21 ) and ( 22 ) to the study of random graphs.
Another important inequality, which applies in the special case where X = X 1 + ··· + X m is the sum of binary random variables X j , was introduced more recently by S. M. Ross [ Probability, Statistics, and Optimization (New York: Wiley, 1994), 185.190], who calls it the “conditional expectation inequality”:
Pr ( X > 0 ) ≥ ∑ j \= 1 m E X j E( X | X j \=1) . ( 24 )
Ross showed that the right-hand side of this inequality is always at least as big as the bound (E X ) 2 /(E X 2 ) that we get from the second moment principle (see exercise 50 ). Furthermore, ( 24 ) is often easier to compute, even though it may look more complicated at first glance.
For example, his method applies nicely to the problem of estimating a reliability polynomial, f ( p 1 ,..., p n ), when f is a monotone Boolean function; here p j represents the probability that component j of a system is “up.” We observed in Section 7.1.4 that reliability polynomials can be evaluated exactly, using BDD methods, when n is reasonably small; but approximations are necessary when f gets complicated. The simple example f ( x 1 ,..., x 5 ) = x 1 x 2 x 3 ∨ x 2 x 3 x 4 ∨ x 4 x 5 illustrates Ross’s general method: Let ( Y 1 ,..., Y 5 ) be independent binary random variables, with E Y j = p j ; and let X = X 1 + X 2 + X 3 , where X 1 = Y 1 Y 2 Y 3 , X 2 = Y 2 Y 3 Y 4 , and X 3 = Y 4 Y 5 correspond to the prime implicants of f . Then Pr( X > 0) = Pr( f ( Y 1 ,..., Y 5 ) = 1) = E f ( Y 1 ,..., Y 5 ) = f ( p 1 ,..., p 5 ), because the Y ’s are independent. And we can evaluate the bound in ( 24 ) easily:
Pr ( X > 0 ) ≥ p 1 p 2 p 3 1 + p 4 + p 4 p 5 + p 2 p 3 p 4 p 1 + 1 + p 5 + p 4 p 5 p 1 p 2 p 3 + p 2 p 3 + 1 . ( 25 )
If, for example, each p j is 0.9, this formula gives ≈ 0 . 848, while (E X ) 2 /(E X 2 ) ≈ 0 . 847; the true value, p 1 p 2 p 3 + p 2 p 3 p 4 + p 4 p 5 − p 1 p 2 p 3 p 4 − p 2 p 3 p 4 p 5 , is 0.9558.
Many other important inequalities relating to expected values have been discovered, of which the most significant for our purposes in this book is the FKG inequality discussed in exercise 61 . It yields easy proofs that certain events are correlated, as illustrated in exercise 62 .
Martingales
A sequence of dependent random variables can be difficult to analyze, but if those variables obey invariant constraints we can often exploit their structure. In particular, the “martingale” property, named after a classic betting strategy (see exercise 67 ), proves to be amazingly useful when it applies. Joseph L. Doob featured martingales in his pioneering book Stochastic Processes (New York: Wiley, 1953), and developed their extensive theory.
The sequence 〈 Z n 〉 = Z 0 , Z 1 , Z 2 , ... of real-valued random variables is called a martingale if it satisfies the condition
E ( Z n + 1 | Z 0 , . . . , Z n ) \= Z n for all n ≥ 0. ( 26 )
(We also implicitly assume, as usual, that the expectations E Z n are well defined.) For example, when n = 0, the random variable E( Z 1 | Z 0 ) must be the same as the random variable Z 0 (see exercise 63 ).
Figure P illustrates George Pólya’s famous “ urn model” [F. Eggenberger and G. Pólya, Zeitschrift für angewandte Math. und Mech. 3 (1923), 279–289], which is associated with a particularly interesting martingale. Imagine an urn that initially contains two balls, one red and one black. Repeatedly remove a randomly chosen ball from the urn, then replace it and contribute a new ball of the same color. The numbers ( r, b ) of red and black balls will follow a path in the diagram, with the respective local probabilities indicated on each branch.
One can show without difficulty that all n + 1 nodes on level n of Fig. P will be reached with the same probability, 1/( n + 1). Furthermore, the probability that a red ball is chosen when going from any level to the next is always 1/2. Thus the urn scheme might seem at first glance to be rather tame and uniform. But in fact the process turns out to be full of surprises, because any inequity between red and black tends to perpetuate itself. For example, if the first ball chosen is black, so that we go from (1, 1) to (1, 2), the probability is only 2 ln 2 − 1 ≈ . 386 that the red balls will ever overtake the black ones in the future (see exercise 88 ).
One good way to analyze Pólya’s process is to use the fact that the ratios r/ ( r + b ) form a martingale. Each visit to the urn changes this ratio either to ( r +1)/( r + b +1) (with probability r/ ( r + b )) or to r/ ( r + b +1) (with probability b/ ( r + b )); so the expected new ratio is ( rb + r 2 + r )/(( r + b )( r + b +1)) = r/ ( r + b ), no different from what it was before. More formally, let X 0 = 1, and for n > 0 let X n be the random variable ‘[the n th ball chosen is red]’. Then there are X 0 + ··· + X n red balls and X ¯ 0 + ⋅ ⋅ ⋅ + X ¯ n + 1 black balls at level n of Fig. P ; and the sequence 〈 Z n 〉 is a martingale if we define
Z n \= ( X 0 + ⋅ ⋅ ⋅ + X n ) / ( n + 2 ) . ( 27 )
In practice it’s usually most convenient to define martingales Z 0 , Z 1 , ... in terms of auxiliary random variables X 0 , X 1 , ... , as we’ve just done. The sequence 〈 Z n 〉 is said to be a martingale with respect to the sequence 〈 X n 〉 if Z n is a function of ( X 0 ,..., X n ) that satisfies
E ( Z n + 1 | X 0 , . . . , X n ) \= Z n for all n ≥ 0. ( 28 )
Fig. P. Pólya’s urn model. The probability of taking any downward path from (1, 1) to ( r, b ) is the product of the probabilities shown on the branches.
Furthermore we say that a sequence 〈 Y n 〉 is fair with respect to the sequence 〈 X n 〉 if Y n is a function of ( X 0 ,..., X n ) that satisfies the simpler condition
E ( Y n + 1 | X 0 , . . . , X n ) \= 0 for all n ≥ 0 ; ( 29 )
and we call 〈 Y n 〉 fair whenever
E ( Y n + 1 | Y 0 , . . . , Y n ) \= 0 for all n ≥ 0. ( 30 )
Exercise 77 proves that ( 28 ) implies ( 26 ) and that ( 29 ) implies ( 30 ); thus an auxiliary sequence 〈 X n 〉 is sufficient but not necessary for defining martingales and fair sequences.
Whenever 〈 Z n 〉 is a martingale, we obtain a fair sequence 〈 Y n 〉 by letting Y 0 = Z 0 and Y n = Z n − Z n −1 for n > 0, because the identity E( Y n +1 | Z 0 ,..., Z n ) = E( Z n + 1 − Z n | Z 0 ,..., Z n ) = Z n − Z n shows that 〈 Y n 〉 is fair with respect to 〈 Z n 〉. Conversely, whenever 〈 Y n 〉 is fair, we obtain a martingale 〈 Z n 〉 by letting Z n = Y 0 + ··· + Y n , because the identity E( Z n +1 | Y 0 ,..., Y n ) = E( Z n + Y n +1 | Y 0 ,..., Y n ) = Z n shows that 〈 Z n 〉 is a martingale with respect to 〈 Y n 〉. In other words, fairness and martingaleness are essentially equivalent. The Y ’s represent unbiased “tweaks” that change one Z to its successor.
It’s easy to construct fair sequences. For example, every sequence of independent random variables with mean 0 is fair. And if 〈 Y n 〉 is fair with respect to 〈 X n 〉, so is the sequence 〈 Y n ′ 〉 defined by Y n ′ \= f n ( X 0 , . . . , X n − 1 ) Y n when f n ( X 0 ,..., X n −1 ) is almost any function whatsoever! (We need only keep f n small enough that E Y n ′ is well defined.) In particular, we can let f n ( X 0 ,..., X n −1 ) = 0 for all large n , thereby making 〈 Z n 〉 eventually fixed.
A sequence of functions N n ( x 0 ,..., x n −1 ) is called a stopping rule if each value is either 0 or 1 and if N n ( x 0 ,..., x n −1 ) = 0 implies N n +1 ( x 0 ,..., x n )= 0. We can assume that N 0 = 1. The number of steps before stopping, with respect to a sequence of random variables 〈 X n 〉, is then the random variable
N \= N 1 ( X 0 ) + N 2 ( X 0 , X 1 ) + N 3 ( X 0 , X 1 , X 2 ) + ⋅ ⋅ ⋅ . ( 31 )
(Intuitively, N n ( x 0 ,..., x n −1 ) means [the values X 0 = x 0 , ... , X n −1 \= x n −1 do not stop the process]; hence it’s really more about “going” than “stopping.”) Any martingale Z n = Y 0 + ··· + Y n with respect to 〈 X n 〉 can be adapted to stop with this strategy if we change it to Z n ′ \= Y 0 ′ + ⋅ ⋅ ⋅ + Y n ′ , where Y n ′ \= N n ( X 0 , . . . , X n − 1 ) Y n . Gamblers who wish to “quit when ahead” are using the stopping rule N n + 1 ( X 0 , ... , X n ) \= [ Z n ′ ≤ 0 ] , when Z n ′ is their current balance.
Notice that if the stopping rule always stops after at most m steps — in other words, if the function N m ( x 0 ,..., x m −1 ) is identically zero — then we have Z m ′ \= Z N ′ , because Z n ′ doesn’t change after the process has stopped. Therefore E Z N ′ \= E Z m ′ \= E Z 0 ′ \= E Z 0 : No stopping rule can change the expected outcome of a martingale when the number of steps is bounded.
An amusing game of chance called Ace Now illustrates this optional stopping principle. Take a deck of cards, shuffle it and place the cards face down; then turn them face up one at a time as follows: Just before seeing the n th card, you are supposed to say either “Stop” or “Deal,” based on the cards you’ve already observed. (If n = 52 you must say “Stop.”) After you’ve decided to stop, you win $12 if the next card is an ace; otherwise you lose $1. What is the best strategy for playing this game? Should you hold back until you have a pretty good chance at the $12? What is the worst strategy? Exercise 82 has the answer.
Tail inequalities from martingales
The essence of martingales is equality of expectations. Yet martingales turn out to be important in the analysis of algorithms because we can use them to derive inequalities , namely to show that certain events occur with very small probability.
To begin our study, let’s introduce inequality into Eq. ( 26 ): A sequence 〈 Z n 〉 is called a submartingale if it satisfies
E ( Z n + 1 | Z 0 , . . . , Z n ) ≥ Z n for all n ≥ 0. ( 32 )
Similarly, it’s called a supermartingale if ‘≥’ is changed to ‘≤’ in the left-hand part of this definition. (Thus a martingale is both sub- and super-.) In a submartingale we have E Z 0 ≤ E Z 1 ≤ E Z 2 ≤ ··· , by taking expectations in ( 32 ). A supermartingale, similarly, has ever smaller expectations as n grows. One way to remember the difference between submartingales and supermartingales is to observe that their names are the reverse of what you might expect.
Submartingales are significant largely because of the fact that they’re quite common. Indeed, if 〈 Z n 〉 is any martingale and if f is any convex function, then 〈 f ( Z n )〉 is a submartingale (see exercise 84 ). For example, the sequences 〈| Z n |〉 and 〈max( Z n , c )〈 and 〈 Z n 2 〉 and 〈 e Z n 〉 all are submartingales whenever 〈 Z n 〉 is known to be a martingale. If, furthermore, 〈 Z n 〉 is always positive, then 〈 Z n 3 〉 and 〈1/ Z n 〉 and 〈ln(1/ Z n )〉 and 〈 Z n ln Z n 〉, etc., are submartingales.
If we modify a submartingale by applying a stopping rule, it’s easy to see that we get another submartingale. Furthermore, if that stopping rule is guaranteed to quit within m steps, we’ll have E Z m ≥ E Z N \= E Z N ′ \= E Z m ′ . Therefore no stopping rule can increase the expected outcome of a submartingale, when the number of steps is bounded.
That comparatively simple observation has many important consequences. For example, exercise 86 uses it to give a simple proof of the so-called “ maximal inequality”: If 〈 Z n 〉 is a nonnegative sub martingale then
Pr ( max ( Z 0 , Z 1 , . . . , Z n ) ≥ x ) ≤ E Z n / x , for all x > 0. ( 33 )
Special cases of this inequality are legion. For instance, martingales 〈 Z n 〉 satisfy
Pr ( max ( | Z 0 | , | Z 1 | , . . . , | Z n | ) ≥ x ) ≤ E | Z n | / x , for all x > 0 ; ( 34 )
Pr ( max ( Z 0 2 , Z 1 2 , ... , Z n 2 ) ≥ x ) ≤ E Z n 2 / x , for all x > 0.
Relation ( 35 ) is known as Kolmogorov’s inequality , because A. N. Kolmogorov proved it when Z n = X 1 + ··· + X n is the sum of independent random variables with E X k = 0 and X k \= σ k 2 for 1 ≤ k ≤ n [ Math. Annalen 99 (1928), 309– 311]. In that case var Z n \= σ 1 2 + ⋅ ⋅ ⋅ + σ n 2 \= σ 2 , and the inequality can be written
Pr ( | X 1 | < t σ , | X 1 + X 2 | < t σ , ... , | X 1 + ⋅ ⋅ ⋅ + X n | < t σ ) ≥ 1 − 1 / t 2 . ( 36 )
Chebyshev’s inequality gives only Pr(| X 1 + ··· + X n | < tσ ) ≥ 1 − 1/ t 2 , which is a considerably weaker result.
Another important inequality applies in the common case where we have good bounds on the terms Y 1 , ... , Y n that enter into the standard representation Z n = Y 0 + Y 1 + ··· + Y n of a martingale. This one is called the Hoeffding– Azuma inequality , after papers by W. Hoeffding [ J. Amer. Statistical Association 58 (1963), 13–30] and K. Azuma [ Tôhoku Math. Journal (2) 19 (1967), 357–367]. It reads as follows: If 〈 Y n 〉 is any fair sequence with a n ≤ Y n ≤ b n when Y 0 , Y 1 , . . . , Y n −1 are given, then
Pr ( Y 1 + ⋅ ⋅ ⋅ + Y n ≥ x ) ≤ e − 2 x 2 / ( ( b 1 − a 1 ) 2 + ⋅ ⋅ ⋅ + ( b n − a n ) 2 ) . ( 37 )
The same bound applies to Pr( Y 1 + ··· + Y n ≤ − x ), since − b n ≤ − Y n ≤ − a n ; so
Pr ( | Y 1 + ⋅ ⋅ ⋅ + Y n | ≥ x ) ≤ 2 e − 2 x 2 / ( ( b 1 − a 1 ) 2 + ⋅ ⋅ ⋅ + ( b n − a n ) 2 ) . ( 38 )
Exercise 90 breaks the proof of this result into small steps. In fact, the proof even shows that a n and b n may be functions of { Y 0 ,..., Y n −1 }.
Applications
The Hoeffding–Azuma inequality is useful in the analysis of many algorithms because it applies to “ Doob martingales,” a very general class of martingales that J. L. Doob featured as Example 1 in his Stochastic Processes (1953), page 92. (In fact, he had already considered them many years earlier, in Trans. Amer. Math. Soc. 47 (1940), 486.) Doob martingales arise from any sequence of random variables 〈 X n 〉, independent or not, and from any other random variable Q : We simply define
Z n \= E ( Q | X 0 , . . . , X n ) . ( 39 )
Then, as Doob pointed out, the resulting sequence is a martingale (see exercise 91 ). In our applications, Q is an aspect of some algorithm that we wish to study, and the variables X 0 , X 1 , ... reflect the inputs to the algorithm. For example, in an algorithm that uses random bits, the X ’s are those bits.
Consider a hashing algorithm in which t objects are placed into m random lists, where the n th object goes into list X n ; thus 1 ≤ X n ≤ m for 1 ≤ n ≤ t , and we assume that each of the m t possibilities is equally likely. Let Q ( x 1 ,..., x t ) be the number of lists that remain empty after the objects have been placed into lists x 1 , ... , x t , and let Z n = E( Q | X 1 ,..., X n ) be the associated Doob martingale. Then Z 0 = E Q is the average number of empty lists; and Z t = Q ( X 1 ,..., X t ) is the actual number, in any particular run of the algorithm.
What fair sequence corresponds to this martingale? If 1 ≤ n ≤ t , the random variable Y n = Z n − Z n −1 is f n ( X 1 ,..., X n ), where f n ( x 1 ,..., x n ) is the average of
Δ ( x 1 , ... , x t ) \= ∑ x \= 1 m Pr ( X n \= x ) ( Q ( x 1 , . . . , x n − 1 , x n , x n + 1 , . . . , x t ) − Q ( x 1 , . . . , x n − 1 , x , x n + 1 , . . . , x t ) ) ( 40 )
taken over all m t − n values of ( x n +1 ,..., x t ).
In our application the function Q ( x 1 ,..., x t ) has the property that
| Q ( x 1 , . . . , x n − 1 , x ′ , x n + 1 , . . . , x t ) − Q ( x 1 , . . . , x n − 1 , x , x n + 1 , . . . , x t ) | ≤ 1 ( 41 )
for all x and x ′, because a change to any one hash address always changes the number of empty lists by either 1, 0, or −1. Consequently, for any fixed setting of the variables ( x 1 ,..., x n −1 , x n +1 ,..., x t ), we have
max x n Δ ( x 1 , ... , x t ) ≤ max x n Δ ( x 1 , ... , x t ) + 1. ( 42 )
The Hoeffding– Azuma inequality ( 37 ) therefore allows us to conclude that
Pr( Z t − Z 0 ≥ x ) = Pr( Y 1 + ⋅ ⋅ ⋅ + Y t ≥ x ) ≤ e − 2 x 2 / t . ( 43 )
Furthermore, Z 0 in this example is m ( m − 1) t / m t , because exactly ( m − 1) t of the m t possible hash sequences leave any particular list empty. And the random variable Z t is the actual number of empty lists when the algorithm is run. Hence we can, for example, set x \= t ln f ( t ) in ( 43 ), thereby proving that
Pr ( Z t ≥ ( m − 1 ) t / m t − 1 + t ln f ( t ) ) ≤ 1 / f ( t ) 2 . ( 44 )
The same upper bound applies to Pr ( Z t ≤ ( m − 1 ) t / m t − 1 − t ln f ( t ) ) .
Notice that the inequality ( 41 ) was crucial in this analysis. Therefore the strategy we’ve used to prove ( 43 ) is often called the “ method of bounded differences.” In general, a function Q ( x 1 ,..., x t ) is said to satisfy a Lipschitz condition in coordinate n if we have
| Q ( x 1 , . . . , x n − 1 , x , x n + 1 , . . . , x t ) − Q ( x 1 , . . . , x n − 1 , x ′ , x n + 1 , . . . , x t ) | ≤ c n ( 45 )
for all x and x ′. (This terminology mimics a well known but only slightly similar constraint that was introduced long ago into functional analysis by Rudolf Lipschitz [ Crelle 63 (1864), 296–308].) Whenever condition ( 45 ) holds, for a function Q associated with a Doob martingale for independent random variables X 1 , ... , X t , we can prove that Pr( Y 1 + ⋅ ⋅ ⋅ + Y t ≥ x ) ≤ exp ( − 2 x 2 / ( c 1 2 + ⋅ ⋅ ⋅ + c t 2 ) ) .
Let’s work out one more example, due to Colin McDiarmid [ London Math. Soc. Lecture Notes 141 (1989), 148–188, §8(a)]: Again we consider independent integer-valued random variables X 1 , ... , X t with 1 ≤ X n ≤ m for 1 ≤ n ≤ t ; but this time we allow each X n to have a different probability distribution. Furthermore we define Q ( x 1 ,..., x t ) to be the minimum number of bins into which objects of sizes x 1 , ... , x t can be packed, where each bin has capacity m .
This bin-packing problem sounds a lot harder than the hashing problem that we just solved. Indeed, the task of evaluating Q ( x 1 ,..., x t ) is well known to be NP-complete [see M. R. Garey and D. S. Johnson, SICOMP 4 (1975), 397–411]. Yet Q obviously satisfies the condition ( 45 ) with c n = 1 for 1 ≤ n ≤ t . Therefore the method of bounded differences tells us that inequality ( 43 ) is true, in spite of the apparent difficulty of this problem!
The only difference between this bin-packing problem and the hashing problem is that we’re clueless about the value of Z 0 . Nobody knows how to compute E Q ( X 1 ,..., X t ), except for very special distributions of the random variables. However — and this is the magic of martingales — we do know that, whatever the value is, the actual numbers Z t will be tightly concentrated around that average.
If all the X ’s have the same distribution, the values β t = E Q ( X 1 ,..., X t ) satisfy β t + t′ ≤ β t + β t ′ , because we could always pack the t and t ′ items separately. Therefore, by the subadditive law (see the answer to exercise 2.5–39), β t / t approaches a limit β as t → ∞. Still, however, random trials won’t give us decent bounds on that limit, because we have no good way to compute the Q function.
If only he could have enjoyed Martingale for its beauty and its peace
without being chained to it by this band of responsibility and guilt!
— P. D. JAMES, Cover Her Face (1962)
Statements that are almost sure, or even quite sure
Probabilities that depend on an integer n often have the property that they approach 0 or 1 as n → ∞, and special terminology simplifies the discussion of such phenomena. If, say, A n is an event for which lim n →∞ Pr( A n ) = 1, it’s convenient to express this fact in words by saying, “ A n occurs almost surely, when n is large.” (Indeed, we usually don’t bother to state that n is large, if we already understand that n is approaching infinity in the context of the current discussion.)
For example, if we toss a fair coin n times, we’ll find that the coin almost surely comes up heads more than . 49 n times, but fewer than . 51 n times.
Furthermore, we’ll occasionally want to express this concept tersely in formulas, by writing just ‘a.s.’ instead of spelling out the words “almost surely.” For instance, the statement just made about n coin tosses can be formulated as
.49 n < X 1 + ⋅ ⋅ ⋅ + X n < .51 n a.s., ( 46 )
if X 1 , ... , X n are independent binary random variables, each with E X j = 1/2. In general a statement such as “ A n a.s.” means that lim n →∞ Pr( A n ) = 1; or, equivalently, that lim n → ∞ Pr ( A ¯ n ) \= 0 . It’s asymptotically almost sure.
If A n and B n are both a.s., then the combined event C n = A n ∩ B n is also a.s., regardless of whether those events are independent. The reason is that Pr( C ¯ n ) = Pr( A ¯ n ∪ B ¯ n ) ≤ Pr( A ¯ n ) + Pr( B ¯ n ) , which approaches 0 as n → ∞.
Thus, to prove ( 46 ) we need only show that X 1 + ··· + X n > .49 n a.s. and that X 1 + ··· + X n < . 51 n a.s., or in other words that Pr( X 1 + ··· + X n ≤ . 49 n ) and Pr( X 1 + ··· + X n ≥ . 51 n ) both approach 0. Those probabilities are actually equal, by symmetry between heads and tails; so we need only show that p n = Pr( X 1 + ··· + X n ≤ . 49 n ) approaches 0. And that’s no sweat, because we know from exercise 1.2.10–21 that p n ≤ e −.0001 n .
In fact, we’ve proved more: We’ve shown that p n is superpolynomially small , namely that
p n \= O ( n − k ) for all fixed numbers K . ( 47 )
When the probability of an event A ¯ n is superpolynomially small, we say that A n holds “ quite surely,” and abbreviate that by ‘q.s.’. In other words, we’ve proved
.49 n < X 1 + ⋅ ⋅ ⋅ + X n < .51 n q.s. ( 48 )
We’ve seen that the combination of any two a.s. events is a.s.; hence the combination of any finite number of a.s. events is also a.s. That’s nice, but q.s. events are even nicer: The combination of any polynomial number of q.s. events is also q.s. For example, if n 4 different people each toss n coins, it is quite sure that every one of them , without exception, will obtain between . 49 n and . 51 n heads!
(When making such asymptotic statements we ignore the inconvenient truth that our bound on the failure of the assertion, 2 n 4 e −.0001 n in this case, becomes negligible only when n is greater than 700,000 or so.)
Exercises
1. [ M21 ] ( Nontransitive dice. ) Suppose three biased dice with the respective faces
are rolled independently at random.
-
Show that Pr( A>B ) = Pr( B>C ) = Pr( C>A ) = 5/9.
-
Find dice with Pr( A>B ), Pr( B>C ), Pr( C>A ) all greater than 5/9.
-
If Fibonacci dice have F m faces instead of just six, show that we could have
Pr( A > B ) \= Pr( B > C ) \= F m − 1 / F m and Pr( C > A ) \= F m − 1 / F m ± 1 / F m 2 .
2. [ M32 ] Prove that the previous exercise is asymptotically optimum , in the sense that min(Pr( A>B ), Pr( B>C ), Pr( C>A )) < 1/ φ , regardless of the number of faces.
3. [ 22 ] ( Lake Wobegon dice. ) Continuing the previous exercises, find three dice such that Pr( A > 1 3 ( A + B + C ) ) ≥ Pr( B > 1 3 ( A + B + C ) ) ≥ Pr ( C > 1 3 ( A + B + C ) ) ≥ 16 / 27 . Each face of each die should be
or
or
or
or
or
.
4. [ 22 ] ( Nontransitive Bingo. ) Each player in the game of NanoBingo has a card containing four numbers from the set S = {1, 2, 3, 4, 5, 6}, arranged in two rows. An announcer calls out the elements of S , in random order; the first player whose card has a horizontal row with both numbers called shouts “Bingo!” and wins. (Or victory is shared when there are multiple Bingoes.) For example, consider the four cards
If the announcer calls “6, 2, 5, 1” when A plays against B , then A wins; but the sequence “1, 3, 2” would yield a tie. One can show that Pr( A beats B ) = 336 720 , Pr( B beats A ) = 312 720 , and Pr( A and B tie) = 72 720 . Determine the probabilities of all possible outcomes when there are (a) two (b) three (c) four different players using those cards.
▶ 5. [ HM22 ] (T. M. Cover, 1989.) Common wisdom asserts that longer games favor the stronger player, because they provide more evidence of the relative skills.
However, consider an n -round game in which Alice scores A 1 + ‧ ‧ ‧ + A n points while Bob scores B 1 + ‧ ‧ ‧ + B n points. Here each of A 1 , . . . , A n are independent random variables with the same distribution, all representing Alice’s strength; similarly, each of B 1 , . . . , B n independently represent Bob’s strength (and are independent of the A ’s). Suppose Alice wins with probability P n .
-
Show that it’s possible to have P 1 = .99 but P 1000 < .0001.
-
Let m k \= 2 k 3 , n k \= 2 k 2+ k , and q k = 2 − k 2 / D , where D = 2 −0 + 2 −1 + 2 −4 + 2 −9 + ‧ ‧ ‧ ≈ 1.56447. Suppose the random variable A takes the values ( m 0 , m 2 , m 4 , . . . ) with probabilities ( q 0 , q 2 , q 4 , . . . ); otherwise A = 0. Independently, the random variable B takes the values ( m 1 , m 3 , m 5 , . . .) with probabilities ( q 1 , q 3 , q 5 , . . . ); otherwise B = 0. What are Pr( A > B ), Pr( A < B ), and Pr( A = B )?
-
With the distributions in (b), prove that P n k → [ k even] as k →∞.
▶ 6. [ M22 ] Consider random Boolean (or binary) vectors X 1 . . . X n , where n ≥ 2, with the following distribution: The vector x 1 . . . x n occurs with probability 1/( n − 1)s 2 if x 1 + ‧ ‧ ‧ + x n = 2, with probability ( n − 2)/(2 n − 2) if x 1 + ‧ ‧ ‧ + x n = 0, and with probability 0 otherwise. Show that the components are pairwise independent (that is, X i is independent of X j when i ≠ j ); but they are not k -wise independent for k > 2.
Also find a joint distribution, depending only on ν x = x 1 +‧ ‧ ‧+ x n , that is k -wise independent for k = 2 and k = 3 but not k = 4.
7. [ M30 ] (Ernst Schulte-Geers, 2012.) Generalizing exercise 6 , construct a νx -based distribution that has k -wise but not ( k + 1)-wise independence, given k ≥ 1.
▶ 8. [ M20 ] Suppose the Boolean vector x 1 + ·· ·+ x n occurs with probability (2+(−1) ν x )/2 n +1 , where νx = x 1 + ‧ ‧ ‧ + x n . For what k is this distribution k -wise independent?
9. [ M20 ] Find a distribution of Boolean vectors x 1 . . . x n such that any two components are dependent; yet if we know the value of any x j , the remaining components are ( n −1)-wise independent. Hint: The answer is so simple, you might feel hornswoggled.
▶ 10. [ M21 ] Let Y 1 , . . . , Y m be independent and uniformly distributed elements of {0, 1, . . . , p − 1}, where p is prime. Also let X j \= ( j m + Y 1 j m −1 + ‧ ‧ ‧ + Y m ) mod p , for 1 ≤ j ≤ n . For what k are the X ’s k -wise independent?
11. [ M20 ] If X 1 , . . . , X 2 n are independent random variables with the same discrete distribution, and if α is any real number whatsoever, prove that
Pr ( | X 1 + ⋅ ⋅ ⋅ + X 2 n 2 n − α | ≤ X 1 + ⋅ ⋅ ⋅ + X n n − α | ) > 1 2 .
12. [ 21 ] Which of the following four statements are equivalent to the statement that Pr( A | B ) > Pr( A )? (i) Pr( B | A ) > Pr( B ); (ii) Pr( A | B ) > Pr( A | B ¯ ) ; (iii) Pr( B | A ) > Pr( B | A ¯ ) ; (iv) Pr( A ¯ | B ¯ ) > Pr( A ¯ | B ) .
13. [ 15 ] True or false: Pr( A | C ) > Pr( A ) if Pr( A | B ) > Pr( A ) and Pr( B | C ) > Pr( B ).
14. [ 10 ] (Thomas Bayes, 1763.) Prove the “ chain rule” for conditional probability:
Pr( A 1 ∩ ··· ∩ A n ) = Pr( A 1 )Pr( A 2 | A 1 )... Pr( A n | A 1 ∩···∩ A n −1 ).
15. [ 12 ] True or false: Pr( A | B ∩ C )Pr( B | C ) = Pr( A ∩ B | C ).
16. [ M15 ] Under what circumstances is Pr( A | B ) = Pr( A ∪ C | B )?
▶ 17. [ 15 ] Evaluate the conditional probability Pr( T is an ace | B = Q ♠) in the playing card example of the text, where T and B denote the top and bottom cards.
18. [ 20 ] Let M and m be the maximum and minimum values of the random variable X . Prove that var X ≤ ( M − E X )(E X − m ).
▶ 19. [ HM28 ] Let X be a random nonnegative integer, with Pr( X = x ) = 1/2 x + 1 , and suppose that X = (... X 2 X 1 X 0 ) 2 and X + 1 = ( ... Y 2 Y 1 Y 0 ) 2 in binary notation.
-
What is E X n ? Hint: Express this number in the binary number system.
-
Prove that the random variables { X 0 , X 1 ,..., X n −1 } are independent.
-
Find the mean and variance of S = X 0 + X 1 + X 2 + ···.
-
Find the mean and variance of R = X 0 ⊕ X 1 ⊕ X 2 ⊕ ···.
-
Let π = (11 .p 0 p 1 p 2 ...) 2 . What is the probability that X n = p n for all n ≥ 0?
-
What is E Y n ? Show that Y 0 and Y 1 are not independent.
-
Find the mean and variance of T = Y 0 + Y 1 + Y 2 + ···.
20. [ M18 ] Let X 1 , ..., X k be binary random variables for which we know that E(∏ j∈J X j ) = ∏ j∈J E X j for all J ⊆ {1,..., k }. Prove that the X ’s are independent.
21. [ M20 ] Find a small-as-possible example of random variables X and Y that satisfy covar( X, Y ) = 0, that is, E XY = (E X )(E Y ), although they aren’t independent.
▶ 22. [ M20 ] Use Eq. ( 8 ) to prove the “ union inequality”
Pr( A 1 ∪···∪ A n ) ≤ Pr( A 1 ) + ··· + Pr( A n ).
▶ 23. [ M21 ] If each X k is an independent binary random variable with E X k = p , the cumulative binomial distribution B m,n ( p ) is the probability that X 1 + ··· + X n ≤ m . Thus it’s easy to see that B m , n ( p ) \= ∑ k \= 0 m ( n k ) p k ( 1 − p ) n − k .
Show that B m,n ( p ) is also equal to ∑ k \= 0 m ( n − m − 1 + k k ) p k ( 1 − p ) n − m , for 0 ≤ m ≤ n . Hint: Consider the random variables J 1 , J 2 , ... , and T defined by the rule that X j = 0 if and only if j has one of the T values { J 1 , J 2 , ..., J T }, where 1 ≤ J 1 < J 2 < ··· < J T ≤ n . What is Pr( T ≥ r and J r = s )?
▶ 24. [ HM28 ] The cumulative binomial distribution also has many other properties.
-
Prove that B m , n ( p ) \= ( n − m ) ( n m ) ∫ p 1 x m ( 1 − x ) n − 1 − m d x , for 0 ≤ m < n .
-
Use that formula to prove that B m , n ( m / n ) > 1 2 , for 0 ≤ m < n/ 2. Hint: Show that ∫ 0 m / n x m ( 1 − x ) n − 1 − m d x < ∫ m / n 1 x m ( 1 − x ) n − 1 − m d x .
-
Show furthermore that B m , n ( m / n ) > 1 2 when n /2 ≤ m ≤ n . [Thus m is the median value of X 1 + ··· + X n , when p = m/n and m is an integer.]
25. [ M25 ] Suppose X 1 , X 2 , ... are independent random binary variables, with means E X k = p k . Let ( ( n k ) ) be the probability that X 1 + ··· + X n = k ; thus ( ( n k ) ) \= p n ( ( n − 1 k − 1 ) ) + q n ( ( n − 1 k ) ) \= [ z k ] ( q 1 + p 1 z ) ⋅ ⋅ ⋅ ( q n + p n z ) . . . ( q n + p n z ) , where q k = 1 − p k .
-
Prove that ( ( n k ) ) ≥ ( ( n k + 1 ) ) , if p j ≤ ( k +1)/( n + 1) for 1 ≤ j ≤ n .
-
Furthermore ( ( n k ) ) ≤ ( n k ) p k q n − k , if p j ≤ p ≤ k/n for 1 ≤ j ≤ n .
26. [ M27 ] Continuing exercise 25 , prove that ( ( n k ) ) 2 ≥ ( ( n k − 1 ) ) ( ( n k + 1 ) ) ( 1 + 1 k ) ( 1 + 1 n − k ) for 0 < k < n . Hint: Consider r n , k \= ( ( n k ) ) / ( n k ) .
27. [ M22 ] Find an expression for the generalized cumulative binomial distribution ∑ k \= 0 m ( ( n k ) ) that is analogous to the alternative formula in exercise 23 .
28. [ HM28 ] (W. Hoeffding, 1956.) Let X = X 1 + ··· + X n and p 1 + ··· + p n = np in exercise 25 , and suppose that E g ( X ) ≤ ∑ k \= 0 n g ( k ) ( ( n k ) ) for some function g .
-
Prove that E g ( X ) ≤ ∑ k \= 0 n g ( k ) ( n k ) p k ( 1 − p ) n − k if g is convex in [0 ..n ].
-
If g isn’t convex, show that the maximum of E g ( X ), over all choices of { p 1 ,..., p n } with p 1 + ··· + p n = np can always be attained by a set of probabilities for which at most three distinct values {0, a, 1} occur among the p j .
-
Furthermore ∑ k \= 0 m ( ( n k ) ) ≤ B m , n ( p ) , whenever p 1 + ··· + p n = np ≥ m + 1.
29. [ HM29 ] (S. M. Samuels, 1965.) Continuing exercise 28 , prove that we have B m,n ( p ) ≥ ((1 − p )( m +1)/((1 − p ) m + 1)) n − m whenever np ≤ m + 1.
30. [ HM34 ] Let X 1 , ... , X n be independent random variables whose values are nonnegative integers, where E X k = 1 for all k , and let p = Pr( X 1 + ··· + X n ≤ n ).
-
What is p , if each X k takes only the values 0 and n + 1?
-
Show that, in any set of distributions that minimize p , each X k assumes only two integer values, 0 and m k , where 1 ≤ m k ≤ n + 1.
-
Furthermore we have p > 1/ e , if each X k has the same two-valued distribution.
▶ 31. [ M20 ] Assume that A 1 , ... , A n are random events such that, for every subset I ⊆ {1, ..., n }, the probability Pr(∩ i∈I A i ) that all A i for i ∈ I occur simultaneously is π I ; here π I is a number with 0 ≤ π I ≤ 1, and π ∅ = 1. Show that the probability of any combination of the events, Pr( f ([ A 1 ],..., [ A n ])) for any Boolean function f , can be found by expanding f ’s multilinear reliability polynomial f ([ A 1 ],..., [ A n ]) and replacing each term ∏ i ∈ I [ A i ] by π I . For example, the reliability polynomial of x 1 ⊕ x 2 ⊕ x 3 is x 1 + x 2 + x 3 − 2 x 1 x 2 − 2 x 1 x 3 − 2 x 2 x 3 + 4 x 1 x 2 x 3 ; hence Pr([ A 1 ] ⊕ [ A 2 ] ⊕ [ A 3 ]) = π 1 + π 2 + π 3 − 2 π 12 − 2 π 13 − 2 π 23 +4 π 123 . (Here ‘ π 12 ’ is short for π {1,2} , etc.)
32. [ M21 ] Not all sets of numbers π I in the preceding exercise can arise in an actual probability distribution. For example, if I ⊆ J we must have π I ≥ π J . What is a necessary and sufficient condition for the 2 n values of π I to be legitimate?
33. [ M20 ] Suppose X and Y are binary random variables whose joint distribution is defined by the probability generating function G ( w, z ) = E( w X z Y ) = pw + qz + rwz , where p, q, r > 0 and p + q + r = 1. Use the definitions in the text to compute the probability generating function E( z E ( X | Y ) ) for the conditional expectation E( X | Y ).
34. [ M17 ] Write out an algebraic proof of ( 12 ), using the definitions ( 7 ) and ( 13 ).
▶ 35. [ M22 ] True or false: (a) E(E( X | Y ) | Y ) = E( X | Y ); (b) E(E( X | Y ) | Z) = E( X | Z ).
36. [ M21 ] Simplify the formulas (a) E( f ( X ) | X ); (b) E ( f ( Y )E( g ( X ) | Y )).
37. [ M20 ] Suppose X 1 ...X n is a random permutation of {1,..., n }, with every permutation occurring with probability 1/ n !. What is E( X k | X 1 ,..., X k −1 )?
38. [ M26 ] Let X 1 ...X n be a random restricted growth string of length n , each with probability 1/ ϖ n (see Section 7.2.1.5). What is E( X k | X 1 ,..., X k − 1 )?
▶ 39. [ HM21 ] A hen lays N eggs, where Pr( N = n ) = e −μ μ n / n ! obeys the Poisson distribution. Each egg hatches with probability p , independent of all other eggs. Let K be the resulting number of chicks. Express (a) E( K | N ), (b) E K , and (c) E( N | K ) in terms of N , K , μ , and p .
40. [ M16 ] Suppose X is a random variable with X ≤ M , and let m be any value with m < M . Show that Pr( X > m ) ≥ (E X − m )/( M − m ).
41. [ HM21 ] Which of the following functions are convex in the set of all real numbers x ? (a) | x | a , where a is a constant; (b) ∑ k ≥ n x k / k !, where n ≥ 0 is an integer; (c) e e | x | ; (d) f ( x )[ x ∈ I ]+ ∞ [ x / ∈ I ], where f is convex in the interval I .
42. [ HM21 ] Prove Jensen’s inequality ( 20 ).
▶ 43. [ M18 ] Use ( 12 ) and ( 20 ) to strengthen ( 20 ): If f is convex in I and if the random variable X takes values in I, then f (E X ) ≤ E ( f( E( X | Y ))) ≤ E f ( X ).
▶ 44. [ M25 ] If f is convex on the real line and if E X = 0, prove that E f ( aX ) ≤ E f ( bX ) whenever 0 ≤ a ≤ b .
45. [ M18 ] Derive the first moment principle ( 21 ) from Markov’s inequality ( 15 ).
46. [ M15 ] Explain why E( X 2 | X > 0) ≥ (E( X | X > 0)) 2 in ( 23 ).
47. [ M15 ] If X is random and Y = max(0, X ), show that E Y ≥ E X and E Y 2 ≤ E X 2 .
▶ 48. [ M20 ] Suppose X 1 , ... , X n are independent random variables with E X k = 0 and E X k 2 \= σ k 2 for 1 ≤ k ≤ n . Chebyshev’s inequality tells us that Pr(| X 1 +···+ X n | ≥ a ) ≤ ( σ 1 2 + ⋅ ⋅ ⋅ + σ n 2 ) / a 2 ; show that the second moment principle gives a somewhat better one-sided estimate, Pr( X 1 + ⋅ ⋅ ⋅ + X n ≥ a ) ≤ ( σ 1 2 + ⋅ ⋅ ⋅ + σ n 2 ) / ( a 2 + σ 1 2 + ⋅ ⋅ ⋅ + σ n 2 ) , if a ≥ 0.
49. [ M20 ] If X is random and ≥ 0, prove that Pr( X = 0) ≤ (E X 2 )/(E X ) 2 − 1.
▶ 50. [ M27 ] Let X = X 1 + ··· + X m be the sum of binary random variables, with E X j = p j . Let J be independent of the X ’s, and uniformly distributed in {1,..., m }.
-
Prove that Pr( X > 0 ) = ∑ j \= 1 m E( X j / X | X j > 0 ) ⋅ Pr( X j > 0 ) .
-
Therefore ( 24 ) holds. Hint: Use Jensen’s inequality with f ( x ) = 1/ x .
-
What are Pr( X J = 1) and Pr( J = j | X J = 1)?
-
Let t j = E( X | J = j and X J = 1). Prove that E X 2 \= ∑ j \= 1 m p j t j .
-
Jensen’s inequality now implies that the right side of ( 24 ) is ≥ (E X ) 2 /(E X 2 ).
▶ 51. [ M21 ] Show how to use the conditional expectation inequality ( 24 ) to obtain also an upper bound on the value of a reliability polynomial, and apply your method to the case illustrated in ( 25 ).
52. [ M21 ] What lower bound does inequality ( 24 ) give for the reliability polynomial of the symmetric function S ≥ k ( x 1 ,..., x n ), when p 1 = ··· = p n = p ?
53. [ M20 ] Use ( 24 ) to obtain a lower bound for the reliability polynomial of the non- monotonic Boolean function f ( x 1 , . . . , x 6 ) \= x 1 x 2 x ¯ 3 ∨ x 2 x 3 x ¯ 4 ∨ ⋅ ⋅ ⋅ ∨ x 5 x 6 x ¯ 1 ∨ x 6 x 1 x ¯ 2 .
54. [ M22 ] Suppose each edge of a random graph on the vertices {1,..., n } is present with probability p , independent of every other edge. If u , v , w are distinct vertices, let X uvw be the binary random variable [{ u, v, w } is a 3- clique]; thus X uvw = [ u ― v ][ u ― w ][ v ― w ], and E X uvw = p 3 . Also let X = ∑ 1≤ u < v < w ≤ n X uvw be the total number of 3-cliques. Use the (a) first and (b) second moment principle to derive bounds on the probability that the graph contains at least one 3-clique.
55. [ 23 ] Evaluate the upper and lower bounds in the previous exercise numerically in the case n = 10, and compare them to the true probability, when (a) p = 1/2; (b) p = 1/10.
56. [ HM20 ] Evaluate the upper and lower bounds of exercise 54 asymptotically when p = λ/n and n → ∞.
▶ 57. [ M21 ] Obtain a lower bound for the probability in exercise 54(b) by using the conditional expectation inequality ( 24 ) instead of the second moment principle ( 22 ).
58. [ M22 ] Generalizing exercise 54 , find bounds on the probability that a random graph on n vertices has a k - clique, when each edge has probability p .
▶ 59. [ HM30 ] ( The four functions theorem. ) The purpose of this exercise is to prove an inequality that applies to four sequences 〈 a n 〉, 〈 b n 〉, 〈 c n 〉, 〈 d n 〉 of nonnegative numbers:
a j b k ≤ c j | k d j & k for 0 ≤ j , k < ∞ implies ∑ j \= 0 ∞ ∑ k \= 0 ∞ a j b k ≤ ∑ j \= 0 ∞ ∑ k \= 0 ∞ c j d k . ( * )
(The sums will be ∞ if they don’t converge.) Although the inequality might appear at first to be merely a curiosity, of interest only to a few lovers of esoteric formulas, we shall see that it’s a fundamental result with many applications of great importance.
-
Prove the special case where a j = b j = c j = d j = 0 for j ≥ 2, namely that
a 0 b 0 ≤ c 0 d 0 , a 0 b 1 ≤ c 1 d 0 , a 1 b 0 ≤ c 1 d 0 , and a 1 b 1 ≤ c 1 d 1 implies ( a 0 + a 1 ) ( b 0 + b 1 ) ≤ ( c 0 + c 1 ) ( d 0 + d 1 ).
Can equality hold in the first four relations but not in the last one? Can equality hold in the last relation but not in the first four?
-
Use that result to prove (*) when a j = b j = c j = d j = 0 for all j ≥ 2 n , given n > 0.
-
Conclude that (*) is true in general.
▶ 60. [ M21 ] If 𝓕 is a family of sets, and if α is a function that maps sets into real numbers, let α (𝓕) = ∑ S∈𝓕 α ( S ). Suppose 𝓕 and 𝓖 are finite families of sets for which nonnegative set functions α , β , γ , and δ have been defined with the property that
α ( S ) β ( T ) ≤ γ ( S ∪ T ) δ ( S ∩ T ) for all S ∈ 𝓕 and T ∈ 𝓖.
-
Use exercise 59 to prove that α (𝓕) β (𝓖) ≤ γ (𝓕 𝓖) δ (𝓕 𝓖).
-
In particular, |𝓕| |𝓖| ≤ |𝓕 ⊔ 𝓖| |𝓕 ⊓ 𝓖| for all families 𝓕 and 𝓖.
▶ 61. [ M28 ] Consider random sets in which S occurs with probability μ ( S ), where
μ ( S ) ≥ 0 and μ ( S ) μ ( T ) ≤ μ ( S ∪ T ) μ ( S ∩ T ) for all sets S and S and T . ( * * )
Assume also that U = ∪ μ(S)>0 S is a finite set.
-
Prove the FKG inequality (which is named for C. M. Fortuin, P. W. Kasteleyn, and J. Ginibre): If f and g are real-valued set functions, then
f ( S ) ≤ f ( T ) and g ( S ) ≤ g ( T ) for all S ⊆ T implies E( fg ) ≥ (E f )(E g ).
Here, as usual, E f stands for Σ S μ ( S ) f ( S ). The conclusion can also be written ‘covar( f, g ) ≥ 0’, using the notation of ( 9 ); we say that f and g are “ positively correlated” when this is true. (The awkward term “ nonnegatively correlated” would be more accurate, because f and g might actually be independent.) Hint: Prove the result first in the special case that both f and g are nonnegative.
-
Furthermore,
f ( S ) ≥ f ( T ) and g ( S ) ≥ g ( T ) for all S ⊆ T implies E( fg ) ≥ (E f )(E g );
f ( S ) ≤ f ( T ) and g ( S ) ≥ g ( T ) for all S ⊆ T implies E( fg ) ≤ (E f )(E g ).
-
It isn’t necessary to verify condition (**) for all sets, if (**) is known to hold for sufficiently many pairs of “neighboring” sets. Given μ , let’s say that set S is supported if μ ( S ) ≠ 0. Prove that (**) holds for all S and T whenever the following three conditions are satisfied: (i) If S and T are supported, so are S ∪ T and S ∩ T . (ii) If S and T are supported and S ⊆ T , the elements of T \ S can be labeled t 1 , ... , t k such that each of the intermediate sets S ∪{ t 1 ,..., t j } is supported, for 1 ≤ j ≤ k . (iii) Condition (**) holds whenever S = R ∪ s and T = R ∪ t and s, t / ∈R .
-
The multivariate Bernoulli distribution B ( p 1 ,..., p m ) on subsets of {1,..., m } is
μ ( S ) \= ( W j \= 1 m p j [ j ∈ S ] ) ( W j \= 1 m ( 1 − p j ) [ j ∉ S ] ) ,
given 0 ≤ p 1 ,..., p m ≤ 1. (Thus each element j is included independently with probability p j , as in exercise 25 .) Show that this distribution satisfies (**).
-
Describe other simple distributions for which (**) holds.
62. [ M20 ] Suppose the m \= ( n 2 ) edges E of a random graph G on n vertices are chosen with the Bernoulli distribution B ( p 1 ,..., p m ). Let f ( E ) = [ G is connected] and g ( E ) = [ G is 4-colorable]. Prove that f is negatively correlated with g .
63. [ M17 ] Suppose Z 0 and Z 1 are random ternary variables with Pr( Z 0 = a and Z 1 = b ) = p ab for 0 ≤ a, b ≤ 2, where p 00 + p 01 + ··· + p 22 = 1. What can you say about those nine probabilities p ab when E( Z 1 | Z 0 ) = Z 0 ?
▶ 64. [ M22 ] (a) If E( Z n +1 | Z n ) = Z n for all n ≥ 0, is 〈 Z n 〉 a martingale? (b) If 〈 Z n 〉 is a martingale, is E( Z n +1 | Z n ) = Z n for all n ≥ 0?
65. [ M21 ] If 〈 Z n 〉 is any martingale, show that any subsequence 〈 Z m ( n ) 〉 is also a martingale, where the nonnegative integers 〈 m ( n )〉 satisfy m (0) < m (1) < m (2) < ···.
▶ 66. [ M22 ] Find all martingales Z 0 , Z 1 , ... such that each random variable Z n assumes only the values ± n .
67. [ M20 ] The Equitable Bank of El Dorado features a money machine such that, if you insert k dollars, you receive 2 k dollars back with probability exactly 1/2; otherwise you get nothing. Thus you either gain $ k or lose $ k , and your expected profit is $0. (Of course these transactions are all done electronically.)
-
Consider, however, the following scheme: Insert $1; if that loses, insert $2; if that also loses, insert $4; then $8, etc. If you first succeed after inserting 2 n dollars, stop (and take the 2 n +1 dollars). What’s your expected net profit at the end?
-
Continuing (a), what’s the expected total amount that you put into the machine?
-
If Z n is your net profit after n trials, show that 〈 Z n 〉 is a martingale.
68. [ HM23 ] When J. H. Quick (a student) visited El Dorado, he decided to proceed by making repeated bets of $1 each, and to stop when he first came out ahead. (He was in no hurry, and was well aware of the perils of the high-stakes strategy in exercise 67 .)
-
What martingale 〈 Z n 〉 corresponds to this more conservative strategy?
-
Let N be the number of bets that Quick made before stopping. What is the probability that N = n ?
-
What is the probability that N ≥ n ?
-
What is E N ?
-
What is the probability that min( Z 0 , Z 1 , ... ) = − m ? (Possible “gambler’s ruin.”)
-
What is the expected number of indices n such that Z n = − m , given m ≥ 0?
69. [ M20 ] Section 1.2.5 discusses two basic ways by which we can go from permutations of {1,..., n − 1} to permutations of {1,..., n }: “Method 1” inserts n among the previous elements in all possible ways; “Method 2” puts a number k from 1 to n in the final position, and adds 1 to each previous number that was ≥ k .
Show that, using either method, every permutation can be associated with a node of Fig. P , using a rule that obeys the probability assumptions of Pólya’s urn model.
70. [ M25 ] If Pólya’s urn model is generalized so that we start with c balls of different colors, is there a martingale that generalizes Fig. P ?
71. [ M21 ] (G. Pólya.) What is the probability of going from node ( r, b )tonode ( r ′, b ′) in Fig. P , given r , r ′, b , and b ′ with r ′ ≥ r and b ′ ≥ b ?
72. [ M23 ] Let X n be the red-ball indicator for Pólya’s urn, as discussed in the text. What is E( X n 1 X n 2 ...X n m ) when 0 < n 1 < n 2 < ··· < n m ?
73. [ M24 ] The ratio Z n = r/ ( n +2)atnode ( r, n +2− r ) of Fig. P is not the only martingale definable on Pólya’s urn. For example, r [ n = r − 1] is another; so is r ( n + 1 r ) / 2 n .
Find the most general martingale 〈 Z n 〉 for this model: Given any sequence a 0 , a 1 , ... , show that there’s exactly one suitable function Z n = f ( r, n ) such that f (1, k ) = a k .
74. [ M20 ] ( Bernard Friedman’s urn. ) Instead of contributing a ball of the same color, as in Fig. P , suppose we use the opposite color. Then the process changes to
and the probabilities of reaching each node become quite different. What are they?
75. [ M25 ] Find an interesting martingale for Bernard Friedman’s urn.
76. [ M20 ] If 〈 Z n 〉 and 〈 Z n ′ 〉 are martingales, is 〈 Z n + Z n ′ 〉 a martingale?
77. [ M21 ] Prove or disprove: If 〈 Z n 〉 is a martingale with respect to 〈 X n 〉 , then 〈 Z n 〉 is a martingale with respect to itself (that is, a martingale).
78. [ M20 ] A sequence of random variables 〈 V n 〉 for which E( V n +1 | V 0 ,..., V n ) = 1 is called “ multiplicatively fair.” Show that Z n = V 0 V 1 ...V n is a martingale in such a case. Conversely, does every martingale lead to a multiplicatively fair sequence?
79. [ M20 ] ( De Moivre’s martingale. ) Let X 1 , X 2 , ... be a sequence of independent coin tosses, with Pr([“heads” occurred on the n th toss]) = Pr( X n = 1) = p for each n . Show that Z n = ( q/p ) 2( X 1 +···+ X n )− n defines a martingale, where q = 1 − p .
80. [ M20 ] Are the following statements true or false for every fair sequence 〈 Y n 〉? (a) E( Y 3 2 Y 5 ) = 0 . (b) E( Y 3 Y 5 2 ) = 0 . (c) E( Y n 1 Y n 2 ...Y n m ) = 0 if n 1 < n 2 < ··· < n m .
81. [ M21 ] Suppose E( X n +1 | X 0 ,..., X n ) = X n + X n −1 for n ≥ 0, where X −1 = 0. Find sequences a n and b n of coefficients so that Z n = a n X n + b n X n −1 is a martingale, where Z 0 = X 0 and Z 1 = 2 X 0 − X 1 . (We might call this a “Fibonacci martingale.”)
▶ 82. [ M20 ] In the game of Ace Now, let X n = [the n th card is an ace], with X 0 = 0.
-
Show that Z n = (4 − X 1 −···− X n )/(52 − n ) satisfies ( 28 ) for 0 ≤ n < 52.
-
Consequently E Z N = 1/13, regardless of the stopping rule employed.
-
Hence all strategies are equally good (or bad); you win $0 on average.
▶ 83. [ HM22 ] Given a sequence 〈 X n 〉 of independent and nonnegative random variables, let S n = X 1 + ··· + X n . If N n ( x 0 ,..., x n −1 ) is any stopping rule and if N is defined by ( 31 ), prove that E ∑ k \= 1 N E X k . (In particular, if E X n = E X 1 for all n > 0 we have “Wald’s equation,” which states that E S N = (E N )(E X 1 ).)
84. [ HM21 ] Let f ( x ) be a convex function for a ≤ x ≤ b , and assume that 〈 Z n 〉 is a martingale such that a ≤ Z n ≤ b for all n ≥ 0. (Possibly a = −∞ and/or b = + ∞.)
-
Prove that 〈 f ( Z n )〉 is a submartingale.
-
What can you say if the sequence 〈 Z n 〉 is assumed only to be a submartingale?
85. [ M20 ] Suppose there are R n red balls and B n black balls at level n of Pólya’s urn ( Fig. P ). Prove that the sequence 〈 R n / B n 〉 is a submartingale.
▶ 86. [ M22 ] Prove ( 33 ) by inventing a suitable stopping rule N n +1 ( Z 0 ,..., Z n ).
87. [ M18 ] What does the maximal inequality ( 33 ) reveal about the chances that Pólya’s urn will hold thrice as many red balls as black balls at some point?
▶ 88. [ HM30 ] Let S = sup Z n be the least upper bound of Z n as n → ∞ in Fig. P .
-
Prove that S > 1/2 with probability ln 2 ≈ . 693.
-
Similarly, show that Pr( S > 2/3) = ln 3 − π / 27 ≈ . 494.
-
Generalize to Pr( S > ( t − 1)/ t ), for all t ≥ 2. Hint: See exercise 7.2.1.6–36.
89. [ M17 ] Let ( X 1 ,..., X n ) be random variables that have the Bernoulli distribution B ( p 1 ,..., p n ), and suppose c 1 , ... , c n are nonnegative. Use ( 37 ) to show that
Pr( c 1 X 1 + ⋅ ⋅ ⋅ + c n X n ≥ c 1 p 1 + ⋅ ⋅ ⋅ + c n p n + x ) ≤ e − 2 x 2 / ( c 1 2 + ⋅ ⋅ ⋅ + c n 2 ) .
90. [ HM25 ] The Hoeffding– Azuma inequality ( 37 ) can be derived as follows:
-
Show first that Pr( Y 1 + ··· + Y n ≥ x ) ≤ E( e ( Y 1 + ··· + Y n ) t ) / e tx for all t > 0.
-
If 0 ≤ p ≤ 1 and q = 1 − p , show that e yt ≤ e f ( t ) + ye g ( t ) when − p ≤ y ≤ q and t > 0, where f ( t ) = − pt + ln( q + pe t ) and g ( t ) = − pt + ln( e t − 1).
-
Prove that f ( t ) ≤ t 2 /8. Hint: Use Taylor’s formula, Eq. 1.2.11.3–( 5 ).
-
Consequently a ≤ Y ≤ b implies e Yt ≤ e ( b − a ) 2 t 2 /8 + Yh ( t ), for some function h ( t ).
-
Let c \= ( c 1 2 + ⋅ ⋅ ⋅ + c n 2 ) / 2 , where c k = b k − a k . Prove that E( e ( Y 1 +···+ Y n ) t ) ≤ e ct 2 /4 .
-
We obtain ( 37 ) by choosing the best value of t .
91. [ M20 ] Prove that Doob’s general formula ( 39 ) always defines a martingale.
▶ 92. [ M20 ] Let 〈 Q n 〉 be the Doob martingale that corresponds to Pólya’s urn ( 27 ) when Q = X m , for some fixed m > 0. Calculate Q 0 , Q 1 , Q 2 , etc.
93. [ M20 ] Solve the text’s hashing problem under the more general model considered in the bin-packing problem: Each variable X n has probability p nk of being equal to k , for 1 ≤ n ≤ t and 1 ≤ k ≤ m . What formula do you get instead of ( 44 )?
▶ 94. [ M22 ] Where is the fact that the variables { X 1 ,..., X t } are independent used in the previous exercise?
95. [ M20 ] True or false: “Pólya’s urn q.s. accumulates more than 100 red balls.”
96. [ HM22 ] Let X be the number of heads seen in n flips of an unbiased coin. Decide whether each of the following statements about X is a.s., q.s., or neither, as n → ∞:
-
| X − n / 2 | < n ln n ;
-
| X − n / 2 | < n ln n ;
-
| X − n / 2 | < n ln ln n ;
-
| X − n / 2 | < n .
▶ 97. [ HM21 ] Suppose ⌊ n 1+δ ⌋ items are hashed into n bins, where δ is a positive constant. Prove that every bin q.s. gets between 1 2 n δ and 2 n δ of them.
98. [ M21 ] Many algorithms are governed by a loop of the form
X ← n ; while X > 0, set X ← X − F ( X )
where F ( X ) is a random integer in the range [1 ..X ]. We assume that each integer F ( X ) is completely independent of any previously generated values, subject only to the requirement that E F ( j ) ≥ g j , where 0 < g 1 ≤ g 2 ≤ ··· ≤ g n .
Prove that the loop sets X ← X − F ( X ) at most 1/ g 1 +1/ g 2 + ··· +1/ g n times, on the average. (“If one step reduces by g n , then perhaps (1/ g n )th of a step reduces by 1.”)
99. [ HM30 ] Show that the result in the previous exercise holds even when the range of F ( X ) is (−∞ ..X ], given 0 < g 1 ≤ ··· ≤ g n ≤ g n +1 ≤ ··· . (Thus X might increase .)
100. [ HM17 ] A certain randomized algorithm takes T steps, where Pr( T = t ) = p t for 1 ≤ t ≤ ∞. Prove that (a) lim m →∞ E min( m, T ) = E T ; (b) E T < ∞ implies p ∞ = 0.
101. [ HM22 ] Suppose X = X 1 + ··· + X m is the sum of independent geometrically distributed random integers, with Pr( X k = n ) = p k (1 − p k ) n −1 for n ≥ 1. Prove that Pr( X ≥ rμ ) ≤ re 1− r for all r ≥ 1, where μ \= E X \= ∑ k \= 1 m 1 / p k .
102. [ M20 ] Cora collects coupons, using a random process. After already owning k − 1 of them, her chance of success when trying for the k th is at least one chance in s k , independent of any previous successes or failures. Prove that she will a.s. own m coupons before making ( s 1 + ··· + s m )ln n trials. And she will q.s. need at most s k ln n ln ln n trials to obtain the k th coupon, for each k ≤ m , if m = O ( n 1000 ). (Here ‘a.s.’ and ‘q.s.’ refer to an implicit parameter n .)
▶ 103. [ M30 ] This exercise is based on two functions of the ternary digits {0, 1, 2}:
f 0 ( x ) \= max( 0 , x − 1 ); f 1 ( x ) \= min( 2 , x + 1 ).
-
What is Pr( f X 1 ( f X 2 (... ( f X n ( i )) ...)) = j ), for each i, j ∈ {0, 1, 2}, assuming that X 1 , X 2 , ... , X n are independent, uniformly random bits?
-
Here’s an algorithm that computes f X 1 ( f X 2 (... ( f X n ( i )) ...)) for i ∈ {0, 1, 2}, and stops when all three values have coalesced to a common value:
Set a 0 a 1 a 2 ← 012 and n ← 0. Then while a 0 = a 2 , set n ← n + 1, t 0 t 1 t 2 ← ( X n ? 122: 001), and a 0 a 1 a 2 ← a t 0 a t 1 a t 2 . Output a 0 .
(Notice that a 0 ≤ a 1 ≤ a 2 always holds.) What is the probability that this algorithm outputs j ? What are the mean and variance of N , the final value of n ?
-
A similar algorithm computes f X n (... ( f X 2 ( f X 1 ( i ))) ...), if we change ‘ a t 0 a t 1 a t 2 ’ to ‘ t a 0 t a 1 t a 2 ’. What’s the probability of output j in this algorithm?
-
Why on earth are the results of (b) and (c) so different?
-
The algorithm in (c) doesn’t really use a 1 . Therefore we might try to speed up process (b) by cleverly evaluating the functions in the opposite direction. Consider the following subroutine, called sub( T ):
Set a 0 a 2 ← 02 and n ← 0. Then while n < T set n ← n +1, X n ← random bit, and a 0 a 2 ← ( X n ? f 1 ( a 0 ) f 1 ( a 2 ): f 0 ( a 0 ) f 0 ( a 2 )). If a 0 = a 2 output a 0 , otherwise output −1.
Then the algorithm of (b) would seem to be equivalent to
Set T ← 1, a ← −1; while a < 0 set T ← 2 T and a ← sub( T ); output a .
Prove, however, that this fails. (Randomized algorithms can be quite delicate!)
-
Patch the algorithm of (e) and obtain a correct alternative to (b).
104. [ M21 ] Solve exercise 103(b) and 103(c) when each X k is 1 with probability p .
▶ 105. [ M30 ] ( Random walk on an n - cycle. ) Given integers a and n , with 0 ≤ a ≤ n , let N be minimum such that ( a +(−1) X 1 +(−1) X 2 + ··· +(−1) X N ) mod n = 0, where X 1 , X 2 , ... is a sequence of independent random bits. Find the generating function g a \= ∑ k \= 0 ∞ Pr( N \= k ) z k . What are the mean and variance of N ?
106. [ M25 ] Consider the algorithm of exercise 103(b) when the digits are d -ary instead of ternary; thus f 0 ( x ) = max(0, x − 1) and f 1 ( x ) = min( d − 1, x + 1). Find the generating function, mean, and variance of the number N of steps required before a 0 = a 1 = ··· = a d −1 is first reached in this more general situation.
▶ 107. [ M22 ] ( Coupling. ) If X is a random variable on the probability space Ω′ and Y is another random variable on another probability space Ω″, we can study them together by redefining them on a common probability space Ω. All conclusions about X or Y are valid with respect to Ω, provided that we have Pr( X = x ) = Pr′( X = x ) and Pr( Y = y ) = Pr″( Y = y ) for all x and y .
Such “coupling” is obviously possible if we let Ω be the set Ω′ × Ω″ of pairs {ω ′ ω ″ | ω ′ ∈ Ω′ and ω ″ ∈ Ω″}, and if we define Pr( ω ′ ω ″) = Pr′( ω ′)Pr″( ω ″) for each pair of events. But coupling can also be achieved in many other ways.
For example, suppose Ω′ and Ω″ each contain only two events, { Q , K } and {♣, ♠}, with Pr′( Q ) = p , Pr′( K ) = 1 − p , Pr″(♣) = q , Pr″(♠) = 1 − q . We could couple them with a four-event space Ω = { Q ♣, Q ♠, K ♣, K ♠}, having Pr( Q ♣) = pq , Pr( Q ♠) = p (1 − q ), Pr( K ♣) = (1 − p ) q , Pr( K ♠) = (1 − p )(1 − q ). But if p < q we could also get by with just three events, letting Pr( Q ♣) = p , Pr( K ♣) = q − p , Pr( K ♠) = 1 − q . A similar scheme works when p > q , omitting K ♣. And if p = q we need only two events, Q ♣ and K ♠.
-
Show that if Ω′ and Ω″ each have just three events, with respective probabilities {p 1 , p 2 , p 3 } and { q 1 , q 2 , q 3 }, they can always be coupled in a five-event space Ω.
-
Also, four events suffice if { p 1 , p 2 , p 3 } \= { 1 12 , 5 12 , 6 12 } , { q 1 , q 2 , q 3 } \= { 2 12 , 3 12 , 7 12 } .
-
But some three-event distributions cannot be coupled with fewer than five.
108. [ HM21 ] If X and Y are integer-valued random variables such that Pr′( X ≥ n ) ≤ Pr″( Y ≥ n ) for all integers n , find a way to couple them so that X ≤ Y always holds.
109. [ M27 ] Suppose X and Y have values in a finite partially ordered set P , and that
Pr′( X ≻ a for some a ∈ A ) ≤ Pr″( Y ≻ a for some a ∈ A ), for all A ⊆ P.
We will show that there’s a coupling in which X ≺ Y always holds.
-
Write out exactly what needs to be proved, in the simple case where P = {1, 2, 3} and the partial order has 1 ≺ 3, 2 ≺ 3. (Let p k = Pr′( X = k ) and q k = Pr″( Y = k ) for k ∈ P . When P = {1,..., n }, a coupling is an n × n matrix ( p ij ) of nonnegative probabilities whose row sums are ∑ j p ij = p i and column sums are ∑ i p ij = q j .) Compare this to the result proved in the preceding exercise.
-
Prove that Pr′( X ≺ b for some b ∈ B ) ≥ Pr″( Y ≺ b for some b ∈ B ), for all B ⊆ P .
-
A coupling between n pairs of events can be viewed as a flow in a network that has 2 n + 2 vertices { s, x 1 ,..., x n , y 1 ,..., y n , t }, where there are p i units of flow from s to x i , p ij units of flow from x i to y j , and q j units of flow from y j to t . The “ max-flow min-cut theorem” (see Section 7.5.3) states that such a flow is possible if and only if there are no subsets I, J ⊆ {1,..., n } such that (i) every path from s to t goes through some arc s → x i for i ∈ I or some arc y j → t for j ∈ J , and (ii) ∑ i∈I p i + ∑ j∈J q j < 1. Use that theorem to prove the desired result.
110. [ M25 ] If X and Y take values in {1,..., n }, let p k = Pr′( X = k ), q k = Pr″( Y = k ), and r k = min( p k , q k ) for 1 ≤ k ≤ n . The probability that X = Y in any coupling is obviously at most r \= ∑ k \= 1 n r k .
-
Show that there always is a coupling with Pr( X = Y ) = r .
-
Can the result of the previous exercise be extended, so that we have not only Pr( X ≺ Y ) = 1 but also Pr( X = Y ) = r ?
▶ 111. [ M20 ] A family of N permutations of the numbers {1,..., n } is called minwise independent if, whenever 1 ≤ j ≤ k ≤ n and { a 1 ,..., a k } ⊆ {1,..., n }, exactly N/k of the permutations π have min( a 1 π,...,a k π ) = a j π .
For example, the family F of N = 60 permutations obtained by cyclic shifts of
123456, 126345, 152346, 152634, 164235, 154263, 165324, 164523, 156342, 165432
can be shown to be minwise independent permutations of {1, 2, 3, 4, 5, 6}.
-
Verify the independence condition for F in the case k = 3, a 1 = 1, a 2 = 3, a 3 = 4.
-
Suppose we choose a random π from a minwise independent family, and assign the “sketch” S A = min a ∈ A aπ to every A ⊆ {1,..., n }. Prove that, if A and B are arbitrary subsets, Pr( S A = S B ) = | A ∩ B | / | A ∪ B |.
-
Given three subsets A , B , C , what is Pr( S A = S B = S C )?
112. [ M25 ] The size of a family F of minwise independent permutations must be a multiple of k for each k ≤ n , by definition. In this exercise we’ll see how to construct such a family with the minimum possible size, namely N = lcm(1, 2,..., n ).
The basic idea is that, if all elements of the permutations in F that exceed m are replaced by ∞, the “truncated” family is still minwise independent in the sense that, if min a ∈ A aπ = ∞, we can imagine that the minimum occurs at a random element of A . (This can happen only if π takes all elements of A to ∞.)
-
Conversely, show that an m -truncated family can be lifted to an ( m +1)-truncated family if, for each subset B of size n − m , we insert m + 1 equally often into each of B ’s n − m positions, within the permutations whose ∞’s are in B .
-
Use this principle to construct minimum-size families F .
113. [ M25 ] Although minwise permutations are defined only in terms of the minimum operation, a minwise independent family actually turns out to be also maxwise independent — and even more is true!
-
Let E be the event that a i π < k , bπ = k , and c j π > k , for any disjoint sets {a 1 ,..., a l }, { b }, { c 1 ,..., c r } ⊆ {1,..., n }. Prove that, if π is chosen randomly from a minwise independent set, Pr( E ) is the same as the probability that E occurs when π is chosen randomly from the set of all permutations. (For example, Pr(5 π< 7, 2 π =7, 1 π> 7, 8 π> 7) = 6( n − 7)( n − 8)( n − 4)!/ n !, whenever n ≥ 8.)
-
Furthermore, if { a 1 ,..., a k } ⊆ {1,..., n }, the probability that a j π is the r th largest element of { a 1 π,...,a k π } is 1/ k , whenever 1 ≤ j, r ≤ k .
▶ 114. [ M28 ] ( The “ combinatorial nullstellensatz.” ) Let f ( x 1 ,..., x n ) be a polynomial in which the coefficient of x 1 d 1 . . . x n d n is nonzero and each term has degree ≤ d 1 +···+ d n . Given subsets S 1 , ... , S n of the field of coefficients, with | S j | > d j for 1 ≤ j ≤ n , choose X 1 , ... , X n independently and uniformly, with each X j ∈ S j . Prove that
Pr ( f ( X 1 , . . . , X 2 ) ≠ 0 ) ≥ | S 1 | + ⋅ ⋅ ⋅ + | S n | − ( d 1 + n ) + 1 | S 1 | ⋅ ⋅ ⋅ | S n | .
Hint: See exercise 4.6.1–16.
115. [ M21 ] Prove that an m × n grid cannot be fully covered by p horizontal lines, q vertical lines, r diagonal lines of slope +1, and r diagonal lines of slope −1, if m = p + 2 ⌊ r /2⌋ + 1 and n = q + 2 ⌈ r /2⌉ + 1. Hint: Apply exercise 114 to a suitable polynomial f ( x, y ).
116. [ HM25 ] Use exercise 114 to prove that, if p is prime, any multigraph G on n vertices with more than ( p − 1) n edges contains a nonempty subgraph in which the degree of every vertex is a multiple of p . (In particular, if each vertex of G has fewer than 2 p neighbors, G contains a p - regular subgraph. A loop from v to itself adds two to v ’s degree.) Hint: Let the polynomial contain a variable x e for each edge e of G .
▶ 117. [ HM25 ] Let X have the binomial distribution B n ( p ), so that Pr( X \= k ) = ( n k ) p k ( 1 − p ) n − k for 0 ≤ k ≤ n . Prove that X mod m is approximately uniform:
| Pr( X mod m \= r ) − 1 m | < 2 m ∑ j \= 1 ∞ e − 8 p ( 1 − p ) j 2 n / m 2 , for 0 ≤ r < m .
118. [ M20 ] Use the second moment principle to prove the Paley– Zygmund inequality
Pr( X ≥ x ) ≥ ( E X − x ) 2 E X 2 , if 0 ≤ x ≤ E X.
119. [ HM24 ] Let x be a fixed value in [0 . . 1]. Prove that, if we independently and uniformly choose U ⋵ [0 . . x ], V ⋵ [ x . . 1], W ⋵ [0 . . 1], then the median 〈 UVW 〉 is uniformly distributed in [min( U, V,W ) . . max( U, V,W )].
120. [ M20 ] Consider random binary search trees Tn obtained by successively inserting independent uniform deviates U 1 , U 2 , . . . into an initially empty tree. Let T nk be the number of external nodes on level k , and define T n ( z ) \= ∑ k \= 0 ∞ T n k z k / ( n + 1 ) . Prove that Z n \= T n ( z )/ g n +1 ( z ) is a martingale, where g n ( z ) = (2 z + n −2)(2 z + n −3) . . . (2 z )/ n ! is the generating function for the cost of the nth insertion (exercise 6.2.2.6).
▶ 121. [ M26 ] Let X and Y be random variables with the distributions Pr( X = t ) = x ( t ) and Pr( Y = t ) = y ( t ). The ratio ⍴( t ) = y ( t )/ x ( t ), which may be infinity, is called the probability density of Y with respect to X . We define the relative entropy of _X with respect to Y , also called the _Kullback–Leibler divergence of X from Y , by the formulas
D ( y | | x ) \= E( ρ ( X ) lg ρ ( X ) ) = E lg ρ ( Y ) \= ∑ t y ( t ) lg y ( t ) x ( t ) ,
with 0 lg 0 and 0 lg(0/0) understood to mean 0. It can be viewed intuitively as the number of bits of information that are lost when X is used to approximate Y .
-
Suppose X is a random six-sided die with the uniform distribution, but Y is a “loaded ” die in which Pr( Y =
) = 1 5 Pr( Y =
) = 2 15 , instead of 1 6 . Compute D ( y || x ) and D ( x || y ). -
Prove that D ( y || x ) ≥ 0. When is it zero?
-
If p = Pr( X ∈ T ) and q = Pr( Y ∈ T ), show that E (lg ρ ( Y ) | Y ∈ T ) ≥ lg( q/p ).
-
Suppose x ( t ) = 1/ m for all t in an m -element set S , and y ( t ) = 0 only when t ∈ S . Express D ( y || x ) in terms of the entropy H Y = E lg(1/ Y ) (see Eq. 6.2.2–(18)).
-
Let Z ( u, v ) = Pr( X = u and Y = v ) when X and Y have any joint distribution, and let W ( u, v ) be that same probability under the assumption that X and Y are independent. The joint entropy H X,Y is defined to be H Z , and the mutual information I X,Y is defined to be D ( z || w ). Prove that H W = H X + H Y and I X,Y = H W − H Z . (Consequently H X,Y ≤ H X + H Y , and I X,Y measures the difference.)
-
Let H X | Y \= H X − I X,Y = H X,Y − H Y = ∑ t y ( t ) H X | t be the average uncertainty of X , in bits, after Y has been revealed. Prove that H X |( Y,Z ) ≤ H X | Y .
122. [ HM24 ] Continuing exercise 121 , compute D ( y || x ) and D ( x || y ) when
-
x ( t ) = 1/2 t +1 and y ( t ) = 3 t /4 t +1 for t = 0, 1, 2, ... ;
-
x ( t ) = e − np ( np ) t / t ! and y ( t ) \= ( n t ) p t ( 1 − p ) n − t , for t ≥ 0 and 0 < p < 1. (Give asymptotic answers with absolute error O (1/ n ), for fixed p as n → ∞.)
▶ 123. [ M20 ] Let X and Y be as in exercise 121 . The random variable Z = A ? Y : X either has the distribution x ( t ) or y ( t ), but we don’t know whether A is true or false. If we believe that the hypothesis Z = Y holds with the a priori probability Pr( A ) = p k , we assume that z k ( t ) = Pr k ( Z = t ) = p k x ( t ) + (1 − p k ) y ( t ). But after seeing a new value of Z , say Z = Z k , we will believe the hypothesis with the a posteriori probability p k +1 = Pr( A | Z k ). Show that D ( y || x ) is the expected “ information gained,” lg( p k +1 /(1 − p k +1 )) − lg( p k /(1 − p k )), averaged with respect to the distribution of Y .
124. [ HM22 ] ( Importance sampling .) In the setting of exercise 121 , we have E f ( Y ) = E( ρ ( X ) f ( X )) for any function f ; thus ρ ( t ) measures the “importance” of the X -value t with respect to the Y -value t . Many situations arise when it’s easy to generate random variables with an approximate distribution x ( t ), but difficult to generate them with the exact distribution y ( t ). In such cases we can estimate the average value E ( f ) = E f ( Y ) by calculating E n ( f ) = ( ρ ( X 1 ) f ( X 1 )+ ··· + ρ ( X n ) f ( X n ))/ n , where the X j are independent random variables, each distributed as x ( t ).
Let n = c 4 2 D ( y || x ) . Prove that if c > 1, this estimate E n is relatively accurate:
E | E n ( f ) - E ( f ) | ≤ ∥ f ∥ ( 1 / c + 2 Δ c ) , where Δ c \= Pr( ρ ( Y ) > c 2 2 D ( y ∥ x ) ).
(Here ∥ f ∥ denotes (E f ( Y ) 2 ) 1/2 .) On the other hand if c < 1 the estimate is poor:
Pr( E n ( 1 ) ≥ a ) ≤ c 2 + ( 1 − Δ c ) / a . for 0 < a < 1 ,
Here ‘1’ denotes the constant function f ( y ) = 1 (hence E (1) = 1).
▶ 125. [ M28 ] Let 〈 a n 〉 = a 0 , a 1 , a 2 , ... be a sequence of nonnegative numbers with no “ internal zeros” (no indices i < j < k such that a i > 0, a j = 0, a k > 0). We call it log-convex if a n 2 ≤ a n −1 a n +1 for all n ≥ 1, and log-concave if a n 2 ≥ a n −1 a n +1 for all n ≥ 1.
-
What sequences are both log-convex and log-concave?
-
If 〈 a n 〉 is log-convex or log-concave, so is its “ left shift” 〈 a n +1 〉 = a 1 , a 2 , a 3 , .... What can be said about the “ right shift” 〈 a n −1 〉 = c , a 0 , a 1 , ... , given c ?
-
Show that a log-concave sequence has a m a n ≥ a m −1 a n +1 whenever 1 ≤ m ≤ n .
-
If 〈 a n 〉 and 〈 b n 〉 are log-convex, show that 〈 a n + b n 〉 is also log-convex.
-
If 〈 a n 〉 and 〈 b n 〉 are log-convex, show that 〈 ∑ k ( n k ) a k b n − k 〉 is also log-concave?
-
If 〈 a n 〉 and 〈 b n 〉 are log-concave, is 〈∑ k a k b n – k 〉 also log-concave?
-
If 〈 a n 〉 and 〈 b n 〉 are log-concave, is 〈 ∑ k ( n k ) a k b n − k 〉 also log-concave?
126. [ HM22 ] Suppose X 1 , ..., X n are independent binary random variables with E X k = m/n for all k , where 0 ≤ m ≤ n . Prove that Pr( X 1 +···+ X n = m ) = Ω( n −1/2 ).
127. [ HM30 ] Say that a binary vector x = x 1 ... x n is sparse if νx ≤ θn , where θ is a given threshold parameter, 0 < θ < 1 2 . Let S ( n, θ ) be the number of sparse vectors.
-
Show that S ( n, θ ) ≤ 2 H (θ) n , where H denotes entropy.
-
On the other hand, S ( n, θ ) is also Ω ( 2 H ( 0 ) n / n ) .
-
Let X ′ and X ″ be independent and uniformly distributed sparse vectors, and let x be any binary vector, all of length n . Prove that x ⊕ X ′ ⊕ X ″ is q.s. not sparse. [ Hint: Both X ′ and X ″ q.s. have nearly θn 1s. Furthermore exercise 126 can be used to pretend that the individual bits of x ⊕ X ′ ⊕ X ″ are independent.]
▶ 128. [ HM26 ] Consider n independent processors that are competing for access to a shared database. They’re totally unable to communicate with each other, so they agree to adopt the following protocol: During each unit of time, called a “round,” each processor independently generates a random uniform deviate U and “pings” the database (attempts an access) if U < 1/n. If exactly one processor pings, its attempt succeeds; otherwise nobody gets access during that round.
-
What is the probability that some processor pings successfully, in a given round?
-
How many rounds does a particular processor have to wait, on average, before being successful? (Give an asymptotic answer, correct to O (1/ n ).)
-
Let ∈ be any positive constant. Prove that the processors a.s. will all have at least one success during the first (1 + ∈) en ln n rounds. Hint: See exercise 3.3.2–10.
-
But prove also that they a.s. will not all succeed during (1 − ∈) en ln n rounds.
129. [ HM28 ] ( General rational summation. ) Let r ( x ) = p ( x )/ q ( x ), where p and q are polynomials, deg( q ) ≥ deg( p ) + 2, and q has no integer roots. Prove that
Σ k \= − ∞ ∞ p ( k ) q ( k ) \= − π Σ j \= 1 t ( Residue of r ( z ) cot π z at z j ) ,
where z 1 , ... , z t are the roots of q . Hint: Show that 1 2 π i ∮ r ( z ) cot π z d z \= O ( 1 / M ) , when the integral is taken along the square path for which max ( | ℜ z | , | ℑ z | ) \= M + 1 2 .
Use this method to evaluate the following sums in “closed form”:
Σ k \= − ∞ ∞ 1 ( 2 k − 1 ) 2 ; Σ k \= − ∞ ∞ 1 k 2 + 1 ; Σ k \= − ∞ ∞ 1 k 2 + k + 1 ; Σ k \= − ∞ ∞ 1 ( k 2 + k + 1 ) ( 2 k − 1 ) .
130. [ HM30 ] Many of the probability distributions that arise in modern computer applications have “ heavy tails,” in contrast to bell-shaped curves that are concentrated near the mean. The simplest and most useful example — although it also is somewhat paradoxical — is the Cauchy distribution , defined by
Pr ( X ≤ x ) \= 1 π x − ∞ d t 1 + t 2 .
-
If X is a Cauchy deviate, what are E X and E X 2 ?
-
What are Pr(| X | ≤ 1), Pr ( | X | ≤ 3 ) , and Pr ( | X | ≤ 2 + 3 ) ?
-
If U is a uniform deviate, show that tan( π ( U − 1/2)) is a Cauchy deviate.
-
Suggest other ways to generate Cauchy deviates.
-
Let Z = pX + qY where X and Y are independent Cauchy deviates and p + q = 1, p, q > 0. Prove that Z has the Cauchy distribution.
-
Let X = ( X 1 ,..., X n ) be a vector of n independent Cauchy deviates, and let c = ( c 1 ,..., c n ) be any vector of real numbers. What is the distribution of the dot product c · X = ( c 1 X 1 + ··· + c n X n )?
-
What is the “ characteristic function” E e itX , when X is a Cauchy deviate?
131. [ HM30 ] An integer-valued analog of Cauchy deviates, which we shall call the “ iCauchy distribution” for convenience, has Pr( X = n ) = c/ (1 + n 2 ) for −∞ < n < ∞.
-
What constant c makes this a valid probability distribution?
-
Compare the distribution of X + Y to the distribution of 2 Z , when X , Y , and Z are independent iCauchy deviates.
▸ 132. [ HM26 ] Choose n balls from an urn that contains N balls, K of which are green.
-
What’s the probability p k that exactly k green balls are chosen?
-
What are the mean, modes, and variance? (A mode in a probability distribution is a value of k that’s a local maximum: p k − 1 ≤ p k ≥ p k +1 and p k > 0.)
-
Let X j = [the j th ball is green], so that p k = Pr( X 1 + ··· + X n = k ). Use a Doob martingale to establish an exponentially small upper bound on the tail probability Pr( X 1 + ··· + X n ≥ nK/N + x ).
133. [ M25 ] Call t rows of a binary matrix shattered if all 2 t possible columns occur.
-
Prove that any binary matrix with m rows and more than f ( m , t ) \= ( m 0 ) + ( m 1 ) + ... + ( m t − 1 ) distinct columns contains t shattered rows.
-
Construct a matrix with m rows and f ( m, t ) distinct columns, no t shattered.
134. [ HM28 ] (V. N. Vapnik and A. Ya. Chervonenkis, 1971.) Many different events 𝓐 = { A 1 ,..., A n }, which depend on each other in complicated ways, might be of interest simultaneously, and we often want to learn their probabilities p j = Pr( A j ) by observing a sufficiently large sample. If χ = { X 1 ,..., X m } is a subset of the probability space Ω, the probability of sampling χ (with replacement) is Pr( X 1 ... Pr( X m ).
Consider the random m × n binary matrix whose entries are X ij = [ X i ∈ A j ] = [the atomic event X i is an instance of A j ]. The empirical probability P ^ j ( χ ) based on sample χ is then M j (χ )/ m , where M j (χ ) = X 1 j + ··· + X mj , for 1 ≤ j ≤ n .
Let E j ( χ ) \= | P ^ j ( χ ) − p j | be the difference between the empirical and actual probabilities. We hope that the uniform sampling error E (χ) = max 1≤ j≤n E j (χ) is small.
-
For all ∈ > 0 and 1 ≤ j ≤ n , prove that Pr( E j (χ) > ∈) ≤ 1/(4∈ 2 m ).
-
Given independent m -samples χ and χ′, let E ^ j ( χ , χ ′ ) \= | P ^ j ( χ ) − P ^ j ( χ ′ ) | . Show that Pr ( E ^ j ( χ , χ ′ ) > ∈ ) < 2 e − 2 ∈ 2 m . Hint: See exercise 132 .
-
Let Δ m (𝓐) be the maximum number of distinct columns that can appear in any of the m × n binary matrices obtainable from samples χ of size m . If m ≥ 2/∈ 2 , use (a) and (b) to prove that Pr ( E ( χ ) > ∈ ) ≤ 4 Δ 2 m ( A ) e − ∈ 2 m / 8 .
[ Note: The maximum d such that d atomic events of Ω can be shattered by the events of 𝓐 is called the Vapnik–Chervonenkis dimension of 𝓐 . Exercise 133 shows that Δ m ( 𝓐 ) has polynomial growth of degree d .]
135. [ HM30 ] ( Baxter permutations. ) Let P = p 1 ...p n be a permutation of {1,..., n }, and let P − = q 1 ...q n be its inverse. These permutations are called Baxter permutations if and only if there are no indices k and l with 0 < k,l < n such that either ( q k < l and p l > k and p l +1 < k and q k +1 > l ) or ( q k +1 < l and p l < k and p l +1 > k and q k > l ).
What’s a good way to count the number b n of n -element Baxter permutations?
136. [ HM20 ] Let f ( x )=[ x> 0] x ln x be the fundamental convex function that underlies formulas for entropy. Prove or disprove: If 0≤ x ≤ y ≤1 then | f ( y )− f ( x )|≤| f ( y − x )|.
137. [ HM31 ] The median of a real-valued random variable X is a value m for which Pr ( X ≤ m ) ≥ 1 2 and Pr ( X ≥ m ) ≥ 1 2 . For example, if X is a binary random variable with E X = p , then 1 is a median ⇔ p ≥ 1 2 ; 0 is a median ⇔ p ≤ 1 2 ; and a value m between 0 and 1 is a median ⇔ p \= 1 2 . Let med X be the set of all X ’s medians.
-
Show that med X is always a closed interval [ m .. m ¯ ] , for some real m ≤ m ¯ .
-
If m < m ¯ , then Pr ( X ≤ m ) \= Pr ( X ≥ m ¯ ) \= 1 2 . (Discretely, X is never actually equal to any value of med X except for the two extreme elements m and m ¯ .)
-
True or false: If Pr ( X ∈ [ x .. y ] ) ≥ 1 2 then [ x..y ] ⊇ med X .
-
Assuming that E | X − c | exists for all c , show that E | X − m | = min c E | X − c | if and only if m ∈ med X .
-
True or false: If μ = E X and σ 2 = var X and m ∈ med X then | μ − m | ≤ σ .
-
Prove an analog of Jensen’s inequality: If f is convex for all real values of x , then f (med X ) ≤ med f ( X ), assuming that we interpret this formula properly in cases when med X and/or med f ( X ) aren’t unique.
▸ 138. [ M21 ] ( Law of total variance .) The “truly marvelous identity” ( 12 ), which is often called the law of total expectation, has an even more marvelous counterpart:
var( X ) = var(E( X | Y )) + E(var( X | Y )).
“The overall variance of a random variable X is the variance of its average plus the average of its variance, with respect to any other random variable Y .” Prove it.
▸ 139. [ HM33 ] (Frank Spitzer, 1956.) A random walk is defined by S 0 = 0 and S n = S n − 1 + X n for n > 0, where the integer-valued random variables X 1 , X 2 , ... are independent and have the same distribution. Let S n + \= max ( S n , 0 ) , S n − \= max ( + S n , 0 ) , R n = max( S 0 , S 1 ,..., S n , R n + \= R n − S n , and define the generating functions
r n ( w , z ) \= Σ j , k Pr ( R n \= j , R n + \= k ) w j z k , S n + ( z ) \= Σ k Pr ( S n + \= k ) z k , S n − ( z ) \= Σ k Pr ( S n − \= k ) z k .
Prove that these three basic quantities are related by the remarkable formula
Σ n \= 0 ∞ r n ( w , z ) t n \= exp ( Σ n \= 1 ∞ ( s n + ( w ) + s n − ( z ) − 1 ) t n n ) .
▸ 140. [ HM34 ] ( Smoothed analysis .) Algorithms are traditionally analyzed by either studying their worst case or an “average” case. A nice compromise between these extremes was introduced by D. A. Spielman and S.-H. Teng in JACM 51 (2004), 385–463: An adversary sets up the data for some particular case, and this data is perturbed by some random process. Then we analyze the expected running time when the algorithm is applied to the perturbed data, maximizing over all cases.
The purpose of this exercise is to carry out a smoothed analysis of Algorithm 1.2.10M, the very first algorithm that was analyzed in TAOCP: Given a sequence X = x 1 ...x n of distinct numbers, let λ ( X ) be the number of left-to-right maxima, namely the number of indices k with x k > x j for 1 ≤ j < k . When X is a random permutation, we showed in Section 1.2.10 that E λ ( X ) = H n ≈ ln n and var λ ( X ) \= H n − H n ( 2 ) . On the other hand, λ ( X ) can be as large as n .
Several natural models will give a smooth transition between ln n and n , when we suppose that an arbitrary sequence X ¯ \= x ¯ 1 ... x ¯ n is perturbed to get X = x 1 ...x n .
-
Given a permutation X ¯ of {1,..., n }, mark each x ¯ k with probability p (independently); then permute the marked elements uniformly to get X . What is E λ ( X ) when X ¯ \= 12... n (the only case for which λ ( X ¯ ) \= n ), and 0 < p < 1 is fixed?
-
Continuing (a), explore E λ ( X ) when X ¯ \= ( n − m + 1 ) ... n 1... ( n − m ) , p \= 1 2 .
-
Continuing (a) and (b), show that E λ ( X ) \= O ( ( n log n ) / p ) for all X ¯ .
-
A single swap in model (a) can reduce λ ( X ) from n to 1! So the following model is better: Let 0 ≤ x ¯ k ≤ 1 for 1 ≤ k ≤ n , and set x k ← x ¯ k + δ k , where δ k is uniformly random in [−∈..∈]. Show that E λ ( X ) is greatest when x ¯ 1 ≤ ⋅ ⋅ ⋅ ≤ x ¯ n .
-
Continuing (d), show that in this model we have E λ ( X ) \= O ( n / ∈ + log n ) .
141. [ M20 ] ( Arithmetic and geometric mean inequality ). When x k , p k > 0, prove that
p 1 x 1 + p 2 x 2 + ⋅ ⋅ ⋅ + p n x n p 1 + p 2 + ⋅ ⋅ ⋅ + p n ≥ ( x 1 p 1 x 2 p 2 ... x n p n ) 1 / ( p 1 + p 2 + ... + p n ) .
(For integer p k , these are the means of the multiset { p 1 · x 1 , p 2 · x 2 ,..., p n · x n }.)
▸ 142. [ M30 ] (L. J. Rogers, 1887.) Let M r = E | X | r be the r th absolute “moment” of the random variable X . (In particular, M r = ∞ if r < 0 and Pr( X =0) > 0.)
-
Suppose q ≤ r ≤ s ≤ t and q + t = r + s . Set the values of ( a j , b j , x j , y j ) in Binet’s identity, exercise 1.2.3–30, to ( p j , p j x j s − q , x j q , x j r ) , where p 1 , p 2 , ... are probabilities that sum to 1. What inequality involving M q , M r , M s , M t do you get?
-
Deduce from exercise 141 that M q s − r M r q − s M s r − q ≥ 1 when q < r < s and M r < ∞. Hint: What happens when p j and x j are replaced respectively by p j x j r and x j s − r ?
-
Let p > 1. Use the fact that M 1 / p ≤ M 1 1 / p to prove Hölder’s inequality :
Σ k \= 1 n a k b k ≤ ( Σ k \= 1 n a k p ) 1 p ( Σ k \= 1 n b k q ) 1 q , if 1 p + 1 q \= 1 and a k , b k ≥ 0.
-
Consequently | E XY | ≤ (E | X | p ) 1/ p (E | Y | q ) 1/ q .
143. [ M22 ] For p > 1, use Hölder’s inequality to prove Minkowski’s inequality :
(E | X + Y | p ) 1/ p ≤ (E | X | p ) 1/ p + (E | Y | p ) 1/ p .
144. [ HM26 ] If E X exists and is finite, clearly E( X − E X ) = 0.
-
If p ≥ 1 and E Y = 0, then E | X | p ≤ E | X + Y | p when X and Y are independent.
-
The symmetrization of a random variable X is X sym = X + − X − , where X + and X − are independent random variables, each with the same distribution as X . Prove that p ≥ 1 and E X = 0 implies E | X | p ≤ E | X sym | p .
-
Suppose X 1 , ... , X n are independent random variables that are symmetric about 0, in the sense that Pr( X j = x ) = Pr( X j = − x ) for 1 ≤ j ≤ n and all x . Prove that E | X 1 | p + ··· + E | X n | p ≤ E | X 1 + ··· + X n | p , when p ≥ 2. Hint: | x | p + | y | p ≤ 1 2 ( | x + y | p + | x − y | p ) .
-
Now suppose only that X 1 , ... , X n are independent with E X 1 = ··· = E X n = 0. Prove that E | X 1 | p + ··· +E | X n | p ≤ 2 p E | X 1 + ··· + X n | p for p ≥ 2.
▸ 145. [ M20 ] ( Khinchin’s inequality. ) Let a 1 , ... , a n be real numbers and let X 1 , ... , X n be random signs: Independently, each X k is equally likely to be +1 or −1. Prove that
( a 1 2 + ⋅ ⋅ ⋅ a n 2 ) m ≤ E ( ( a 1 X 1 + ⋅ ⋅ ⋅ + a n X n ) 2 m ) ≤ ( 2 m − 1 ) ! ! ( a 1 2 + ⋅ ⋅ ⋅ + a n 2 ) m
for all integers m ≥ 0, where ( 2 m − 1 ) ! ! \= Π k \= 1 m ( 2 k − 1 ) is a “ semifactorial.”
146. [ M25 ] ( Marcinkiewicz and Zygmund’s inequality .) Let X 1 , ... , X n be independent random variables, each with mean 0 but possibly with different distributions. Then
1 2 2 m E ( ( Σ k \= 1 n X k 2 ) m ) ≤ E ( ( Σ k \= 1 n X k ) 2 m ) ≤ 2 2 m ( 2 m − 1 ) ! ! E ( ( Σ k \= 1 n X k 2 ) m ) .
147. [ M34 ] ( Rosenthal’s inequality .) Under the assumptions of exercise 146 ,
1 2 2 m B ≤ E ( ( Σ k \= 1 n X k ) 2 m ) ≤ 2 m 2 + 2 m ( 2 m − 1 ) ! ! B , B \= max ( Σ k \= 1 n E X k 2 m , ( Σ k \= 1 n E X k 2 ) m ) .
Every man must judge for himself between conflicting vague probabilities.
— CHARLES DARWIN, letter to N. A. von Mengden (5 June 1879)