A Practical Guide to Quantitative Finance Interviews
Contents

4.4 Discrete and Continuous Distributions

In this section, we review a variety of distribution functions for random variables that are widely used in quantitative modeling. Although it may not be necessary to memorize the properties of these distributions, having an intuitive understanding of the distributions and having the ability to quickly derive important properties are valuable skills in practice. As usual, let’s begin with the theories:

Common function of random variables

Table 4.1 summarizes how the basic properties of discrete and continuous random variables are defined or calculated. These are the basics you should commit to memory.

Table 4.1 Basic properties of discrete and continuous random variables
Random variable (XX)DiscreteContinuous19
Cumulative distribution function/cdfF(a)=P{X≤a}F(a)=P\{X\le a\}F(a)=∫−∞af(x)dxF(a)=\displaystyle\int_{-\infty}^{a}f(x)dx
Probability mass function /pmf
Probability density function /pdf
pmf:
p(x)=P{X=x}p(x)=P\{X=x\}
pdf: f(x)=ddxF(x)f(x)=\dfrac d{dx}F(x)
Expected value/ E[X]E[X]∑x:p(x)>0xp(x)\displaystyle\sum_{x:p(x)>0}xp(x)∫−∞∞xf(x)dx\displaystyle\int_{-\infty}^{\infty}xf(x)dx
Expected value of g(X)g(X)/ E[g(X)]E[g(X)]∑x:p(x)>0g(x)p(x)\displaystyle\sum_{x:p(x)>0}g(x)p(x)∫−∞∞g(x)f(x)dx\displaystyle\int_{-\infty}^{\infty}g(x)f(x)dx
Variance of XX/ var(X)var(X)E[(X−E[X])2]=E[X2]−(E[X])2E[(X-E[X])^2]=E[X^2]-(E[X])^2
Standard deviation of XX/ std(X)std(X)var(X)\sqrt{var(X)}

Discrete random variables

Table 4.2 includes some of the most widely-used discrete distributions. Discrete uniform random variable represents the occurrence of a value between number aa and bb when all values in the set {a,a+1,⋯ ,b}\{a,a+1,\cdots,b\} have equal probability. Binomial random variable represents the number of successes in a sequence of nn experiments when each trial is 87 independently a success with probability pp. Poisson random variable represents the number of events occurring in a fixed period of time with the expected number of occurrences λt\lambda t when events occur with a known average rate λ\lambda and are independent of the time since the last event. Geometric random variable represents the trial number (nn) to get the first success when each trial is independently a success with probability pp. Negative Binomial random variable represents the trial number to get to the rr-th success when each trial is independently a success with probability pp.

Table 4.2 Probability mass function, expected value and variance of discrete random variables
NameProbability mass function (pmf)E[X]E[X]var(X)var(X)
UniformP(x)=1b−a+1, x=a,a+1,⋯ ,bP(x)=\dfrac1{b-a+1},\ x=a,a+1,\cdots,bb+a2\dfrac{b+a}2(b−a+1)2−112\dfrac{(b-a+1)^2-1}{12}
BinomialP(x)=(nx)px(1−p)n−x, x=0,1,⋯ ,nP(x)=\binom nx p^x(1-p)^{n-x},\ x=0,1,\cdots,nnpnpnp(1−p)np(1-p)
PoissonP(x)=e−λt(λt)xx!, x=0,1,⋯P(x)=\dfrac{e^{-\lambda t}(\lambda t)^x}{x!},\ x=0,1,\cdots20λt\lambda tλt\lambda t
GeometricP(x)=(1−p)x−1p, x=1,2,⋯P(x)=(1-p)^{x-1}p,\ x=1,2,\cdots1p\dfrac1p1−pp2\dfrac{1-p}{p^2}
Negative BinomialP(x)=(x−1r−1)pr(1−p)x−r, x=r,r+1,⋯P(x)=\binom{x-1}{r-1}p^r(1-p)^{x-r},\ x=r,r+1,\cdotsrp\dfrac rpr(1−p)p2\dfrac{r(1-p)}{p^2}

Continuous random variables

Table 4.3 includes some of the commonly encountered continuous distributions. Uniform distribution describes a random variable uniformly distributed over the interval [a,b][a,b]. Because of the central limit theorem, normal distribution/Gaussian distribution is by far the most popular continuous distribution. Exponential distribution models the arrival time of an event if it has a constant arrival rate λ\lambda. Gamma distribution with parameters (α,λ)(\alpha,\lambda) often arises, in practice, as the distribution of the amount of time one has to wait until a total of nn events occur. Beta distributions are used to model events 88 that are constrained within a defined interval. By adjusting the shape parameters α\alpha and β\beta, it can model different shapes of probability density functions.21

Table 4.3 Probability density function, expected value and variance of continuous random variables
NameProbability density function (pdf)E[X]E[X]var(X)var(X)
Uniform1b−a, a≤x≤b\dfrac1{b-a},\ a\le x\le bb+a2\dfrac{b+a}2(b−a)212\dfrac{(b-a)^2}{12}
Normal12πσe−(x−μ)22σ2, x∈(−∞,∞)\dfrac1{\sqrt{2\pi}\sigma}e^{-\frac{(x-\mu)^2}{2\sigma^2}},\ x\in(-\infty,\infty)μ\muσ2\sigma^2
Exponentialλe−λx, x≥0\lambda e^{-\lambda x},\ x\ge01/λ1/\lambda1/λ21/\lambda^2
Gammaλe−λx(λx)α−1Γ(α), x≥0, Γ(a)=∫0∞e−yya−1\dfrac{\lambda e^{-\lambda x}(\lambda x)^{\alpha-1}}{\Gamma(\alpha)},\ x\ge0,\ \Gamma(a)=\displaystyle\int_0^\infty e^{-y}y^{a-1}α/λ\alpha/\lambdaα/λ2\alpha/\lambda^2
BetaΓ(α+β)Γ(α)Γ(β)xα−1(1−x)β−1, 0<x<1\dfrac{\Gamma(\alpha+\beta)}{\Gamma(\alpha)\Gamma(\beta)}x^{\alpha-1}(1-x)^{\beta-1},\ 0<x<1αα+β\dfrac\alpha{\alpha+\beta}αβ(α+β+1)(α+β)2\dfrac{\alpha\beta}{(\alpha+\beta+1)(\alpha+\beta)^2}

Meeting probability

Two bankers each arrive at the station at some random time between 5:00 am and 6:00 am (arrival time for either banker is uniformly distributed). They stay exactly five minutes and then leave. What is the probability they will meet on a given day?

Solution: Assume banker AA arrives XX minutes after 5:00 am and BB arrives YY minutes after 5:00 am. XX and YY are independent uniform distribution between 0 and 60. Since both only stay exactly five minutes, as shown in Figure 4.4, AA and BB meet if and only if ∣X−Y∣≤5|X-Y|\le5.

So the probability that AA and BB will meet is simply the area of the shadowed region divided by the area of the square (the rest of the region can be combined to a square with size length 55): 60×60−2×(1/2×55×55)60×60=(60+55)×(60−55)60×60=23144\dfrac{60\times60-2\times(1/2\times55\times55)}{60\times60}=\dfrac{(60+55)\times(60-55)}{60\times60}=\dfrac{23}{144}.

89
Square arrival-time distribution with axes X and Y from 0 to 60; shaded diagonal band |X−Y|≤5 labeled A and B meet, and guides at 55.
Figure 4.4 Distributions of Banker A’s and Banker B’s arrival times

Probability of triangle

A stick is cut twice randomly (each cut point follows a uniform distribution on the stick), what is the probability that the 3 segments can form a triangle?22

Solution: Without loss of generality, let’s assume that the length of the stick is 1. Let’s also label the point of the first cut as xx and the second cut as yy.

If x<yx<y, then the three segments are x, y−xx,\ y-x and 1−y1-y. The conditions to form a triangle are

Stick divided into three segments labeled x, y−x and 1−y.
x+(y−x)>1−y⇒y>1/2x+(1−y)>y−x⇒y<1/2+x(y−x)+(1−y)>x⇒x<1/2\begin{aligned}x+(y-x)>1-y&\Rightarrow y>1/2\\x+(1-y)>y-x&\Rightarrow y<1/2+x\\(y-x)+(1-y)>x&\Rightarrow x<1/2\end{aligned}

The feasible area is shown in Figure 4.5. The case for x<yx<y is the left gray triangle. Using symmetry, we can see that the case for x>yx>y is the right gray triangle.

Original scan of cuts X and Y in a unit square, with a diamond connecting side midpoints and gray triangles at the upper corners.
Figure 4.5 Distribution of cuts X and Y
90

The total shadowed area represents the region where 3 segments can form a triangle, which is 1/4 of the square. So the probability is 1/4.

Property of Poisson process

You are waiting for a bus at a bus station. The buses arrive at the station according to a Poisson process with an average arrival time of 10 minutes (λ=0.1/min\lambda=0.1/\text{min}). If the buses have been running for a long time and you arrive at the bus station at a random time, what is your expected waiting time? On average, how many minutes ago did the last bus leave?

Solution: Considering the importance of jump-diffusion processes in derivative pricing and the role of Poisson processes in studying jump processes, let’s elaborate more on exponential random variables and the Poison process. Exponential distribution is widely used to model the time interval between independent events that happen at a constant average rate (arrival rate) λ: f(t)={λe−λt(t≥0)0(t<0)\lambda:\ f(t)=\begin{cases}\lambda e^{-\lambda t}&(t\ge0)\\0&(t<0)\end{cases}. The expected arrival time is 1/λ1/\lambda and the variance is 1/λ21/\lambda^2. Using integration, we can calculate the cdf of an exponential distribution to be F(t)=P(τ≤t)=1−e−τtF(t)=P(\tau\le t)=1-e^{-\tau t} and P(τ>t)=e−τtP(\tau>t)=e^{-\tau t}, where τ\tau is the random variable for arrival time. One unique property of exponential distribution is memorylessness: P{τ>s+t∣τ>s}=P{τ>t}P\{\tau>s+t\mid\tau>s\}=P\{\tau>t\}.23 That means if we have waited for ss time units, the extra waiting time has the same distribution as the waiting time when we start at time 0.

When the arrivals of a series of events each independently follow an exponential distribution with arrival rate λ\lambda, the number of arrivals between time 0 and tt can be modeled as a Poisson process P(N(t)=x)=e−λtλtxx!, x=0,1,⋯P(N(t)=x)=\dfrac{e^{-\lambda t}\lambda t^x}{x!},\ x=0,1,\cdots.24 The expected number of arrivals is λt\lambda t and the variance is also λt\lambda t. Because of the memoryless nature of exponential distribution, the number of arrivals between time ss and tt is also a Poisson process P(N(t−s)=x)=e−λ(t−s)(λ(t−s))xx!P(N(t-s)=x)=\dfrac{e^{-\lambda(t-s)}(\lambda(t-s))^x}{x!}.

Taking advantage of the memoryless property of exponential distribution, we know that the expected waiting time is 1/λ=10 min1/\lambda=10\text{ min}. If you look back in time, the memoryless property stills applies. So on average, the last bus arrived 10 minutes ago as well.

91

This is another example that your intuition may misguide you. You may be wondering that if the last bus on average arrived 10 minutes ago and the next bus on average will arrive 10 minutes later, shouldn’t the average arrival time be 20 minutes instead of 10? The explanation to the apparent discrepancy is that when you arrive at a random time, you are more likely to arrive in a long time interval between two bus arrivals than in a short one. For example, if one interval between two bus arrivals is 30 minutes and another is 5 minutes, you are more likely to arrive at a time during that 30-minute interval rather than 5-minute interval. In fact, if you arrive at a random time, the expected residual life (the time for the next bus to arrive) is E[X2]2E[X]\dfrac{E[X^2]}{2E[X]} for a general distribution.25

Moments of normal distribution

If XX follows standard normal distribution (X∼N(0,1)X\sim N(0,1)), what is E[Xn]E[X^n] for n=1,2,3n=1,2,3 and 4?

Solution: The first to fourth moments of the standard normal distribution are essentially the mean, the variance, the skewness and the kurtosis. So you probably have remembered that the answers are 0, 1, 0 (no skewness), and 3, respectively.

Standard normal distribution has pdf f(x)=12πe−x2/2f(x)=\dfrac1{\sqrt{2\pi}}e^{-x^2/2}. Using simple symmetry we have E[xn]=∫−∞∞xn12πe−x2/2dx=0E[x^n]=\displaystyle\int_{-\infty}^\infty x^n\dfrac1{\sqrt{2\pi}}e^{-x^2/2}dx=0 when nn is odd. For n=2n=2, integration by parts are often used. To solve E[Xn]E[X^n] for any integer nn, an approach using moment generating functions may be a better choice. Moment generating functions are defined as

M(t)=E[etX]={∑xetxp(x),if x is discrete∫−∞∞etxf(x)dx,if x is continuousM(t)=E[e^{tX}]=\begin{cases}\displaystyle\sum_x e^{tx}p(x),&\text{if }x\text{ is discrete}\\\displaystyle\int_{-\infty}^\infty e^{tx}f(x)dx,&\text{if }x\text{ is continuous}\end{cases}

Sequentially taking derivative of M(t)M(t), we get one frequently-used property of M(t)M(t):

M′(t)=ddtE[etX]=E[XetX]⇒M′(0)=E[X],M'(t)=\frac d{dt}E[e^{tX}]=E[Xe^{tX}]\Rightarrow M'(0)=E[X], M′′(t)=ddtE[XetX]=E[X2etX]⇒M′′(0)=E[X2],M''(t)=\frac d{dt}E[Xe^{tX}]=E[X^2e^{tX}]\Rightarrow M''(0)=E[X^2], 92

and Mn(0)=E[Xn], ∀n≥1M^n(0)=E[X^n],\ \forall n\ge1 in general.

We can use this property to solve E[Xn]E[X^n] for X∼N(0,1)X\sim N(0,1). For standard normal distribution M(t)=E[etX]=∫−∞∞etx12πe−x2/2dx=et2/2∫−∞∞12πe−(x−t)2/2dx=et2/2M(t)=E[e^{tX}]=\displaystyle\int_{-\infty}^{\infty}e^{tx}\dfrac1{\sqrt{2\pi}}e^{-x^2/2}dx=e^{t^2/2}\int_{-\infty}^{\infty}\dfrac1{\sqrt{2\pi}}e^{-(x-t)^2/2}dx=e^{t^2/2}.

(12πe−(x−t)2/2\dfrac1{\sqrt{2\pi}}e^{-(x-t)^2/2} is the pdf of normal distribution X∼N(t,1)X\sim N(t,1), so ∫−∞∞f(x)dx=1\displaystyle\int_{-\infty}^{\infty}f(x)dx=1).

Taking derivatives, we have

M′(t)=tet2/2⇒M′(0)=0, M′′(t)=et2/2+t2et2/2⇒M′′(0)=e0=1,M'(t)=te^{t^2/2}\Rightarrow M'(0)=0,\ M''(t)=e^{t^2/2}+t^2e^{t^2/2}\Rightarrow M''(0)=e^0=1, M3(t)=tet2/2+2tet2/2+t3et2/2=3tet2/2+t3et2/2⇒M3(0)=0,M^3(t)=te^{t^2/2}+2te^{t^2/2}+t^3e^{t^2/2}=3te^{t^2/2}+t^3e^{t^2/2}\Rightarrow M^3(0)=0,

and M4(t)=3et2/2+3t2et2/2+3t2et2/2+3t4et2/2⇒M4(0)=3e0=3M^4(t)=3e^{t^2/2}+3t^2e^{t^2/2}+3t^2e^{t^2/2}+3t^4e^{t^2/2}\Rightarrow M^4(0)=3e^0=3.