Derivatives Foundation puzzles, solved step by step
- Puzzles
- 100
- Traced to a firm
- 66
- Topics
- 12
- Hard
- 29
002Every market day is either trending or choppy. A trending day is followed by another trending day 70% of the time, and a choppy day by another choppy day 60% of the time. In the long run, what fraction of days are trending? And when a trend starts, how many days does it last on average?Quant tradingHedge funds
Try it first
Gut call before the algebra: which is larger, the share of trending days or the share of choppy days?
Show the worked solution
4/7 of days trend, about 57.1%, and a trend lasts 3.3 days on average. In the long run the flow out of trending must equal the flow in: 0.3 times the trending share equals 0.4 times the choppy share, so the shares stand 4 to 3. A trend ends on any given day with probability 0.3, so its expected length is 1/0.3, and a choppy spell lasts 1/0.4 = 2.5 days.
Why must the two flows balance?
Picture two rooms at a party with a door between them. Each minute, 30% of the people in room A wander into B and 40% of those in B wander into A. The crowd settles when the two queues through the door carry the same number of people; otherwise one room keeps filling. A stationary split is one where the number of days leaving each state equals the number entering it, and that single equation fixes the split. Days leaving trending: 0.3 times the trending share. Days entering it from choppy: 0.4 times the choppy share. Set them equal and the ratio is 4 to 3.
Trending days keep 0.7 of their successors and lose 0.3 to choppy, while choppy days keep 0.6 and lose 0.4 back, so the long-run shares stand 4 to 3, 57.1% trending and 42.9% choppy, with trends lasting 3.3 days and choppy spells 2.5 days on average. The relationshippi_T, pi_C the long-run shares of trending and choppy days 0.3, 0.4 the chance a trending day flips to choppy, and a choppy day flips to trending 1/0.3 expected length of a run that ends with probability 0.3 each day What it says in wordsEach state's share is the other state's flip rate divided by the sum of the two flip rates, and a run's length is one over its own flip rate.Why is the average streak 1/0.3 and not something longer?
A trend that has lasted five days is no more likely to end tomorrow than one that started today: the chain has no memory beyond yesterday. Each trending day ends the run with probability 0.3, independent of its age, so the run length is a geometric count with mean 1/0.3 = 3.33 days. That is the same reason the expected number of rolls to a six is 6. The two answers also check each other: the share of a state equals how often a run of it starts, times how long it lasts, and 4/7 against 3/7 is exactly 3.33 against 2.5 scaled by the same start rate.
What does the chain say about tomorrow, given today?
This is where the puzzle connects to trading. Today's state carries real information: after a trending day, tomorrow trends with probability 0.7, well above the unconditional 57%. After a choppy day it is only 0.4. The long-run split tells you nothing about tomorrow; the transition row for today's state does. Say that distinction out loud, because an interviewer who hears 57% quoted as a one-day forecast knows you have confused the stationary distribution with a conditional one. The limitation to add: a two-state chain with fixed probabilities is a toy, and real regime persistence drifts over time.
Where candidates lose it
The first wrong answer is 50%, on the grounds that each state has one way in and one way out. The flows are not equal in rate: trending leaks at 0.3, choppy at 0.4, and the slower leak wins more of the time.
The second loss is writing out eigenvectors of a two-by-two matrix under time pressure. The balance equation, flow out equals flow in, takes one line and is what the interviewer wants to hear.
What the interviewer asks next
- Starting from a choppy day, what is the chance that the day after tomorrow is trending?
- Add a third state, a crash day, that follows a choppy day 5% of the time. How does the method change?
- How would you estimate these transition probabilities from a year of daily data, and how noisy would they be?
055A token sits on one corner of a square. Every second it moves to one of the two neighbouring corners, chosen by a fair coin. What is the expected number of seconds until it first reaches the opposite corner?Quant trading
Try it first
The opposite corner is two steps away. Expected time to get there?
Show the worked solution
4 seconds. By symmetry, the two corners next to the start are the same state, call it adjacent. From the start you always move to adjacent in one step. From adjacent, half the time you reach the target and half the time you return to the start. So E(start) = 1 + E(adjacent) and E(adjacent) = 1 + E(start)/2, giving E(adjacent) = 3 and E(start) = 4.
Why collapse four corners into three states?
If you are lost in a town with a river on one side, what matters is how far you are from the river, not which street you are on. The square is the same: standing at either corner next to the start, the token's future looks identical, one coin flip from the target and one from the start. Grouping corners by their distance from the target turns a four-state chain into a three-state line, and a line is solved with one equation per unknown. You have two unknowns, the expected time from the start and from an adjacent corner, because the target itself takes zero time.
Grouping the two corners next to the start into one state gives a three-state chain in which the start always moves to adjacent, and adjacent finishes or returns to the start with equal chance, so E(adjacent) = 3 and E(start) = 4 seconds. How do you set up and solve the equations in the room?
Each equation says the same sentence: one step, plus the average of what is left from where you land. From the start, every step lands on an adjacent corner, so E(start) = 1 + E(adjacent); from an adjacent corner, half the steps finish and half return, so E(adjacent) = 1 + (1/2) x 0 + (1/2) x E(start). Substitute the first into the second: E(adjacent) = 1 + (1/2)(1 + E(adjacent)), so E(adjacent)/2 = 3/2, E(adjacent) = 3, and E(start) = 4. Saying the sentence before the symbols is what keeps the equations honest.
The relationshipE_0 the expected steps to the target from the starting corner E_1 the expected steps from either corner next to the start 1/2 the chance a step from an adjacent corner lands on the target What it says in wordsFrom the start you always move one step closer; from there a coin flip either finishes or sends you back, and the two equations give four steps on average.What is the check, and what does the general case look like?
Check it with the geometric picture. After the first step you are adjacent, and from there each attempt either finishes in one step or costs two steps, back to the start and out again, before you are adjacent once more. Each attempt succeeds with chance 1/2, so E(adjacent) = (1/2) x 1 + (1/2) x (2 + E(adjacent)), which again gives 3, and the first step makes it 4. On a cube the same method with four distance classes gives 10 steps to the opposite vertex; on a general graph the method is the same, but the number of distance classes grows and the arithmetic stops being mental.
Where candidates lose it
The fast wrong answer is 2, the length of the shortest path. The interviewer is checking whether you see that the token can bounce back, and whether you reach for the first-step equations rather than trying to sum a series.
The second loss is writing four equations, one per corner. Say the symmetry out loud, collapse to three states, and the whole thing is two lines.
What the interviewer asks next
- What is the expected time to return to the starting corner for the first time?
- Same walk on the eight corners of a cube. Expected time to the opposite vertex?
- What is the probability the token reaches the opposite corner within 4 steps?
- The coin is biased: it moves clockwise with chance 0.7. Does the expected time change?
083A price starts at 100 and moves up or down 1 each day with equal chance for 10 days. What is the probability that it touches 104 at some point in those 10 days?Exotics tradingQuant trading
Try it first
Which quantity is easier to count, and how does it relate to touching?
Show the worked solution
232 of the 1,024 paths touch 104, about 22.7%. A path ending at or above 104 must have touched it: that needs at least 7 up days, 176 paths. A path that touches 104 and ends below it can be reflected in the 104 line after its first touch, and the reflection ends above 104, needing at least 8 up days: 56 paths. The pairing is one to one, so the count is 176 + 56 = 232.
Why is the reflection a fair way to count?
Imagine a walker who reaches a wall at some point and then wanders on. Flip every step after the first touch, up for down, and you get another walker who also touched the wall at the same moment and is now the same distance on the other side of it. Each flipped step is as likely as the original, so the two walks have equal probability. Reflection pairs every path that touches 104 and finishes below it with exactly one path that finishes above 104, so the hard count becomes an easy count of endpoints. Paths that finish at exactly 104 are their own partners and are counted once.
A path that climbs to 104 by day 4 and ends at 100 is mirrored in the 104 line after the first touch into a path that ends at 108, and counting by endpoint gives 176 paths ending at or above 104 plus 56 mirrors of paths ending above it, 232 of 1,024 paths, which is 22.7%. How do the binomial counts fall out?
After 10 days of plus or minus 1, the position is 100 plus ups minus downs, which is 100 + 2 x ups - 10. Ending at or above 104 needs ups of at least 7: C(10,7) + C(10,8) + C(10,9) + C(10,10) = 120 + 45 + 10 + 1 = 176. Ending strictly above 104 means at or above 106, since the endpoint is always even, so ups of at least 8: 45 + 10 + 1 = 56. The probability of touching is (176 + 56)/1,024 = 232/1,024, about 22.7%, against only 176/1,024 = 17.2% for ending at or above 104. The gap is the 56 paths that visited the barrier and came back.
The relationshipS_10 the net move after ten days P(S_10 >= 4) paths ending at or above the barrier, 176 P(S_10 > 4) paths ending strictly above, which are the reflections of touch-and-return paths, 56 What it says in wordsThe chance of touching a level equals the chance of ending at or past it plus the chance of ending strictly past it.Say why a derivatives desk cares. A knock-out or one-touch option pays on exactly this event, and the reflection principle is how the closed-form barrier prices are derived in continuous time. The limitation is in the symmetry: reflection needs the up and down steps to be equally likely and the barrier to sit on the lattice. With a drift, or in continuous time with a non-zero rate, the reflected path is not equally likely and a correction factor appears, which is why barrier formulas carry that extra power of the barrier over the spot.
Where candidates lose it
The usual loss is answering the probability of ending at or above 104, 17.2%, and forgetting the paths that touched and came back. The interviewer asked about touching, and the difference is a quarter of the answer.
The second loss is trying to enumerate paths that stay below 104 by hand. There are 792 of them and no clean way to list them in the room. Reflection exists so you do not have to.
What the interviewer asks next
- What is the probability the price touches 104 and ends at 100?
- Change the odds to 55% up. Why does reflection stop working as stated?
- How does this count turn into the price of a one-touch option?
