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

24Timed Test 1

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

Section A — 6 questions, 40 minutes

Question 24.1

A fair coin is flipped 10 times. What is the probability that no two heads appear in a row?

Answer

Answer to Question 24.1.

The answer is 144/1024=9/64≈0.141144/1024 = 9/64 \approx 0.141.

Let ana_n be the number of strings of nn flips with no two adjacent heads. A good string ends either in tails, after any good string of length n−1n - 1, or in tails-heads, after any good string of length n−2n - 2. So an=an−1+an−2a_n = a_{n-1} + a_{n-2}, with a1=2a_1 = 2 and a2=3a_2 = 3. The sequence runs 2,3,5,8,13,21,34,55,89,1442, 3, 5, 8, 13, 21, 34, 55, 89, 144, and there are 210=10242^{10} = 1024 equally likely strings.

Why it matters. Writing down the last flip or two is the fastest route through most counts of this kind, and it avoids a long case analysis.

Question 24.2

Two players take turns flipping one fair coin, and the first player goes first. A player wins by flipping tails when the flip just before was heads. What is the probability that the first player wins?

Answer

Answer to Question 24.2.

The first player wins with probability 4/94/9.

Use first-step analysis, with two states for the player about to flip. Let yy be that player’s chance of winning when the flip before was heads, and xx when it was not. If the flip before was heads, tails wins at once, and heads hands the same state to the opponent:

y=12+12(1−y),so y=23.y = \tfrac12 + \tfrac12(1 - y), \quad\text{so } y = \tfrac23.

If not, any flip hands the turn over, with heads giving the opponent the good state:

x=12(1−y)+12(1−x),so x=49.x = \tfrac12(1 - y) + \tfrac12(1 - x), \quad\text{so } x = \tfrac49.

The first player starts in the state xx.

Classic wrong answer. Moving first is not an advantage here. Your first flip cannot win, and it may hand the opponent a winning chance.

Question 24.3

You have 2 identical eggs and a building of 100 floors. An egg survives a drop from any floor up to some unknown floor, and breaks from any floor above it. A surviving egg can be used again. What is the smallest number of drops that guarantees you find that floor?

Answer

Answer to Question 24.3.

The answer is 14 drops, starting from floor 14.

If your plan allows kk drops, the first drop can be at most from floor kk: if the egg breaks, the second egg has to walk up through the k−1k - 1 floors below, one at a time. If it survives, k−1k - 1 drops remain, so the next jump is k−1k - 1 floors, and so on. Thus kk drops can cover k+(k−1)+⋯+1=k(k+1)/2k + (k - 1) + \dots + 1 = k(k + 1)/2 floors. Since 13⋅14/2=9113 \cdot 14/2 = 91 is too few and 14⋅15/2=10514 \cdot 15/2 = 105 is enough, k=14k = 14, with the first egg going to floors 14, 27, 39, and so on.

Classic wrong answer. Equal steps of 10, which costs up to 19 drops. Equal steps waste the cost of the early drops.

Follow-up. And with 3 eggs? 9 drops.

Question 24.4

XX and YY are independent and uniform on [0,1][0, 1]. What is the probability that 14<∣X−Y∣<12\tfrac14 < |X - Y| < \tfrac12?

Answer

Answer to Question 24.4.

The answer is 5/165/16.

Find it by areas in the unit square. The event ∣X−Y∣>a|X - Y| > a is two right-angled corner triangles, each with legs 1−a1 - a, with total area (1−a)2(1 - a)^2. So P(∣X−Y∣<a)=1−(1−a)2P(|X - Y| < a) = 1 - (1 - a)^2, and

P(14<∣X−Y∣<12)=(34)2−(12)2=916−416=516,P\bigl(\tfrac14 < |X - Y| < \tfrac12\bigr) = \bigl(\tfrac34\bigr)^2 - \bigl(\tfrac12\bigr)^2 = \tfrac{9}{16} - \tfrac{4}{16} = \tfrac{5}{16} ,

which is the shaded area in Figure 24.1.

The unit square with the two shaded bands where |X - Y| lies between 1/4 and 1/2. The dashed line is X = Y.
Figure 24.1. The unit square with the two shaded bands where ∣X−Y∣|X - Y| lies between 14\tfrac14 and 12\tfrac12. The dashed line is X=YX = Y.

Question 24.5

A strategy has monthly returns that are independent and normal, and its annual Sharpe ratio, mean over standard deviation, is 1. About what fraction of its months lose money?

Answer

Answer to Question 24.5.

About 0.390.39 of months lose money, or 0.3860.386 to three places. Anything from 0.380.38 to 0.390.39 is fine by hand.

Over 12 independent months, mean and variance both scale by 12, so the annual Sharpe ratio is 12\sqrt{12} times the monthly one. The monthly Sharpe ratio is therefore 1/12≈0.291/\sqrt{12} \approx 0.29. A month loses money when a standard normal falls below −0.29-0.29. Near zero the normal density is about 0.40.4, so this probability is about 0.5−0.29⋅0.4=0.3840.5 - 0.29 \cdot 0.4 = 0.384, and the exact value is 0.3860.386.

Why it matters. Even a strategy with a Sharpe ratio of 1 loses in almost two months out of five. Expect that before you judge a live track record by a bad quarter.

Question 24.6

A 5×55 \times 5 matrix has 1 in every diagonal entry and 0.250.25 in every other entry. What is its determinant?

Answer

Answer to Question 24.6.

The determinant is 81/128≈0.63381/128 \approx 0.633.

Write the matrix as 0.75 I+0.25 11⊤0.75\,I + 0.25\,\mathbf{1}\mathbf{1}^\top, where 1\mathbf{1} is the vector of ones. The matrix 11⊤\mathbf{1}\mathbf{1}^\top has eigenvalue 5 in the direction of 1\mathbf{1} and eigenvalue 0 on the four directions orthogonal to it. So the eigenvalues are 0.75+0.25⋅5=20.75 + 0.25 \cdot 5 = 2, once, and 0.750.75, four times. The determinant is the product: 2⋅(3/4)4=81/1282 \cdot (3/4)^4 = 81/128.

Follow-up. How negative could the common off-diagonal entry cc be, for this to remain a correlation matrix? The large eigenvalue becomes 1+4c1 + 4c, which must not be negative. So c≥−1/4c \ge -1/4.

Section B — 6 questions, 60 minutes

Question 24.7

A player takes 100 basketball shots, making the first and missing the second. From then on, the probability of making each shot equals the fraction of shots made so far. What is the probability of making exactly 50 of the 100?

Answer

Answer to Question 24.7.

The probability is 1/991/99. All totals from 1 to 99 are equally likely.

This is a Pólya urn: each outcome adds one to its own count, and the next probability is the proportion. Prove the claim by induction. After nn shots, suppose the number of makes is uniform on 1,…,n−11, \dots, n - 1, so each value has probability 1/(n−1)1/(n - 1). To make kk of n+1n + 1, either you had k−1k - 1 and made the shot, or you had kk and missed:

1n−1(k−1n+n−kn)=1n−1⋅n−1n=1n.\frac{1}{n - 1}\left(\frac{k - 1}{n} + \frac{n - k}{n}\right) = \frac{1}{n - 1}\cdot\frac{n - 1}{n} = \frac1n .

So after n+1n + 1 shots the number of makes is uniform on 1,…,n1, \dots, n. It starts true at n=2n = 2, and with 100 shots there are 99 values.

Classic wrong answer. Expecting a peak at 50 like a binomial. The shots are not independent, and an early streak persists.

Question 24.8

A stick of length 1 is cut at two independent uniform points. How long, on average, is the longest of the three pieces?

Answer

Answer to Question 24.8.

The expected longest piece is 11/18≈0.61111/18 \approx 0.611.

Use the tail formula with inclusion–exclusion. Any one piece exceeds xx with probability (1−x)2(1 - x)^2. Two chosen pieces both exceed xx with probability (1−2x)2(1 - 2x)^2 when 2x<12x < 1, and all three with probability (1−3x)2(1 - 3x)^2 when 3x<13x < 1. Hence

P(L>x)=3(1−x)2−3(1−2x)+2+(1−3x)+2.P(L > x) = 3(1 - x)^2 - 3(1 - 2x)_+^2 + (1 - 3x)_+^2 .

Integrating over xx from 0 to 1 gives 1−12+19=11181 - \tfrac12 + \tfrac19 = \tfrac{11}{18}.

Follow-up. Is there a quicker route? The smallest piece has mean 13⋅13\tfrac13 \cdot \tfrac13, the next is larger by 13⋅12\tfrac13 \cdot \tfrac12 on average, and the largest by a further 13⋅1\tfrac13 \cdot 1. So the largest has mean 13(1+12+13)=1118\tfrac13(1 + \tfrac12 + \tfrac13) = \tfrac{11}{18}. With nn pieces it is Hn/nH_n/n, where HnH_n is the harmonic sum.

Question 24.9

Exactly one of 1 000 wine bottles is poisoned. A test strip dipped in a mix of wines turns positive if the mix contains any of the poison. A positive strip cannot be used again, and a negative one can. You have two rounds of testing: strips of one round are all read together, and you may choose the second round after reading the first. In each round, each strip you use goes into one mix. What is the smallest number of strips you must own to be sure of identifying the bottle?

Answer

Answer to Question 24.9.

The answer is 7 strips.

Each strip has three possible stories: positive in round 1, positive in round 2, or never positive. With ss strips there are at most 3s3^s outcomes, and each bottle needs its own outcome. Since 36=729<1000≤2187=373^6 = 729 < 1000 \le 2187 = 3^7, six strips are not enough, even with choices in round 2 that depend on round 1: if kk strips test positive in round 1, only 2s−k2^{s-k} outcomes remain, and ∑k(sk)2s−k=3s\sum_k \binom{s}{k}2^{s-k} = 3^s all the same.

Seven are enough. Write each bottle’s number in base 3 with 7 digits. Strip ii tests a bottle in round 1 if digit ii is 0, in round 2 if it is 1, and not at all if it is 2. The strips that fire, and when, read out the poisoned bottle’s digits.

Classic wrong answer. The answer 10, from 210≥10002^{10} \ge 1000, which ignores the second round entirely.

Question 24.10

You travel between home and office and own 3 umbrellas. Each trip, it rains with probability 0.30.3, independently of the other trips. You carry an umbrella only if it is raining and there is one where you are. In the long run, what fraction of trips leave you wet?

Answer

Answer to Question 24.10.

You get wet on 21/370≈5.68%21/370 \approx 5.68\% of trips.

Model the number ii of umbrellas where you are, with r=3r = 3 in total, rain probability p=0.3p = 0.3, and q=0.7q = 0.7. With none, the next place holds all rr. With i>0i > 0, the next place holds r−ir - i if it stays dry, and r−i+1r - i + 1 if it rains and you carry one over. Solving the balance equations gives

π0=qr+q,πi=1r+q(i=1,…,r).\pi_0 = \frac{q}{r + q}, \qquad \pi_i = \frac{1}{r + q} \quad (i = 1, \dots, r).

You are wet when you have none and it rains, so the fraction is p π0=0.3⋅0.7/3.7=21/370p\,\pi_0 = 0.3 \cdot 0.7/3.7 = 21/370.

Classic wrong answer. Using a uniform distribution, π0=1/4\pi_0 = 1/4, which gives 0.0750.075. State zero is rarer than the others, by the factor qq.

Question 24.11

Three players fire at one another in the repeating order A, B, C, skipping anyone dead, until one is left. A hits with probability 1/31/3, B with probability 2/32/3, and C never misses. On a turn a player can aim at either opponent or fire into the air, and each plays to maximise their own chance of surviving. What is the probability that A survives?

Answer

Answer to Question 24.11.

A survives with probability 25/63≈0.39725/63 \approx 0.397, by firing into the air on the first turn.

Work backwards. In a duel between A and B with A firing first, a full round passes with no hit with probability 23⋅13=29\tfrac23 \cdot \tfrac13 = \tfrac29, so A wins with probability 13/(1−29)=37\tfrac13/(1 - \tfrac29) = \tfrac37.

With all three alive, B must aim at C, since otherwise C kills B at once. C, if reached, aims at B, the better shot. So if A fires in the air, then B hits C with probability 2/32/3, leaving A a duel with the first shot, worth 3/73/7. Otherwise C kills B, and A has one shot at C, worth 1/31/3. Altogether

23⋅37+13⋅13=2563.\tfrac23 \cdot \tfrac37 + \tfrac13 \cdot \tfrac13 = \tfrac{25}{63}.

Aiming at C is worse: a hit leaves A to take B’s fire first, worth only 1/71/7, for a total of 59/18959/189. Aiming at B is worst, for a total of 50/18950/189, since hitting B means C kills A.

Why it matters. The weakest player does best by not shooting, because the other two have to deal with each other first.

Question 24.12

You test whether a coin is fair, using a two-sided test at the 5% level. If the coin’s probability of heads is in fact 0.60.6, you want to detect this with probability 80%. Using the normal approximation, about how many flips do you need?

Answer

Answer to Question 24.12.

You need about 194 flips. Anything from 190 to 200 is fine.

Let nn be the number of flips, and work with the proportion of heads. The test rejects when the proportion is further than 1.96⋅0.5/n1.96 \cdot 0.5/\sqrt n from 0.50.5. Under the alternative, the proportion has mean 0.60.6 and standard deviation 0.24/n≈0.49/n\sqrt{0.24}/\sqrt n \approx 0.49/\sqrt n. For 80% power, the rejection point must lie 0.840.84 of those standard deviations below 0.60.6. So

0.1=1.96⋅0.5+0.84⋅0.49n=1.39n,n≈193.0.1 = \frac{1.96 \cdot 0.5 + 0.84 \cdot 0.49}{\sqrt n} = \frac{1.39}{\sqrt n}, \qquad n \approx 193 .

Keeping more digits gives 194, and the exact binomial power at 194 flips is 0.810.81. The usual shortcut of 0.50.5 for both standard deviations gives 196, which is fine.

Classic wrong answer. Using 1.6451.645, the one-sided value, gives about 152. That would be the answer to another question.