Random Variables and Distributions

Definition of a Random Variable

The Concept of a Random Variable

Random Variable

Let Ω\Omega be the sample space of a random experiment. If for every sample point ω\omega in Ω\Omega there is a real number X(ω)X(\omega) corresponding to it, then X(ω)X(\omega) is called a random variable, abbreviated as XX.

Classification of Random Variables

Classification:

  1. Discrete random variable: a random variable whose values are finitely many or countably infinitely many
  2. Continuous random variable: a random variable whose values are all real numbers on some interval
  3. Mixed random variable: a random variable that is neither discrete nor continuous

Examples of Random Variables

Example 1: rolling a die, with XX denoting the number that appears

  • XX is a discrete random variable
  • The possible values of XX are: 1,2,3,4,5,61, 2, 3, 4, 5, 6

Example 2: measuring the length of an object, with XX denoting the measurement result

  • XX is a continuous random variable
  • The possible values of XX are: [0,+∞)[0, +\infty)

Example 3: tossing a coin, with XX denoting the number of heads that appear

  • XX is a discrete random variable
  • The possible values of XX are: 0,10, 1

Distribution Law of a Discrete Random Variable

Definition of the Distribution Law

Distribution Law

Let XX be a discrete random variable whose possible values are x1,x2,…,xn,…x_1, x_2, \dots, x_n, \dots. Then: P(X=xi)=pi,i=1,2,…,n,…P(X = x_i) = p_i, \quad i = 1, 2, \dots, n, \dots

is called the distribution law or probability distribution of XX.

Properties of the Distribution Law

Property 1: pi≥0p_i \geq 0, i=1,2,…i = 1, 2, \dots

Property 2: ∑i=1∞pi=1\sum_{i=1}^{\infty} p_i = 1

Ways of Representing the Distribution Law

Method 1: tabular form

XXx1x_1x2x_2…\dotsxnx_n…\dots
PPp1p_1p2p_2…\dotspnp_n…\dots

Method 2: formula form P(X=xi)=pi,i=1,2,…P(X = x_i) = p_i, \quad i = 1, 2, \dots

Examples of Distribution Laws

Example 4: rolling a fair die, with XX denoting the number that appears

  • Distribution law: P(X=i)=16P(X = i) = \frac{1}{6}, i=1,2,3,4,5,6i = 1, 2, 3, 4, 5, 6

Example 5: tossing a coin, with XX denoting the number of heads that appear

  • Distribution law: P(X=0)=12P(X = 0) = \frac{1}{2}, P(X=1)=12P(X = 1) = \frac{1}{2}

Probability Density Function of a Continuous Random Variable

Definition of the Probability Density Function

Probability Density Function

Let XX be a continuous random variable. If there exists a non-negative function f(x)f(x) such that for any real numbers a<ba < b: P(a<X≤b)=∫abf(x)dxP(a < X \leq b) = \int_a^b f(x) dx

then f(x)f(x) is called the probability density function of XX, or simply the density function.

Properties of the Probability Density Function

Property 1: f(x)≥0f(x) \geq 0, −∞<x<+∞-\infty < x < +\infty

Property 2: ∫−∞+∞f(x)dx=1\int_{-\infty}^{+\infty} f(x) dx = 1

Property 3: P(a<X≤b)=∫abf(x)dxP(a < X \leq b) = \int_a^b f(x) dx

Examples of Probability Density Functions

Example 6: a random variable uniformly distributed on the interval [0,1][0, 1]

  • Density function: f(x)={1,0≤x≤10,otherwisef(x) = \begin{cases} 1, & 0 \leq x \leq 1 \\ 0, & \text{otherwise} \end{cases}

Example 7: a random variable with the standard normal distribution

  • Density function: f(x)=12πe−x22f(x) = \frac{1}{\sqrt{2\pi}} e^{-\frac{x^2}{2}}, −∞<x<+∞-\infty < x < +\infty

Distribution Function

Definition of the Distribution Function

Distribution Function

Let XX be a random variable. The function: F(x)=P(X≤x),−∞<x<+∞F(x) = P(X \leq x), \quad -\infty < x < +\infty

is called the distribution function of XX.

Properties of the Distribution Function

Property 1: 0≤F(x)≤10 \leq F(x) \leq 1, −∞<x<+∞-\infty < x < +\infty

Property 2: F(x)F(x) is a non-decreasing function

Property 3: lim⁡x→−∞F(x)=0\lim_{x \to -\infty} F(x) = 0, lim⁡x→+∞F(x)=1\lim_{x \to +\infty} F(x) = 1

Property 4: F(x)F(x) is a right-continuous function

Relation Between the Distribution Function and the Distribution Law

Discrete random variable: F(x)=∑xi≤xP(X=xi)F(x) = \sum_{x_i \leq x} P(X = x_i)

Relation Between the Distribution Function and the Density Function

Continuous random variable: F(x)=∫−∞xf(t)dtF(x) = \int_{-\infty}^x f(t) dt

Derivative relation: f(x)=F′(x)f(x) = F'(x)

Examples of Distribution Functions

Example 8: the distribution function of a die roll

F(x)={0,x<116,1≤x<226,2≤x<336,3≤x<446,4≤x<556,5≤x<61,x≥6F(x) = \begin{cases} 0, & x < 1 \\ \frac{1}{6}, & 1 \leq x < 2 \\ \frac{2}{6}, & 2 \leq x < 3 \\ \frac{3}{6}, & 3 \leq x < 4 \\ \frac{4}{6}, & 4 \leq x < 5 \\ \frac{5}{6}, & 5 \leq x < 6 \\ 1, & x \geq 6 \end{cases}

Example 9: the distribution function of the uniform distribution [0,1][0, 1]

F(x)={0,x<0x,0≤x<11,x≥1F(x) = \begin{cases} 0, & x < 0 \\ x, & 0 \leq x < 1 \\ 1, & x \geq 1 \end{cases}

Common Discrete Distributions

Two-Point Distribution (Bernoulli Distribution)

Two-Point Distribution

If the random variable XX takes only the two values 00 and 11, with P(X=1)=pP(X = 1) = p and P(X=0)=1−pP(X = 0) = 1-p, then XX is said to follow the two-point distribution with parameter pp, denoted by X∼B(1,p)X \sim B(1, p).

Distribution law: P(X=k)=pk(1−p)1−k,k=0,1P(X = k) = p^k(1-p)^{1-k}, \quad k = 0, 1

Binomial Distribution

Binomial Distribution

If the random variable XX denotes the number of occurrences of event AA in nn independent repeated trials, and P(A)=pP(A) = p in every trial, then XX is said to follow the binomial distribution with parameters n,pn, p, denoted by X∼B(n,p)X \sim B(n, p).

Distribution law: P(X=k)=Cnkpk(1−p)n−k,k=0,1,2,…,nP(X = k) = C_n^k p^k(1-p)^{n-k}, \quad k = 0, 1, 2, \dots, n

Poisson Distribution

Poisson Distribution

If the distribution law of the random variable XX is: P(X=k)=λkk!e−λ,k=0,1,2,…P(X = k) = \frac{\lambda^k}{k!} e^{-\lambda}, \quad k = 0, 1, 2, \dots

then XX is said to follow the Poisson distribution with parameter λ\lambda, denoted by X∼P(λ)X \sim P(\lambda).

Common Continuous Distributions

Uniform Distribution

Uniform Distribution

If the probability density function of the random variable XX is:

f(x)={1b−a,a≤x≤b0,otherwisef(x) = \begin{cases} \frac{1}{b-a}, & a \leq x \leq b \\ 0, & \text{otherwise} \end{cases}

then XX is said to follow the uniform distribution on the interval [a,b][a, b], denoted by X∼U(a,b)X \sim U(a, b).

Exponential Distribution

Exponential Distribution

If the probability density function of the random variable XX is:

f(x)={λe−λx,x≥00,x<0f(x) = \begin{cases} \lambda e^{-\lambda x}, & x \geq 0 \\ 0, & x < 0 \end{cases}

then XX is said to follow the exponential distribution with parameter λ\lambda, denoted by X∼E(λ)X \sim E(\lambda).

Normal Distribution

Normal Distribution

If the probability density function of the random variable XX is: f(x)=12πσe−(x−μ)22σ2,−∞<x<+∞f(x) = \frac{1}{\sqrt{2\pi}\sigma} e^{-\frac{(x-\mu)^2}{2\sigma^2}}, \quad -\infty < x < +\infty

then XX is said to follow the normal distribution with parameters μ,σ2\mu, \sigma^2, denoted by X∼N(μ,σ2)X \sim N(\mu, \sigma^2).

Exercises

Exercise 1

Given the distribution law P(X=1)=0.2,P(X=2)=0.5,P(X=3)=0.3P(X=1)=0.2, P(X=2)=0.5, P(X=3)=0.3 of the random variable XX, find the distribution function of XX.

distribution functiondefinition and computationcontinuous random variable

Approach: Compute from the definition of the distribution function.

Steps:

  1. F(x)=P(X≤x)=∑xi≤xP(X=xi)F(x) = P(X \leq x) = \sum_{x_i \leq x} P(X = x_i)
  2. When x<1x < 1, F(x)=0F(x) = 0
  3. When 1≤x<21 \leq x < 2, F(x)=P(X=1)=0.2F(x) = P(X = 1) = 0.2
  4. When 2≤x<32 \leq x < 3, F(x)=P(X=1)+P(X=2)=0.2+0.5=0.7F(x) = P(X = 1) + P(X = 2) = 0.2 + 0.5 = 0.7
  5. When x≥3x \geq 3, F(x)=P(X=1)+P(X=2)+P(X=3)=0.2+0.5+0.3=1F(x) = P(X = 1) + P(X = 2) + P(X = 3) = 0.2 + 0.5 + 0.3 = 1

Answer:

F(x)={0,x<10.2,1≤x<20.7,2≤x<31,x≥3F(x) = \begin{cases} 0, & x < 1 \\ 0.2, & 1 \leq x < 2 \\ 0.7, & 2 \leq x < 3 \\ 1, & x \geq 3 \end{cases}

Exercise 2

Given that the distribution function of the random variable XX is F(x)={0,x<0x,0≤x<11,x≥1F(x)=\begin{cases} 0, x<0 \\ x, 0\leq x<1 \\ 1, x\geq1 \end{cases}, find the probability density function of XX.

probability density functiondistribution functioncontinuous random variable

Approach: Use the fact that the density function is the derivative of the distribution function.

Steps:

  1. f(x)=F′(x)f(x) = F'(x)
  2. When x<0x < 0, F(x)=0F(x) = 0, so f(x)=0f(x) = 0
  3. When 0≤x<10 \leq x < 1, F(x)=xF(x) = x, so f(x)=1f(x) = 1
  4. When x≥1x \geq 1, F(x)=1F(x) = 1, so f(x)=0f(x) = 0

Answer:

f(x)={1,0≤x<10,otherwisef(x) = \begin{cases} 1, & 0 \leq x < 1 \\ 0, & \text{otherwise} \end{cases}

Exercise 3

Roll two dice, with XX denoting the sum of the numbers on the two dice. Find the distribution law of XX.

definition of probabilityclassical probability modelrandom experiment

Approach: List all possible outcomes and compute their probabilities.

Steps:

  1. The possible values of the sum of the two dice are: 2,3,4,5,6,7,8,9,10,11,122, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
  2. Compute the probability of each case:
    • P(X=2)=136P(X = 2) = \frac{1}{36} (only the case (1,1))
    • P(X=3)=236P(X = 3) = \frac{2}{36} (the cases (1,2), (2,1))
    • P(X=4)=336P(X = 4) = \frac{3}{36} (the cases (1,3), (2,2), (3,1))
    • and so on…

Answer:

XX23456789101112
PP136\frac{1}{36}236\frac{2}{36}336\frac{3}{36}436\frac{4}{36}536\frac{5}{36}636\frac{6}{36}536\frac{5}{36}436\frac{4}{36}336\frac{3}{36}236\frac{2}{36}136\frac{1}{36}

Exercise 4

Given that the random variable XX follows an exponential distribution with parameter λ\lambda, find the distribution function of XX.

probability density functiondistribution functioncontinuous random variable

Approach: Use the relation between the distribution function and the density function.

Steps:

  1. The density function of the exponential distribution: f(x)={λe−λx,x≥00,x<0f(x) = \begin{cases} \lambda e^{-\lambda x}, & x \geq 0 \\ 0, & x < 0 \end{cases}
  2. The distribution function: F(x)=∫−∞xf(t)dtF(x) = \int_{-\infty}^x f(t) dt
  3. When x<0x < 0, F(x)=0F(x) = 0
  4. When x≥0x \geq 0, F(x)=∫0xλe−λtdt=1−e−λxF(x) = \int_0^x \lambda e^{-\lambda t} dt = 1 - e^{-\lambda x}

Answer:

F(x)={0,x<01−e−λx,x≥0F(x) = \begin{cases} 0, & x < 0 \\ 1 - e^{-\lambda x}, & x \geq 0 \end{cases}

Exercise 5

Prove that for any random variable XX, its distribution function F(x)F(x) satisfies 0≤F(x)≤10 \leq F(x) \leq 1.

distribution functionpropertiesproof

Approach: Use the definition of the distribution function and the properties of probability.

Steps:

  1. F(x)=P(X≤x)F(x) = P(X \leq x)
  2. By the non-negativity of probability, P(X≤x)≥0P(X \leq x) \geq 0, so F(x)≥0F(x) \geq 0
  3. By the normalization of probability, P(X≤x)≤1P(X \leq x) \leq 1, so F(x)≤1F(x) \leq 1
  4. Therefore 0≤F(x)≤10 \leq F(x) \leq 1

Answer: the proof is complete

Found an issue with this content?

Tell us what could be improved.