Let X be a random variable with cumulative distribution function FX(x). We can derive the distribution function for the minimum Yn=min(X1,X2,⋯,Xn) and for the maximum Zn=max(X1,X2,⋯,Xn) of n IID random variables with cdf FX(x) as
Let X1,X2,⋯,Xn be IID random variables with uniform distribution between 0 and 1. What are the cumulative distribution function, the probability density function and expected value of Zn=max(X1,X2,⋯,Xn)? What are the cumulative distribution function, the probability density function and expected value of Yn=min(X1,X2,⋯,Xn)?
Solution: This is a direct test of textbook knowledge. For uniform distribution on [0,1], FX(x)=x and fX(x)=1. Applying FX(x) and fX(x) to Zn=max(X1,X2,⋯,Xn) we have
and E[Yn]=∫01nx(1−x)n−1dx=∫01n(1−y)yn−1dx=[yn]01−n+1n[yn+1]01=n+11.
Correlation of max and min
Let X1 and X2 be IID random variables with uniform distribution between 0 and 1, Y=min(X1,X2) and Z=max(X1,X2). What is the probability of Y≥y given that Z≤z for any y,z∈[0,1]? What is the correlation of Y and Z?
Solution: This problem is another demonstration that a figure is worth a thousand words. As shown in Figure 4.7, the probability that Z≤z is simply the square with side length z. So P(Z≤z)=z2. Since Z=max(X1,X2) and Y=min(X1,X2), we must have Y≤Z for any pair of X1 and X2. So if y>z, P(Y≥y∣Z≤z)=0. For y≤z, that X1 and X2 satisfies Y≥y and Z≤z is the square with vertices (y,y),(z,y),(z,z), and (y,z), which has an area (z−y)2. So P(Y≥y∩Z≤z)=(z−y)2. Hence
P(Y≥y∣Z≤z)={(z−y)2/z2,0,if 0≤z≤1 and 0≤y≤zotherwise.
Now let’s move on to calculate the correlation of Y and Z.
corr(Y,Z)=std(Y)×std(Z)cov(Y,Z)=E[Y2]−E[Y]2×E[Z2]−E[Z]2E[YZ]−E[Y]E[Z]101Figure 4.7 Distribution of X1, X2, their maximum and minimum.
Using previous problem’s conclusions, we have E[Y]=2+11=31, E[Z]=2+12=32. From the pdfs of Y and Z, fYn(x)=n(1−x)n−1=2(1−x) and fZ(z)=nzn−1=2z, we can also get E[Yn2]=∫012(1−y)y2dy=32−42=61 and E[Zn2]=∫012z3dz=42, which give us the variances: var(Y)=E[Y2]−E[Y]2=61−(31)2=181 and var(Z)=42−(32)2=181.33
To calculate E[YZ], we can use E[YZ]=∫01∫0zyzf(y,z)dydz. To solve this equation, we need f(y,z). Let’s again go back to Figure 4.7. From the figure we can see that when 0≤z≤1and0≤y≤z, F(y,z) is the shadowed area with probability
F(y,z)=P(Y≤y∩Z≤z)=P(Z≤z)−P(Y≥y∩Z≤z)=z2−(z−y)2=2zy−y2∴f(y,z)=∂y∂z∂F(y,z)=2 and E[YZ]=∫01∫0z2yzdydz=∫00z[y2]0zdz=∫01z3dz=41.102
An alternative and simpler approach to calculate E[YZ] is again to take advantage of symmetry. Notice that no matter x1≤x2 or x1>x2, we always have yz=x1x2 (z=max(x1,x2) and y=min(x1,x2)).
Hence cov(Y,Z)=E[YZ]−E[Y]E[Z]=361 and corr(Y,Z)=var(Y)×var(Z)cov(Y,Z)=21.
Sanity check: That Y and Z have positive autocorrelation make sense since when Y becomes large, Z tends to become large as well (Z≥Y).
Random ants
500 ants are randomly put on a 1-foot string (independent uniform distribution for each ant between 0 and 1). Each ant randomly moves toward one end of the string (equal probability to the left or right) at constant speed of 1 foot/minute until it falls off at one end of the string. Also assume that the size of the ant is infinitely small. When two ants collide head-on, they both immediately change directions and keep on moving at 1 foot/min. What is the expected time for all ants to fall off the string?34
Solution: This problem is often perceived to be a difficult one. The following components contribute to the complexity of the problem: The ants are randomly located; each ant can go either direction; an ant needs to change direction when it meets another ant. To solve the problem, let’s tackle these components.
When two ants collide head-on, both immediately change directions. What does it mean? The following diagram illustrates the key point:
Before collision: ;After collision: ;switch label:
When an ant A collides with another ant B, both switch direction. But if we exchange the ants’ labels, it’s like that the collision never happens. A continues to move to the right and B moves to the left. Since the labels are randomly assigned anyway, collisions make no difference to the result. So we can assume that when two ants meet, each just keeps on going in its original direction. What about the random direction that each ant chooses? Once the collision is removed, we can use symmetry to argue that it makes no difference which direction that an ant goes either. That means if an ant is put at the x-th foot, the 103expected value for it to fall off is just x min. If it goes in the other direction, simply set x to 1−x. So the original problem is equivalent to the following:
What is the expected value of the maximum of 500 IID random variables with uniform distribution between 0 and 1?
Clearly the answer is 500499 min, which is the expected time for all ants to fall off the string.