Library

Quant puzzles with worked solutions

Become a member

A quant puzzle is a piece of mathematics wearing a story. Take the story away and what is left is usually one of a dozen ideas: pigeonhole and counting, conditional expectation, a symmetry that makes an ugly sum collapse, a martingale nobody told you was a martingale, or a limit case you can check by hand in thirty seconds.

This page holds the 134 puzzles in the Thuztra Learn library, grouped by difficulty, because difficulty is what a reader chooses on. The 17 marked free carry the full worked solution, and every one is solved in full for members. A linked title opens the puzzle on a page of its own.

Free puzzles, solved in full

Start here if you want to check your working against a complete solution.

A month with holes in it

A file of daily takings for a shop, shorter than the month it covers, with some rows recording a day when nothing was sold. Work out what the table says, and what it only appears to say.

Intro · free, full solution

At least one six in three rolls

A fair die is rolled three times and we are betting on a six appearing. Adding the chance up roll by roll gives a very tidy number, and a wrong one.

Intro · free, full solution

A chord drawn at random, and three honest answers

Draw a chord of a circle at random and ask whether it beats the side of the inscribed equilateral triangle. Three reasonable constructions, three different numbers, and no arithmetic error anywhere.

Hard · free, full solution

The cards caught between two jokers

A shuffled deck with both jokers left in. How many ordinary cards sit strictly between them on average? One card at a time, and the deck size stops mattering.

Intro · free, full solution

What a forward has to cost, before anyone has an opinion

A storable asset, a financing rate, and a delivery date a year out. Pin the forward price with a replication argument, then say what to do when the quoted one disagrees.

Intro · free, full solution

One written rule, four people objecting

A rule, one number out of a test of it, and four people who each object to that number differently. Sort the objections by whose job they are, then price what the number claims.

Intro · free, full solution

Doubling time, and where the rule of 72 comes from

A quantity compounds at a fixed rate every period. Get the doubling time in your head, then explain why the shortcut constant is the constant it is.

Intro · free, full solution

Your first interview question: the die you may roll twice

One die, paid in dollars, then a second chance to roll. Price the plain game, then price the choice, using nothing beyond the average outcome from Level 0.

Intro · free, full solution

The install that opened no window

An installer finishes and no icon appears, a mistyped command answers in red, and one calculation runs at two speeds on one machine. Decide which of the three is a problem.

Intro · free, full solution

Reading the kitty book back

A shared kitty book with four entries, one of them a charge that should never have been there. Walk the balance through all four, then settle an argument about which of three flatmates is best placed.

Intro · free, full solution

The last price, and the next three hundred kilos

A published number from the last completed trade, a shopper who wants far more than it covered, and the stalls that actually hold the goods. Work out what the number was promising.

Intro · free, full solution

A fall of a fifth, and the rise that undoes it

An amount drops by a fifth, then climbs back by the same percentage it fell. Where it lands, and the rule for what any fall costs to reverse.

Intro · free, full solution

Three numbers that all read the same

A spinner, a weather record and a considered opinion all produce the same chance. Decide which can be checked before anything happens, and what one day going the other way settles.

Intro · free, full solution

Two dice, one question

Two ordinary dice, added together. One total appears more often than any other, and the way to settle which one is to write out every pair rather than argue about it.

Intro · free, full solution

Two shops, two rates, one combined share

Two shops of different sizes pay different shares of their takings into one fund. Work out what the two gave together, and what the treasurer's shortcut would have needed to be true.

Intro · free, full solution

Two stalls, and the same two digits on both cards

Two delivery charges built from the same pair of numbers, with the numbers swapped between the part that repeats and the part that happens once. Find the order size where they agree.

Intro · free, full solution

Which moments a sample will support

A diagnostic for moment existence that needs no threshold, no fitted model and no tuning parameter. Work out what it does, read the simulated table, and find the column that lies.

Medium · free, full solution

Intro puzzles

One idea each, stated plainly enough that the work is understanding the question rather than decoding it.

A month with holes in it

A file of daily takings for a shop, shorter than the month it covers, with some rows recording a day when nothing was sold. Work out what the table says, and what it only appears to say.

Free, full solution

A running total that gains one over n

A running total gains one over n at each step. Decide whether it settles, work out what a modest target costs, and compare it against the same sum with a slightly larger exponent.

A tenth, added ten times

A reconciliation check adds a tenth to a running total ten times and tests the result against one. Decide whether the test passes, size the gap, and say what the test should have been.

Deep in the money, and still not worth exercising

An American call sits well in the money with a year to run and no dividend in sight. Decide whether exercising today is ever the best move, using a bound rather than a model.

At least one six in three rolls

A fair die is rolled three times and we are betting on a six appearing. Adding the chance up roll by roll gives a very tidy number, and a wrong one.

Free, full solution

Counting the steps a bisection search needs

A root finder brackets an unknown volatility and halves the bracket each pass. Count the passes needed for a stated tolerance, and say why the count does not depend on the function.

The bus that forgets how long we have waited

Buses arrive at random with a known average gap. We have already been standing there a while. Does the wait we have served buy us anything on the wait to come?

The cards caught between two jokers

A shuffled deck with both jokers left in. How many ordinary cards sit strictly between them on average? One card at a time, and the deck size stops mattering.

Free, full solution

The cheapest first step is not the cheapest route

A grid of tolls, moves restricted to right and down, and a corner to reach. Find the cheapest route, then test it against the rule that always steps to the cheaper neighbour.

How two dates on the same Brownian path hang together

Take a Brownian path at an early date and a later one. Find the covariance and the correlation between the two readings, using nothing but the fact that increments do not talk to each other.

Two numbers that already contain the eigenvalues

A small symmetric matrix, and no characteristic polynomial in sight. Read its eigenvalues off the trace and the determinant, then say what they tell us about the matrix.

Four independent wobbles

A stage moves a sample in four steps and each step lands slightly off. How far off is the finish, and how many more steps would it take to double that spread?

An exponent with mean zero, and a level that drifts up

Exponentiate a driftless Brownian motion. The exponent averages zero at every date, so decide whether the level averages one, and find the correction that makes it a martingale.

What a forward has to cost, before anyone has an opinion

A storable asset, a financing rate, and a delivery date a year out. Pin the forward price with a replication argument, then say what to do when the quoted one disagrees.

Free, full solution

One written rule, four people objecting

A rule, one number out of a test of it, and four people who each object to that number differently. Sort the objections by whose job they are, then price what the number claims.

Free, full solution

Attacking the cheap door more often than the valuable one

One guard, two doors of unequal worth, and both sides choose at the same instant. Find the randomisation each side should use, and check which side's payoffs set which side's mix.

Guessing two thirds of what everyone else guesses

A room full of people each name a number, and the winner is nearest to two thirds of the room's average. Find the equilibrium, and decide whether it is what you would actually submit.

Four rules for walking away

Four rules for when to leave a fair coin game. Only some of them can be checked at the moment they fire, and that difference decides whether the game stays fair.

Neighbouring flips that agree

Ten flips of a fair coin, and we count the places where a flip agrees with the one before it. The events overlap heavily, and that turns out not to matter.

Buying accuracy from a Monte Carlo run

A simulation reports a price and a standard error. Work out what it costs to tighten that error by a factor, and why the run time grows faster than the accuracy.

Doubling time, and where the rule of 72 comes from

A quantity compounds at a fixed rate every period. Get the doubling time in your head, then explain why the shortcut constant is the constant it is.

Free, full solution

Identical units, labelled buckets

Ten identical units go into four labelled buckets. Count the allocations three ways: unconstrained, with nothing left empty, and with a ceiling on every bucket.

Members · question, hint and idea free

Your first interview question: the die you may roll twice

One die, paid in dollars, then a second chance to roll. Price the plain game, then price the choice, using nothing beyond the average outcome from Level 0.

Free, full solution

The install that opened no window

An installer finishes and no icon appears, a mistyped command answers in red, and one calculation runs at two speeds on one machine. Decide which of the three is a problem.

Free, full solution

Reading the kitty book back

A shared kitty book with four entries, one of them a charge that should never have been there. Walk the balance through all four, then settle an argument about which of three flatmates is best placed.

Free, full solution

The last price, and the next three hundred kilos

A published number from the last completed trade, a shopper who wants far more than it covered, and the stalls that actually hold the goods. Work out what the number was promising.

Free, full solution

A fall of a fifth, and the rise that undoes it

An amount drops by a fifth, then climbs back by the same percentage it fell. Where it lands, and the rule for what any fall costs to reverse.

Free, full solution

Three numbers that all read the same

A spinner, a weather record and a considered opinion all produce the same chance. Decide which can be checked before anything happens, and what one day going the other way settles.

Free, full solution

Two dice, one question

Two ordinary dice, added together. One total appears more often than any other, and the way to settle which one is to write out every pair rather than argue about it.

Free, full solution

Two hedges that are secretly one

Two instruments, two risk factors, and a target exposure to hit. The solver returns something, so decide whether the hedge exists at all and what the solver was actually doing.

Two shops, two rates, one combined share

Two shops of different sizes pay different shares of their takings into one fund. Work out what the two gave together, and what the treasurer's shortcut would have needed to be true.

Free, full solution

Two stalls, and the same two digits on both cards

Two delivery charges built from the same pair of numbers, with the numbers swapped between the part that repeats and the part that happens once. Find the order size where they agree.

Free, full solution

An urn that rewards the colour it drew

One red ball, one blue, and a rule that adds another of whichever colour came out. The urn is built to tilt toward its own history, so what happens to the next draw?

Turning down an offer worth the average

Offers arrive one per week, each one take it or leave it, and every week of waiting costs money. Find the rule that maximises the expected net, and price the temptation to settle.

Medium puzzles

A derivation or a careful count. Paper and a clear head, no software.

A divergent sum of probabilities that still happens finitely often

A sequence of events whose probabilities sum to infinity, built from one uniform draw. Work out how many of them actually occur, and say which lemma quietly stopped applying.

A residual that became a matrix

A residual with a mean of essentially zero, a clean looking distribution, and a standard deviation larger than the series it came from. Nothing raised anything at any point.

Every direction on one side of a line

Scatter points at random around a circle. Find the chance they all fit inside some half of it, with an argument short enough to say out loud and no integral in sight.

Members · question and hint free

The overnight run, the core count, and the ceiling nobody costed

A revaluation job splits into a part that parallelises perfectly and a part that does not. More cores are approved. Work out what they buy, and what the deadline needs instead.

The area under a Brownian path

Integrate a Brownian path over a horizon and what comes out is a random area. Find its law two ways, then say how tightly it is tied to where the path happened to finish.

How old is the quote the join gave us

An as-of join always finds a match, which is the problem. How stale the matched quote typically is, what a tolerance actually discards, and why the typical gap is the wrong guide.

The tail your Box-Muller generator cannot reach

A normal generator built on a 32-bit uniform stream has a largest output it can physically produce. Find it, decide whether it matters, and check whether the obvious alternative helps.

The card immediately after the first ace

Deal a shuffled deck until the first ace shows, then look at the very next card. The chance it is the ace of spades takes pages by casework and one line by insertion.

A correlation ring, and its spectrum by hand

Four assets arranged in a ring, neighbours correlated one way and opposites another. Find every eigenvalue without a solver, and the portfolio the matrix says cannot move.

How soon two random identifiers collide

A billion possible identifiers sounds like plenty. Work out how many have to be issued before two of them collide, and the answer arrives far sooner than the size of the space suggests.

Counting switches in a shuffled deck

Deal a shuffled deck and count how often the colour flips. The indicators are as dependent as they get, which is exactly why the calculation is one line long.

What duration gets wrong on a large yield move

A ten-year par bond and a big parallel move in its yield. The first-order estimate is wrong by a knowable fraction in a knowable direction, and the second-order term is not a rounding fix.

How many jumps, and above what size

Three models, one threshold, and the expected number of jumps above it. One of them still has an answer once the threshold is removed and two of them do not, which is the whole distinction.

The delta method, and the interval it gives for a ratio

A standard error for any smooth function of an estimate, from one line of Taylor expansion. Derive it, then find what its interval really covers when the denominator is noisy.

How many independent days is a persistent series worth?

A thousand days of P&L with first-order autocorrelation. The point estimate is fine and the standard error is not, and the gap between them decides whether the strategy looks significant.

Nobody idle

Distinguishable tasks land on workers at random. Count the assignments that leave nobody idle. Subtracting the bad cases needs a correction, and then a correction to the correction.

How high a four-step walk gets

A fair walk takes four steps and we record the highest point it touched, counting the start. Reflection turns a question about whole paths into a question about where they finish.

Two arrivals, a quarter hour of patience

Two people agree to meet within an hour, each waits a quarter of an hour and then leaves. Do they meet? A continuous problem that turns into an area.

Members · question, hint and idea free

The first time the walk comes home

A coin-flip walk leaves the origin, and we ask when it first comes back. The chance it has not come back yet turns out to equal a quantity that looks like it belongs to a different question.

Where five arrivals landed inside the minute

Exactly five events land in one minute. Where were they? The conditional answer throws the rate away entirely, which is either obvious or startling depending on which way it is first met.

Five days of gamma against five days of theta

A long option, hedged at each close, over one short week of moves. Add up what gamma collected and what theta cost, then back out the volatility the stock actually realized.

Two forward quotes, one of them tradeable

A storable good, a financing rate and a warehouse bill. Two forward quotes are offered, one above the carry cost and one below. Only one of them supports a trade, and the asymmetry is the point.

The forward rate hidden in two par swap quotes

Three par swap quotes on a steep curve, and the forward rates they imply. The rule most people reach for is a linear extrapolation that is close enough to look right and wrong in one direction.

Two identical bets that are almost the same bet

Each position is sized correctly on its own. Put both on at a high correlation and the pair is badly overlevered, with nothing in either calculation to say so.

Hedging inside a default risk bucket

Three credit positions and one protection contract, under a rule that decides what the protection is worth. Then move the same hedge twice, changing no risk, and watch the charge move both ways.

The Heston variance curve and the shape it cannot make

Three Heston parameters fix an entire variance term structure. Build the variance swap curve, read the forward variance off it, then find the shape no parameter choice reaches.

The index is quieter than everything in it

Every name in a basket carries the same volatility, and the basket carries less. Turn the gap into a correlation, then work out what a dispersion position earns when the gap moves.

Impurity importance with a duplicated feature

Copy one informative column, change nothing else, and refit the forest. The reported importances move a long way. Work out where the credit went, and whether any fix rescues it.

The strike that is not on the grid

An FFT option pricer is accurate to the last bit of double precision at the strikes it chooses, and loses most of that accuracy at the strike the desk asked for.

The inverse you can write down without a solver

A covariance built from one common driver plus independent noise has an inverse in closed form. Find it, then find the minimum-variance portfolio it implies.

Joining the back of a queue

We join a bid queue with a pile of lots standing in front of us. Trades and cancels move us up, and the price moving away kills the order. Work out whether it ever trades.

The log-likelihood of five hundred assets, on paper

A Gaussian likelihood needs the determinant of a five hundred square covariance matrix. Two identities reduce it, and the total variance, to arithmetic done by hand.

The spot grid with a negative weight

Discretise the pricing equation in spot rather than log-price and one of the three trinomial weights goes negative. Find where, then decide whether it is worth fixing.

Three piles, and the invariant that settles all of them

Three piles, take as many counters as you like from any one of them, and the final counter decides it. Find the invariant that settles every position, then flip who wins at the end.

Members · question, hint and idea free

NOT IN with a NULL in the list

A filter that excludes two symbols returns nothing at all, a table splits into two halves that do not add up, and two ways of writing an average disagree. One cause behind all three.

The cap looked comfortable until the volume came in light

A buy order, a forecast volume curve and a hard limit on our share of it. The headroom looks generous. Work out how much of a volume miss it actually survives.

Paying redemptions out of the liquid sleeve

A fund meets redemptions from its cash-like assets first, because that is the cheapest thing to do today. Work out what it does to everyone who stayed, and what the fix costs.

The scoring rule that picks out a quantile

Forecast one number and get graded by an asymmetric penalty. Work out which number wins, then try the same trick on a tail average and watch it fetch the wrong thing.

A call, a put, and a dividend in between

Four quotes on one name and a dividend before expiry. Find the trade that locks a profit today, then run the relation backwards to see what the quotes say about the payout.

Members · question, hint and idea free

The largest, the smallest, and the gap

Five numbers drawn uniformly from the unit interval. Find the average of the largest, then the average gap between largest and smallest, then the version that survives when five becomes n.

A very accurate test for a very rare thing

A screening test that is right almost every time, applied to a condition almost nobody has. The number most people give is wrong by more than an order of magnitude.

Members · question, hint and idea free

Reading a price correction off the skew

Index option quotes across two maturities collapse onto a single straight line once the coordinate is right. Recover the constants that carry all the stochastic volatility.

Ridge and lasso meet a duplicated column

Paste a second copy of a column into the design and refit. One penalty leaves the total effect alone and one does not. Work out which, and what that says about the two penalties.

A position with a negative risk contribution

Split a two-position risk number across its two positions. One of them comes out negative, and the obvious reading of that number is the wrong one. Say what it does and does not mean.

Recovering the spread from the autocovariance of price changes

A tape of trade prices and no quotes at all. Successive price changes are negatively correlated, and that single fact recovers the spread and splits the observed variance in two.

A rolling window that walked across a market gap

A window of five observations, ten seconds apart, quietly reaching back over two hours of nothing. The default argument counts rows, and rows are not a clock.

What a discount factor's volatility permits

A one-period pricing kernel with a given mean and standard deviation. Work out the risk-free rate it implies, and the largest Sharpe ratio the model is allowed to contain.

The gaps between points dropped on an interval

Nine points land uniformly on an interval and cut it into ten gaps. The typical gap is easy. The largest gap is much wider than most people guess, and there is a one-line reason.

Stratifying a digital payoff

A digital pays one when a standard normal clears a threshold. Chop the driving uniform into equal strata and the variance collapses, and for one choice it vanishes.

The Gaussian integral, and the parameter that gives every moment

Derive the normalising constant of the bell curve from scratch by squaring the integral and going polar. Then let one parameter into it, and differentiate out every even moment.

The join that doubled the position

A trades table joined to a reference table on symbol. Nothing errors, every row looks plausible, and the total is wrong. Work out by how much, and why the ratio is not obvious.

The keyword that was supposed to make it faster

A profiler blames an accumulation loop. Someone adds the keyword that is supposed to fix exactly this, and the timing does not move. The assembly shows the change worked.

The shadow price of a return target

A mandate says the book must earn a stated return. The multiplier on that constraint prices the mandate in variance, and the price is not what a straight line predicts.

How long the walk stays on the winning side

Four fair coin flips, and we count how much of the walk sat above the axis. The even split feels like the natural answer, and the distribution is not shaped the way that instinct expects.

Three tunnels and no memory

Three tunnels, one of them the way out, and a choice made fresh every time. First step analysis gives the expected wait, and then memory changes it by more than anyone guesses.

Members · question, hint and idea free

A triangle that closes on mids and not on quotes

Three currencies, three two-way prices, and a cross rate that disagrees with the direct quote. Work out which side of each quote gets hit, then see whether anything is left.

Two eggs and a tall building

Two identical eggs, a tall building, and a threshold floor to locate. Minimise the worst case, not the average, and the search strategy stops being binary.

Members · question and hint free

Splitting balls between two urns

Fifty white balls, fifty black balls, two urns, and a blind draw. Arrange them to make white as likely as possible. The best split is lopsided.

Two schedules, one day, two benchmarks

A buy order, a lopsided volume profile and a drifting price. Work out what two schedules pay against the market's average, then why one of the answers was forced.

Which moments a sample will support

A diagnostic for moment existence that needs no threshold, no fitted model and no tuning parameter. Work out what it does, read the simulated table, and find the column that lies.

Free, full solution

Hard puzzles

The setup carries a trap, or the argument needs a structure the question never mentions.

Is there always a block that divides evenly

A row of whole numbers, chosen by an adversary, and a claim about some consecutive stretch inside it. Decide whether it always holds, and whether a shorter row would still do.

A no-short constraint that binds

The minimum-variance weights come back with a short in them and the mandate forbids shorting. The repair that everybody codes is not the answer, and the multiplier says so.

Where the exercise right is worth something

A two-step tree, a put and a call struck away from the money, and the same right to exercise early attached to both. Find where that right pays, where it is worthless, and what it costs.

A true model that reports a flat slope

The pricing model holds exactly, the betas are estimated without bias, and the second-pass regression still understates the premium and invents an intercept. Work out by how much.

An urn of unknown composition, two white draws

Five balls, each white or black, with a flat prior on how many are white. Two draws come out white. The posterior is the whole answer, and the prediction it implies has a name.

A chord drawn at random, and three honest answers

Draw a chord of a circle at random and ask whether it beats the side of the inscribed equilateral triangle. Three reasonable constructions, three different numbers, and no arithmetic error anywhere.

Free, full solution

Two children, one of them a boy born on a Tuesday

A parent of two answers one yes-or-no question about their children. An apparently irrelevant detail about the day of the week moves the odds. It should.

Members · question, hint and idea free

A needle dropped on a ruled floor

Drop a needle on a floor of evenly ruled parallel lines. The chance it crosses one has pi in it, which is strange for a problem whose statement contains no circle at all.

Members · question, hint and idea free

Common random numbers fixed the delta. Do they fix the gamma?

Sharing draws between the bumped legs turned a useless delta into a good one. The same line of code applied to a second difference does something less generous. Find the rates.

A proof that says who wins and refuses to say how

Players bite squares out of a grid and whoever eats the poisoned corner loses. Settle who wins on any board, then notice the proof will not name a single move to play.

Twelve coins, one counterfeit, three weighings

One coin in a pile is the wrong weight, and nobody says which way. Find it and name the direction on a balance scale, inside a fixed weighing budget.

Collecting coupons that do not arrive equally often

Four coupons arriving at four different rates. Collecting the set takes noticeably longer than it would at equal rates, and the stage-by-stage trick that solves the equal case quietly stops working.

Members · question, hint and idea free

Default correlation is not asset correlation

Two firms, one dependence parameter, and two different numbers that both get called correlation. Which one a loan portfolio actually feels, and what happens to it as the credits get safer.

Degrees of freedom from the fourth moment

A Student t has a kurtosis, so invert it and read the tail parameter off the sample. The estimator is consistent, and it has no standard error at all.

Do we have to differentiate the exercise boundary?

Bumping spot moves the exercise rule as well as the paths. One of those two effects can be ignored, and only at one particular place. Find it, and say what it costs to be off it.

Dependent variables whose sum behaves as if they were independent

Independence makes characteristic functions multiply. Build a dependent pair that does it anyway, first with no variance at all and then with a finite one, on three points.

The digital that will not converge at second order

The time integrator is damped, the scheme is second order in space, and refining the grid halves the error instead of quartering it. The defect is in the first line of the solve.

Ten million identical rows, and a total that is too big

A notional column stored in single precision, totalled by a running sum. Two library calls on the same column return answers that differ by a tenth, and neither of them raises anything.

Forward hazard rate from a steep credit curve

Two quotes on one issuer, three years and five, and the second is twice the first. The intensity that applies in the back two years is neither, and two standard shortcuts miss it the same way.

How wide to quote when inventory is charged for

Quote tighter and trade more, quote wider and carry less. Put a price on the inventory, optimise, and find out what the wider quote actually bought.

The passenger who lost their boarding pass

One passenger sits at random and every later passenger takes their own seat if it is free. Does the final passenger get theirs? Symmetry answers it in a line.

Members · question and hint free

The break that looks like long memory

A series with no memory at all, whose mean shifted once. Its sample autocorrelation function is what every long memory claim rests on, and here it is measuring something else.

Scaling a capital charge to five liquidity horizons

A book whose risk factors cannot all be exited in the same time. Push it through the regulatory horizon formula, then show what the formula collapses to when every factor is equally slow.

Two desks merge and the risk number goes up

Add a liquidation cost to a coherent risk measure and it stops being coherent. Work out which term breaks, which axiom it breaks first, and where the same cost gets charged twice.

Where to stop the Merton series

A jump-diffusion call is a Poisson-weighted sum of Black-Scholes prices. Find the tail bound that can be written down before any term is evaluated, then check the sum three ways.

The total that changes when the worker count changes

An aggregation service is scaled from four workers to eight. Nothing else changes, and the reported total changes in the ninth decimal. Reconciliation opens a ticket. Who is right.

Pooling ten losses with a power tail

Ten independent losses, equal weights, and a tail that falls off as a power. Work out how far the per-unit quantile drops, then find the index at which pooling stops paying anything at all.

The product of two correlated Brownian motions

Multiply two correlated Brownian motions together. Neither factor has a drift and the product does. Find that drift, remove it, then work out how far the product spreads.

Will the resting order fill before the quote moves away

Our limit order joins the back of a queue and races a clock. A competing-exponentials argument turns queue position into a fill probability, and shows why other people cancelling helps us.

The total moved and nothing else did

Same code, same input, same seed, same machine, and a daily total that changed in its final digits after the grid was resized. Find the mechanism, bound the size, and make it repeatable.

The same pricer, one year and one week

A Fourier option pricer reaches machine precision on a small grid at one maturity and cannot get near it on a grid thousands of times larger at another. Only the maturity moved.

The pile that grows until it does not

Each round the pile grows by a random amount or is wiped out entirely. Guessing the stopping rule is easy. The work is proving that looking one step ahead is enough.

Where waiting is worth nothing, and one step later worth the most

A fair walk along a line of states, a reward table with a peak and a longer climb beyond it, and one chance to cash out. The set of states where we stop turns out disconnected.

The query that knew the future

A fundamentals table, a decision table, and a join on the period end date. Count the rows, find the two dates where it lies, and write the version that cannot.

How long it takes to climb back

A drifting log-wealth process has fallen below its old peak. Recovery is certain, so the question is when, and the average answer is nothing like the usual one.

Two identical arrays, one slow addition

Two arrays hold exactly the same numbers and pass an equality check. Adding one to itself is quick. Adding it to the other is not, and no arithmetic has changed anywhere.

The payoff object called once per path

A simulation calls a payoff through a base-class pointer, once per path. Someone proposes a template instead. Estimate the speedup before reading on, then see what four builds say.

Waiting longer than the average gap

Events arrive every ten minutes on average, and the average wait for one is longer than that. Not a paradox, and the size of the effect is set by one number about the gaps.

The accelerator that spends its day waiting for the bus

Two kernels, one machine, one link between them. Work out the intensity at which shipping the data to a coprocessor starts paying, and which of the two kernels can never reach it.

The point where a regression stops having an answer

Two regressors that agree to within a tiny epsilon. Find the exact epsilon at which the textbook route to the coefficients fails outright, and how many digits it costs before.

By topic

The ideas this collection comes back to most often, each gathered across every form the library takes it in.

Learn quant finance on Thuztra Learn

Thuztra Learn teaches the maths of quant finance from zero, in short lessons, for readers who are unsure of it. Three questions in the app build your quant roadmap, free. Membership is a paid subscription. See what Thuztra Learn is and what it costs, or see the whole Core quant curriculum.

Get the app and answer the three questions:

Download on the Microsoft Store Download for Android

On Android, the app is a direct download, not a Google Play listing. Which devices, and what each one needs.

Also in the library