量化金融 · 第 18 册 · 职业发展

Interviews I: Maths, Probability and Speed

本书暂未推出简体中文版。现有版本:English, Français。

Interviews I: Maths, Probability and Speed · 职业发展

22Stochastic Calculus

Brownian motion as a tool: Ito’s lemma, martingales and optional stopping, reflection and hitting times, integrals of the path, Girsanov’s change of measure and Feynman–Kac. Most results here can be reached in two ways, and the second is the check.

Question 22.1 ★ QR, QT, QD, Risk • any • junior

WW is a standard Brownian motion. Give Cov⁡(Ws,Wt)\operatorname{Cov}(W_s, W_t). Find the variance of W1+W2W_1 + W_2, the correlation of W1W_1 and W4W_4, and the probability that W1W_1 and W2W_2 are both positive.

Answer

Answer to Question 22.1.

Cov⁡(Ws,Wt)=min⁡(s,t)\operatorname{Cov}(W_s, W_t) = \min(s, t). The variance is 5, the correlation 12\frac12, and the probability 38\frac38.

For s≤ts \le t, write Wt=Ws+(Wt−Ws)W_t = W_s + (W_t - W_s), whose second term is independent of WsW_s. That leaves Var⁡Ws=s\operatorname{Var}W_s = s.

Then Var⁡(W1+W2)=1+2+2(1)=5\operatorname{Var}(W_1 + W_2) = 1 + 2 + 2(1) = 5. The correlation of W1W_1 and W4W_4 is 1/1×4=121/\sqrt{1 \times 4} = \frac12.

For two jointly normal variables with mean zero and correlation rr, the chance that both are positive is 14+arcsin⁡(r)/(2π)\frac14 + \arcsin(r)/(2\pi). Here r=1/2r = 1/\sqrt{2}, so arcsin⁡r=π/4\arcsin r = \pi/4, and the probability is 14+18\frac14 + \frac18. A simulation gives 0.3750.375.

Classic wrong answer. Treating W1W_1 and W2W_2 as independent, which gives a variance of 3 and a probability of 14\frac14. They overlap on [0,1][0, 1].

Follow-up. What is the variance of W1+⋯+W10W_1 + \dots + W_{10}? ∑i,jmin⁡(i,j)=12+22+⋯+102=385\sum_{i, j}\min(i, j) = 1^2 + 2^2 + \dots + 10^2 = 385, a useful identity.

Why it matters. The covariance formula is the source of everything else, and the question checks that it can be used and not only recited.

Question 22.2 ★ QR, QT, QD, Risk • any • junior

Which of these are martingales: WtW_t, Wt2W_t^2, Wt2−tW_t^2 - t, tWttW_t, eWt−t/2e^{W_t - t/2}, Wt3W_t^3, Wt3−3tWtW_t^3 - 3tW_t? Give one test that decides all of them.

Answer

Answer to Question 22.2.

Martingales: WtW_t, Wt2−tW_t^2 - t, eWt−t/2e^{W_t - t/2} and Wt3−3tWtW_t^3 - 3tW_t. Not martingales: Wt2W_t^2, tWttW_t and Wt3W_t^3. The test is whether ft+12fxx=0f_t + \frac12f_{xx} = 0.

By Ito’s lemma, df(t,Wt)=(ft+12fxx) dt+fx dWdf(t, W_t) = (f_t + \frac12f_{xx})\,dt + f_x\,dW. A martingale needs the dtdt term to vanish.

WtW_t gives 00. Wt2W_t^2 gives 11, so it has a drift, and subtracting tt removes it. tWttW_t gives WtW_t, which is not zero. eWt−t/2e^{W_t - t/2} gives −12f+12f=0-\frac12 f + \frac12f = 0. Wt3W_t^3 gives 3Wt3W_t, and Wt3−3tWtW_t^3 - 3tW_t gives −3Wt+3Wt=0-3W_t + 3W_t = 0. Gaussian quadrature of the conditional expectations confirms the seven verdicts.

A rule of thumb for tWttW_t: its mean is 0, which may suggest a martingale. Constant mean is necessary, and not sufficient. Its conditional mean given time ss is tWstW_s, not sWssW_s.

Classic wrong answer. Saying that Wt3W_t^3 is a martingale because its mean is always zero. Given WsW_s, the mean of Wt3W_t^3 is Ws3+3(t−s)WsW_s^3 + 3(t - s)W_s.

Follow-up. Find the next polynomial in the family. Wt4−6tWt2+3t2W_t^4 - 6tW_t^2 + 3t^2. These are Hermite polynomials in Wt/tW_t/\sqrt{t}, scaled by powers of t\sqrt{t}.

Why it matters. The one-line test replaces seven separate calculations. Knowing it marks a working knowledge of Ito’s lemma.

Question 22.3 ★ QR, QT, QD, Risk • bank, hedge fund • junior

A stock follows dS=μS dt+σS dWdS = \mu S\,dt + \sigma S\,dW with μ=10%\mu = 10\% and σ=20%\sigma = 20\% a year. Use Ito’s lemma on ln⁡S\ln S. Starting from 1, what are the mean and median after one year? What is the probability of ending above the mean?

Answer

Answer to Question 22.3.

dln⁡S=(μ−12σ2) dt+σ dWd\ln S = (\mu - \frac12\sigma^2)\,dt + \sigma\,dW. The mean is e0.1=1.105e^{0.1} = 1.105, the median e0.08=1.083e^{0.08} = 1.083, and the probability 0.460.46.

Ito’s lemma gives dln⁡S=dS/S−12(dS)2/S2d\ln S = dS/S - \frac12(dS)^2/S^2, and (dS)2=σ2S2 dt(dS)^2 = \sigma^2S^2\,dt. So the log has drift μ−12σ2=8%\mu - \frac12\sigma^2 = 8\%.

ln⁡S1\ln S_1 is normal with mean 0.080.08 and standard deviation 0.20.2. The median is at the mean of the log, so e0.08e^{0.08}. For the mean of SS, Ee0.08+0.2Z=e0.08+0.02=e0.1\mathbb{E}e^{0.08 + 0.2Z} = e^{0.08 + 0.02} = e^{0.1}, as the equation for SS also shows.

The chance of ending above the mean needs 0.08+0.2Z>0.10.08 + 0.2Z > 0.1, that is, Z>0.1Z > 0.1, with probability 1−Φ(0.1)=0.461 - \Phi(0.1) = 0.46. A simulation of the discretised equation gives these numbers.

With no volatility, mean and median agree. The gap grows with σ2\sigma^2.

Classic wrong answer. Dropping the −12σ2-\frac12\sigma^2, which is the second-order Ito term, and giving a median of e0.1e^{0.1}.

Follow-up. At what volatility is the median growth zero, with μ=10%\mu = 10\%? σ2/2=0.1\sigma^2/2 = 0.1, so σ=44.7%\sigma = 44.7\%. The average path still grows at 10% while the typical path goes nowhere.

Why it matters. This is the first thing done with Ito’s lemma in finance, and the difference between mean and median is its most useful result.

Question 22.4 ★ QR, QT, QD, Risk • any • junior

Compute EWt4\mathbb{E}W_t^4 and EeaWt\mathbb{E}e^{aW_t} from the normal distribution. What is Ee2W1\mathbb{E}e^{2W_1}? Find the correlation of W12W_1^2 with W42W_4^2.

Answer

Answer to Question 22.4.

EWt4=3t2\mathbb{E}W_t^4 = 3t^2, EeaWt=ea2t/2\mathbb{E}e^{aW_t} = e^{a^2t/2}, Ee2W1=e2≈7.39\mathbb{E}e^{2W_1} = e^2 \approx 7.39, and the correlation is 14\frac14.

Since Wt=tZW_t = \sqrt{t}Z, the fourth moment is t2EZ4=3t2t^2\mathbb{E}Z^4 = 3t^2. Completing the square in the normal integral gives the exponential formula.

For the squares, write W4=W1+VW_4 = W_1 + V, where VV is independent of W1W_1 with variance 3. Then

EW12W42=EW14+EW12 EV2=3+3=6.\mathbb{E}W_1^2W_4^2 = \mathbb{E}W_1^4 + \mathbb{E}W_1^2\,\mathbb{E}V^2 = 3 + 3 = 6.

So the covariance is 6−1×4=26 - 1 \times 4 = 2. The variances are 22 and 2×16=322 \times 16 = 32, which gives 2/64=142/\sqrt{64} = \frac14. This is the square of the correlation 12\frac12 of W1W_1 and W4W_4, as is always true of two jointly normal variables with mean zero. A simulation agrees.

Classic wrong answer. Giving EWt4=t2\mathbb{E}W_t^4 = t^2, which ignores the kurtosis. Or giving the correlation as 12\frac12, the value for W1W_1 and W4W_4 themselves.

Follow-up. What is EWt6\mathbb{E}W_t^6? 15t315t^3. The even normal moments are 1,3,15,1051, 3, 15, 105, each the previous times the next odd number.

Why it matters. These moments come up in every variance calculation. Quick recall saves effort, and the correlation of squares is a small test of care.

Question 22.5 ★ QR, QT, QD, Risk • any • junior

Show that cWt/c2cW_{t/c^2} is a Brownian motion for any c≠0c \ne 0. Use this to relate P(W4>2)P(W_4 > 2) to a probability at time 1, and give its value. A return has a daily volatility of 1%. What is the annual volatility, with 252 days and independent returns?

Answer

Answer to Question 22.5.

P(W4>2)=P(W1>1)=0.1587P(W_4 > 2) = P(W_1 > 1) = 0.1587, and the annual volatility is 15.9%15.9\%.

Xt=cWt/c2X_t = cW_{t/c^2} is continuous, starts at 0, and has independent normal increments with mean zero. Its covariance is c2min⁡(s/c2,t/c2)=min⁡(s,t)c^2\min(s/c^2, t/c^2) = \min(s, t). So it is a Brownian motion.

With c=2c = 2: W4=2W1′W_4 = 2W'_1 for a Brownian motion W′W', so P(W4>2)=P(W1′>1)P(W_4 > 2) = P(W'_1 > 1), which is 1−Φ(1)=0.15871 - \Phi(1) = 0.1587.

Independent returns add their variances, so standard deviations scale with the square root of time: 1%×252=15.9%1\% \times \sqrt{252} = 15.9\%. If returns are not independent, this figure is wrong, which is why some measure of autocorrelation has to accompany it.

Classic wrong answer. Multiplying by 252, which gives 252%. Variance scales with time, and volatility with its root.

Follow-up. What is the annual volatility for a monthly volatility of 5%? 5%×12=17.3%5\% \times \sqrt{12} = 17.3\%.

Why it matters. Scaling is the Brownian fact used most on any desk, and proving it with the covariance formula takes one line.

Question 22.6 ★ QR, QT, QD, Risk • any • junior

Split [0,1][0, 1] into 1000 equal steps. Find the mean and the standard deviation for the sum of squared increments of WW, and what is the mean of the sum of the absolute increments? What happens to each as the steps shrink?

Answer

Answer to Question 22.6.

The sum of squares has mean 1 and standard deviation 0.0450.045. The sum of absolute values has a mean of 25.225.2. As the steps shrink, the first converges to 1, and the second diverges.

Each increment is normal with variance 1/n1/n. Its square has mean 1/n1/n and variance 2/n22/n^2. Summing over nn independent steps gives mean 1 and variance 2/n2/n, so the sum converges to 1 and its standard deviation at n=1000n = 1000 is 0.002\sqrt{0.002}.

The absolute value has mean 2/π/n\sqrt{2/\pi}/\sqrt{n}, and so the sum has mean 2n/π\sqrt{2n/\pi}, which is 25.225.2 here. It grows like n\sqrt{n}. So a Brownian path has infinite length but finite quadratic variation, and this is the reason that the extra term in Ito’s lemma exists: (dW)2(dW)^2 behaves like dtdt.

A simulation with 20 00020\,000 paths confirms all three numbers.

Classic wrong answer. Thinking that the sum of squares is random in the limit, or that it tends to 0 as for a smooth path. For a smooth path the sum of squares goes to 0, while here it stays at TT, with no randomness left.

Follow-up. With 252 daily returns, how noisy is a realised variance? The relative standard deviation is 2/252=8.9%\sqrt{2/252} = 8.9\% for constant volatility and normal returns, and more with fat tails.

Why it matters. This is the heart of the subject. It explains (dW)2=dt(dW)^2 = dt with a calculation, and it is the theory behind realised variance.

Question 22.7 ★★ QR, QT, QD • bank, hedge fund • junior, experienced

Find ∫0TWt dWt\int_0^TW_t\,dW_t using Ito’s lemma. Give its mean and variance. You approximate it by a sum over small steps, evaluating WW at the left end of each step, then at the right end, then at the midpoint. What does each sum converge to?

Answer

Answer to Question 22.7.

∫0TW dW=12(WT2−T)\int_0^TW\,dW = \frac12(W_T^2 - T), with mean 0 and variance T2/2T^2/2. The left sum converges to this, the right sum to this plus TT, and the midpoint to 12WT2\frac12W_T^2.

Ito’s lemma on W2W^2 gives d(W2)=2W dW+dtd(W^2) = 2W\,dW + dt, which rearranges to the result. The mean is 0, since EWT2=T\mathbb{E}W_T^2 = T. The variance is 14Var⁡WT2=14×2T2\frac14\operatorname{Var}W_T^2 = \frac14 \times 2T^2, or by the Ito isometry, ∫0TEWt2 dt=T2/2\int_0^T\mathbb{E}W_t^2\,dt = T^2/2.

The left-end sum is the definition, and its terms have mean zero, as the integrand is known before the increment.

The right sum minus the left sum is ∑(ΔW)2\sum(\Delta W)^2, which converges to TT, so the right sum has mean TT. In the limit, it is 12(WT2+T)\frac12(W_T^2 + T).

The average of the two sums is the midpoint form, and it telescopes exactly: ∑12(Wi+Wi+1)(Wi+1−Wi)=12WT2\sum\frac12(W_i + W_{i + 1})(W_{i + 1} - W_i) = \frac12W_T^2. This is the Stratonovich integral, which keeps the rules of ordinary calculus, and evaluating WW at the true midpoint of each step has the same limit. A run with 1000 steps shows the left, right and averaged sums.

Classic wrong answer. Writing 12WT2\frac12W_T^2 from ordinary calculus. Its mean is T/2T/2, which is impossible for a sum of terms with mean zero.

Follow-up. Why does finance use the left endpoint? Because a position must be chosen before the price move it earns. A right-end rule would trade on the future, and it would earn exactly the extra TT.

Why it matters. This is the shortest illustration of why stochastic integrals differ from ordinary ones, and it shows that the choice of endpoint has real content.

Question 22.8 ★★ QR, QT, QD • bank, hedge fund • junior, experienced

Let IT=∫0TWt dtI_T = \int_0^TW_t\,dt. Find its distribution, using an integration by parts, and check the variance by a double integral. What is its correlation with WTW_T? Evaluate the variance at T=3T = 3.

Answer

Answer to Question 22.8.

ITI_T is normal with mean 0 and variance T3/3T^3/3, which is 9 at T=3T = 3. Its correlation with WTW_T is 3/2=0.866\sqrt{3}/2 = 0.866.

Integrating by parts, d(tWt)=Wt dt+t dWtd(tW_t) = W_t\,dt + t\,dW_t, so

IT=TWT−∫0Tt dWt=∫0T(T−t) dWt.I_T = TW_T - \int_0^Tt\,dW_t = \int_0^T(T - t)\,dW_t.

This is an integral of a deterministic function against dWdW, and it is therefore normal with mean 0. The variance by the isometry is ∫0T(T−t)2 dt=T3/3\int_0^T(T - t)^2\,dt = T^3/3.

As a check, the double integral gives ∫0T∫0Tmin⁡(s,t) ds dt=T3/3\int_0^T\int_0^T\min(s, t)\,ds\,dt = T^3/3, and at T=3T = 3 a quadrature also gives 9.

The covariance with WT=∫0TdWW_T = \int_0^T dW is ∫0T(T−t) dt=T2/2\int_0^T(T - t)\,dt = T^2/2. So the correlation is

T2/2T3/3⋅T=32,\frac{T^2/2}{\sqrt{T^3/3 \cdot T}} = \frac{\sqrt{3}}{2},

whatever TT is. A simulation with 2000 steps agrees.

Classic wrong answer. Giving the variance as T2/2T^2/2 or T3T^3. A units check helps: ITI_T has the units of WW times time, so its variance scales as T×T2T \times T^2.

Follow-up. How does the volatility of a price averaged over a period compare with that of the price itself? The average IT/TI_T/T has variance T/3T/3, so its volatility is the price’s divided by 3\sqrt{3}. A 20% volatility becomes 11.5%11.5\%, which is why Asian options are cheaper.

Why it matters. Integrated Brownian motion is one of the standard calculations, and the integration by parts is more insightful than the double integral.

Question 22.9 ★★ QR, QT, QD, Risk • bank, hedge fund • junior, experienced

State the reflection principle, and derive the distribution of MT=max⁡s≤TWsM_T = \max_{s \le T}W_s. What are P(M1≥1)P(M_1 \ge 1) and EM1\mathbb{E}M_1? How does your answer change if the barrier is only checked at daily closes, with 252 closes in the year?

Answer

Answer to Question 22.9.

P(MT≥a)=2P(WT≥a)P(M_T \ge a) = 2P(W_T \ge a), so MTM_T has the law of ∣WT∣|W_T|. P(M1≥1)=0.317P(M_1 \ge 1) = 0.317, and EM1=0.798\mathbb{E}M_1 = 0.798. Checking only at daily closes moves the barrier out by about 0.5826σΔ0.5826\sigma\sqrt{\Delta}.

Once WW first reaches aa, the rest of the path is symmetric about aa, so the end is as likely to lie above aa as below it. So P(MT≥a,WT<a)=P(MT≥a,WT>a)=P(WT>a)P(M_T \ge a, W_T < a) = P(M_T \ge a, W_T > a) = P(W_T > a). Adding gives the factor 2.

So P(MT≥a)=2(1−Φ(a/T))P(M_T \ge a) = 2(1 - \Phi(a/\sqrt{T})), which is the tail of ∣WT∣|W_T|. At a=T=1a = T = 1 it is 0.31730.3173. The mean is E∣W1∣=2/π\mathbb{E}|W_1| = \sqrt{2/\pi}.

A path can cross between two closes and return. So the discrete maximum is lower, and the hit probability is lower. The usual correction shifts the barrier by 0.58260.5826 standard deviations of one step, here 0.5826/252=0.0370.5826/\sqrt{252} = 0.037. It gives 2(1−Φ(1.037))=0.3002(1 - \Phi(1.037)) = 0.300. A simulation of daily closes with 100 000100\,000 paths gives this number, not 0.3170.317.

Classic wrong answer. Forgetting the factor 2, or using the continuous formula for a barrier checked once a day. On a one-year barrier, that is about two points of probability.

Follow-up. Why does the factor 2 not hold with drift? The reflected path is no longer equally likely. With drift, the formula gains a second term with a factor of e2μa/σ2e^{2\mu a/\sigma^2}.

Why it matters. This is the standard result for barrier options, and the correction for discrete monitoring is where the theory meets a real term sheet.

Question 22.10 ★★ QR, QT, QD, Risk • any • junior, experienced

TaT_a is the first time that WW reaches a>0a > 0. Show that TaT_a is finite with probability one, and find its median for a=1a = 1. What is P(T1>100)P(T_1 > 100)? Why is its mean infinite?

Answer

Answer to Question 22.10.

From the distribution P(Ta≤t)=2(1−Φ(a/t))P(T_a \le t) = 2(1 - \Phi(a/\sqrt{t})), the median for a=1a = 1 is 2.202.20, and P(T1>100)=0.080P(T_1 > 100) = 0.080. The mean is infinite because the tail is of order 1/t1/\sqrt{t}.

Ta≤tT_a \le t is the event Mt≥aM_t \ge a, so the reflection principle gives the formula. As t→∞t \to \infty it tends to 2(1−Φ(0))=12(1 - \Phi(0)) = 1, so the time is finite with probability one.

For the median, 2(1−Φ(1/t))=122(1 - \Phi(1/\sqrt{t})) = \frac12 gives 1/t=Φ−1(0.75)=0.67451/\sqrt{t} = \Phi^{-1}(0.75) = 0.6745, so t=2.198t = 2.198.

Also, P(T1>100)=1−2(1−Φ(0.1))=0.0797P(T_1 > 100) = 1 - 2(1 - \Phi(0.1)) = 0.0797.

For large tt, P(Ta>t)≈2ϕ(0)a/t=0.798a/tP(T_a > t) \approx 2\phi(0)a/\sqrt{t} = 0.798a/\sqrt{t}. The mean is the integral of this tail, which diverges. Equivalently, TaT_a has the law of a2/Z2a^2/Z^2. Samples of this form confirm both the median and the tail, and truncated means keep growing as the cutoff rises. A direct run of the path gives a hit by t=2.198t = 2.198 about half the time.

Classic wrong answer. Assuming that a certain event must have a finite mean waiting time. Here half the paths arrive by 2.22.2, while 8% are still out at 100.

Follow-up. How does the median change for a=10a = 10? By scaling, it is multiplied by a2a^2, so the median becomes about 220.

Why it matters. Certain arrival with infinite mean is the key surprise of the subject, and it reappears wherever someone assumes that a mean-zero bet will come back within a known time.

Question 22.11 ★★ QR, QT, QD, Risk • any • junior

WW starts at 0 and stops on first reaching −1-1 or 22. Using two martingales, find the probability that it ends at 2 and the expected stopping time. What is the general formula for −a-a and bb? What happens as a→∞a \to \infty?

Answer

Answer to Question 22.11.

The probability of ending at 2 is 13\frac13, and the expected time is 2. In general, these are a/(a+b)a/(a + b) and abab.

Let τ\tau be the stopping time. It has finite mean, and the stopped WW is bounded, so optional stopping applies.

With WW: EWτ=0\mathbb{E}W_\tau = 0. If qq is the probability of ending at bb, then qb−(1−q)a=0qb - (1 - q)a = 0, so q=a/(a+b)q = a/(a + b). With a=1a = 1, b=2b = 2, this is 13\frac13.

With W2−tW^2 - t: EWτ2=Eτ\mathbb{E}W_\tau^2 = \mathbb{E}\tau. So

Eτ=qb2+(1−q)a2=ab2+ba2a+b=ab=2.\mathbb{E}\tau = qb^2 + (1 - q)a^2 = \frac{ab^2 + ba^2}{a + b} = ab = 2.

A symmetric lattice walk has these same values exactly, and a run with 20 00020\,000 paths on a lattice of 0.10.1 gives 0.330.33 and 2.02.0.

As a→∞a \to \infty, q→1q \to 1 and Eτ=ab→∞\mathbb{E}\tau = ab \to \infty: reaching bb is certain and takes infinite expected time, which agrees with the one-sided hitting time.

Classic wrong answer. Using optional stopping with no check. On the one-sided problem it would give EWτ=0\mathbb{E}W_\tau = 0, while Wτ=bW_\tau = b. It is the bound on the stopped process that makes it valid here.

Follow-up. What are the answers for a symmetric interval ±a\pm a? 12\frac12 and a2a^2. So the typical time to move a distance aa is a2a^2, the same scale as the variance.

Why it matters. Two martingales and one line each. It is the canonical use of optional stopping, and interviewers listen for the check on when it applies.

Question 22.12 ★★ QR, QT, QD, Risk • hedge fund, bank • junior, experienced

Xt=μt+σWtX_t = \mu t + \sigma W_t with μ>0\mu > 0 and X0=0X_0 = 0. Find an exponential martingale, and use it to derive the probability that XX ever falls to −a-a. A strategy has an annual mean of 10% and a volatility of 20%, with no compounding. What is the probability that it ever loses 20% from the start?

Answer

Answer to Question 22.12.

e−2μXt/σ2e^{-2\mu X_t/\sigma^2} is a martingale, which gives P(ever at −a)=e−2μa/σ2P(\text{ever at } {-a}) = e^{-2\mu a/\sigma^2}. Here e−1=0.368e^{-1} = 0.368.

Try eθXte^{\theta X_t}. Its drift has the factor θμ+12θ2σ2\theta\mu + \frac12\theta^2\sigma^2, which vanishes at θ=−2μ/σ2\theta = -2\mu/\sigma^2.

Stop at τ\tau, the first time at −a-a, or at some high level bb. The martingale is bounded on the interval, so optional stopping gives

1=qe2μa/σ2+(1−q)e−2μb/σ2,1 = qe^{2\mu a/\sigma^2} + (1 - q)e^{-2\mu b/\sigma^2},

where qq is the chance of hitting −a-a first. As b→∞b \to \infty, the second term vanishes, so q=e−2μa/σ2q = e^{-2\mu a/\sigma^2}.

With μ=0.1\mu = 0.1, σ=0.2\sigma = 0.2 and a=0.2a = 0.2: 2×0.1×0.2/0.04=12 \times 0.1 \times 0.2/0.04 = 1, so the answer is e−1e^{-1}. A walk with matching mean and variance has the exact ruin formula, and it gives 0.3680.368 for small steps. A simulation in steps of 0.010.01 years agrees, after the correction for checking at discrete times.

Note the limits: μ→0\mu \to 0 gives 1, as the driftless path reaches every level, and a large μ\mu gives a small number. The key ratio is μa/σ2\mu a/\sigma^2, so doubling the volatility divides the exponent by four.

Classic wrong answer. Using a normal tail at one horizon, such as a one-year chance of −20%-20\%. That misses all the paths that dip and recover, and it is much smaller than the true figure.

Follow-up. What is the chance of ever losing 50%, with the same numbers? e−2.5=0.082e^{-2.5} = 0.082. The probability falls exponentially in the size of the loss.

Why it matters. This is a practical risk-of-ruin formula. It is derived in three lines with a martingale, and it is often needed in a discussion of sizing.

Question 22.13 ★★ QR, QT, QD, Risk • bank, hedge fund • junior, experienced

For dS=μS dt+σS dWdS = \mu S\,dt + \sigma S\,dW, apply Ito’s lemma to SpS^p. Find EST2\mathbb{E}S_T^2, and find the pp that makes SpS^p a martingale, given μ=10%\mu = 10\% and σ=20%\sigma = 20\%. Starting from 1, what is the probability of reaching 2 before 12\frac12?

Answer

Answer to Question 22.13.

EST2=S02e(2μ+σ2)T\mathbb{E}S_T^2 = S_0^2e^{(2\mu + \sigma^2)T}, the martingale power is p=1−2μ/σ2=−4p = 1 - 2\mu/\sigma^2 = -4, and the probability is 15/15.94=0.94115/15.94 = 0.941.

Ito’s lemma gives

d(Sp)=Sp((pμ+12p(p−1)σ2)dt+pσ dW).d(S^p) = S^p\left(\left(p\mu + \tfrac12p(p - 1)\sigma^2\right)dt + p\sigma\,dW\right).

So ESTp=S0pexp⁡((pμ+12p(p−1)σ2)T)\mathbb{E}S_T^p = S_0^p\exp((p\mu + \frac12p(p - 1)\sigma^2)T), and p=2p = 2 gives the second moment, e0.24=1.271e^{0.24} = 1.271 per unit of initial square at T=1T = 1.

The drift is zero when μ+12(p−1)σ2=0\mu + \frac12(p - 1)\sigma^2 = 0, or at p=0p = 0, which is trivial. So p=1−2μ/σ2=1−5=−4p = 1 - 2\mu/\sigma^2 = 1 - 5 = -4.

Stopping S−4S^{-4} at 22 or 12\frac12, where it is bounded: q2−4+(1−q)24=1q2^{-4} + (1 - q)2^4 = 1. So q=15/(16−116)=0.941q = 15/(16 - \frac{1}{16}) = 0.941.

A second route works with ln⁡S\ln S, with drift 0.080.08 and volatility 0.20.2, exiting at ±ln⁡2\pm\ln 2. The exponential martingale eθXe^{\theta X} with θ=−4\theta = -4 gives the same equation, which is no surprise, since S−4=e−4ln⁡SS^{-4} = e^{-4\ln S}. A simulation with fine steps returns 0.940.94.

Classic wrong answer. Saying that the probability is 12\frac12, since both levels are a factor of 2 away, or that it follows from μ\mu alone. The log drift of 0.080.08 against a volatility of 0.20.2 is what makes this so lopsided.

Follow-up. What is pp when μ=12σ2\mu = \frac12\sigma^2? p=0p = 0, and the martingale is then the log itself, since the log has no drift. The exit probability then is exactly 12\frac12.

Why it matters. Finding the power that removes the drift is the fastest way to solve exit problems for geometric processes.

Question 22.14 ★★ QR, QT, QD, Risk • bank, hedge fund • junior, experienced

Given W1=xW_1 = x, what are the conditional mean and variance of WsW_s, 0<s<10 < s < 1? Given W1=0W_1 = 0, what is the probability that WW reaches level 1 during the interval? Derive the formula by reflection, for any xx.

Answer

Answer to Question 22.14.

The mean is sxsx, and the variance s(1−s)s(1 - s). Given W1=0W_1 = 0, the probability of reaching 1 is e−2=0.135e^{-2} = 0.135. In general, for a≥max⁡(x,0)a \ge \max(x, 0), it is e−2a(a−x)e^{-2a(a - x)}.

(Ws,W1)(W_s, W_1) is jointly normal, with covariance ss and Var⁡W1=1\operatorname{Var}W_1 = 1. The regression gives the conditional mean sxsx and the variance s−s2s - s^2. So the bridge is pinned at both ends, with the largest uncertainty, 14\frac14, at the midpoint.

By reflection at aa, a path that ends at x<ax < a and has touched aa corresponds to a path that ends at 2a−x2a - x. So the density of paths with both properties is ϕ(2a−x)\phi(2a - x), and the conditional probability is the ratio of densities:

ϕ(2a−x)ϕ(x)=exp⁡(−(2a−x)2−x22)=e−2a(a−x).\frac{\phi(2a - x)}{\phi(x)} = \exp\left(-\frac{(2a - x)^2 - x^2}{2}\right) = e^{-2a(a - x)}.

With x=0x = 0 and a=1a = 1, this is e−2e^{-2}. Note the limit x→ax \to a, where the formula gives 1, as it must. A simulated bridge with 2000 steps gives 0.1350.135 after the correction for discrete checking.

Classic wrong answer. Using 2(1−Φ(1))2(1 - \Phi(1)) from the unconditional maximum. That averages over all endpoints. Pinning the end at 0 reduces the chance by more than half.

Follow-up. A price moves from 100 to 101 in a day with a daily volatility of 1. What is the chance that it touched 102 between the two closes? Here a=2a = 2 and x=1x = 1, giving e−4=0.018e^{-4} = 0.018. This is how barrier monitoring is corrected between observation dates.

Why it matters. This formula is in every barrier pricer and in path-dependent simulation. The derivation by reflection is short enough for an interview.

Question 22.15 ★★ QR, QT, QD, Risk • any • junior, experienced

Solve the Ornstein–Uhlenbeck equation dX=−κX dt+σ dWdX = -\kappa X\,dt + \sigma\,dW. Give the mean and variance at tt, the stationary variance and the half-life of a shock. Evaluate these at κ=2\kappa = 2, σ=1\sigma = 1, t=1t = 1, X0=3X_0 = 3.

Answer

Answer to Question 22.15.

Xt=X0e−κt+σ∫0te−κ(t−s) dWsX_t = X_0e^{-\kappa t} + \sigma\int_0^te^{-\kappa(t - s)}\,dW_s. The mean is 0.4060.406, the variance 0.2450.245, the stationary variance 14\frac14, and the half-life 0.3470.347.

Multiply by the integrating factor: d(eκtX)=eκtσ dWd(e^{\kappa t}X) = e^{\kappa t}\sigma\,dW. Integrating gives the solution.

The mean is X0e−κtX_0e^{-\kappa t}, here 3e−2=0.4063e^{-2} = 0.406. By the isometry, the variance is

σ2∫0te−2κ(t−s) ds=σ22κ(1−e−2κt),\sigma^2\int_0^te^{-2\kappa(t - s)}\,ds = \frac{\sigma^2}{2\kappa}\left(1 - e^{-2\kappa t}\right),

which is 14(1−e−4)=0.245\frac14(1 - e^{-4}) = 0.245 at these values. As tt grows, this tends to the stationary value σ2/(2κ)=14\sigma^2/(2\kappa) = \frac14. The half-life solves e−κt=12e^{-\kappa t} = \frac12, so t=ln⁡2/κt = \ln 2/\kappa.

Limits: for small tt, the variance is close to σ2t\sigma^2t, as for plain Brownian motion. As κ→0\kappa \to 0, the same is true for all tt. Both an exact AR(1) sampling and an Euler run give 0.4060.406 and 0.2450.245.

Classic wrong answer. Forgetting that the mean-reversion also reduces the noise’s contribution, and giving the variance as σ2t\sigma^2t. It is bounded, which is the point of the model.

Follow-up. A daily series has AR(1) coefficient 0.980.98. What are κ\kappa and the half-life? κ=−ln⁡0.98=0.0202\kappa = -\ln 0.98 = 0.0202 per day, and the half-life is 34.334.3 days. This is the standard calculation for a mean-reverting spread.

Why it matters. This is the second-most used stochastic process in finance, the base of many pairs and rates models.

Question 22.16 ★★ QR, QT, QD, Risk • bank, hedge fund • junior

W1W^1 and W2W^2 have correlation ρ\rho. Write one in terms of the other and an independent motion. Use Ito’s lemma to find EWt1Wt2\mathbb{E}W^1_tW^2_t. At ρ=0.5\rho = 0.5 and t=1t = 1, find Var⁡(Wt1+Wt2)\operatorname{Var}(W^1_t + W^2_t) and E[(Wt1)2(Wt2)2]\mathbb{E}[(W^1_t)^2(W^2_t)^2].

Answer

Answer to Question 22.16.

W2=ρW1+1−ρ2 W⊥W^2 = \rho W^1 + \sqrt{1 - \rho^2}\,W^\perp, EWt1Wt2=ρt\mathbb{E}W^1_tW^2_t = \rho t, and the two values are 3 and 1.51.5.

The construction has unit variance, and the correlation with W1W^1 is ρ\rho.

Ito’s lemma gives d(W1W2)=W1 dW2+W2 dW1+ρ dtd(W^1W^2) = W^1\,dW^2 + W^2\,dW^1 + \rho\,dt, since dW1dW2=ρ dtdW^1dW^2 = \rho\,dt. The stochastic integrals have mean zero, so the mean of the product is ρt\rho t.

Then Var⁡(W1+W2)=t+t+2ρt=3\operatorname{Var}(W^1 + W^2) = t + t + 2\rho t = 3.

For the last one, E[X2Y2]=σX2σY2+2Cov⁡(X,Y)2\mathbb{E}[X^2Y^2] = \sigma_X^2\sigma_Y^2 + 2\operatorname{Cov}(X, Y)^2 for jointly normal variables with mean zero, by Isserlis’ theorem. That gives t2(1+2ρ2)=1.5t^2(1 + 2\rho^2) = 1.5. Direct substitution checks this: writing W2=12W1+34VW^2 = \frac12W^1 + \sqrt{\frac34}V with VV independent gives 14×3+34×1=1.5\frac14 \times 3 + \frac34 \times 1 = 1.5. A simulation confirms this. At ρ=0\rho = 0, the result is 1, the product of the variances, and at ρ=1\rho = 1 it is 3, the fourth moment.

Classic wrong answer. Multiplying the variances to get 1, which ignores the correlation of squares. Or writing W2=ρW1+(1−ρ)W⊥W^2 = \rho W^1 + (1 - \rho)W^\perp, which does not have unit variance.

Follow-up. What is the variance of the sum at ρ=−12\rho = -\frac12? 2t(1+ρ)=12t(1 + \rho) = 1 at t=1t = 1. That is the basic diversification formula.

Why it matters. Every multi-asset simulation is built this way. The Ito cross-term is where people go wrong.

Question 22.17 ★★ QR, QT, QD • bank, hedge fund • junior, experienced

Show directly, by completing the square, that E[f(WT+μT)]=E[f(WT)eμWT−μ2T/2]\mathbb{E}[f(W_T + \mu T)] = \mathbb{E}[f(W_T)e^{\mu W_T - \mu^2T/2}]. Use the identity to estimate P(W1>4)P(W_1 > 4) by simulation, with a tilted drift. By how much does this reduce the standard error, for one million paths?

Answer

Answer to Question 22.17.

The identity follows from the shift of the density. The tilted estimator reduces the relative standard error from 18% to about 0.2%0.2\%, a factor of more than 60.

With Z=WTZ = W_T and density ϕT\phi_T,

E[f(WT+μT)]=∫f(x+μT)ϕT(x) dx=∫f(y)ϕT(y−μT) dy,\mathbb{E}[f(W_T + \mu T)] = \int f(x + \mu T)\phi_T(x)\,dx = \int f(y)\phi_T(y - \mu T)\,dy,

and completing the square gives ϕT(y−μT)=ϕT(y)eμy−μ2T/2\phi_T(y - \mu T) = \phi_T(y)e^{\mu y - \mu^2T/2}. So the drift can be moved into a weight. That is Girsanov’s theorem for a single time, and it extends to paths.

As a check, with μ=T=1\mu = T = 1 and f=1(x>0)f = \mathbf{1}(x > 0), both forms give Φ(1)=0.8413\Phi(1) = 0.8413.

For P(W1>4)=3.17×10−5P(W_1 > 4) = 3.17 \times 10^{-5}, a plain simulation with 10610^6 paths gets about 32 hits, and so has a relative error of 18%18\%.

Reverse the identity: simulate Y=Z+4Y = Z + 4 and average 1(Y>4)e−4Y+8\mathbf{1}(Y > 4)e^{-4Y + 8}. Now half the paths land in the event, and each carries a small weight. On a run, this reduces the relative error to about 0.2%0.2\%, matching an integral for the second moment. Plain sampling would need several thousand times as many paths for the same accuracy.

Too large a shift hurts again, because the weights become erratic. For a tail event, the good choice puts the mean at the boundary of the event.

Classic wrong answer. Dropping the weight, or using e4Y−8e^{4Y - 8}, the wrong direction. A check that the mean weight is 1 finds this at once.

Follow-up. Why is that weight a martingale in time? It is the exponential martingale eμWt−μ2t/2e^{\mu W_t - \mu^2t/2}, with mean 1, and this is what makes the new measure a probability measure.

Why it matters. Change of measure is often stated abstractly. This version shows what it does in one line, and gives a practical reason to care.

Question 22.18 ★★ QR, QT, QD, Risk • bank, hedge fund • junior

A stock has μ=10%\mu = 10\%, σ=20%\sigma = 20\%, S0=100S_0 = 100, and the rate is zero. A one-year digital pays 1 if S1>100S_1 > 100. What are the real-world probability, the risk-neutral probability and the price? What is the market price of risk, and how does it relate the two measures? Does the price depend on μ\mu?

Answer

Answer to Question 22.18.

Real-world 0.6550.655, risk-neutral 0.4600.460, price 0.4600.460. The market price of risk is 12\frac12. The price does not depend on μ\mu.

ln⁡S1−ln⁡100\ln S_1 - \ln 100 is normal with standard deviation 0.20.2. Its mean is μ−12σ2=0.08\mu - \frac12\sigma^2 = 0.08 in the real world, so P(S1>100)=Φ(0.08/0.2)=Φ(0.4)P(S_1 > 100) = \Phi(0.08/0.2) = \Phi(0.4).

Under the risk-neutral measure, the drift is the rate, here zero, so the log mean is −0.02-0.02, and the probability is Φ(−0.1)=0.460\Phi(-0.1) = 0.460. With a zero rate, the price is this probability, by the replication argument for a digital.

The market price of risk is λ=(μ−r)/σ=0.5\lambda = (\mu - r)/\sigma = 0.5. The two measures are related by dQ/dP=e−λW1−λ2/2dQ/dP = e^{-\lambda W_1 - \lambda^2/2}, which removes the drift λσ\lambda\sigma from the return. Reweighting real-world paths with this factor gives 0.4600.460 in a simulation, and the weight has mean 1.

Anyone holding the digital at 0.460.46 has a positive expected profit, of 0.655−0.460.655 - 0.46. This is not free: the digital pays in states where the stock is up, so it carries stock risk, for which the holder expects compensation.

Classic wrong answer. Pricing with the real-world probability, or thinking that μ\mu affects the price because it affects the chance of the payoff. Hedging removes it from the price, though it does not remove it from the holder’s expected profit.

Follow-up. What are the probabilities if μ=2%\mu = 2\%? The real-world chance is now Φ(0)=12\Phi(0) = \frac12, and the price is still 0.4600.460. The gap has shrunk to 0.040.04, because the expected profit comes only from the drift.

Why it matters. Confusion between probabilities and prices is the most common error in this area, and the digital isolates it.

Question 22.19 ★★ QR, QT, QD • bank, hedge fund • junior, experienced

State the Feynman–Kac formula for ut+μux+12σ2uxx−ru=0u_t + \mu u_x + \frac12\sigma^2u_{xx} - ru = 0, with terminal condition u(T,x)=g(x)u(T, x) = g(x). Solve the equation with μ=r=0\mu = r = 0, σ=1\sigma = 1, first for g=x2g = x^2, then for g=exg = e^x. Check each by substituting into the equation. How does a rate rr change them?

Answer

Answer to Question 22.19.

u(t,x)=e−r(T−t)E[g(XT)∣Xt=x]u(t, x) = e^{-r(T - t)}\mathbb{E}[g(X_T) \mid X_t = x], where dX=μ dt+σ dWdX = \mu\,dt + \sigma\,dW. The two solutions are x2+T−tx^2 + T - t and ex+(T−t)/2e^{x + (T - t)/2}.

Let Ms=e−rsu(s,Xs)M_s = e^{-rs}u(s, X_s). Ito’s lemma gives drift e−rs(ut+μux+12σ2uxx−ru)e^{-rs}(u_t + \mu u_x + \frac12\sigma^2u_{xx} - ru), which is 0 by the equation. So MM is a martingale, and Mt=E[MT∣Xt]M_t = \mathbb{E}[M_T \mid X_t], which is the formula.

With μ=r=0\mu = r = 0, σ=1\sigma = 1: given Wt=xW_t = x, WTW_T is normal, with mean xx and variance T−tT - t.

For g=x2g = x^2: u=x2+(T−t)u = x^2 + (T - t). Check: ut=−1u_t = -1 and 12uxx=1\frac12u_{xx} = 1, which sum to 0.

For g=exg = e^x: u=ex+(T−t)/2u = e^{x + (T - t)/2}. Check: ut=−12uu_t = -\frac12u and 12uxx=12u\frac12u_{xx} = \frac12u, which also sum to 0.

Finite differences and sampling agree with both at the points tried. A rate rr multiplies each by e−r(T−t)e^{-r(T - t)}, and this can be checked by substitution. The terminal value is g(x)g(x), as required.

Classic wrong answer. Getting the sign of utu_t wrong. This is a backward equation, solved from the terminal time. So time to go, T−tT - t, appears, and not tt.

Follow-up. How do you get the Black–Scholes equation from this? Use dS=rS dt+σS dWdS = rS\,dt + \sigma S\,dW under the risk-neutral measure. Then the formula says that the price solves ut+rSuS+12σ2S2uSS−ru=0u_t + rSu_S + \frac12\sigma^2S^2u_{SS} - ru = 0, which is that equation.

Why it matters. This is the link between expectations and differential equations, which lets you choose the easier of the two.

Question 22.20 ★★ QR, QT, QD, Risk • hedge fund • junior, experienced

Let Xt=eWt−t/2X_t = e^{W_t - t/2}. What equation does it solve? What are EXT\mathbb{E}X_T, the median and P(XT<1)P(X_T < 1) at T=1T = 1 and T=100T = 100? What is the long-run behaviour of a single path? How do you reconcile this with the mean?

Answer

Answer to Question 22.20.

dX=X dWdX = X\,dW. The mean is always 1, the median is e−T/2e^{-T/2}, and P(XT<1)=Φ(T/2)P(X_T < 1) = \Phi(\sqrt{T}/2), which is 0.690.69 at T=1T = 1 and 0.99999970.9999997 at T=100T = 100. Almost every path goes to 0.

XX is the exponential martingale, with dX=X dWdX = X\,dW by Ito’s lemma. So the mean stays at 1.

ln⁡XT=WT−T/2\ln X_T = W_T - T/2 is normal with mean −T/2-T/2 and variance TT. So the median is e−T/2e^{-T/2}: 0.6070.607 at T=1T = 1 and about 2×10−222 \times 10^{-22} at T=100T = 100. Also, XT<1X_T < 1 needs WT<T/2W_T < T/2, whose chance is Φ(T/2)\Phi(\sqrt{T}/2).

Since Wt/t→0W_t/t \to 0, ln⁡Xt≈−t/2→−∞\ln X_t \approx -t/2 \to -\infty, so each path goes to 0 with probability one.

The reconciliation is that the mean is carried by ever rarer paths with enormous values. The variance is eT−1e^T - 1, which is huge. At T=100T = 100, no feasible simulation can show a mean of 1. A million paths usually give far less, with the rest in a tail too thin to sample. Note that optional stopping does not apply at T=∞T = \infty: the limit is 0, while the mean is 1, so the martingale is not uniformly integrable.

In investment terms, this is a fair bet at full size, with a positive chance of huge gains and almost sure ruin in the long run. That is the reason for caring about growth rates and not only expected values.

Classic wrong answer. Saying that the mean is a good guide to typical wealth. It is the extreme example of a mean that describes no path anyone is likely to see.

Follow-up. What are the second moments at T=1T = 1 and T=100T = 100? e1=2.72e^1 = 2.72 and e100=2.7×1043e^{100} = 2.7 \times 10^{43}. So the sample mean is useless long before T=100T = 100.

Why it matters. This separates ensemble averages from time averages, which is the heart of the discussion of sizing and of the Kelly criterion.

Question 22.21 ★★★ QR, QT, QD • bank, hedge fund • experienced

What are the conditional mean and variance of ∫0TWt dt\int_0^TW_t\,dt given WTW_T? Evaluate them for T=1T = 1. What share of the variance of the integral is explained by the endpoint?

Answer

Answer to Question 22.21.

The conditional mean is TWT/2TW_T/2, and the conditional variance is T3/12T^3/12. At T=1T = 1, these are W1/2W_1/2 and 112\frac{1}{12}, and the endpoint explains 34\frac34 of the variance.

ITI_T and WTW_T are jointly normal with mean zero, with Var⁡IT=T3/3\operatorname{Var}I_T = T^3/3, Var⁡WT=T\operatorname{Var}W_T = T and Cov⁡=T2/2\operatorname{Cov} = T^2/2. These follow from IT=∫0T(T−t) dWtI_T = \int_0^T(T - t)\,dW_t.

So normal regression applies. The slope is Cov⁡/Var⁡WT=T/2\operatorname{Cov}/\operatorname{Var}W_T = T/2, which gives the mean TWT/2TW_T/2. That makes sense: given the endpoint, the bridge is on average a straight line from 0 to WTW_T, whose integral is the area of a triangle.

The remaining variance is

T33−(T2/2)2T=T33−T34=T312.\frac{T^3}{3} - \frac{(T^2/2)^2}{T} = \frac{T^3}{3} - \frac{T^3}{4} = \frac{T^3}{12}.

A second route: it should equal the variance of the integral of a Brownian bridge on [0,T][0, T]. For T=1T = 1, ∫01∫01(min⁡(s,t)−st) ds dt=13−14=112\int_0^1\int_0^1(\min(s, t) - st)\,ds\,dt = \frac13 - \frac14 = \frac{1}{12}, the same.

The share explained is (13−112)/13=34(\frac13 - \frac{1}{12})/\frac13 = \frac34, which is 0.86620.866^2, the squared correlation between the two. A simulation with 40 00040\,000 paths recovers the slope, the residual variance and the share.

Classic wrong answer. Thinking that the integral is independent of the endpoint because the increments are independent. They are not independent: both are sums of the same increments.

Follow-up. Does this give a control variate for an Asian option? Yes. Since the endpoint explains three quarters of the variance, a simulated average can be regressed on WTW_T, and that alone cuts the variance by that amount. A geometric average does better still.

Why it matters. Conditioning on a normal variable is a one-line tool, and the same tool appears in Brownian bridge constructions and in variance reduction.

Question 22.22 ★★★ QR, QT • hedge fund • junior, experienced

Let AA be the fraction of [0,1][0, 1] that WW spends above 0. State the distribution of AA. Give the mean, the variance and P(A≤0.1)P(A \le 0.1). A trader’s cumulative profit behaves like WW. What does this say about how often a skill-free trader is ahead for at least 90% of the year?

Answer

Answer to Question 22.22.

AA has the arcsine law, with density 1/(πx(1−x))1/(\pi\sqrt{x(1 - x)}): mean 12\frac12, variance 18\frac18, and P(A≤0.1)=2πarcsin⁡0.1=0.205P(A \le 0.1) = \frac{2}{\pi}\arcsin\sqrt{0.1} = 0.205. So a skill-free trader is ahead for 90% of the year about 20% of the time.

The density is highest near 0 and 1, and lowest at 12\frac12. The mean follows by symmetry. The variance comes from EA2=38\mathbb{E}A^2 = \frac38, a double integral of the orthant probability.

The distribution function is F(x)=2πarcsin⁡xF(x) = \frac{2}{\pi}\arcsin\sqrt{x}, so P(A≤0.1)=0.205P(A \le 0.1) = 0.205. By symmetry, P(A≥0.9)P(A \ge 0.9) is the same. So with 41%41\% chance, the path spends more than 90% of the time on one side. Compare a fraction between 0.450.45 and 0.550.55, which has a chance of only 6.4%6.4\%. The most balanced outcome is the least likely.

A simulated walk with 2000 steps gives a mean of 0.500.50, a variance of 0.1250.125 and a tail near 0.2050.205, which is a check independent of the formula. Note the conclusion. A profit curve above water for 90% of the year says little about skill, as about one trader in five with no skill at all will have one.

A trader’s edge, in contrast, moves the fraction reliably toward 1, but this measure is a weak test of it. A tt-statistic on the mean uses the same data better.

Classic wrong answer. Assuming that a zero-mean path should spend about half its time above 0. The opposite is true: long stays on one side are normal, since excursions are long.

Follow-up. What is the standard deviation of AA? 1/8=0.354\sqrt{1/8} = 0.354. That is above the uniform distribution’s 0.2890.289, and a good way toward the 0.50.5 of an equal mix of 0 and 1.

Why it matters. It is the strongest intuition-breaking result about random walks, with a direct reading for performance evaluation.

Question 22.23 ★★★ QR, QT • hedge fund • junior, experienced

Let MTM_T be the running maximum of WW. From the reflection principle, find P(MT≥a,WT≤x)P(M_T \ge a, W_T \le x) for x≤ax \le a. Show that MT−WTM_T - W_T has the same law as ∣WT∣|W_T|. A driftless strategy has a volatility of 20% with no compounding. What is the expected distance below its high after a year, and what is the chance that this exceeds 20%?

Answer

Answer to Question 22.23.

P(MT≥a,WT≤x)=P(WT≥2a−x)P(M_T \ge a, W_T \le x) = P(W_T \ge 2a - x). The gap MT−WTM_T - W_T has the law of ∣WT∣|W_T|. The expected gap is 16%, and the chance that it exceeds 20% is 0.3170.317.

For x≤ax \le a, reflect each path after it first reaches aa. A path with MT≥aM_T \ge a and an end at or below xx corresponds one-to-one to a path ending at or above 2a−x2a - x, which must have passed aa on the way. So the two events have equal probability.

Differentiating with respect to aa and xx gives the joint density of (MT,WT)(M_T, W_T). From it, the density of MT−WTM_T - W_T can be computed directly, and it is that of ∣WT∣|W_T|.

A cleaner argument uses time reversal. Define W^s=WT−s−WT\hat{W}_s = W_{T - s} - W_T, which is also a Brownian motion. Then MT−WT=max⁡s(Ws−WT)=max⁡sW^T−s=max⁡sW^sM_T - W_T = \max_s(W_s - W_T) = \max_s\hat{W}_{T - s} = \max_s\hat{W}_s, whose law is that of the maximum, and so of ∣WT∣|W_T| by reflection. Hence

E(MT−WT)=2T/π,P(MT−WT≥c)=2(1−Φ(c/T)).\mathbb{E}(M_T - W_T) = \sqrt{2T/\pi}, \qquad P(M_T - W_T \ge c) = 2(1 - \Phi(c/\sqrt{T})).

With volatility σ\sigma: multiply by σ\sigma. So 0.798×0.2=16%0.798 \times 0.2 = 16\%, and P(gap>20%)=2(1−Φ(1))=0.317P(\text{gap} > 20\%) = 2(1 - \Phi(1)) = 0.317. A simulation with 40 00040\,000 paths agrees after correcting for discrete checking. Since EWT=0\mathbb{E}W_T = 0, the same number is also EMT\mathbb{E}M_T.

Classic wrong answer. Treating a 16% distance from the high as a signal of something wrong. In a driftless process with a 20% volatility, it is what the average year looks like.

Follow-up. What is the expected gap after two years? It grows with the root of time: 16%×2=22.6%16\% \times \sqrt{2} = 22.6\%. Note that this is the current gap at the end. The maximum drawdown during the period is larger.

Why it matters. Time reversal is a beautiful trick, and it gives a benchmark for drawdowns that investors often misjudge.

Question 22.24 ★★★ QR, QT, QD, Risk • hedge fund, bank • experienced

Xt=μt+σWtX_t = \mu t + \sigma W_t with μ>0\mu > 0, and τ\tau is the first time that XX reaches a>0a > 0. Use martingales to derive Eτ\mathbb{E}\tau and Var⁡τ\operatorname{Var}\tau. Evaluate them at a=1a = 1, μ=0.1\mu = 0.1 and σ=0.2\sigma = 0.2. What is P(τ>20)P(\tau > 20), and what distribution is this?

Answer

Answer to Question 22.24.

Eτ=a/μ=10\mathbb{E}\tau = a/\mu = 10, and Var⁡τ=aσ2/μ3=40\operatorname{Var}\tau = a\sigma^2/\mu^3 = 40. τ\tau has the inverse Gaussian law, with P(τ>20)=0.073P(\tau > 20) = 0.073.

τ\tau has finite mean under μ>0\mu > 0. For the mean, Xt−μtX_t - \mu t is a martingale. Optional stopping gives a−μEτ=0a - \mu\mathbb{E}\tau = 0.

For the variance, (Xt−μt)2−σ2t(X_t - \mu t)^2 - \sigma^2t is a martingale. At τ\tau, Xτ=aX_\tau = a, so

E(a−μτ)2=σ2Eτ.\mathbb{E}(a - \mu\tau)^2 = \sigma^2\mathbb{E}\tau.

The left side is μ2Var⁡τ\mu^2\operatorname{Var}\tau, since Eμτ=a\mathbb{E}\mu\tau = a. So Var⁡τ=σ2(a/μ)/μ2=aσ2/μ3\operatorname{Var}\tau = \sigma^2(a/\mu)/\mu^2 = a\sigma^2/\mu^3.

At the stated values: Eτ=1/0.1=10\mathbb{E}\tau = 1/0.1 = 10, and Var⁡τ=0.04/0.001=40\operatorname{Var}\tau = 0.04/0.001 = 40, with a standard deviation of 6.36.3.

This is the inverse Gaussian, with mean a/μa/\mu and shape a2/σ2=25a^2/\sigma^2 = 25. Its tail has the closed form

P(τ≤t)=Φ(μt−aσt)+e2μa/σ2Φ(−μt−aσt),P(\tau \le t) = \Phi\left(\frac{\mu t - a}{\sigma\sqrt{t}}\right) + e^{2\mu a/\sigma^2}\Phi\left(\frac{-\mu t - a}{\sigma\sqrt{t}}\right),

which gives 0.0730.073 for P(τ>20)P(\tau > 20). Sampling the law and a direct Euler run of the process agree with the mean and variance.

Limits: as μ→0\mu \to 0, both blow up, and the variance faster, as they must, since the driftless case has an infinite mean. At μ=0.01\mu = 0.01, the variance is already 40 00040\,000.

Classic wrong answer. Giving the deterministic time a/μa/\mu with no spread, or a variance of σ2/μ2\sigma^2/\mu^2, which has the wrong scaling in aa and μ\mu. Dimensions catch that one.

Follow-up. If the target is 10 times as far, what happens to the relative spread? The mean and the variance each grow by 10, so the coefficient of variation falls by 10\sqrt{10}. Long-horizon targets are more predictable, proportionally.

Why it matters. Time-to-target is common in execution and in strategy evaluation. The martingale derivation is faster than the density.

Question 22.25 ★★★ QR, QT • hedge fund • experienced

Use an exponential martingale and optional stopping to show that Ee−λTa=e−a2λ\mathbb{E}e^{-\lambda T_a} = e^{-a\sqrt{2\lambda}}, where TaT_a is the first time WW reaches a>0a > 0. Why must you choose the positive root? What do you learn by letting λ→0\lambda \to 0, and from the derivative there? Evaluate at a=1a = 1 and λ=12\lambda = \frac12.

Answer

Answer to Question 22.25.

With λ=θ2/2\lambda = \theta^2/2, the martingale eθWt−θ2t/2e^{\theta W_t - \theta^2t/2} gives the result. The limit λ→0\lambda \to 0 shows that TaT_a is finite, and the infinite derivative shows that its mean is infinite. At a=1a = 1, λ=12\lambda = \frac12, the value is e−1=0.368e^{-1} = 0.368.

For θ>0\theta > 0, Mt=eθWt−θ2t/2M_t = e^{\theta W_t - \theta^2t/2} is a martingale. Stopped at TaT_a, it is bounded by eθae^{\theta a}, as W≤aW \le a before TaT_a and the time term only reduces it. On the event Ta=∞T_a = \infty, Mt→0M_t \to 0, as WtW_t stays below aa while tt grows. So bounded optional stopping gives

1=E[eθae−θ2Ta/21(Ta<∞)].1 = \mathbb{E}\left[e^{\theta a}e^{-\theta^2T_a/2}\mathbf{1}(T_a < \infty)\right].

Putting λ=θ2/2\lambda = \theta^2/2, we have E[e−λTa1(Ta<∞)]=e−a2λ\mathbb{E}[e^{-\lambda T_a}\mathbf{1}(T_a < \infty)] = e^{-a\sqrt{2\lambda}}.

The positive root matters. With θ<0\theta < 0, MM is unbounded as W→−∞W \to -\infty before TaT_a, so optional stopping fails. The other root would give a transform above 1, which is impossible.

Let λ→0\lambda \to 0: P(Ta<∞)=1P(T_a < \infty) = 1. The derivative of e−a2λe^{-a\sqrt{2\lambda}} at 0 is −∞-\infty, because of the square root, and so ETa=∞\mathbb{E}T_a = \infty.

At a=1a = 1, λ=12\lambda = \frac12: e−1e^{-1}. Sampling from T1=1/Z2T_1 = 1/Z^2 gives 0.3680.368.

Classic wrong answer. Applying optional stopping with no check on boundedness. The same step would show that EWTa=0\mathbb{E}W_{T_a} = 0, which is false, since WTa=aW_{T_a} = a.

Follow-up. What changes with drift μ>0\mu > 0? The same argument with a shifted exponent gives Ee−λτ=ea(μ−μ2+2λ)\mathbb{E}e^{-\lambda\tau} = e^{a(\mu - \sqrt{\mu^2 + 2\lambda})}, with σ=1\sigma = 1. Now the derivative at 0 is finite, −a/μ-a/\mu. At μ=12\mu = \frac12, a=1a = 1, λ=12\lambda = \frac12, this gives e0.5−1.118e^{0.5 - 1.118}, as sampling confirms.

Why it matters. It is a compact use of the stopping theorem, and the choice of the root shows whether its conditions are understood.

Question 22.26 ★★★ QR, QT, QD, Risk • hedge fund, bank • experienced

An asset follows geometric Brownian motion with volatility 20%. Starting from 1, find the expected time to reach 2 if μ=10%\mu = 10\%. If μ=1%\mu = 1\%, what is the probability that it ever reaches 2? What happens at μ=2%\mu = 2\%? Check the second result with a martingale of the form SpS^p.

Answer

Answer to Question 22.26.

At μ=10%\mu = 10\%, the expected time is ln⁡2/0.08=8.66\ln 2/0.08 = 8.66 years. At μ=1%\mu = 1\%, the probability is 2−1/2=0.7072^{-1/2} = 0.707. At μ=2%\mu = 2\%, it reaches 2 with certainty, but the expected time is infinite.

X=ln⁡SX = \ln S has drift ν=μ−12σ2\nu = \mu - \frac12\sigma^2 and volatility σ\sigma, and the target is a=ln⁡2a = \ln 2.

μ=10%\mu = 10\%: ν=8%\nu = 8\%. The mean of a positive-drift hitting time is a/ν=0.693/0.08=8.66a/\nu = 0.693/0.08 = 8.66.

μ=1%\mu = 1\%: ν=−1%\nu = -1\%, so the log drifts away. The chance of ever reaching a level aa above is e2νa/σ2=e−0.5ln⁡2=2−1/2e^{2\nu a/\sigma^2} = e^{-0.5\ln 2} = 2^{-1/2}. Note that the expected value of SS still grows.

Check with a martingale: p=1−2μ/σ2=12p = 1 - 2\mu/\sigma^2 = \frac12, so S\sqrt{S} is a martingale. It is bounded by 2\sqrt{2} up to the hitting time, and if 2 is never reached, S→0S \to 0 since ν<0\nu < 0, and the martingale tends to 0. So 1=q21 = q\sqrt{2}, which gives q=1/2q = 1/\sqrt{2}. The answers agree, with no reference to the first formula.

μ=2%\mu = 2\%: ν=0\nu = 0. The log is driftless, so it hits with certainty and has an infinite mean, as a one-sided hit for a driftless Brownian motion does.

A simulated 400-year run at μ=1%\mu = 1\% reaches 2 in about 68%68\% of paths after a correction for discrete checks. That matches the first-passage formula at that horizon, 0.6830.683, and the limit is 0.7070.707.

Classic wrong answer. Saying that any positive μ\mu means the asset surely doubles. The sign that matters is that of the log drift. With 0<μ<σ2/20 < \mu < \sigma^2/2, the expected value rises while the typical path falls.

Follow-up. At which μ\mu does the expected time become finite? For any μ>σ2/2=2%\mu > \sigma^2/2 = 2\%, and it blows up at that value. The expected time at μ=2.1%\mu = 2.1\% would be about 693 years.

Why it matters. It tests the difference between arithmetic and geometric drift, and the check by a power martingale is a good habit.

Question 22.27 ★★★ QR, QT, QD • hedge fund, bank • experienced

Ito’s lemma does not apply to ∣x∣|x|, which has a kink at 0. Using Tanaka’s formula, write ∣Wt∣|W_t| as a stochastic integral plus a local time LtL_t. Find EL1\mathbb{E}L_1. What does LL measure, and how could you estimate it from a simulated path? What other process has the same law as LtL_t?

Answer

Answer to Question 22.27.

∣Wt∣=∫0tsign⁡(Ws) dWs+Lt|W_t| = \int_0^t\operatorname{sign}(W_s)\,dW_s + L_t, with EL1=2/π=0.798\mathbb{E}L_1 = \sqrt{2/\pi} = 0.798. LL measures time spent at 0, per unit of space, and it has the law of the running maximum.

A smooth approximation of ∣x∣|x| has a second derivative that is concentrated around 0, with total mass 2. So the Ito term 12f′′(W) dt\frac12f^{\prime\prime}(W)\,dt does not vanish, and it accumulates only when WW is at 0. Its limit is LtL_t, defined by

Lt=lim⁡ε→012ε∫0t1(∣Ws∣<ε) ds.L_t = \lim_{\varepsilon \to 0}\frac{1}{2\varepsilon}\int_0^t\mathbf{1}(|W_s| < \varepsilon)\,ds.

This is the local time at 0: a rate of time spent near 0 per unit width.

The stochastic integral has mean zero, so EL1=E∣W1∣=2/π\mathbb{E}L_1 = \mathbb{E}|W_1| = \sqrt{2/\pi}.

There are two estimators from a path. One is the occupation formula, with a small ε\varepsilon. The other is ∣W1∣−∑sign⁡(Wi)ΔWi|W_1| - \sum\operatorname{sign}(W_{i})\Delta W_i, which rearranges Tanaka’s formula. In a run, each has a mean near 0.7980.798, and the two estimators are strongly correlated across paths, above 0.90.9. So they are measuring the same thing.

By Tanaka, ∫sign⁡(W) dW\int\operatorname{sign}(W)\,dW is itself a Brownian motion BB, by Lévy’s characterisation, as its quadratic variation is tt. Writing ∣Wt∣=Bt+Lt|W_t| = B_t + L_t and noting that LL grows only when ∣W∣=0|W| = 0, Skorokhod’s lemma gives Lt=max⁡s≤t(−Bs)L_t = \max_{s \le t}(-B_s). So LtL_t has the law of the maximum of a Brownian motion, and so of ∣Wt∣|W_t|. The quantiles from the run match.

Classic wrong answer. Applying Ito’s lemma to ∣x∣|x| with f′′=0f^{\prime\prime} = 0, which gives ∣Wt∣=∫sign⁡(W) dW|W_t| = \int\operatorname{sign}(W)\,dW. Its mean would be zero, which is impossible for a positive variable.

Follow-up. Where does this appear in hedging? A stop-loss strategy holds a share only when the price is above the strike. Its failure to replicate a call is exactly the local time at the strike: a cost that does not go away with more frequent trading.

Why it matters. This is one of the few places where the second-derivative term of Ito’s lemma is visible on its own. It tests experienced candidates, and the hedging link is a real one.

Question 22.28 ★★★ QR, QT • hedge fund • experienced

Find the mean and variance of Q=∫01Wt2 dtQ = \int_0^1W_t^2\,dt by double integrals. Then check both using the expansion Wt=∑k2 Zksin⁡((k−12)πt)/((k−12)π)W_t = \sum_k\sqrt{2}\,Z_k\sin((k - \frac12)\pi t)/((k - \frac12)\pi), with independent standard normal ZkZ_k, using ∑k((k−12)π)−2=12\sum_k((k - \frac12)\pi)^{-2} = \frac12. What sum must you use for the variance?

Answer

Answer to Question 22.28.

EQ=12\mathbb{E}Q = \frac12, and Var⁡Q=13\operatorname{Var}Q = \frac13. The series gives the same results, using also ∑k((k−12)π)−4=16\sum_k((k - \frac12)\pi)^{-4} = \frac16.

The mean is ∫01EWt2 dt=∫01t dt=12\int_0^1\mathbb{E}W_t^2\,dt = \int_0^1t\,dt = \frac12.

For the variance, Cov⁡(Ws2,Wt2)=2min⁡(s,t)2\operatorname{Cov}(W_s^2, W_t^2) = 2\min(s, t)^2, as for any two normals with mean zero. So

Var⁡Q=2∫01∫01min⁡(s,t)2 ds dt=4∫01∫0ts2 ds dt=4∫01t33 dt=13.\operatorname{Var}Q = 2\int_0^1\int_0^1\min(s, t)^2\,ds\,dt = 4\int_0^1\int_0^ts^2\,ds\,dt = 4\int_0^1\frac{t^3}{3}\,dt = \frac13.

For the series, the sine functions 2sin⁡((k−12)πt)\sqrt{2}\sin((k - \frac12)\pi t) are orthonormal on [0,1][0, 1]. Writing λk=((k−12)π)−2\lambda_k = ((k - \frac12)\pi)^{-2} and integrating the square of the expansion,

Q=∑kλkZk2,Q = \sum_k\lambda_kZ_k^2,

since cross-terms vanish. So EQ=∑kλk=12\mathbb{E}Q = \sum_k\lambda_k = \frac12, as given, and Var⁡Q=2∑kλk2\operatorname{Var}Q = 2\sum_k\lambda_k^2, as Var⁡Z2=2\operatorname{Var}Z^2 = 2. Thus the required sum is ∑kλk2=16\sum_k\lambda_k^2 = \frac16. This is the classical sum ∑1/(2k−1)4=π4/96\sum 1/(2k - 1)^4 = \pi^4/96 in disguise, and a numeric sum gives 16\frac16 to twelve decimals. So the two routes agree.

The first term has λ1=4/π2=0.405\lambda_1 = 4/\pi^2 = 0.405, and it carries 98.6%98.6\% of the variance. So QQ is close to a scaled chi-square with one degree of freedom, and its distribution is strongly skewed. A simulation returns 0.500.50 and 0.330.33.

Classic wrong answer. Using EQ2=(EQ)2+∫Var⁡Wt2 dt\mathbb{E}Q^2 = (\mathbb{E}Q)^2 + \int\operatorname{Var}W_t^2\,dt, which ignores the correlation over time. It gives 14+23\frac14 + \frac23 in place of 14+13\frac14 + \frac13, which is too large.

Follow-up. Why does a single term carry so much of the variance? The eigenvalues fall as 1/k21/k^2, and their squares as 1/k41/k^4. A random walk’s level is dominated by its slowest component.

Why it matters. Such quantities arise in unit-root statistics, whose limits are integrals like QQ. The expansion tells you much more than the two moments do.

Question 22.29 ★★★★ QR, QT • hedge fund • experienced

Let Q=∫01Wt2 dtQ = \int_0^1W_t^2\,dt. Derive Ee−θ2Q/2=1/cosh⁡θ\mathbb{E}e^{-\theta^2Q/2} = 1/\sqrt{\cosh\theta} using the Feynman–Kac formula, with the guess u(t,x)=exp⁡(−12A(t)x2+B(t))u(t, x) = \exp(-\frac12A(t)x^2 + B(t)). Solve for AA and BB. Check the small-θ\theta limit against the mean of QQ, which is 12\frac12. Evaluate it at θ=1\theta = 1.

Answer

Answer to Question 22.29.

u(0,0)=1/cosh⁡θu(0, 0) = 1/\sqrt{\cosh\theta}, with A=θtanh⁡(θ(1−t))A = \theta\tanh(\theta(1 - t)), and BB its integral. At θ=1\theta = 1, the value is 0.8050.805.

Define u(t,x)=E[e−12θ2∫t1Ws2 ds∣Wt=x]u(t, x) = \mathbb{E}[e^{-\frac12\theta^2\int_t^1W_s^2\,ds} \mid W_t = x]. Feynman–Kac with a state-dependent discount gives

ut+12uxx−12θ2x2u=0,u(1,x)=1.u_t + \frac12u_{xx} - \frac12\theta^2x^2u = 0, \qquad u(1, x) = 1.

Substitute u=exp⁡(−12A(t)x2+B(t))u = \exp(-\frac12A(t)x^2 + B(t)). Then ut=(−12A′x2+B′)uu_t = (-\frac12A'x^2 + B')u and uxx=(A2x2−A)uu_{xx} = (A^2x^2 - A)u. Matching powers of xx:

A′=A2−θ2,B′=12A,A(1)=B(1)=0.A' = A^2 - \theta^2, \qquad B' = \tfrac12A, \qquad A(1) = B(1) = 0.

The Riccati equation has the solution A(t)=θtanh⁡(θ(1−t))A(t) = \theta\tanh(\theta(1 - t)). Check: A′=−θ2sech⁡2=θ2(tanh⁡2−1)=A2−θ2A' = -\theta^2\operatorname{sech}^2 = \theta^2(\tanh^2 - 1) = A^2 - \theta^2.

Then

B(0)=−∫0112θtanh⁡(θ(1−t)) dt=−12ln⁡cosh⁡θ.B(0) = -\int_0^1\frac12\theta\tanh(\theta(1 - t))\,dt = -\frac12\ln\cosh\theta.

So u(0,0)=eB(0)=(cosh⁡θ)−1/2u(0, 0) = e^{B(0)} = (\cosh\theta)^{-1/2}.

For small θ\theta, this is 1−θ2/41 - \theta^2/4, while the left side expands to 1−12θ2EQ=1−θ2/41 - \frac12\theta^2\mathbb{E}Q = 1 - \theta^2/4. They agree. As θ→∞\theta \to \infty, it decays like 2e−θ/2\sqrt{2}e^{-\theta/2}, so the chance of a very small QQ falls off quickly, as it must.

A second route uses the series: Q=∑λkZk2Q = \sum\lambda_kZ_k^2 gives ∏k(1+θ2λk)−1/2\prod_k(1 + \theta^2\lambda_k)^{-1/2}, and the product form of the hyperbolic cosine turns this into the same result. A numerical product and a simulation both give 0.8050.805.

Classic wrong answer. Trying a guess with no x2x^2 term, or getting the sign of the tanh⁡\tanh wrong so that uu grows with xx. The discount punishes large xx, so uu must fall with it.

Follow-up. Why is a quadratic exponent the right guess? The potential is quadratic and the diffusion is Gaussian. Such problems stay Gaussian, and a quadratic exponent is the most general Gaussian form.

Why it matters. This requires several techniques at once. The Riccati structure is the same one behind quadratic-Gaussian and affine models.

Question 22.30 ★★★★ QR, QT • hedge fund • experienced

τ\tau is the first time that WW leaves (−a,a)(-a, a). Using cosh⁡(θWt)e−θ2t/2\cosh(\theta W_t)e^{-\theta^2t/2}, find Ee−λτ\mathbb{E}e^{-\lambda\tau}. Expand it to obtain Eτ\mathbb{E}\tau and Var⁡τ\operatorname{Var}\tau. Check these using the polynomial martingale Wt4−6tWt2+3t2W_t^4 - 6tW_t^2 + 3t^2. Then use the poles of the transform to give the rate at which P(τ>t)P(\tau > t) decays.

Answer

Answer to Question 22.30.

Ee−λτ=1/cosh⁡(a2λ)\mathbb{E}e^{-\lambda\tau} = 1/\cosh(a\sqrt{2\lambda}), Eτ=a2\mathbb{E}\tau = a^2, Var⁡τ=23a4\operatorname{Var}\tau = \frac23a^4, and P(τ>t)P(\tau > t) decays at rate π2/(8a2)\pi^2/(8a^2).

cosh⁡(θWt)e−θ2t/2\cosh(\theta W_t)e^{-\theta^2t/2} is a martingale, as the average of e±θWt−θ2t/2e^{\pm\theta W_t - \theta^2t/2}. It is bounded up to τ\tau, and at τ\tau we have ∣Wτ∣=a|W_\tau| = a, so cosh⁡(θWτ)=cosh⁡θa\cosh(\theta W_\tau) = \cosh\theta a. Optional stopping gives cosh⁡(θa)Ee−θ2τ/2=1\cosh(\theta a)\mathbb{E}e^{-\theta^2\tau/2} = 1, and with λ=θ2/2\lambda = \theta^2/2 this is the result.

Expanding with x=a2λx = a\sqrt{2\lambda}: 1/cosh⁡x=1−12x2+524x4−…1/\cosh x = 1 - \frac12x^2 + \frac{5}{24}x^4 - \dots, and x2=2λa2x^2 = 2\lambda a^2. So

Ee−λτ=1−λa2+56λ2a4−…\mathbb{E}e^{-\lambda\tau} = 1 - \lambda a^2 + \frac56\lambda^2a^4 - \dots

Matching with 1−λEτ+12λ2Eτ21 - \lambda\mathbb{E}\tau + \frac12\lambda^2\mathbb{E}\tau^2: Eτ=a2\mathbb{E}\tau = a^2, and Eτ2=53a4\mathbb{E}\tau^2 = \frac53a^4. So Var⁡τ=23a4\operatorname{Var}\tau = \frac23a^4.

Check: the polynomial is a martingale. At τ\tau, a4−6a2Eτ+3Eτ2=0a^4 - 6a^2\mathbb{E}\tau + 3\mathbb{E}\tau^2 = 0. With Eτ=a2\mathbb{E}\tau = a^2, this gives Eτ2=53a4\mathbb{E}\tau^2 = \frac53a^4, the same.

For the tail, cosh⁡(a2λ)\cosh(a\sqrt{2\lambda}) vanishes when a2λ=iπ/2a\sqrt{2\lambda} = i\pi/2, so at λ=−π2/(8a2)\lambda = -\pi^2/(8a^2). The nearest singularity sets the exponential decay of the tail: P(τ>t)≈4πe−π2t/(8a2)P(\tau > t) \approx \frac{4}{\pi}e^{-\pi^2t/(8a^2)}.

At a=1a = 1, λ=12\lambda = \frac12: 1/cosh⁡1=0.6481/\cosh 1 = 0.648, and P(τ>4)≈0.0092P(\tau > 4) \approx 0.0092. A symmetric lattice walk with 100 000100\,000 paths agrees on the mean, the variance, the transform and the tail. Compare with the one-sided case: a second barrier turns the heavy tail, of order 1/t1/\sqrt{t}, into an exponential one, and every moment becomes finite.

Classic wrong answer. Using Eτ2=(Eτ)2+Eτ\mathbb{E}\tau^2 = (\mathbb{E}\tau)^2 + \mathbb{E}\tau, or dropping the factor 12\frac12 in the expansion of the exponential. The polynomial martingale is a quick check on this kind of slip.

Follow-up. Why is 4π\frac{4}{\pi} the constant in the tail? The full tail is the series 4π∑k≥0(−1)k2k+1e−(2k+1)2π2t/(8a2)\frac{4}{\pi}\sum_{k \ge 0}\frac{(-1)^k}{2k + 1}e^{-(2k + 1)^2\pi^2t/(8a^2)}, and the first term dominates quickly. At t=0t = 0 the alternating sum is π/4\pi/4, which gives 1, as it must.

Why it matters. It connects a martingale, a transform, moments and a tail in one problem. The check by a second polynomial martingale shows the habit expected at the top level.