Interview prep for stochastic calculus, including Brownian motion, Ito's lemma, SDEs, and martingales
A stochastic process is a collection of random variables {Xt} indexed by time t.
Discrete-time: X0,X1,X2,...
Continuous-time: Xt for t∈[0,∞)
Interpretation: A stochastic process describes the evolution of a random quantity over time.
A filtration {Ft} is an increasing family of σ-algebras representing information available at time t.
Properties:
- Fs⊆Ft for s≤t
- Represents "everything known up to time t"
Adapted process: Xt is Ft-measurable (its value is known at time t)
A process has the Markov property if:
P(Xt+s∈A∣Ft)=P(Xt+s∈A∣Xt)
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.
A simple random walk starts at S0=0 and at each step:
Sn=Sn−1+Xn
where Xn∈{−1,+1} with equal probability.
Properties:
- E[Sn]=0
- Var(Sn)=n
- Symmetric, no drift
If Xn=+1 with probability p and Xn=−1 with probability 1−p:
Drift: μ=E[Xn]=2p−1
Expected position: E[Sn]=nμ
Variance: Var(Sn)=n⋅4p(1−p)
Consider a random walk on time steps of length Δt with step size Δx:
SnΔt=∑i=1nΔx⋅Xi
Scaling limit: As Δt→0 and Δx→0 with Δt(Δx)2→σ2:
St→Brownian motion with variance σ2t
Standard Brownian motion Wt (also called Wiener process) satisfies:
- W0=0 with probability 1
- Independent increments: Wt−Ws is independent of {Wr:r≤s} for t>s
- Stationary increments: Wt−Ws∼N(0,t−s) for t>s
- Continuous paths: t↦Wt is continuous
Key insight: Brownian motion is the continuous-time limit of a scaled random walk.
Mean and variance:
- E[Wt]=0
- Var(Wt)=t
- Wt∼N(0,t)
Covariance: For s<t:
Cov(Ws,Wt)=min(s,t)=s
Martingale property:
E[Wt∣Fs]=Wsfor s<t
Time scaling: For c>0:
{cWt/c2} is also a Brownian motion
Reflection: {−Wt} is also a Brownian motion
Time reversal: {WT−WT−t:t∈[0,T]} is a Brownian motion
Time inversion: {tW1/t} for t>0 (with W0=0) is a Brownian motion
The quadratic variation of Brownian motion over [0,t]:
[W]t=lim∥Π∥→0∑i=1n(Wti−Wti−1)2=t
where Π={0=t0<t1<...<tn=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
Brownian motion paths are:
- Continuous everywhere
- Differentiable nowhere (with probability 1)
Consequence: Standard calculus doesn't apply; we need stochastic calculus.
General Brownian motion:
Xt=μt+σWt
where μ is the drift and σ is the volatility.
Properties:
- E[Xt]=μt
- Var(Xt)=σ2t
- Xt∼N(μt,σ2t)
The Ito integral of a stochastic process f(t,ω) with respect to Brownian motion:
It=∫0tf(s)dWs
Construction: For simple processes:
∫0tf(s)dWs=limn→∞∑i=1nf(ti−1)(Wti−Wti−1)
Key: Integrand is evaluated at the left endpoint of each interval (Ito convention).
Martingale: If f is adapted and E[∫0tf(s)2ds]<∞:
E[∫0tf(s)dWs]=0
E[∫0tf(s)dWsFs]=∫0sf(r)dWr
Ito isometry:
E[(∫0tf(s)dWs)2]=E[∫0tf(s)2ds]
Quadratic variation:
[∫0⋅f(s)dWs]t=∫0tf(s)2ds
An alternative definition using midpoint evaluation:
∫0tf(s)∘dWs=limn→∞∑i=1nf(2ti−1+ti)(Wti−Wti−1)
Relationship to Ito integral:
∫0tf(s)∘dWs=∫0tf(s)dWs+21∫0tf′(s)f(s)ds
Use: Stratonovich calculus follows ordinary chain rule; Ito calculus requires Ito's lemma.
Let Xt satisfy the SDE:
dXt=μ(Xt,t)dt+σ(Xt,t)dWt
For f(x,t) twice continuously differentiable in x and once in t:
df(Xt,t)=(∂t∂f+μ∂x∂f+21σ2∂x2∂2f)dt+σ∂x∂fdWt
Comparison to chain rule: The extra term 21σ2∂x2∂2f arises from quadratic variation.
Heuristic derivation: Use (dWt)2=dt and Taylor expansion.
f(Xt,t)=f(X0,0)+∫0t∂s∂f(Xs,s)ds+∫0t∂x∂f(Xs,s)dXs+21∫0tσ2(Xs,s)∂x2∂2f(Xs,s)ds
For Xt∈Rn satisfying:
dXt=μ(Xt,t)dt+Σ(Xt,t)dWt
where Wt is an m-dimensional Brownian motion:
df(Xt,t)=∂t∂fdt+∑i=1n∂xi∂fdXit+21∑i=1n∑j=1n∂xi∂xj∂2fdXitdXjt
where dXitdXjt=(ΣΣT)ijdt.
An SDE describes the evolution of Xt:
dXt=μ(Xt,t)dt+σ(Xt,t)dWt
- μ(Xt,t): drift coefficient (deterministic trend)
- σ(Xt,t): diffusion coefficient (volatility/randomness)
Integral form:
Xt=X0+∫0tμ(Xs,s)ds+∫0tσ(Xs,s)dWs
Theorem: If μ and σ satisfy:
- Lipschitz condition: ∣μ(x,t)−μ(y,t)∣+∣σ(x,t)−σ(y,t)∣≤K∣x−y∣
- Growth condition: ∣μ(x,t)∣+∣σ(x,t)∣≤K(1+∣x∣)
then the SDE has a unique strong solution.
Ornstein-Uhlenbeck process (mean-reverting):
dXt=θ(μ−Xt)dt+σdWt
Geometric Brownian motion:
dSt=μStdt+σStdWt
Cox-Ingersoll-Ross (CIR) process:
drt=κ(θ−rt)dt+σrtdWt
The SDE:
dSt=μStdt+σStdWt
models exponential growth with random fluctuations.
Used for: Stock prices, asset values (always positive).
Apply Ito's lemma to f(St,t)=logSt:
d(logSt)=(μ−2σ2)dt+σdWt
Integrating:
logSt=logS0+(μ−2σ2)t+σWt
Therefore:
St=S0exp((μ−2σ2)t+σWt)
Log-normal distribution: St is log-normally distributed:
logSt∼N(logS0+(μ−2σ2)t,σ2t)
Expectation:
E[St]=S0eμt
Variance:
Var(St)=S02e2μt(eσ2t−1)
Positivity: St>0 for all t (never reaches zero).
For stochastic differentials:
| × | dt | dWt |
|---|
| dt | 0 | 0 |
| dWt | 0 | dt |
Key rule: (dWt)2=dt (from quadratic variation)
All higher order terms vanish: (dt)2=0, dt⋅dWt=0
For processes Xt and Yt:
d(XtYt)=XtdYt+YtdXt+dXtdYt
The last term does not vanish (unlike ordinary calculus).
Example: If dXt=μXdt+σXdWt and dYt=μYdt+σYdWt:
dXtdYt=σXσYdt
If Xt and Yt are Ito processes:
d(XtYt)=XtdYt+YtdXt+d⟨X,Y⟩t
where d⟨X,Y⟩t is the quadratic covariation.
A discrete-time Markov chain is a sequence X0,X1,X2,... with state space S satisfying:
P(Xn+1=j∣Xn=i,Xn−1,...,X0)=P(Xn+1=j∣Xn=i)
Transition matrix: P=(pij) where:
pij=P(Xn+1=j∣Xn=i)
Properties:
- pij≥0 for all i,j
- ∑jpij=1 for all i
P(Xn=j∣X0=i)=(Pn)ij
Chapman-Kolmogorov equation:
pij(n+m)=∑k∈Spik(n)pkj(m)
A distribution π=(πi) is stationary if:
πTP=πT
Interpretation: If the chain starts with distribution π, it remains in distribution π forever.
Accessible: State j is accessible from state i if pij(n)>0 for some n≥0
Communicating: States i and j communicate if each is accessible from the other
Irreducible: All states communicate with each other
Period: d(i)=gcd{n:pii(n)>0}
- Aperiodic: d(i)=1
Recurrent: P(return to i∣X0=i)=1
Transient: P(return to i∣X0=i)<1
Theorem: For an irreducible, aperiodic, finite Markov chain:
limn→∞pij(n)=πj
independent of i, where π is the unique stationary distribution.
State changes occur at random times. Defined by rate matrix Q=(qij):
P(Xt+h=j∣Xt=i)=qijh+o(h)for i=j
Holding time in state i: Exp(−qii)
Forward equation (Kolmogorov):
P′(t)=P(t)Q
where P(t)=(pij(t)) and pij(t)=P(Xt=j∣X0=i).
An MDP is a tuple (S,A,P,R,γ):
- S: State space
- A: Action space
- P: Transition probabilities P(s′∣s,a)
- R: Reward function R(s,a) or R(s,a,s′)
- γ∈[0,1]: Discount factor
Interpretation: An agent in state s takes action a, receives reward R(s,a), and transitions to state s′ with probability P(s′∣s,a).
A policy π maps states to actions:
- Deterministic: π:S→A
- Stochastic: π(a∣s)=P(action a∣state s)
Goal: Find policy π∗ that maximizes expected cumulative reward.
State value function under policy π:
Vπ(s)=Eπ[∑t=0∞γtR(st,at)s0=s]
Action value function (Q-function):
Qπ(s,a)=Eπ[∑t=0∞γtR(st,at)s0=s,a0=a]
Relationship:
Vπ(s)=∑aπ(a∣s)Qπ(s,a)
Qπ(s,a)=R(s,a)+γ∑s′P(s′∣s,a)Vπ(s′)
Bellman expectation equation:
Vπ(s)=∑aπ(a∣s)[R(s,a)+γ∑s′P(s′∣s,a)Vπ(s′)]
Bellman optimality equation:
V∗(s)=maxa[R(s,a)+γ∑s′P(s′∣s,a)V∗(s′)]
Q∗(s,a)=R(s,a)+γ∑s′P(s′∣s,a)maxa′Q∗(s′,a′)
Optimal policy: π∗(s)=argmaxaQ∗(s,a)
Value Iteration:
Vk+1(s)=maxa[R(s,a)+γ∑s′P(s′∣s,a)Vk(s′)]
Converges to V∗ as k→∞.
Policy Iteration:
- Policy evaluation: Solve Vπ from Bellman expectation equation
- Policy improvement: π′(s)=argmaxaQπ(s,a)
- Repeat until convergence
Q-Learning (model-free):
Q(s,a)←Q(s,a)+α[r+γmaxa′Q(s′,a′)−Q(s,a)]
Infinite horizon: ∑t=0∞γtR(st,at) with γ<1
Finite horizon: ∑t=0TR(st,at) for fixed horizon T
Stationary policy: Optimal policy independent of time (for infinite horizon with discount)
Non-stationary policy: Optimal policy may depend on time (for finite horizon)
Extension: Agent doesn't directly observe state s, but receives observation o∼O(o∣s,a)
Belief state: Probability distribution over states b(s)=P(s∣history)
More complex: Must maintain and update beliefs; problem becomes continuous-state MDP over belief space.
A process Mt is a martingale with respect to filtration {Ft} if:
E[Mt∣Fs]=Msfor all s<t
Interpretation: Best prediction of future value is current value (fair game).
Examples:
- Brownian motion Wt
- Wt2−t
- Ito integral ∫0tf(s)dWs
Submartingale: E[Mt∣Fs]≥Ms (tendency to increase)
Supermartingale: E[Mt∣Fs]≤Ms (tendency to decrease)
Example: Geometric Brownian motion St with μ>0 is a submartingale.
A random variable τ is a stopping time if:
{τ≤t}∈Ftfor all t
Interpretation: Decision to stop at time τ depends only on information up to τ.
Examples: First hitting time, first passage time.
If Mt is a martingale and τ is a stopping time with E[τ]<∞ and appropriate boundedness:
E[Mτ]=E[M0]
Use: Computing expected values at random times, gambler's ruin problems.
Always remember (dWt)2=dt when applying Ito's lemma or product rule.
To solve dXt=μ(Xt)dt+σ(Xt)dWt:
- Guess a transformation f(Xt)
- Apply Ito's lemma
- Choose f to simplify the SDE
Example: For dSt=μStdt+σStdWt, use f(S)=logS.
Under a change of probability measure, Brownian motion with drift becomes standard Brownian motion:
W~t=Wt+∫0tθsds
is a Brownian motion under the new measure.
Links PDEs to expectations of SDEs. If u(x,t) solves:
∂t∂u+μ∂x∂u+21σ2∂x2∂2u=0
with u(x,T)=g(x), then:
u(x,t)=E[g(XT)∣Xt=x]
where dXt=μdt+σdWt.
Any Ft-martingale can be written as an Ito integral:
Mt=M0+∫0tϕsdWs
For finding stationary distributions:
- Set up πP=π
- Add constraint ∑iπi=1
- Solve linear system
Use contraction mapping: ∥Vk+1−V∗∥≤γ∥Vk−V∗∥
Converges geometrically with rate γ.
In Markov chains, use symmetry to reduce computation (e.g., random walk on symmetric graph).
V(s)=maxa[R(s,a)+γ∑s′P(s′∣s,a)V(s′)]
Condition on first action, solve recursively.
Check units: if Wt has units time, then dWt has units (time)1/2 and (dWt)2 has units of time.
| Given | Find | Approach |
|---|
| Standard Brownian motion Wt | Mean, variance, distribution, covariance | Use E[Wt]=0, Var(Wt)=t, Cov(Ws,Wt)=min(s,t) |
| Given | Find | Approach |
|---|
| SDE for Xt, function f(Xt,t) | SDE for f(Xt,t) | Apply Ito's lemma: include 21σ2∂x2∂2f term |
| Given | Find | Approach |
|---|
| Linear SDE or geometric SDE | Explicit solution | Use Ito's lemma with appropriate transformation (e.g., log for GBM) |
| Given | Find | Approach |
|---|
| Stochastic process | Quadratic variation [X]t | Use dWt⋅dWt=dt, dt⋅dt=0, sum quadratic terms |
| Given | Find | Approach |
|---|
| Two Ito processes Xt, Yt | Differential of XtYt | Apply d(XY)=XdY+YdX+dXdY with multiplication table |
| Given | Find | Approach |
|---|
| Transition matrix P | Stationary distribution π | Solve πP=π with ∑iπi=1 |
| Given | Find | Approach |
|---|
| MDP parameters (S,A,P,R,γ) | Optimal value V∗(s) or policy π∗ | Use Bellman optimality equation, value iteration, or policy iteration |
| Given | Find | Approach |
|---|
| Brownian motion or diffusion, barrier | Expected hitting time or probability | Use martingale methods, reflection principle, or solve PDE |
| Given | Find | Approach |
|---|
| GBM parameters μ, σ, initial S0 | Distribution of St, expectation, probability | Use log-normal distribution: logSt∼N(...) |
| Given | Find | Approach |
|---|
| Stochastic process | Check if martingale, compute expectations at stopping times | Verify E[Xt∥Fs]=Xs, use optional stopping |
Wrong: Using ordinary chain rule without 21σ2∂x2∂2f term
Correct: Always include the second-order term from quadratic variation
Wrong: Assuming stochastic integrals follow ordinary calculus rules
Check: Ito uses left-endpoint; Stratonovich uses midpoint; they give different results
Wrong: Treating (dWt)2 as zero like (dt)2
Correct: (dWt)2=dt due to quadratic variation
Wrong: Using d(XY)=XdY+YdX without the dXdY term
Correct: Include dXdY term (it doesn't vanish in stochastic calculus)
Wrong: Trying to compute dtdWt (doesn't exist)
Correct: Work with differentials dWt directly
Wrong: Using future information in the integrand
Check: Integrand must be adapted (known at time t)
Wrong: Finding eigenvector of P instead of row vector satisfying πP=π
Check: π is a row vector (probability distribution)
Wrong: Omitting γ in Bellman equations
Correct: Always include discount factor in value functions
Wrong: Using V(s,a) notation (incorrect)
Correct: V(s) for state value, Q(s,a) for action value
Brownian Motion Properties:
E[Wt]=0,Var(Wt)=t,Cov(Ws,Wt)=min(s,t)
Quadratic Variation:
[W]t=t,(dWt)2=dt
Ito's Lemma:
df(Xt,t)=(∂t∂f+μ∂x∂f+21σ2∂x2∂2f)dt+σ∂x∂fdWt
Ito Isometry:
E[(∫0tf(s)dWs)2]=E[∫0tf(s)2ds]
Geometric Brownian Motion Solution:
St=S0exp((μ−2σ2)t+σWt)
Ito Product Rule:
d(XtYt)=XtdYt+YtdXt+dXtdYt
Bellman Optimality:
V∗(s)=maxa[R(s,a)+γ∑s′P(s′∣s,a)V∗(s′)]
Stationary Distribution:
πP=π,∑iπi=1
- 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