Financial Analysis puzzles, solved step by step
- Puzzles
- 100
- Traced to a firm
- 47
- Topics
- 13
- Hard
- 30
029A bowl holds 100 noodles. You pick two free ends at random and tie them together, and keep doing this until no free ends are left. What is the expected number of loops in the bowl at the end?Consulting-style caseKPO research support
Try it first
Before you compute: roughly how many loops do you expect from 100 noodles?
Show the worked solution
About 3.28 loops. Every tie cuts the number of strands by one, so there are exactly 100 ties. With k strands left, the second end you grab is one of 2k - 1 free ends, and only one of those closes a loop, so that tie adds 1 over (2k - 1) to the expected count. Summing 1 + 1/3 + 1/5 + ... + 1/199 gives 3.2843.
How do you avoid tracking the whole bowl?
Think of shaking hands at a party where each person has two hands. You do not need the seating plan to know that each handshake joins two hands. Whatever the bowl looks like, every tie reduces the count of strands by exactly one, and a strand is either an open piece or a closed loop that has left the game. So you can ignore the tangled history and ask one question per tie: does this tie close a loop, yes or no?
Pick any free end first; which one does not matter. With k strands there are 2k free ends, so 2k - 1 remain for the second pick, and exactly one of them is the other end of the same strand. That tie closes a loop with chance 1 over (2k - 1). Otherwise two strands fuse into one longer strand.
Early ties almost never close a loop: with 100 strands the chance is 1 in 199, and the expected count is only 1.15 after 90 ties. The last three ties add 0.2, 0.33 and 1, bringing the total to 3.28 loops. Why can you add the step expectations when the steps depend on each other?
Whether an early tie closes a loop changes nothing about how many strands remain, because every tie removes one strand either way. Expected values add even when the events are linked, so the total is simply the sum of the per-tie chances. This is linearity of expectation, and it is what makes the puzzle a two-minute answer instead of a simulation. For large n the sum is close to half the natural log of n plus about 0.98; for 100 noodles that gives 3.28, a useful sanity check.
The relationshipn the number of noodles, 100 k strands left before a tie 1/(2k-1) the chance the second end chosen belongs to the same strand What it says in wordsAdd, tie by tie, the chance that the tie closes a loop.Where candidates lose it
Candidates try to picture how the strands grow and get lost in cases. The problem is only tractable when you notice that each tie does exactly one of two things and that the strand count falls by one either way.
The second loss is getting the chance wrong as 1 over 2k. You have already picked one end, so the pool for the second pick is 2k - 1, not 2k.
What the interviewer asks next
- With just two noodles, what is the chance of ending with two loops?
- Roughly how many loops would you expect from 10,000 noodles?
- Where else does linearity of expectation save you from tracking dependence?
073You pay Rs 100 to roll a fair die and receive Rs 30 times the face. Should you play? Now suppose that after seeing the roll you may pay Rs 20 to roll once more and take the second result instead. What is your rule, and what is the game worth?Consulting-style caseTreasury
Try it first
With the Rs 20 re-roll available, which rolls do you re-roll?
Show the worked solution
Play: one roll pays 30 x 3.5 = Rs 105 on average against a Rs 100 fee, an edge of Rs 5. With the re-roll, keep a 3 or better and re-roll a 1 or 2; the game is worth Rs 118.33, an edge of Rs 18.33. A fresh roll is worth 105 less the Rs 20 fee, 85, so re-roll only a result paying less than 85: 30 and 60 qualify, 90 does not.
Why is the first game worth playing?
A fair die averages 3.5, so the average payout is 30 x 3.5 = Rs 105, more than the Rs 100 you pay. On expected value the game pays Rs 5 a play, so a player who can repeat it should play. Half the time you lose money, since a 1, 2 or 3 pays 30, 60 or 90, and the other half you win 120, 150 or 180; the wins are larger than the losses, which is where the edge sits.
How does the re-roll change the rule?
Think of returning a shirt. You keep it if what you have is worth more than what the shop will hand you after the restocking fee. Re-roll only when the roll in hand is worth less than a fresh roll net of its fee, which is 105 - 20 = Rs 85. A 1 pays 30 and a 2 pays 60, both below 85: re-roll. A 3 pays 90, above 85: keep it, even though 3 is below the average face. The fee is what makes a 3 worth keeping.
Faces 3 to 6 are kept for 90, 120, 150 and 180, while faces 1 and 2 lead to a Rs 20 re-roll worth 85 net, so the game is worth 118.33 against 105 without the option, an edge of 18.33 over the Rs 100 fee. The relationship90 to 180 the payouts kept on a 3, 4, 5 or 6 105 - 20 a fresh roll's average payout less the re-roll fee 2/6 the chance of a 1 or a 2, the rolls you re-roll What it says in wordsThe game is worth the chance of keeping times the average kept, plus the chance of re-rolling times the fresh roll's value after the fee.What does the option itself cost and earn?
The re-roll lifts the game from 105 to 118.33, so the option is worth Rs 13.33 on average, and it also cuts the chance of losing money from a half to a third, because a bad first roll gets a second chance. Re-rolling a 3 as well would give 117.50, worse by 0.83; a free re-roll would make re-rolling the 3 right and lift the game to 127.5. The threshold moves with the fee: below a fee of Rs 15 the 3 is worth re-rolling, above it the 3 is kept. The limit to say: the worst path, a 1 or 2 followed by a 1, costs Rs 90, and a player who cannot afford that should not value the game by its average.
Where candidates lose it
The common loss is re-rolling anything below the 3.5 average, including a 3. The bar is not the average face; it is the value of a fresh roll after its fee, and the Rs 20 fee pulls that bar below 90. Re-rolling a 3 gives up almost a rupee a play.
The quieter slip is forgetting to charge the fee at all, which puts the game at 127.5 and the threshold at 3. State the net value of a re-roll, 85, before deciding anything.
What the interviewer asks next
- The re-roll fee is Rs 10. Which rolls do you now re-roll, and what is the game worth?
- You may re-roll twice, Rs 20 each time. What is the game worth and how does the first-roll bar change?
- The payout is Rs 30 times the face squared. Should you still play at Rs 100, and does the re-roll rule change?
100You toss a fair coin until you see two heads in a row. How many tosses do you expect to need? And why is that more than the number you expect to wait for a head followed by a tail?Consulting-style caseKPO research support
Try it first
Which pattern takes longer on average to appear, HH or HT?
Show the worked solution
Six tosses for HH on average, four for HT. For HH, a tail after a head sends you back to the start with nothing. For HT, once you hold a head, every further head keeps you one toss from finishing, so nothing is lost. Solve HH with two unknowns: from the start E0 = 1 + E0/2 + E1/2, and after a head E1 = 1 + E0/2, which gives E1 = 4 and E0 = 6. For HT, E1 = 1 + E1/2 = 2 and E0 = 4.
Why is waiting for two heads different from waiting for a head then a tail?
Suppose you will go trekking after two dry days in a row. One wet day after a dry one puts you back to zero: you need two fresh dry days. Now suppose instead you are waiting for a dry day followed by a wet one. Extra dry days cost nothing; you stay ready, and the first wet day finishes the job. A failed attempt at HH throws away the progress you had, while a failed attempt at HT keeps it, so HH pays for its failures twice: the wasted toss and the lost head. That asymmetry is the whole answer; the algebra just prices it.
Write the states. E0 is the expected tosses still needed from nothing, E1 from one head in hand. From nothing, one toss is spent and you land back at E0 with a tail or at E1 with a head: E0 = 1 + E0/2 + E1/2, so E0 = 2 + E1. For HH, from one head a head finishes and a tail drops you to E0: E1 = 1 + E0/2. Substitute: E1 = 1 + (2 + E1)/2, so E1/2 = 2, E1 = 4 and E0 = 6. For HT, from one head a tail finishes and a head keeps you at E1: E1 = 1 + E1/2, so E1 = 2 and E0 = 4.
The relationshipE0 expected tosses still needed with no useful toss in hand E1 expected tosses still needed holding one head 1/2 the chance of a head, and of a tail, on a fair coin What it says in wordsEach state's expected wait is one toss plus the average of the waits in the states a head and a tail lead to.In the HH diagram the tail arrow from the one-head state runs all the way back to the start, which is why the wait is 6 tosses, while in the HT diagram a head from the one-head state only loops in place, so the wait is 4. Is there a rule for longer patterns?
Yes, and it is quick enough for the room. For each length k at which the pattern's first k symbols equal its last k symbols, add 2 to the power k. HH matches itself at k = 1 (H and H) and at k = 2 (the whole thing): 2 + 4 = 6. HT matches itself only at k = 2: 4. HHH gives 2 + 4 + 8 = 14; HTH gives 2 + 8 = 10; HTT gives just 8. Patterns that overlap with themselves take longer to appear from a fresh start, because their occurrences come in clusters, and the same long-run frequency spread into clusters means longer gaps between them. Every pattern of length n shows up once in 2 to the n positions on average; what differs is how bunched those appearances are.
The average hides a wide spread. The chance that HH has not appeared after ten tosses is 14.1%, against 1.1% for HT, so one game in seven is still running at toss ten when you wait for HH. And the figures assume a fair, independent coin: with heads at 60%, the HH wait falls to 1/p + 1/p squared, about 4.4 tosses. The finance link is any rule that needs consecutive results, such as a bonus or a covenant test that requires two good quarters in a row: one bad quarter resets the count, so the rule is harder to satisfy than its two-in-four odds suggest.
Where candidates lose it
The common wrong answer is 4 for both, from 'each pattern has probability 1/4, so wait 4 tosses'. That is the long-run frequency, not the wait from a fresh start, and it ignores that a failed HH attempt destroys the head you had. Another is 8, from doubling the single-head wait of 2 and then adding; the state equations, not intuition, settle it at 6.
The second loss is reaching 6 and 4 with no reason. The interviewer asked why, and the one-sentence answer is that HT keeps its progress after a failure and HH does not. Offer the overlap rule afterwards: it shows you can extend the result to HHH or HTH without starting over.
What the interviewer asks next
- How many tosses do you expect to wait for HHH, and for HTH?
- Two players toss one coin: one wins if HH appears first, the other if HT appears first. Who is more likely to win?
- With a coin that shows heads 60% of the time, what is the expected wait for HH?
