๐Ÿง  Max Dama on Automated Trading - Brain Teasers (Enhanced Edition) ๐Ÿ”—

This is an original, corrected, and expanded study guide inspired by the quantitative interview topics in Max Dama’s On Automated Trading notes. Several mathematical errors from the original circulating notes have been fixed, missing derivations have been worked out in full, and every problem has been restated in clear, self-contained form.

๐Ÿ“‘ Table of Contents ๐Ÿ”—


๐Ÿ“ˆ Market Making and Betting ๐Ÿ”—

Q: A bag contains 100 coins: 98 are fair (50% Heads, 50% Tails), 1 is double-headed (HH), and 1 is double-tailed (TT). You draw one coin uniformly at random, flip it once, and observe Heads. What is the posterior probability that you drew the double-headed coin?

Answer: Applying Bayes’ Theorem: Out of the 100 coins, 98 yield Heads with probability 0.50.5, 1 yields Heads with probability 11, and 1 yields Heads with probability 00. Let HH denote observing Heads, and HHHH denote selecting the double-headed coin:

P(HHโˆฃH)=P(HโˆฃHH)P(HH)P(H)P(HH \mid H) = \frac{P(H \mid HH) P(HH)}{P(H)}

P(H)=(98100โ‹…0.5)+(1100โ‹…1)+(1100โ‹…0)=0.49+0.01=0.50P(H) = \left(\frac{98}{100} \cdot 0.5\right) + \left(\frac{1}{100} \cdot 1\right) + \left(\frac{1}{100} \cdot 0\right) = 0.49 + 0.01 = 0.50

P(HHโˆฃH)=1โ‹…0.010.50=150=2%P(HH \mid H) = \frac{1 \cdot 0.01}{0.50} = \frac{1}{50} = 2\%

Intuitively, there are 200 equally likely coin faces in the bag, exactly 100 of which are Heads, and 2 of those 100 belong to the double-headed coinโ€”giving a 2%2\% probability.

Q: Suppose 10,000 fair coins are tossed (scoring 1 for Heads and 0 for Tails). You are offered an even-money (1-to-1) wager that the total number of Heads is strictly below 5,000, and you may stake any integer dollar amount from $1 to $100. How much should you wager? How does your optimal wager change if you learn ahead of time that the total number of Heads is strictly below 5,100?

Answer: First, compute the probability of landing on the exact midpoint of 5,000 Heads:

P(X=5000)=(100005000)โ‹…0.510000โ‰ˆ15000ฯ€โ‰ˆ0.79%P(X = 5000) = \binom{10000}{5000} \cdot 0.5^{10000} \approx \frac{1}{\sqrt{5000\pi}} \approx 0.79\%

By symmetry of the binomial distribution, the probability of getting strictly fewer than 5,000 Heads is:

P(X<5000)=1โˆ’0.00792=49.6%P(X < 5000) = \frac{1 - 0.0079}{2} = 49.6\%

Because your win probability is under 50% on an even-money payout, the wager has negative expected value. You should bet $0.

With the side information that X<5100X < 5100: Since the standard deviation is ฯƒ=10000โ‹…0.25=50\sigma = \sqrt{10000 \cdot 0.25} = 50, a threshold of 5,100 lies +2ฯƒ+2 \sigma above the mean, which has cumulative probability P(X<5100)โ‰ˆ97.7%P(X < 5100) \approx 97.7\%. Conditioning on X<5100X < 5100, your updated probability of winning the X<5000X < 5000 bet becomes:

P(X<5000โˆฃX<5100)=P(X<5000)P(X<5100)=0.4960.977โ‰ˆ50.76%P(X < 5000 \mid X < 5100) = \frac{P(X < 5000)}{P(X < 5100)} = \frac{0.496}{0.977} \approx 50.76\%

Now you have a positive edge. Applying the Kelly Criterion (fโˆ—=2pโˆ’1f^* = 2p - 1 for even-money bets):

fโˆ—=2(0.5076)โˆ’1=0.0152f^* = 2(0.5076) - 1 = 0.0152

You should stake 1.52% of your bankroll.

(Note: If instead the bet itself pays out whenever X<5100X < 5100, your win probability is 97.7%97.7\%, and the Kelly fraction is 2(0.977)โˆ’1=95.4%2(0.977) - 1 = 95.4\% of your bankroll).

Q: You roll a fair six-sided die repeatedly and keep a running sum, stopping as soon as the cumulative total exceeds 63. What is the probability that the penultimate (second-to-last) roll was a specific value Xโˆˆ{1,2,3,4,5,6}X \in \{1, 2, 3, 4, 5, 6\}?

Answer: The probability is uniformly 1/61/6 for each value 1 through 6. Because the Markov chain over the running sum reaches a nearly uniform stationary distribution over residues long before reaching 63, and the penultimate roll is completed before the final stopping roll is conditioned upon, each face remains equally likely (1/61/6).

Q: Six sealed envelopes containing $2, $4, $8, $16, $32, and $64 are arranged in a row in strictly sorted order (either ascending or descending, with equal probability). Two adjacent envelopes are selected, shuffled, and dealt to you and a counterparty. You open yours and find $16. Should you offer to swap envelopes?

Answer: Consider the four equally likely ways you can hold the $16 envelope (two under ascending order, two under descending order):

  1. Pair ($8, $16), ascending โ†’ Swapping gives $8 (lose $8).
  2. Pair ($16, $32), ascending โ†’ Swapping gives $32 (gain $16).
  3. Pair ($32, $16), descending โ†’ Swapping gives $32 (gain $16).
  4. Pair ($16, $8), descending โ†’ Swapping gives $8 (lose $8).

In a two-player rational trading game (the Adverse Selection / No-Trade Theorem), if the counterparty also peeks inside their envelope before accepting a swap, they will never accept when they hold $32 and will always accept when they hold $8! Thus, an optional mutual trade has negative expected value (you only get filled when the counterparty has $8). If the swap is unilateral (forced without the counterparty’s consent), then since $16 is an interior value, swapping yields 0.5(8)+0.5(32)=20>160.5(8) + 0.5(32) = 20 > 16.

Q: Suppose you draw a random count NN from one probability distribution, and then draw NN independent and identically distributed samples X1,X2,โ€ฆ,XNX_1, X_2, \dots, X_N from a second distribution (independent of NN). How do you price the fair value of their sum?

Answer: By Wald’s Identity, when NN is independent of the XiX_i sequence, the expected value of the random sum is simply the product of the two expectations:

E(โˆ‘i=1NXi)=E(N)โ‹…E(X)E\left(\sum_{i=1}^{N} X_i\right) = E(N) \cdot E(X)

Q: Derive the log-utility optimal fraction of your bankroll to stake on a fair coin toss that pays +x+x on Heads and loses โˆ’y-y on Tails (x>y>0x > y > 0).

Answer: Using the Kelly Criterion where net payout odds per unit risked are b=x/yb = x/y and win probability is p=0.5p = 0.5:

fโˆ—=p(b+1)โˆ’1bf^* = \frac{p(b+1) - 1}{b}

fโˆ—=0.5(x/y+1)โˆ’1x/y=0.5((x+y)/y)โˆ’1x/y=0.5xโˆ’0.5yx=xโˆ’y2xf^* = \frac{0.5(x/y + 1) - 1}{x/y} = \frac{0.5((x+y)/y) - 1}{x/y} = \frac{0.5x - 0.5y}{x} = \frac{x - y}{2x}

Note that this fraction is scaled relative to a loss of yy; the fraction of total capital exposed to loss on a Tails outcome is (xโˆ’y)/(2x)(x - y) / (2x).

Q: How does your research and risk-management approach differ between a 25-factor quantitative trading model and a 100-factor model? If the 100-factor model shows 25% higher backtested performance, how would you evaluate whether to deploy it?

Answer: Moving from 25 factors to 100 factors dramatically increases degrees of freedom and the risk of in-sample overfitting (the curse of dimensionality). A 25% improvement in backtested return or Sharpe ratio across 4x as many features is easily explained by fitting historical noise rather than genuine out-of-sample signal. To evaluate it rigorously:

  1. Collinearity & Dimensionality Reduction (PCA): Inspect the factor correlation matrix and eigenvalue spectrum to see how many orthogonal risk/alpha dimensions those 75 extra factors actually span.
  2. Regularization & Information Criteria: Apply L1L_1 (Lasso) / Elastic Net regularization and compare penalized model selection metrics (AIC, BIC, or cross-validated log-likelihood) to see if the added parameters justify their complexity penalty.
  3. Strict Out-of-Sample & Walk-Forward Validation: Test performance decay on an untouched holdout period and measure turnover and transaction-cost drag.

Q: An asset begins at price pp, rises by x%x\%, and subsequently falls by x%x\% (with x>0x > 0). How does the final price compare to pp?

Answer: It is strictly less than pp (known as volatility drag). Because the percentage drop is applied to the larger post-gain base p(1+x)p(1+x):

pโ‹…(1+x)โ‹…(1โˆ’x)=pโ‹…(1โˆ’x2)<pp \cdot (1+x) \cdot (1-x) = p \cdot (1-x^2) < p

Q: Starting with a $100 bankroll, you are offered 100 sequential bets on a biased coin that lands Heads with 90% probability. Staking xx dollars loses xx on Tails and returns 2x2x on Heads. What fraction of your bankroll should you wager on each toss?

Answer: The optimal fraction depends on whether “returns 2x2x” means net profit of 2x2x (2-to-1 odds, b=2b = 2) or gross payout of 2x2x (net profit xx, 1-to-1 odds, b=1b = 1):

Q: Make a two-sided market (Bid/Ask) on the total number of manhole covers in New York City.

Answer: We construct a Fermi estimate from road mileage: New York City has roughly 8.5 million residents and approximately 6,000 miles of paved streets. Utility access covers (sewer, water, electrical, telecom) appear roughly every 100 feet along city streets, which equates to about 5,280/100โ‰ˆ525,280 / 100 \approx 52 covers per mile: 6,000ย milesร—52ย covers/mileโ‰ˆ312,000ย covers6{,}000\text{ miles} \times 52\text{ covers/mile} \approx 312{,}000\text{ covers}. Accounting for estimation variance, a reasonable initial market is 200,000 Bid at 450,000 Ask.


๐ŸŽฒ Probability ๐Ÿ”—

Q: Estimate the probability of obtaining exactly 500 Heads in 1,000 flips of a fair coin to within 5% accuracy using mental math.

Answer: Apply Stirling’s approximation, n!โ‰ˆ2ฯ€n(n/e)nn! \approx \sqrt{2 \pi n} (n/e)^n:

P(X=500)=(1000500)0.51000=1000!500!โ‹…500!0.51000P(X = 500) = \binom{1000}{500} 0.5^{1000} = \frac{1000!}{500! \cdot 500!} 0.5^{1000}

โ‰ˆ2ฯ€โ‹…1000(1000/e)1000โ‹…0.51000(2ฯ€โ‹…500(500/e)500)2\approx \frac{\sqrt{2\pi \cdot 1000} (1000/e)^{1000} \cdot 0.5^{1000}}{\left(\sqrt{2\pi \cdot 500} (500/e)^{500}\right)^2}

=2000ฯ€2ฯ€โ‹…500=1500ฯ€= \frac{\sqrt{2000\pi}}{2\pi \cdot 500} = \frac{1}{\sqrt{500\pi}}

Since 500ฯ€โ‰ˆ1570500 \pi \approx 1570 and 402=160040^2 = 1600, 1570โ‰ˆ39.6โ‰ˆ40\sqrt{1570} \approx 39.6 \approx 40. Thus Pโ‰ˆ1/40=2.5%P \approx 1/40 = 2.5\% (the exact value is 2.523%2.523\%).

Q: To pass a three-game tennis challenge against two opponentsโ€”a stronger player A and a weaker player Bโ€”you must win two consecutive games. Should you choose the schedule A-B-A or B-A-B?

Answer: Let PaP_a and PbP_b be your single-game win probabilities against A and B, where Pa<PbP_a < P_b. To win two games in a row out of three, you must win the middle game (Game 2) and at least one of the outer games (Game 1 or Game 3):

Because Pa<PbP_a < P_b, we have Pa2Pb<PaPb2P_a^2 P_b < P_a P_b^2, which makes A-B-A strictly better! (Correction note: While intuition often suggests facing B in the middle game, playing the stronger opponent A in the mandatory middle game actually gives a lower total probability because 2PaPbโˆ’Pa2Pb>2PaPbโˆ’PaPb22P_a P_b - P_a^2 P_b > 2P_a P_b - P_a P_b^2. Facing A-B-A maximizes your chance of winning the crucial middle match against the weaker opponent B!)

Q: Two players take turns rolling a fair six-sided die. Player 1 rolls first and wins immediately on a 1; otherwise Player 2 rolls and wins immediately on a 6; otherwise play returns to Player 1, and so on. Find each player’s winning probability.

Answer: Let EE be Player 1’s probability of winning from the start of a round:

E=16+(56โ‹…56โ‹…E)E = \frac{1}{6} + \left(\frac{5}{6} \cdot \frac{5}{6} \cdot E\right)

E=16+2536EE = \frac{1}{6} + \frac{25}{36} E

1136E=16โ€…โ€ŠโŸนโ€…โ€ŠE=611โ‰ˆ54.55%\frac{11}{36} E = \frac{1}{6} \implies E = \frac{6}{11} \approx 54.55\%

Player 2’s winning probability is 1โˆ’6/11=5/11โ‰ˆ45.45%1 - 6/11 = 5/11 \approx 45.45\%.

Q: Cards from a standard 52-card deck (26 red, 26 black) are turned over one at a time. At any point before the deck runs out, you may call “Stop” and bet on the color of the very next card (+$1 if red, -$1 if black). What is the fair price to play this game under an optimal stopping rule?

Answer: $0. The fraction of red cards remaining in the deck at step tt forms a martingale. By Doob’s Optional Stopping Theorem, for any bounded stopping time ฯ„\tau, the expected proportion of red cards at time ฯ„\tau equals the initial proportion (26/52=0.526/52 = 0.5), meaning no card-counting strategy can achieve a positive expected payoff.

Q: A medical screening test for a rare condition (prevalence 0.5% in the general population) has 99% sensitivity (true positive rate) and 99% specificity (true negative rate). If a randomly tested individual receives a positive result, what is the probability they actually have the condition?

Answer: By Bayes’ Theorem:

P(ConditionโˆฃPositive)=0.005โ‹…0.99(0.005โ‹…0.99)+(0.995โ‹…0.01)P(\text{Condition} \mid \text{Positive}) = \frac{0.005 \cdot 0.99}{(0.005 \cdot 0.99) + (0.995 \cdot 0.01)}

=0.004950.00495+0.00995=0.004950.0149โ‰ˆ33.22%= \frac{0.00495}{0.00495 + 0.00995} = \frac{0.00495}{0.0149} \approx 33.22\%

Because the base rate (0.5%0.5\%) is smaller than the false-positive rate (1%1\%), roughly two-thirds of positive screens are false positives.

Q: Three pancakes are stacked on a plate: one is browned on both sides, one is browned on one side and pale on the other, and one is pale on both sides. You look at the top face of a randomly chosen pancake and see that it is browned. What is the probability that its underside is also browned?

Answer: Count the equally likely faces rather than pancakes: there are 6 pancake sides in total, 3 of which are browned. Two of those 3 browned faces belong to the double-browned pancake, where the opposite face is also browned. Therefore, the probability is 2/3โ‰ˆ66.7%2/3 \approx 66.7\%.

Q: Rolling a fair six-sided die repeatedly, find the expected number of rolls needed to observe: (a) a single 6, (b) two consecutive 6s (6-6), and (c) a 6 immediately followed by a 5 (6-5).

Answer:

Q: You roll a fair six-sided die and receive a dollar payout equal to the final face shown. After the initial roll, you may choose to re-roll up to two additional times (for a maximum of 3 total rolls), forfeiting any prior roll whenever you re-roll. What is the fair value of this game?

Answer: Solve by backward induction:

The fair value of the game is $4.67 (14/314/3 dollars).

Q: Two players alternate flipping a fair coin, and the first player to flip Heads wins $1. How much should you be willing to pay to go first rather than second?

Answer: Let EE be the expected payoff of the first player:

E=0.5(1)+0.5(1โˆ’E)โ€…โ€ŠโŸนโ€…โ€ŠE=23E = 0.5(1) + 0.5(1 - E) \implies E = \frac{2}{3}

Since the second player’s expected payoff is 1โˆ’2/3=1/31 - 2/3 = 1/3, the advantage of moving first is 2/3โˆ’1/3=1/32/3 - 1/3 = 1/3, or $0.33.

Q: Out of 5 coinsโ€”four fair coins and one double-headed coinโ€”you pick one at random and flip it 5 times, observing 5 consecutive Heads. What is the probability that you selected the double-headed coin?

Answer: By Bayes’ Theorem:

P(Doubleโˆฃ5H)=1โ‹…0.2(1โ‹…0.2)+(0.55โ‹…0.8)=0.20.2+0.025=89โ‰ˆ88.89%P(\text{Double} \mid \text{5H}) = \frac{1 \cdot 0.2}{(1 \cdot 0.2) + (0.5^5 \cdot 0.8)} = \frac{0.2}{0.2 + 0.025} = \frac{8}{9} \approx 88.89\%

๐Ÿงฎ Mental Math ๐Ÿ”—

Rapid mental calculation benchmarks:


๐Ÿงฉ Math and Logic ๐Ÿ”—

Q: A swimmer is at the exact center of a circular lake of radius rr, while a predator on the shoreline can run along the perimeter at twice the swimmer’s maximum swimming speed (2v2v vs. vv). Assuming the predator always moves along the shore toward the point closest to the swimmer, can the swimmer reach dry land before the predator arrives?

Answer: Yes. Even if the swimmer simply swims in a straight radial line directly opposite the predator’s starting position, the swimmer only needs to cover distance rr (taking time r/vr / v), whereas the predator must run halfway around the circumference, a distance of ฯ€r\pi r (taking time (ฯ€r)/(2v)(\pi r) / (2v)). Because ฯ€/2โ‰ˆ1.57>1\pi / 2 \approx 1.57 > 1, the swimmer reaches the shore well ahead of the predator.

Q: The hour and minute hands of an analog clock overlap at 12:00 midnight. At what exact time do they next overlap?

Answer: The minute hand sweeps 360โˆ˜360^\circ per hour, while the hour hand sweeps 30โˆ˜30^\circ per hour, giving a relative angular speed of 330โˆ˜330^\circ per hour. The hands next overlap when the minute hand gains a full 360โˆ˜360^\circ lap on the hour hand:

They next overlap at 1:05:27.27 AM.

Q: Three duelistsโ€”A (100% accuracy), B (66% accuracy), and C (33% accuracy)โ€”fire in circular turn order starting with the weakest shooter C, followed by B, then A, until only one survives. What is C’s optimal first move?

Answer: C should intentionally miss (fire into the ground/air) on the first turn.

Q: Solve for positive real xx in the infinite power tower xxxโ€ฆ=2x^{x^{x^{\dots}}} = 2.

Answer: Because the infinite exponent tower converges to 2, substituting 2 for the exponent tower above the base xx yields:

x2=2โ€…โ€ŠโŸนโ€…โ€Šx=2x^2 = 2 \implies x = \sqrt{2}

Q: Evaluate the nested radical 2+2+2+โ€ฆ\sqrt{2 + \sqrt{2 + \sqrt{2 + \dots}}}.

Answer: Let x>0x > 0 denote the limit of the nested radical:

x=2+xx = \sqrt{2 + x}

x2โˆ’xโˆ’2=0โ€…โ€ŠโŸนโ€…โ€Š(xโˆ’2)(x+1)=0x^2 - x - 2 = 0 \implies (x - 2)(x + 1) = 0

Since x>0x > 0, the value is x=2x = 2.

Q: A stick of unit length is broken at two points chosen independently and uniformly at random along its length. What is the probability that the three resulting pieces can form a triangle?

Answer: 25% (1/41/4). By the Triangle Inequality, three segments of total length 1 form a triangle if and only if each segment has length strictly less than 1/21/2. Plotting the two uniform break points (u,v)โˆˆ[0,1]2(u, v) \in [0, 1]^2, the valid region where minโก(u,v)<1/2\min(u,v) < 1/2, 1โˆ’maxโก(u,v)<1/21 - \max(u,v) < 1/2, and โˆฃuโˆ’vโˆฃ<1/2|u - v| < 1/2 consists of two triangles each of area 1/81/8, giving a total probability of 2โ‹…(1/8)=1/4=25%2 \cdot (1/8) = 1/4 = 25\%.

Q: Three points are chosen independently and uniformly at random on the circumference of a circle. What is the probability that all three lie on some common semicircle?

Answer: 75% (3/43/4). In general, for nn independent uniform points on a circle, each point defines a clockwise semicircle starting at that point of length 1/21/2; the probability that all other nโˆ’1n - 1 points fall within it is (1/2)nโˆ’1(1/2)^{n-1}. Since these nn events are mutually exclusive (assuming the points don’t span the entire circle), the total probability is n/2nโˆ’1n / 2^{n-1}. Setting n=3n = 3 gives 3/4=75%3 / 4 = 75\%.

Q: Given two concentric circles, a chord of the outer circle of length 8 is tangent to the inner circle. What is the area of the annulus (ring) between the two circles?

Answer: Let RR and rr be the outer and inner radii. The radius rr drawn to the point of tangency is perpendicular to the chord and bisects it into two segments of length 4. By the Pythagorean Theorem on the resulting right triangle:

r2+42=R2โ€…โ€ŠโŸนโ€…โ€ŠR2โˆ’r2=16r^2 + 4^2 = R^2 \implies R^2 - r^2 = 16

Therefore, the area of the annulus is ฯ€(R2โˆ’r2)=\pi (R^2 - r^2) = 16ฯ€16 \pi.

Q: Cup A contains 1 cup of pure milk and Cup B contains 1 cup of pure water. You transfer 1 teaspoon of milk from Cup A into Cup B, stir thoroughly, and then transfer 1 teaspoon of the mixture from Cup B back into Cup A. Does Cup A now contain more water than Cup B contains milk, or vice versa?

Answer: They are identical. Because both cups begin and end with the exact same total liquid volume (1 cup each), whatever volume of water now resides in Cup A must have displaced an identical volume of milk that now resides in Cup B.


๐Ÿ“š Download My Free Ebook ๐Ÿ”—

Get the curated offline edition of Kaue's Way of Lifeโ€”a practical field guide to optimizing ๐Ÿ Health, ๐Ÿ’ฐ Wealth, โค๏ธ Love, and ๐Ÿง˜ Meaning.

Kaue's Way of Life

Kaue's Way of Life
Minimum price
Free!
Suggested price
$0.00

๐Ÿ“ฌ Join My Mailing List ๐Ÿ”—

Get notified when I publish new essays, book summaries, and practical guides on living well. No spamโ€”unsubscribe anytime.


๐Ÿ’ฌ Comments & Discussion ๐Ÿ”—

Have a question, perspective, or suggestion? Share your thoughts below.



Updated on 2026 Oct 11.

DISCLAIMER: The content on this site is for informational and educational purposes only and does not constitute medical, psychological, financial, investment, tax, or legal advice. The ideas, curation, and opinions presented here are my own and do not represent those of my employer. Book, lecture, and article summaries are independent educational commentary and remain the intellectual property of their respective authors. AI tools may be used to assist with editing, formatting, and synthesis; while every effort is made to ensure accuracy, errors may occur. PRIVACY: This site uses third-party services for cookieless analytics (Google Analytics), optional newsletter subscriptions (Mailchimp), comments (Disqus), live chat (Tawk.to), and embedded media (YouTube), which may process visitor IP addresses and cookies in accordance with their respective privacy policies.