Preptide

Stochastic Calculus

Interview prep for stochastic calculus, including Brownian motion, Ito's lemma, SDEs, and martingales

Fundamental Concepts

Stochastic Processes

A stochastic process is a collection of random variables {Xt}\{X_t\} indexed by time tt.

Discrete-time: X0,X1,X2,...X_0, X_1, X_2, ...

Continuous-time: XtX_t for t[0,)t \in [0, \infty)

Interpretation: A stochastic process describes the evolution of a random quantity over time.

Filtration

A filtration {Ft}\{\mathcal{F}_t\} is an increasing family of σ-algebras representing information available at time tt.

Properties:

  • FsFt\mathcal{F}_s \subseteq \mathcal{F}_t for sts \leq t
  • Represents "everything known up to time tt"

Adapted process: XtX_t is Ft\mathcal{F}_t-measurable (its value is known at time tt)

Markov Property

A process has the Markov property if:

P(Xt+sAFt)=P(Xt+sAXt)P(X_{t+s} \in A | \mathcal{F}_t) = P(X_{t+s} \in A | X_t)

Interpretation: The future depends only on the present, not on the past.

Memoryless: Given the present state, the past is irrelevant for predicting the future.

Random Walks

Simple Random Walk

A simple random walk starts at S0=0S_0 = 0 and at each step:

Sn=Sn1+XnS_n = S_{n-1} + X_n

where Xn{1,+1}X_n \in \{-1, +1\} with equal probability.

Properties:

  • E[Sn]=0E[S_n] = 0
  • Var(Sn)=n\text{Var}(S_n) = n
  • Symmetric, no drift

Random Walk with Drift

If Xn=+1X_n = +1 with probability pp and Xn=1X_n = -1 with probability 1p1-p:

Drift: μ=E[Xn]=2p1\mu = E[X_n] = 2p - 1

Expected position: E[Sn]=nμE[S_n] = n\mu

Variance: Var(Sn)=n4p(1p)\text{Var}(S_n) = n \cdot 4p(1-p)

Scaled Random Walk

Consider a random walk on time steps of length Δt\Delta t with step size Δx\Delta x:

SnΔt=i=1nΔxXiS_{n\Delta t} = \sum_{i=1}^n \Delta x \cdot X_i

Scaling limit: As Δt0\Delta t \to 0 and Δx0\Delta x \to 0 with (Δx)2Δtσ2\frac{(\Delta x)^2}{\Delta t} \to \sigma^2:

StBrownian motion with variance σ2tS_t \to \text{Brownian motion with variance } \sigma^2 t

Brownian Motion

Definition

Standard Brownian motion WtW_t (also called Wiener process) satisfies:

  1. W0=0W_0 = 0 with probability 1
  2. Independent increments: WtWsW_t - W_s is independent of {Wr:rs}\{W_r : r \leq s\} for t>st > s
  3. Stationary increments: WtWsN(0,ts)W_t - W_s \sim \mathcal{N}(0, t-s) for t>st > s
  4. Continuous paths: tWtt \mapsto W_t is continuous

Key insight: Brownian motion is the continuous-time limit of a scaled random walk.

Properties of Brownian Motion

Mean and variance:

  • E[Wt]=0E[W_t] = 0
  • Var(Wt)=t\text{Var}(W_t) = t
  • WtN(0,t)W_t \sim \mathcal{N}(0, t)

Covariance: For s<ts < t:

Cov(Ws,Wt)=min(s,t)=s\text{Cov}(W_s, W_t) = \min(s, t) = s

Martingale property:

E[WtFs]=Wsfor s<tE[W_t | \mathcal{F}_s] = W_s \quad \text{for } s < t

Symmetries and Transformations

Time scaling: For c>0c > 0:

{cWt/c2} is also a Brownian motion\{cW_{t/c^2}\} \text{ is also a Brownian motion}

Reflection: {Wt}\{-W_t\} is also a Brownian motion

Time reversal: {WTWTt:t[0,T]}\{W_T - W_{T-t} : t \in [0,T]\} is a Brownian motion

Time inversion: {tW1/t}\{tW_{1/t}\} for t>0t > 0 (with W0=0W_0 = 0) is a Brownian motion

Quadratic Variation

The quadratic variation of Brownian motion over [0,t][0,t]:

[W]t=limΠ0i=1n(WtiWti1)2=t[W]_t = \lim_{\|\Pi\| \to 0} \sum_{i=1}^n (W_{t_i} - W_{t_{i-1}})^2 = t

where Π={0=t0<t1<...<tn=t}\Pi = \{0 = t_0 < t_1 < ... < t_n = t\} is a partition.

Critical property: Unlike smooth functions (which have zero quadratic variation), Brownian motion has non-zero quadratic variation.

Heuristic: (dWt)2=dt(dW_t)^2 = dt

Non-Differentiability

Brownian motion paths are:

  • Continuous everywhere
  • Differentiable nowhere (with probability 1)

Consequence: Standard calculus doesn't apply; we need stochastic calculus.

Brownian Motion with Drift and Diffusion

General Brownian motion:

Xt=μt+σWtX_t = \mu t + \sigma W_t

where μ\mu is the drift and σ\sigma is the volatility.

Properties:

  • E[Xt]=μtE[X_t] = \mu t
  • Var(Xt)=σ2t\text{Var}(X_t) = \sigma^2 t
  • XtN(μt,σ2t)X_t \sim \mathcal{N}(\mu t, \sigma^2 t)

Stochastic Integration

Ito Integral

The Ito integral of a stochastic process f(t,ω)f(t, \omega) with respect to Brownian motion:

It=0tf(s)dWsI_t = \int_0^t f(s) \, dW_s

Construction: For simple processes:

0tf(s)dWs=limni=1nf(ti1)(WtiWti1)\int_0^t f(s) \, dW_s = \lim_{n \to \infty} \sum_{i=1}^n f(t_{i-1}) (W_{t_i} - W_{t_{i-1}})

Key: Integrand is evaluated at the left endpoint of each interval (Ito convention).

Properties of Ito Integral

Martingale: If ff is adapted and E[0tf(s)2ds]<E[\int_0^t f(s)^2 ds] < \infty:

E[0tf(s)dWs]=0E\left[\int_0^t f(s) \, dW_s\right] = 0

E[0tf(s)dWsFs]=0sf(r)dWrE\left[\int_0^t f(s) \, dW_s \Big| \mathcal{F}_s\right] = \int_0^s f(r) \, dW_r

Ito isometry:

E[(0tf(s)dWs)2]=E[0tf(s)2ds]E\left[\left(\int_0^t f(s) \, dW_s\right)^2\right] = E\left[\int_0^t f(s)^2 \, ds\right]

Quadratic variation:

[0f(s)dWs]t=0tf(s)2ds\left[\int_0^\cdot f(s) \, dW_s\right]_t = \int_0^t f(s)^2 \, ds

Stratonovich Integral

An alternative definition using midpoint evaluation:

0tf(s)dWs=limni=1nf(ti1+ti2)(WtiWti1)\int_0^t f(s) \circ dW_s = \lim_{n \to \infty} \sum_{i=1}^n f\left(\frac{t_{i-1} + t_i}{2}\right) (W_{t_i} - W_{t_{i-1}})

Relationship to Ito integral:

0tf(s)dWs=0tf(s)dWs+120tf(s)f(s)ds\int_0^t f(s) \circ dW_s = \int_0^t f(s) \, dW_s + \frac{1}{2}\int_0^t f'(s)f(s) \, ds

Use: Stratonovich calculus follows ordinary chain rule; Ito calculus requires Ito's lemma.

Ito's Lemma

One-Dimensional Ito's Lemma

Let XtX_t satisfy the SDE:

dXt=μ(Xt,t)dt+σ(Xt,t)dWtdX_t = \mu(X_t, t) \, dt + \sigma(X_t, t) \, dW_t

For f(x,t)f(x, t) twice continuously differentiable in xx and once in tt:

df(Xt,t)=(ft+μfx+12σ22fx2)dt+σfxdWtdf(X_t, t) = \left(\frac{\partial f}{\partial t} + \mu \frac{\partial f}{\partial x} + \frac{1}{2}\sigma^2 \frac{\partial^2 f}{\partial x^2}\right) dt + \sigma \frac{\partial f}{\partial x} \, dW_t

Comparison to chain rule: The extra term 12σ22fx2\frac{1}{2}\sigma^2 \frac{\partial^2 f}{\partial x^2} arises from quadratic variation.

Heuristic derivation: Use (dWt)2=dt(dW_t)^2 = dt and Taylor expansion.

Ito's Formula (Integral Form)

f(Xt,t)=f(X0,0)+0tfs(Xs,s)ds+0tfx(Xs,s)dXs+120tσ2(Xs,s)2fx2(Xs,s)dsf(X_t, t) = f(X_0, 0) + \int_0^t \frac{\partial f}{\partial s}(X_s, s) \, ds + \int_0^t \frac{\partial f}{\partial x}(X_s, s) \, dX_s + \frac{1}{2}\int_0^t \sigma^2(X_s, s) \frac{\partial^2 f}{\partial x^2}(X_s, s) \, ds

Multidimensional Ito's Lemma

For XtRn\mathbf{X}_t \in \mathbb{R}^n satisfying:

dXt=μ(Xt,t)dt+Σ(Xt,t)dWtd\mathbf{X}_t = \boldsymbol{\mu}(\mathbf{X}_t, t) \, dt + \boldsymbol{\Sigma}(\mathbf{X}_t, t) \, d\mathbf{W}_t

where Wt\mathbf{W}_t is an mm-dimensional Brownian motion:

df(Xt,t)=ftdt+i=1nfxidXit+12i=1nj=1n2fxixjdXitdXjtdf(\mathbf{X}_t, t) = \frac{\partial f}{\partial t} dt + \sum_{i=1}^n \frac{\partial f}{\partial x_i} dX_i^t + \frac{1}{2}\sum_{i=1}^n \sum_{j=1}^n \frac{\partial^2 f}{\partial x_i \partial x_j} dX_i^t dX_j^t

where dXitdXjt=(ΣΣT)ijdtdX_i^t dX_j^t = (\boldsymbol{\Sigma} \boldsymbol{\Sigma}^T)_{ij} dt.

Stochastic Differential Equations (SDEs)

General Form

An SDE describes the evolution of XtX_t:

dXt=μ(Xt,t)dt+σ(Xt,t)dWtdX_t = \mu(X_t, t) \, dt + \sigma(X_t, t) \, dW_t

  • μ(Xt,t)\mu(X_t, t): drift coefficient (deterministic trend)
  • σ(Xt,t)\sigma(X_t, t): diffusion coefficient (volatility/randomness)

Integral form:

Xt=X0+0tμ(Xs,s)ds+0tσ(Xs,s)dWsX_t = X_0 + \int_0^t \mu(X_s, s) \, ds + \int_0^t \sigma(X_s, s) \, dW_s

Existence and Uniqueness

Theorem: If μ\mu and σ\sigma satisfy:

  1. Lipschitz condition: μ(x,t)μ(y,t)+σ(x,t)σ(y,t)Kxy|\mu(x,t) - \mu(y,t)| + |\sigma(x,t) - \sigma(y,t)| \leq K|x-y|
  2. Growth condition: μ(x,t)+σ(x,t)K(1+x)|\mu(x,t)| + |\sigma(x,t)| \leq K(1 + |x|)

then the SDE has a unique strong solution.

Common SDEs

Ornstein-Uhlenbeck process (mean-reverting):

dXt=θ(μXt)dt+σdWtdX_t = \theta(\mu - X_t) \, dt + \sigma \, dW_t

Geometric Brownian motion:

dSt=μStdt+σStdWtdS_t = \mu S_t \, dt + \sigma S_t \, dW_t

Cox-Ingersoll-Ross (CIR) process:

drt=κ(θrt)dt+σrtdWtdr_t = \kappa(\theta - r_t) \, dt + \sigma\sqrt{r_t} \, dW_t

Geometric Brownian Motion

Definition

The SDE:

dSt=μStdt+σStdWtdS_t = \mu S_t \, dt + \sigma S_t \, dW_t

models exponential growth with random fluctuations.

Used for: Stock prices, asset values (always positive).

Analytical Solution

Apply Ito's lemma to f(St,t)=logStf(S_t, t) = \log S_t:

d(logSt)=(μσ22)dt+σdWtd(\log S_t) = \left(\mu - \frac{\sigma^2}{2}\right) dt + \sigma \, dW_t

Integrating:

logSt=logS0+(μσ22)t+σWt\log S_t = \log S_0 + \left(\mu - \frac{\sigma^2}{2}\right)t + \sigma W_t

Therefore:

St=S0exp((μσ22)t+σWt)S_t = S_0 \exp\left(\left(\mu - \frac{\sigma^2}{2}\right)t + \sigma W_t\right)

Properties

Log-normal distribution: StS_t is log-normally distributed:

logStN(logS0+(μσ22)t,σ2t)\log S_t \sim \mathcal{N}\left(\log S_0 + \left(\mu - \frac{\sigma^2}{2}\right)t, \sigma^2 t\right)

Expectation:

E[St]=S0eμtE[S_t] = S_0 e^{\mu t}

Variance:

Var(St)=S02e2μt(eσ2t1)\text{Var}(S_t) = S_0^2 e^{2\mu t}(e^{\sigma^2 t} - 1)

Positivity: St>0S_t > 0 for all tt (never reaches zero).

Ito Calculus Rules

Multiplication Table

For stochastic differentials:

×dtdtdWtdW_t
dtdt00
dWtdW_t0dtdt

Key rule: (dWt)2=dt(dW_t)^2 = dt (from quadratic variation)

All higher order terms vanish: (dt)2=0(dt)^2 = 0, dtdWt=0dt \cdot dW_t = 0

Integration by Parts (Ito Product Rule)

For processes XtX_t and YtY_t:

d(XtYt)=XtdYt+YtdXt+dXtdYtd(X_t Y_t) = X_t \, dY_t + Y_t \, dX_t + dX_t \, dY_t

The last term does not vanish (unlike ordinary calculus).

Example: If dXt=μXdt+σXdWtdX_t = \mu_X dt + \sigma_X dW_t and dYt=μYdt+σYdWtdY_t = \mu_Y dt + \sigma_Y dW_t:

dXtdYt=σXσYdtdX_t \, dY_t = \sigma_X \sigma_Y \, dt

Ito's Formula for Products

If XtX_t and YtY_t are Ito processes:

d(XtYt)=XtdYt+YtdXt+dX,Ytd(X_t Y_t) = X_t dY_t + Y_t dX_t + d\langle X, Y \rangle_t

where dX,Ytd\langle X, Y \rangle_t is the quadratic covariation.

Markov Chains

Discrete-Time Markov Chains

A discrete-time Markov chain is a sequence X0,X1,X2,...X_0, X_1, X_2, ... with state space SS satisfying:

P(Xn+1=jXn=i,Xn1,...,X0)=P(Xn+1=jXn=i)P(X_{n+1} = j | X_n = i, X_{n-1}, ..., X_0) = P(X_{n+1} = j | X_n = i)

Transition matrix: P=(pij)P = (p_{ij}) where:

pij=P(Xn+1=jXn=i)p_{ij} = P(X_{n+1} = j | X_n = i)

Properties:

  • pij0p_{ij} \geq 0 for all i,ji, j
  • jpij=1\sum_j p_{ij} = 1 for all ii

n-Step Transition Probabilities

P(Xn=jX0=i)=(Pn)ijP(X_n = j | X_0 = i) = (P^n)_{ij}

Chapman-Kolmogorov equation:

pij(n+m)=kSpik(n)pkj(m)p_{ij}^{(n+m)} = \sum_{k \in S} p_{ik}^{(n)} p_{kj}^{(m)}

Stationary Distribution

A distribution π=(πi)\boldsymbol{\pi} = (\pi_i) is stationary if:

πTP=πT\boldsymbol{\pi}^T P = \boldsymbol{\pi}^T

Interpretation: If the chain starts with distribution π\boldsymbol{\pi}, it remains in distribution π\boldsymbol{\pi} forever.

Classification of States

Accessible: State jj is accessible from state ii if pij(n)>0p_{ij}^{(n)} > 0 for some n0n \geq 0

Communicating: States ii and jj communicate if each is accessible from the other

Irreducible: All states communicate with each other

Period: d(i)=gcd{n:pii(n)>0}d(i) = \gcd\{n : p_{ii}^{(n)} > 0\}

  • Aperiodic: d(i)=1d(i) = 1

Recurrent: P(return to iX0=i)=1P(\text{return to } i | X_0 = i) = 1

Transient: P(return to iX0=i)<1P(\text{return to } i | X_0 = i) < 1

Convergence to Stationarity

Theorem: For an irreducible, aperiodic, finite Markov chain:

limnpij(n)=πj\lim_{n \to \infty} p_{ij}^{(n)} = \pi_j

independent of ii, where π\boldsymbol{\pi} is the unique stationary distribution.

Continuous-Time Markov Chains

State changes occur at random times. Defined by rate matrix Q=(qij)Q = (q_{ij}):

P(Xt+h=jXt=i)=qijh+o(h)for ijP(X_{t+h} = j | X_t = i) = q_{ij} h + o(h) \quad \text{for } i \neq j

Holding time in state ii: Exp(qii)\text{Exp}(-q_{ii})

Forward equation (Kolmogorov):

P(t)=P(t)QP'(t) = P(t) Q

where P(t)=(pij(t))P(t) = (p_{ij}(t)) and pij(t)=P(Xt=jX0=i)p_{ij}(t) = P(X_t = j | X_0 = i).

Markov Decision Processes (MDPs)

Definition

An MDP is a tuple (S,A,P,R,γ)(S, A, P, R, \gamma):

  • SS: State space
  • AA: Action space
  • PP: Transition probabilities P(ss,a)P(s' | s, a)
  • RR: Reward function R(s,a)R(s, a) or R(s,a,s)R(s, a, s')
  • γ[0,1]\gamma \in [0, 1]: Discount factor

Interpretation: An agent in state ss takes action aa, receives reward R(s,a)R(s,a), and transitions to state ss' with probability P(ss,a)P(s'|s,a).

Policy

A policy π\pi maps states to actions:

  • Deterministic: π:SA\pi: S \to A
  • Stochastic: π(as)=P(action astate s)\pi(a|s) = P(\text{action } a | \text{state } s)

Goal: Find policy π\pi^* that maximizes expected cumulative reward.

Value Functions

State value function under policy π\pi:

Vπ(s)=Eπ[t=0γtR(st,at)s0=s]V^\pi(s) = E_\pi\left[\sum_{t=0}^\infty \gamma^t R(s_t, a_t) \Big| s_0 = s\right]

Action value function (Q-function):

Qπ(s,a)=Eπ[t=0γtR(st,at)s0=s,a0=a]Q^\pi(s, a) = E_\pi\left[\sum_{t=0}^\infty \gamma^t R(s_t, a_t) \Big| s_0 = s, a_0 = a\right]

Relationship:

Vπ(s)=aπ(as)Qπ(s,a)V^\pi(s) = \sum_a \pi(a|s) Q^\pi(s, a)

Qπ(s,a)=R(s,a)+γsP(ss,a)Vπ(s)Q^\pi(s, a) = R(s, a) + \gamma \sum_{s'} P(s'|s,a) V^\pi(s')

Bellman Equations

Bellman expectation equation:

Vπ(s)=aπ(as)[R(s,a)+γsP(ss,a)Vπ(s)]V^\pi(s) = \sum_a \pi(a|s) \left[R(s,a) + \gamma \sum_{s'} P(s'|s,a) V^\pi(s')\right]

Bellman optimality equation:

V(s)=maxa[R(s,a)+γsP(ss,a)V(s)]V^*(s) = \max_a \left[R(s,a) + \gamma \sum_{s'} P(s'|s,a) V^*(s')\right]

Q(s,a)=R(s,a)+γsP(ss,a)maxaQ(s,a)Q^*(s,a) = R(s,a) + \gamma \sum_{s'} P(s'|s,a) \max_{a'} Q^*(s', a')

Optimal policy: π(s)=argmaxaQ(s,a)\pi^*(s) = \arg\max_a Q^*(s,a)

Solution Methods

Value Iteration:

Vk+1(s)=maxa[R(s,a)+γsP(ss,a)Vk(s)]V_{k+1}(s) = \max_a \left[R(s,a) + \gamma \sum_{s'} P(s'|s,a) V_k(s')\right]

Converges to VV^* as kk \to \infty.

Policy Iteration:

  1. Policy evaluation: Solve VπV^\pi from Bellman expectation equation
  2. Policy improvement: π(s)=argmaxaQπ(s,a)\pi'(s) = \arg\max_a Q^\pi(s,a)
  3. Repeat until convergence

Q-Learning (model-free):

Q(s,a)Q(s,a)+α[r+γmaxaQ(s,a)Q(s,a)]Q(s,a) \leftarrow Q(s,a) + \alpha\left[r + \gamma \max_{a'} Q(s', a') - Q(s,a)\right]

Infinite Horizon vs. Finite Horizon

Infinite horizon: t=0γtR(st,at)\sum_{t=0}^\infty \gamma^t R(s_t, a_t) with γ<1\gamma < 1

Finite horizon: t=0TR(st,at)\sum_{t=0}^T R(s_t, a_t) for fixed horizon TT

Stationary policy: Optimal policy independent of time (for infinite horizon with discount)

Non-stationary policy: Optimal policy may depend on time (for finite horizon)

Partially Observable MDPs (POMDPs)

Extension: Agent doesn't directly observe state ss, but receives observation oO(os,a)o \sim O(o|s,a)

Belief state: Probability distribution over states b(s)=P(shistory)b(s) = P(s | \text{history})

More complex: Must maintain and update beliefs; problem becomes continuous-state MDP over belief space.

Martingales

Definition

A process MtM_t is a martingale with respect to filtration {Ft}\{\mathcal{F}_t\} if:

E[MtFs]=Msfor all s<tE[M_t | \mathcal{F}_s] = M_s \quad \text{for all } s < t

Interpretation: Best prediction of future value is current value (fair game).

Examples:

  • Brownian motion WtW_t
  • Wt2tW_t^2 - t
  • Ito integral 0tf(s)dWs\int_0^t f(s) \, dW_s

Submartingales and Supermartingales

Submartingale: E[MtFs]MsE[M_t | \mathcal{F}_s] \geq M_s (tendency to increase)

Supermartingale: E[MtFs]MsE[M_t | \mathcal{F}_s] \leq M_s (tendency to decrease)

Example: Geometric Brownian motion StS_t with μ>0\mu > 0 is a submartingale.

Stopping Times

A random variable τ\tau is a stopping time if:

{τt}Ftfor all t\{\tau \leq t\} \in \mathcal{F}_t \quad \text{for all } t

Interpretation: Decision to stop at time τ\tau depends only on information up to τ\tau.

Examples: First hitting time, first passage time.

Optional Stopping Theorem

If MtM_t is a martingale and τ\tau is a stopping time with E[τ]<E[\tau] < \infty and appropriate boundedness:

E[Mτ]=E[M0]E[M_\tau] = E[M_0]

Use: Computing expected values at random times, gambler's ruin problems.

Important Tricks and Techniques

Trick 1: Recognizing Quadratic Variation

Always remember (dWt)2=dt(dW_t)^2 = dt when applying Ito's lemma or product rule.

Trick 2: Solving SDEs via Ito's Lemma

To solve dXt=μ(Xt)dt+σ(Xt)dWtdX_t = \mu(X_t) dt + \sigma(X_t) dW_t:

  1. Guess a transformation f(Xt)f(X_t)
  2. Apply Ito's lemma
  3. Choose ff to simplify the SDE

Example: For dSt=μStdt+σStdWtdS_t = \mu S_t dt + \sigma S_t dW_t, use f(S)=logSf(S) = \log S.

Trick 3: Change of Measure (Girsanov Theorem)

Under a change of probability measure, Brownian motion with drift becomes standard Brownian motion:

W~t=Wt+0tθsds\tilde{W}_t = W_t + \int_0^t \theta_s \, ds

is a Brownian motion under the new measure.

Trick 4: Feynman-Kac Formula

Links PDEs to expectations of SDEs. If u(x,t)u(x,t) solves:

ut+μux+12σ22ux2=0\frac{\partial u}{\partial t} + \mu \frac{\partial u}{\partial x} + \frac{1}{2}\sigma^2 \frac{\partial^2 u}{\partial x^2} = 0

with u(x,T)=g(x)u(x,T) = g(x), then:

u(x,t)=E[g(XT)Xt=x]u(x,t) = E[g(X_T) | X_t = x]

where dXt=μdt+σdWtdX_t = \mu dt + \sigma dW_t.

Trick 5: Martingale Representation

Any Ft\mathcal{F}_t-martingale can be written as an Ito integral:

Mt=M0+0tϕsdWsM_t = M_0 + \int_0^t \phi_s \, dW_s

Trick 6: Markov Chain Analysis

For finding stationary distributions:

  1. Set up πP=π\boldsymbol{\pi}P = \boldsymbol{\pi}
  2. Add constraint iπi=1\sum_i \pi_i = 1
  3. Solve linear system

Trick 7: Value Iteration Convergence

Use contraction mapping: Vk+1VγVkV\|V_{k+1} - V^*\| \leq \gamma \|V_k - V^*\|

Converges geometrically with rate γ\gamma.

Trick 8: Exploiting Symmetry

In Markov chains, use symmetry to reduce computation (e.g., random walk on symmetric graph).

Trick 9: First-Step Analysis for MDPs

V(s)=maxa[R(s,a)+γsP(ss,a)V(s)]V(s) = \max_a \left[R(s,a) + \gamma \sum_{s'} P(s'|s,a) V(s')\right]

Condition on first action, solve recursively.

Trick 10: Dimensional Analysis

Check units: if WtW_t has units time\sqrt{\text{time}}, then dWtdW_t has units (time)1/2(\text{time})^{1/2} and (dWt)2(dW_t)^2 has units of time.

Interview Problem Types

Type 1: Brownian Motion Properties

GivenFindApproach
Standard Brownian motion WtW_tMean, variance, distribution, covarianceUse E[Wt]=0E[W_t] = 0, Var(Wt)=t\text{Var}(W_t) = t, Cov(Ws,Wt)=min(s,t)\text{Cov}(W_s, W_t) = \min(s,t)

Type 2: Applying Ito's Lemma

GivenFindApproach
SDE for XtX_t, function f(Xt,t)f(X_t, t)SDE for f(Xt,t)f(X_t, t)Apply Ito's lemma: include 12σ22fx2\frac{1}{2}\sigma^2 \frac{\partial^2 f}{\partial x^2} term

Type 3: Solving SDEs

GivenFindApproach
Linear SDE or geometric SDEExplicit solutionUse Ito's lemma with appropriate transformation (e.g., log\log for GBM)

Type 4: Quadratic Variation Calculations

GivenFindApproach
Stochastic processQuadratic variation [X]t[X]_tUse dWtdWt=dtdW_t \cdot dW_t = dt, dtdt=0dt \cdot dt = 0, sum quadratic terms

Type 5: Ito Product Rule

GivenFindApproach
Two Ito processes XtX_t, YtY_tDifferential of XtYtX_t Y_tApply d(XY)=XdY+YdX+dXdYd(XY) = X dY + Y dX + dX dY with multiplication table

Type 6: Markov Chain Stationary Distribution

GivenFindApproach
Transition matrix PPStationary distribution π\boldsymbol{\pi}Solve πP=π\boldsymbol{\pi}P = \boldsymbol{\pi} with iπi=1\sum_i \pi_i = 1

Type 7: MDP Value Functions

GivenFindApproach
MDP parameters (S,A,P,R,γ)(S, A, P, R, \gamma)Optimal value V(s)V^*(s) or policy π\pi^*Use Bellman optimality equation, value iteration, or policy iteration

Type 8: First Passage Times

GivenFindApproach
Brownian motion or diffusion, barrierExpected hitting time or probabilityUse martingale methods, reflection principle, or solve PDE

Type 9: Geometric Brownian Motion

GivenFindApproach
GBM parameters μ\mu, σ\sigma, initial S0S_0Distribution of StS_t, expectation, probabilityUse log-normal distribution: logStN(...)\log S_t \sim \mathcal{N}(...)

Type 10: Martingale Properties

GivenFindApproach
Stochastic processCheck if martingale, compute expectations at stopping timesVerify E[XtFs]=XsE[X_t \| \mathcal{F}_s] = X_s, use optional stopping

Common Pitfalls

Pitfall 1: Forgetting the Second-Order Term in Ito's Lemma

Wrong: Using ordinary chain rule without 12σ22fx2\frac{1}{2}\sigma^2 \frac{\partial^2 f}{\partial x^2} term

Correct: Always include the second-order term from quadratic variation

Pitfall 2: Confusing Ito and Stratonovich Integrals

Wrong: Assuming stochastic integrals follow ordinary calculus rules

Check: Ito uses left-endpoint; Stratonovich uses midpoint; they give different results

Pitfall 3: Incorrect Multiplication Rules

Wrong: Treating (dWt)2(dW_t)^2 as zero like (dt)2(dt)^2

Correct: (dWt)2=dt(dW_t)^2 = dt due to quadratic variation

Pitfall 4: Misapplying Product Rule

Wrong: Using d(XY)=XdY+YdXd(XY) = X dY + Y dX without the dXdYdX dY term

Correct: Include dXdYdX dY term (it doesn't vanish in stochastic calculus)

Pitfall 5: Assuming Differentiability

Wrong: Trying to compute dWtdt\frac{dW_t}{dt} (doesn't exist)

Correct: Work with differentials dWtdW_t directly

Pitfall 6: Non-Adapted Processes in Ito Integral

Wrong: Using future information in the integrand

Check: Integrand must be adapted (known at time tt)

Pitfall 7: Wrong Stationary Distribution

Wrong: Finding eigenvector of PP instead of row vector satisfying πP=π\boldsymbol{\pi}P = \boldsymbol{\pi}

Check: π\boldsymbol{\pi} is a row vector (probability distribution)

Pitfall 8: Forgetting Discount Factor in MDP

Wrong: Omitting γ\gamma in Bellman equations

Correct: Always include discount factor in value functions

Pitfall 9: Confusing State and Action Values

Wrong: Using V(s,a)V(s,a) notation (incorrect)

Correct: V(s)V(s) for state value, Q(s,a)Q(s,a) for action value

Quick Reference: Key Formulas

Brownian Motion Properties:

E[Wt]=0,Var(Wt)=t,Cov(Ws,Wt)=min(s,t)E[W_t] = 0, \quad \text{Var}(W_t) = t, \quad \text{Cov}(W_s, W_t) = \min(s,t)

Quadratic Variation:

[W]t=t,(dWt)2=dt[W]_t = t, \quad (dW_t)^2 = dt

Ito's Lemma:

df(Xt,t)=(ft+μfx+12σ22fx2)dt+σfxdWtdf(X_t, t) = \left(\frac{\partial f}{\partial t} + \mu \frac{\partial f}{\partial x} + \frac{1}{2}\sigma^2 \frac{\partial^2 f}{\partial x^2}\right) dt + \sigma \frac{\partial f}{\partial x} dW_t

Ito Isometry:

E[(0tf(s)dWs)2]=E[0tf(s)2ds]E\left[\left(\int_0^t f(s) dW_s\right)^2\right] = E\left[\int_0^t f(s)^2 ds\right]

Geometric Brownian Motion Solution:

St=S0exp((μσ22)t+σWt)S_t = S_0 \exp\left(\left(\mu - \frac{\sigma^2}{2}\right)t + \sigma W_t\right)

Ito Product Rule:

d(XtYt)=XtdYt+YtdXt+dXtdYtd(X_t Y_t) = X_t dY_t + Y_t dX_t + dX_t dY_t

Bellman Optimality:

V(s)=maxa[R(s,a)+γsP(ss,a)V(s)]V^*(s) = \max_a \left[R(s,a) + \gamma \sum_{s'} P(s'|s,a) V^*(s')\right]

Stationary Distribution:

πP=π,iπi=1\boldsymbol{\pi}P = \boldsymbol{\pi}, \quad \sum_i \pi_i = 1

Practice Problem Categories

  • Computing Brownian motion expectations and covariances
  • Applying Ito's lemma to polynomial, exponential, logarithmic functions
  • Solving linear SDEs (Ornstein-Uhlenbeck)
  • Solving geometric SDEs (GBM, CIR)
  • Quadratic variation calculations
  • Ito integral properties
  • Product rule for stochastic processes
  • First passage time problems
  • Reflection principle applications
  • Martingale verification
  • Optional stopping theorem
  • Change of measure (Girsanov)
  • Feynman-Kac applications
  • Markov chain classification (recurrent/transient)
  • Finding stationary distributions
  • Long-run proportions
  • Continuous-time Markov chains
  • Value iteration for MDPs
  • Policy iteration for MDPs
  • Q-learning basics
  • Finite vs. infinite horizon MDPs
  • Optimal stopping problems
  • Stochastic control
  • Black-Scholes derivation
  • Option pricing via risk-neutral measure

On this page

Fundamental ConceptsStochastic ProcessesFiltrationMarkov PropertyRandom WalksSimple Random WalkRandom Walk with DriftScaled Random WalkBrownian MotionDefinitionProperties of Brownian MotionSymmetries and TransformationsQuadratic VariationNon-DifferentiabilityBrownian Motion with Drift and DiffusionStochastic IntegrationIto IntegralProperties of Ito IntegralStratonovich IntegralIto's LemmaOne-Dimensional Ito's LemmaIto's Formula (Integral Form)Multidimensional Ito's LemmaStochastic Differential Equations (SDEs)General FormExistence and UniquenessCommon SDEsGeometric Brownian MotionDefinitionAnalytical SolutionPropertiesIto Calculus RulesMultiplication TableIntegration by Parts (Ito Product Rule)Ito's Formula for ProductsMarkov ChainsDiscrete-Time Markov Chainsn-Step Transition ProbabilitiesStationary DistributionClassification of StatesConvergence to StationarityContinuous-Time Markov ChainsMarkov Decision Processes (MDPs)DefinitionPolicyValue FunctionsBellman EquationsSolution MethodsInfinite Horizon vs. Finite HorizonPartially Observable MDPs (POMDPs)MartingalesDefinitionSubmartingales and SupermartingalesStopping TimesOptional Stopping TheoremImportant Tricks and TechniquesTrick 1: Recognizing Quadratic VariationTrick 2: Solving SDEs via Ito's LemmaTrick 3: Change of Measure (Girsanov Theorem)Trick 4: Feynman-Kac FormulaTrick 5: Martingale RepresentationTrick 6: Markov Chain AnalysisTrick 7: Value Iteration ConvergenceTrick 8: Exploiting SymmetryTrick 9: First-Step Analysis for MDPsTrick 10: Dimensional AnalysisInterview Problem TypesType 1: Brownian Motion PropertiesType 2: Applying Ito's LemmaType 3: Solving SDEsType 4: Quadratic Variation CalculationsType 5: Ito Product RuleType 6: Markov Chain Stationary DistributionType 7: MDP Value FunctionsType 8: First Passage TimesType 9: Geometric Brownian MotionType 10: Martingale PropertiesCommon PitfallsPitfall 1: Forgetting the Second-Order Term in Ito's LemmaPitfall 2: Confusing Ito and Stratonovich IntegralsPitfall 3: Incorrect Multiplication RulesPitfall 4: Misapplying Product RulePitfall 5: Assuming DifferentiabilityPitfall 6: Non-Adapted Processes in Ito IntegralPitfall 7: Wrong Stationary DistributionPitfall 8: Forgetting Discount Factor in MDPPitfall 9: Confusing State and Action ValuesQuick Reference: Key FormulasPractice Problem Categories