MatheLinuxMatheLinux
Curriculum
Sign inStart free
Mathematical Foundations of Quantitative Finance
0%

0 of 19 lessons complete

Lessons

  • Random Variables & Distributions8m
  • Expectation, Variance & Moments8m
  • The Normal & Lognormal Laws8m
  • Conditional Expectation & the CLT8m
  • First-Order ODEs8m
  • Second-Order Linear ODEs8m
  • The Laplace Transform8m
  • The Heat Equation8m
  • Brownian Motion8m
  • The Ito Integral8m
  • Ito's Lemma8m
  • Geometric Brownian Motion & SDEs8m
  • Replication & No-Arbitrage8m
  • Deriving the Black-Scholes PDE8m
  • The Black-Scholes Formula8m
  • The Greeks8m
  • Monte Carlo Pricing8m
  • Binomial Trees8m
  • Finite-Difference Methods8m

MatheLinux — quantitative finance, taught rigorously.

Course content credited to Ibrahim Lanre Adedimeji.

← Mathematical Foundations of Quantitative Finance

Before we can price an option or measure portfolio risk, we need a language for uncertainty. That language is probability, and its central object is the random variable. This lesson builds it from the ground up.

Intuition

Imagine flipping a coin or watching tomorrow's stock return. We do not know the outcome in advance, but we can describe the set of possible outcomes and how likely each is. A random variable is simply a rule that attaches a number to each outcome, so that "the chance of heads" becomes "the chance the number equals 1". Once outcomes are numbers, we can average them, square them, and feed them into pricing formulas.

Formal definition

Start with a sample space Ω\OmegaΩ, the set of all possible outcomes of an experiment. A random variable XXX is a function

X:Ω→R,ω↦X(ω).X : \Omega \to \mathbb{R}, \qquad \omega \mapsto X(\omega).X:Ω→R,ω

Knowledge check

Q1. A random variable X is best described as which of the following?

Q2. For a continuous random variable with density f, what is P(X = x) for a single point x?

Q3. Which property must every valid PDF satisfy?

Q4. The CDF of an Exponential(lambda) random variable is:

Problems

P1

For a Binomial(n=3, p=0.5) random variable, compute P(X >= 2), the probability of at least 2 successes. Give a decimal.

P2

An Exponential random variable has rate lambda = 0.5. Using F(x) = 1 - e^{-lambda x}, compute P(X <= 2). Give a decimal.

Mark this lesson complete to track progress
↦
X(ω).

It maps each raw outcome ω\omegaω to a real number. Events like "X≤xX \le xX≤x" are subsets of Ω\OmegaΩ, and probability assigns them a number in [0,1][0,1][0,1].

The cumulative distribution function (CDF) collects everything we need:

FX(x)=P(X≤x).F_X(x) = P(X \le x).FX​(x)=P(X≤x).

FXF_XFX​ is non-decreasing, right-continuous, with FX(−∞)=0F_X(-\infty)=0FX​(−∞)=0 and FX(+∞)=1F_X(+\infty)=1FX​(+∞)=1.

If XXX takes countably many values, it is discrete and described by a probability mass function (PMF):

pX(x)=P(X=x),∑xpX(x)=1.p_X(x) = P(X = x), \qquad \sum_x p_X(x) = 1.pX​(x)=P(X=x),∑x​pX​(x)=1.

If FXF_XFX​ is differentiable, XXX is continuous and described by a probability density function (PDF):

fX(x)=ddxFX(x),∫−∞∞fX(x) dx=1.f_X(x) = \frac{d}{dx} F_X(x), \qquad \int_{-\infty}^{\infty} f_X(x)\,dx = 1.fX​(x)=dxd​FX​(x),∫−∞∞​fX​(x)dx=1.

For a continuous variable P(X=x)=0P(X=x)=0P(X=x)=0; probability lives in intervals: P(a≤X≤b)=∫abfX(x) dxP(a \le X \le b) = \int_a^b f_X(x)\,dxP(a≤X≤b)=∫ab​fX​(x)dx.

A short derivation: CDF of the exponential

The exponential distribution with rate λgreaterthan0\lambda greater than 0λgreaterthan0 has density fX(x)=λe−λxf_X(x) = \lambda e^{-\lambda x}fX​(x)=λe−λx for x≥0x \ge 0x≥0. Let us derive its CDF. For x≥0x \ge 0x≥0,

FX(x)=∫0xλe−λt dt.F_X(x) = \int_0^x \lambda e^{-\lambda t}\,dt.FX​(x)=∫0x​λe−λtdt.

Use the antiderivative ddt(−e−λt)=λe−λt\frac{d}{dt}\left(-e^{-\lambda t}\right) = \lambda e^{-\lambda t}dtd​(−e−λt)=λe−λt:

FX(x)=[−e−λt]0x=−e−λx−(−e0)=1−e−λx.F_X(x) = \left[ -e^{-\lambda t} \right]_0^x = -e^{-\lambda x} - (-e^{0}) = 1 - e^{-\lambda x}.FX​(x)=[−e−λt]0x​=−e−λx−(−e0)=1−e−λx.

Check the endpoints: FX(0)=0F_X(0)=0FX​(0)=0 and FX(∞)=1F_X(\infty)=1FX​(∞)=1, as required. The density integrates to 1, confirming it is a valid distribution.

Worked numerical example

Let XXX be Binomial with n=3n=3n=3 trials and success probability p=0.5p=0.5p=0.5 (think: number of up-days in 3 days, each up with probability 0.5). Its PMF is

pX(k)=(nk)pk(1−p)n−k.p_X(k) = \binom{n}{k} p^k (1-p)^{n-k}.pX​(k)=(kn​)pk(1−p)n−k.

Compute each value:

kkk(3k)\binom{3}{k}(k3​)pX(k)p_X(k)pX​(k)
011⋅0.50⋅0.53=0.1251 \cdot 0.5^0 \cdot 0.5^3 = 0.1251⋅0.50⋅0.53=0.125
133⋅0.51⋅0.52=0.3753 \cdot 0.5^1 \cdot 0.5^2 = 0.3753⋅0.51⋅0.52=0.375
233⋅0.52⋅0.51=0.3753 \cdot 0.5^2 \cdot 0.5^1 = 0.3753⋅0.52⋅0.51=0.375
311⋅0.53⋅0.50=0.1251 \cdot 0.5^3 \cdot 0.5^0 = 0.1251⋅0.53⋅0.50=0.125

The masses sum to 0.125+0.375+0.375+0.125=10.125+0.375+0.375+0.125 = 10.125+0.375+0.375+0.125=1, as they must. The probability of at least 2 up-days is P(X≥2)=0.375+0.125=0.5P(X \ge 2) = 0.375 + 0.125 = 0.5P(X≥2)=0.375+0.125=0.5.

Two building-block cases worth memorizing: the Bernoulli (n=1n=1n=1) with P(X=1)=pP(X=1)=pP(X=1)=p, P(X=0)=1−pP(X=0)=1-pP(X=0)=1−p; and the continuous Uniform on [a,b][a,b][a,b] with constant density fX(x)=1/(b−a)f_X(x) = 1/(b-a)fX​(x)=1/(b−a) on the interval, giving P(a≤X≤b)=1P(a \le X \le b)=1P(a≤X≤b)=1.

A catalog of the workhorse distributions

It pays to keep a short mental table of the distributions you will meet constantly. Each is just a different choice of PMF or PDF, and each models a different kind of uncertainty.

DistributionTypeModelsKey parameter(s)
BernoulliDiscreteA single yes/no trialppp
BinomialDiscreteNumber of successes in nnn trialsn,pn, pn,p
UniformContinuousEqually likely values on an intervala,ba, ba,b
ExponentialContinuousWaiting time until an eventλ\lambdaλ
NormalContinuousSums of many small shocks (returns)μ,σ\mu, \sigmaμ,σ

The exponential deserves a closer look because it is the model for waiting times, the time until a default, a trade, or a market jump. Its defining feature is the memoryless property: having waited sss units of time tells you nothing about how much longer you must wait,

P(Xgreaterthans+t∣Xgreaterthans)=P(Xgreaterthant).P(X greater than s + t \mid X greater than s) = P(X greater than t).P(Xgreaterthans+t∣Xgreaterthans)=P(Xgreaterthant).

This follows directly from the CDF: P(Xgreaterthans+t∣Xgreaterthans)=e−λ(s+t)/e−λs=e−λtP(X greater than s+t \mid X greater than s) = e^{-\lambda(s+t)}/e^{-\lambda s} = e^{-\lambda t}P(Xgreaterthans+t∣Xgreaterthans)=e−λ(s+t)/e−λs=e−λt. No other continuous distribution on the positive reals has this property, which is exactly why exponential waiting times are the simplest possible model for the timing of unpredictable events.

The binomial, meanwhile, is just a sum of nnn independent Bernoulli variables, which is why a binomial option-pricing tree is built by chaining single up/down steps. As nnn grows large the binomial begins to look like the bell-shaped normal, a foreshadowing of the Central Limit Theorem you will meet later in this module.

Why quants care

Every pricing model is a statement about the distribution of a future quantity. The Black-Scholes model assumes the log-return of a stock is normal; a credit model assumes default times are (roughly) exponential; a binomial tree literally walks a binomial random variable forward in time. Knowing whether a quantity is discrete or continuous tells you whether to sum a PMF or integrate a PDF, and the CDF is exactly what you invert to simulate scenarios or read off a Value-at-Risk quantile. Master the random variable and the rest of quantitative finance becomes applied calculus on distributions.

Adapted from MIT OpenCourseWare (18.03 / 18.S096), CC BY-NC-SA.