Buku ini belum tersedia dalam Bahasa Indonesia. Edisi: English, Français.
Interviews I: Maths, Probability and Speed · Karier
26Timed Test 3
Take it in one sitting, without notes or a calculator.
Section A — 6 questions, 40 minutes
Question 26.1
A cereal box holds one of three toys, with probabilities , and , independently from box to box. On average, how many boxes do you buy to get all three?
Answer
Answer to Question 26.1.
The average is boxes.
Let be the wait for toy . The time to get all is , and inclusion–exclusion over minimums gives
The first sum is . The pairs have , and , which give . The last term is 1. So the mean is .
Sanity check: it must exceed 6, the wait for the rarest toy, and it does so by a little. Equal probabilities would give , so uneven ones cost more.
Classic wrong answer. Using the equal-probability formula , which gives .
Question 26.2
Three fair dice are rolled. Which is more likely, a total of 9 or a total of 10? Give both probabilities.
Answer
Answer to Question 26.2.
A total of 10 is more likely: against .
Both totals have six unordered partitions, which is why they can look equal. But the partitions have different numbers of orderings.
For 9: 126 (6), 135 (6), 144 (3), 225 (3), 234 (6), 333 (1), a total of 25.
For 10: 136 (6), 145 (6), 226 (3), 235 (6), 244 (3), 334 (3), a total of 27.
A check: by the symmetry , totals 10 and 11 have equal probability, as do 9 and 12. And an enumeration over the 216 outcomes confirms both numbers.
Classic wrong answer. Counting partitions as equally likely, which treats 333 like 126. The outcomes are the 216 ordered triples, and only they are equally likely.
Question 26.3
A source sends four symbols with probabilities , , and . What is the fewest expected bits per symbol of a prefix code? What is the entropy of the source?
Answer
Answer to Question 26.3.
Both are bits.
Huffman’s construction merges the two rarest symbols and repeats. It gives code lengths 1, 2, 3 and 3. The expected length is .
The entropy is , with the same numbers, since each is an integer. So the code achieves the theoretical floor exactly.
Compare a fixed-length code, which takes 2 bits. The gain comes from using short words for frequent symbols.
Follow-up. When does the code not reach the entropy? When the probabilities are not powers of . For a source with probabilities and , the code takes 1 bit a symbol, while the entropy is . Coding blocks of symbols closes this gap.
Question 26.4
is uniform on , and given , is uniform on . What is the probability that ?
Answer
Answer to Question 26.4.
The probability is .
Condition on . For , the event is impossible. For , it has chance . So
A second route uses the density of , which is on , found by integrating from to 1. Then , the same.
The mean of is , so a chance of to exceed is reasonable.
Classic wrong answer. Using ’s mean, , as if were uniform on , which gives 0. A value cannot replace a distribution here.
Question 26.5
Two players take turns rolling a die, and A goes first. A wins by rolling a 6. B wins by rolling a 5 or a 6. What is the probability that A wins?
Answer
Answer to Question 26.5.
A wins with probability .
Each full round, A wins with chance . If A fails, B wins with chance . So the game continues to another round with chance .
Let be A’s chance. Then , which gives .
A check: B’s chance is , and the two add to 1. So going first is not enough to offset a target that is twice as easy. With equal targets of a 6, A would have .
Classic wrong answer. Adding up only A’s first roll, or giving by comparing the two chances directly, . That ignores who rolls first.
Question 26.6
Three vertices of a regular hexagon are chosen at random. How likely are they to form a right triangle? What about an equilateral triangle?
Answer
Answer to Question 26.6.
A right triangle has probability , and an equilateral one has probability .
There are triangles. The hexagon’s vertices lie on a circle, so a triangle has a right angle exactly when two of its vertices form a diameter. There are 3 diameters. Each can be combined with any of the 4 other vertices, which gives 12 triangles, all different, since a triangle cannot contain two diameters.
So the right triangles have . The equilateral triangles are the two formed by alternate vertices, so . The remaining 6 are isosceles with an obtuse angle: three neighbouring vertices. An enumeration confirms the counts.
Classic wrong answer. Trying to compute angles for each case. The diameter criterion gives the count at once.
Section B — 6 questions, 60 minutes
Question 26.7
A permutation of is chosen at random. How likely is it that the element 8 lies in a cycle of length exactly 3? What is the expected number of cycles?
Answer
Answer to Question 26.7.
The probability is , and the expected number of cycles is .
Follow the cycle from 8. It closes at the first step with chance , the value . Otherwise it continues to another element, and closes at the next step with chance , and so on. The chance that it has length 3 is . All lengths from 1 to 8 are equally likely, by the same cancellation.
For the number of cycles, use that each element in a cycle of length contributes , with total 1 per cycle. So the count is , and its mean is . Counting by brute force over all permutations gives the same.
Follow-up. What is the mean length of the cycle holding a given element? , the mean of the uniform on 1 to 8. Note that this is larger than the average cycle length, , an inspection effect.
Question 26.8
A disease affects 1% of people, independently. You pool the blood of 10 people and test the pool once. If it is positive, you test all 10 individually. What is the expected number of tests per person?
Answer
Answer to Question 26.8.
About tests per person, a saving of about 80%.
The pool costs one test, or per person. With chance , the pool is positive, and each person takes one more test. So the mean per person is
For the value, .
The best pool size balances the two terms: for , the minimum is near . An exact search shows that pools of 10 and 11 are almost the same. So 10 is a good design.
Follow-up. If the rate rises to 30%, is pooling still useful? Barely. A pool of 2 costs per person, the best pool, of 3, costs , and larger pools cost more. So it no longer pays to bother.
Question 26.9
You keep rolling a fair die and keep a running total. What is the probability that the running total ever equals exactly 6? What is the long-run chance of hitting a large number ?
Answer
Answer to Question 26.9.
The probability is , and for large it tends to .
Let be the chance of hitting , with . Conditioning on the last roll, for ,
So , and for up to 5. Thus . An exact recursion in fractions gives this number.
For large , renewal theory says that hits occur at a rate of one per mean step, and the mean step is . So .
Note that is the largest of the : from 6 onwards, the bound on the number of earlier terms in the recursion takes effect.
Classic wrong answer. Enumerating the compositions of 6 and weighting each by . That works, but it is the slow form of the same answer.
Question 26.10
A stick of length 1 is broken at a uniform random point, and the two pieces become the sides of a rectangle. What is the average area of the rectangle? How likely is the area to exceed ?
Answer
Answer to Question 26.10.
The average area is , and the area exceeds with chance .
With the break at , uniform on , the area is , whose mean is . The area exceeds when , that is when lies between and , and this has chance .
A check: the shorter piece has mean and the longer has mean , with product . But , so their covariance is , and .
Classic wrong answer. Giving , the product of the mean pieces, or , the area at the mean break. The first ignores that the pieces are negatively correlated, and the second is the largest area possible, reached by a single break point.
Why it matters. The mean of a product is the product of the means only without correlation. The average of price times volume is not the average price times the average volume.
Question 26.11
An at-the-money three-month call on a stock at 100 with 16% volatility is worth about , with zero rates. Estimate the price of the straddle. What daily move makes a delta-hedged holder break even, using 252 days?
Answer
Answer to Question 26.11.
The straddle costs about , and the daily break-even move is about 1, or 1%.
The call is worth . At the money with zero rates, put and call have the same value, by parity. So the straddle costs .
The factor comes from : the call is , and it is linear in a small argument.
A delta-hedged option earns per step, so it breaks even when the daily return equals . That is the rule of 16: annual vol over 16 is the daily move.
Classic wrong answer. Comparing the break-even at expiry with daily moves. A hedged holder’s result depends on the sum of squared moves, not on where the stock ends.
Follow-up. What does the straddle cost at one year? , since the time scale doubles the root.
Question 26.12
A random permutation of is written in a line. A position is a local maximum if its value exceeds those of its neighbours, and each end has only one neighbour. How many local maxima are there on average?
Answer
Answer to Question 26.12.
The average is .
Use indicators. An interior position, with two neighbours, has the largest of three random distinct values with chance . An end position, with one neighbour, has chance .
There are 8 interior positions and 2 ends, so the mean is . Brute force for small follows the general formula .
The result is about one in three positions, which is the rate at which a random series makes a peak. So if a chart seems to have fewer turning points than this, the series has a trend or a memory.
Follow-up. What is the count of runs of ascents, for ? The number of ascents has mean , and maximal ascending runs number one more than the descents, so on average. These are the same indicators with pairs in place of triples.