Keuangan Kuantitatif · Buku 18 · Karier

Interviews I: Maths, Probability and Speed

Buku ini belum tersedia dalam Bahasa Indonesia. Edisi: English, Français.

Interviews I: Maths, Probability and Speed · Karier

28Timed Test 5

Take it in one sitting, without notes or a calculator.

Section A — 6 questions, 40 minutes

Question 28.1

Events arrive as a Poisson process with rate 2 per hour. What are the mean and variance of the time of the third event? What is the probability that the third event arrives after one hour?

Answer

Answer to Question 28.1.

The mean is 1.51.5 hours, the variance is 0.750.75, and the probability is 5e−2≈0.6775e^{-2} \approx 0.677.

The gaps are independent exponentials with mean 12\frac12 and variance 14\frac14. The third arrival is the sum of three of them, a Gamma variable. So the mean is 32\frac32 and the variance is 34\frac34.

The third arrival comes after one hour exactly when at most 2 events occur in that hour. The count is Poisson with mean 2, so

P=e−2(1+2+222)=5e−2.P = e^{-2}\left(1 + 2 + \frac{2^2}{2}\right) = 5e^{-2}.

With e−2≈0.135e^{-2} \approx 0.135, this gives 0.6770.677. The mean of 1.51.5 makes this plausible. A simulation agrees.

Classic wrong answer. Using a normal approximation with 3 terms, which gives about 0.720.72. The Gamma is skewed, and the exact route takes one line.

Question 28.2

You flip a fair coin until the first head, and let NN be the number of flips. Then you roll NN fair dice and add them up. Find the mean and the variance of the sum.

Answer

Answer to Question 28.2.

The mean is 7, and the variance is 301330\frac13.

NN is geometric with mean 2 and variance 2. A die has mean 3.53.5 and variance 3512\frac{35}{12}.

The law of total expectation gives 2×3.5=72 \times 3.5 = 7.

The law of total variance gives

Var⁡S=ENVar⁡X+Var⁡N(EX)2=2⋅3512+2⋅12.25=5.83+24.5=30.33.\operatorname{Var}S = \mathbb{E}N\operatorname{Var}X + \operatorname{Var}N(\mathbb{E}X)^2 = 2 \cdot \frac{35}{12} + 2 \cdot 12.25 = 5.83 + 24.5 = 30.33.

Most of the variance comes from not knowing how many dice there are. A simulation returns 7.07.0 and 30.330.3.

Classic wrong answer. Using ENVar⁡X\mathbb{E}N\operatorname{Var}X alone, or Var⁡(N)Var⁡(X)\operatorname{Var}(N)\operatorname{Var}(X). The second term has the squared mean of XX, not its variance.

Question 28.3

A coin has an unknown probability of heads, with a uniform prior on [0,1][0, 1]. You see 3 heads in 4 flips. What is the posterior mean? What is the probability that the next two flips are both heads?

Answer

Answer to Question 28.3.

The posterior mean is 23\frac23, and the probability of two heads is 1021\frac{10}{21}.

The uniform prior is Beta(1,1)(1, 1), so after 3 heads and 1 tail the posterior is Beta(4,2)(4, 2). Its mean is 46\frac46.

The next two flips use the posterior of the posterior. The first head has chance 46\frac46. After it, the distribution is Beta(5,2)(5, 2), so the next head has chance 57\frac57. The product is 2042=1021=0.476\frac{20}{42} = \frac{10}{21} = 0.476.

Note that this exceeds (23)2=0.444(\frac23)^2 = 0.444. Uncertainty in the coin’s bias makes the two flips positively correlated. A numerical integral of p2p^2 over the posterior gives the same value.

Classic wrong answer. Squaring the posterior mean, which assumes that the bias is now known exactly. The difference is the posterior variance of pp.

Question 28.4

Five red and five blue balls are lined up in a random order. A run is a maximal block of one colour. What is the expected number of runs? What is the probability of exactly two runs?

Answer

Answer to Question 28.4.

The expected number is 6, and the probability of exactly two runs is 1126\frac{1}{126}.

The number of runs is 1 plus the number of neighbouring pairs of different colours. Take any one of the 9 neighbouring pairs. The chance that it has different colours is 510⋅59×2=59\frac{5}{10}\cdot\frac{5}{9} \times 2 = \frac59. So the mean is 1+9⋅59=61 + 9 \cdot \frac59 = 6.

Exactly two runs means all the reds and then all the blues, or the reverse. That is 2 orders out of (105)=252\binom{10}{5} = 252, so 1126\frac{1}{126}.

An enumeration of all 252 orders confirms both. It is more than the 5.55.5 runs of 10 independent fair flips, since drawing without replacement makes a change of colour a little more likely.

Classic wrong answer. Using 12\frac12 for each pair, as for independent flips, which gives 5.55.5. Having drawn a red, only 4 of the remaining 9 balls are red.

Question 28.5

Three fair dice are rolled. What is the probability that the product of the three numbers is divisible by 6?

Answer

Answer to Question 28.5.

The probability is 133216≈0.616\frac{133}{216} \approx 0.616.

The product is divisible by 6 when it has a factor of 2 and a factor of 3. Use the complement and inclusion–exclusion.

No factor of 2 means all dice odd: (12)3=27216(\frac12)^3 = \frac{27}{216}. No factor of 3 means no die showing 3 or 6: (23)3=64216(\frac23)^3 = \frac{64}{216}. Neither factor means all dice in {1,5}\{1, 5\}: (13)3=8216(\frac13)^3 = \frac{8}{216}.

So the failure chance is 27+64−8216=83216\frac{27 + 64 - 8}{216} = \frac{83}{216}, and the answer is 133216\frac{133}{216}. An enumeration confirms the count of 133.

Classic wrong answer. Multiplying the chances of having a factor of 2 and of having a factor of 3, as if independent. Both depend on the same dice: a 6 supplies both.

Question 28.6

XX and YY are independent standard normals. What is the chance that the point (X,Y)(X, Y) lies within radius 1 of the origin? What radius holds exactly half the probability?

Answer

Answer to Question 28.6.

The chance is 1−e−1/2≈0.3931 - e^{-1/2} \approx 0.393, and the radius is 2ln⁡2≈1.18\sqrt{2\ln 2} \approx 1.18.

R2=X2+Y2R^2 = X^2 + Y^2 has an exponential law with mean 2. In polar form, the density is 12πe−r2/2r dr dθ\frac{1}{2\pi}e^{-r^2/2}r\,dr\,d\theta, and so P(R>r)=e−r2/2P(R > r) = e^{-r^2/2}.

At r=1r = 1: 1−e−1/2=0.3931 - e^{-1/2} = 0.393. For the median: e−r2/2=12e^{-r^2/2} = \frac12 gives r=2ln⁡2r = \sqrt{2\ln 2}.

Compare one dimension: a standard normal is inside ±1\pm 1 with chance 0.6830.683. Going to two dimensions drops this to 0.3930.393. In a high dimension, the mass moves further out, a fact that matters for distance-based methods. A simulation agrees.

Follow-up. What is the mean radius? π/2=1.25\sqrt{\pi/2} = 1.25, the mean of a Rayleigh variable.

Section B — 6 questions, 60 minutes

Question 28.7

An election between A and B ends with 7 votes for A and 3 for B, counted in random order. What is the probability that A is strictly ahead throughout the count?

Answer

Answer to Question 28.7.

The probability is 7−37+3=25\frac{7 - 3}{7 + 3} = \frac25.

This is the ballot theorem. Count the bad orders. If the first vote is for B, the order is bad, and there are (92)\binom92 such orders. If the first vote is for A and the count is tied at some point, reflect the part before the first tie: this swaps A and B votes and gives a sequence starting with B. So that second group of bad orders matches the first group one-to-one.

The bad orders number 2(92)=722\binom92 = 72 out of (103)=120\binom{10}{3} = 120. So the good ones have 48120=25\frac{48}{120} = \frac25. An enumeration confirms this.

In the limits, a 3–3 count gives 0, as a tie at the end is forced, and a 7–0 count gives 1.

Classic wrong answer. Using the chance that A’s lead is positive at the end, which is 1 here, or simply A’s share of the votes, 710\frac{7}{10}.

Question 28.8

In a random graph on 10 vertices, each edge is present independently with probability 12\frac12. Find the mean and the variance of the number of triangles.

Answer

Answer to Question 28.8.

The mean is 15, and the variance is 52.552.5.

There are (103)=120\binom{10}{3} = 120 possible triangles, each present with chance 18\frac18. So the mean is 15.

Each indicator has variance 18⋅78=764\frac18 \cdot \frac78 = \frac{7}{64}, for a total of 120×764=13.125120 \times \frac{7}{64} = 13.125.

Covariances: two triangles with no common edge are independent. Two sharing exactly one edge have five edges in total, so

Cov⁡=2−5−2−6=164.\operatorname{Cov} = 2^{-5} - 2^{-6} = \frac{1}{64}.

Each triangle shares an edge with 3×7=213 \times 7 = 21 others, one for each edge and each of the 7 other vertices. So there are 120×21120 \times 21 ordered pairs, adding 252064=39.375\frac{2520}{64} = 39.375.

The total is 13.125+39.375=52.513.125 + 39.375 = 52.5. A simulation gives 15.015.0 and about 52.552.5. Note that the correlation adds exactly three times the independent variance.

Classic wrong answer. Stopping at 13.12513.125, which treats triangles as independent. Sharing an edge is a positive dependence, which makes the count much more variable.

Question 28.9

Using log⁡102=0.30103\log_{10}2 = 0.30103, how many decimal digits does 210002^{1000} have, and what is its leading digit?

Answer

Answer to Question 28.9.

It has 302 digits, and the leading digit is 1.

log⁡1021000=301.03\log_{10}2^{1000} = 301.03. A number with base-10 logarithm between 301 and 302 has 302 digits.

The fractional part gives the leading digits: 100.0310^{0.03}. Since ln⁡10≈2.3\ln 10 \approx 2.3, 100.03=e0.069≈1.0710^{0.03} = e^{0.069} \approx 1.07. So the number begins with 1.07, and the first digit is 1.

An exact computation with big integers gives 302 digits, starting 1071. Note that a small error in the logarithm’s fifth digit, multiplied by 1000, moves the fractional part by a hundredth, and that is why the digits given in the question are enough for the first digit and just about for the second.

Follow-up. How often is the first digit of 2n2^n equal to 1, in the long run? log⁡102=30.1%\log_{10}2 = 30.1\%. The fractional parts of nlog⁡102n\log_{10}2 are equidistributed, which gives Benford’s law for this sequence.

Question 28.10

Bus line A arrives every 10 minutes and line B every 15 minutes, each on a fixed timetable, with independent uniform phases. You arrive at a random time and take the first bus. What is your expected wait?

Answer

Answer to Question 28.10.

The expected wait is 359≈3.89\frac{35}{9} \approx 3.89 minutes.

The waits are U∼uniform(0,10)U \sim \text{uniform}(0, 10) and V∼uniform(0,15)V \sim \text{uniform}(0, 15). Then

Emin⁡(U,V)=∫010(1−t10)(1−t15)dt.\mathbb{E}\min(U, V) = \int_0^{10}\left(1 - \frac{t}{10}\right)\left(1 - \frac{t}{15}\right)dt.

Expanding the integrand as 1−t6+t21501 - \frac{t}{6} + \frac{t^2}{150}, the integral is 10−10012+1000450=10−8.33+2.22=3.8910 - \frac{100}{12} + \frac{1000}{450} = 10 - 8.33 + 2.22 = 3.89. A simulation returns 3.893.89.

Checks: the wait must be below 5, the mean wait for A alone. The rule for Poisson lines with the same frequencies gives 1/(110+115)=61/(\frac{1}{10} + \frac{1}{15}) = 6, which is much longer: regular buses are better than random ones.

Classic wrong answer. Giving 3, by combining the two mean waits as parallel rates of 15+17.5\frac15 + \frac{1}{7.5}. The waits are uniform, not exponential.

Question 28.11

A game show has 5 doors, one with a prize. You choose a door. The host, who knows where the prize is, opens one other door with no prize behind it, and offers a switch. If you switch at random to one of the three remaining closed doors, what is your chance of winning?

Answer

Answer to Question 28.11.

Switching wins with probability 415\frac{4}{15}, against 15\frac15 for staying.

Your door has the prize with chance 15\frac15, and the host’s action does not change this: the host can always open a goat door. So the other four doors hold the prize with chance 45\frac45, and the host has shown that one of them does not. That 45\frac45 is now spread across 3 doors.

So each closed door you did not choose has chance 415\frac{4}{15}. The sum checks: 15+3×415=1\frac15 + 3 \times \frac{4}{15} = 1.

A simulation with a random host gives 0.2670.267. Switching is better by a third. With nn doors and one opened, the chance is (n−1)/(n(n−2))(n - 1)/(n(n - 2)). For n=3n = 3, this is 23\frac23, the well-known case.

Classic wrong answer. Saying 14\frac14, with four closed doors treated as equally likely. Your own door is not like the others: the host was never allowed to open it, so the host’s choice says nothing about it.

Question 28.12

XX is binomial with 100 trials and success probability 12\frac12. Bound P(X≥70)P(X \ge 70) by Hoeffding’s inequality exp⁡(−2t2/n)\exp(-2t^2/n), with tt the excess over the mean. Compare the bound with Chebyshev’s inequality and the normal approximation.

Answer

Answer to Question 28.12.

Hoeffding gives e−8≈3.4×10−4e^{-8} \approx 3.4 \times 10^{-4}, Chebyshev gives 0.06250.0625 for the two-sided event, and the normal approximation gives about 5×10−55 \times 10^{-5}.

Here t=20t = 20 and n=100n = 100, so 2t2/n=82t^2/n = 8. The bound is e−8e^{-8}.

Chebyshev uses the variance of 25: P(∣X−50∣≥20)≤25/400=0.0625P(|X - 50| \ge 20) \le 25/400 = 0.0625. One tail is at most half of this if symmetry is used, 0.0310.031.

The normal approximation with continuity correction uses z=19.5/5=3.9z = 19.5/5 = 3.9, with tail 4.8×10−54.8 \times 10^{-5}. The exact binomial tail is 3.9×10−53.9 \times 10^{-5}.

So Chebyshev is off by a thousandfold, and Hoeffding by a factor of about 9, which is good for a bound with no assumption beyond boundedness. Each is valid: they only trade tightness for generality.

Classic wrong answer. Treating a bound as an estimate. An upper bound says what cannot happen, and it can be far from the true value.