Probability · further study

Random variables and distributions

A distribution is more than a formula: it says which values are possible, how plausible they are and how far they tend to lie from the centre.

1. From outcomes to numbers

A random variable is a function X:Ω that assigns a number to each outcome. The function itself is fixed; randomness comes from the outcome supplied to it.

Discrete example

Toss two coins and let X be the number of heads. Its possible values are 0, 1 and 2, with probabilities 14,12,14.

Continuous example

A waiting time can take any non-negative real value in the model. Probabilities belong to intervals rather than individual points.

Support

The support is the set of values on which the variable has positive mass or density.

2. Three descriptions of a distribution

ObjectDefinitionUse
Probability mass functionpX(x)=P(X=x)For discrete variables; masses sum to 1.
DensityfX(x)0, total area 1P(aXb)=abfX(x)dx.
Cumulative distribution functionFX(x)=P(Xx)For every random variable; non-decreasing from 0 to 1.
A density is not a probability. It may exceed 1; the area over an interval must lie between 0 and 1. For a continuous variable, a single point has probability zero.

3. Expectation: the balance point

The expected value weights each value by its probability. It is the distribution's balance point and need not itself be an attainable value.

μ=𝔼[X]=xxpX(x) μ=𝔼[X]=+xfX(x)dx

Expectation is linear: 𝔼[aX+b]=a𝔼[X]+b, without any independence assumption.

4. Mean, median, mode and quantiles

For a collection of observed data, measures of centre, position and spread answer different questions and are not interchangeable.

Arithmetic mean

x¯=i=1nxin. It uses every value and is sensitive to extremes. The sample mean can estimate the theoretical mean μ.

Median

After sorting the data, this is the middle value. With an even number of observations it is the mean of the two middle values. It is robust to extremes and skewness.

Mode

The most frequent value. A data set may have no mode or more than one. Mode also applies to non-numerical categories.

Weighted mean

x¯=wixiwi. Use it when observations, marks or groups carry different weights.

Quantiles and quartiles

A quantile of order q leaves roughly a fraction q of the data below it. Q1, the median and Q3 correspond to 25%, 50% and 75%.

Range and interquartile range

The range is maximum minus minimum. The interquartile range IQR=Q3Q1 measures the spread of the middle half and is less sensitive to extremes.

Which centre? Mean is natural for reasonably symmetric data; median is often more informative with long tails or outliers; mode answers “which value is most common?”. Quantile conventions can differ, especially for small samples.

5. Variance and standard deviation

Two distributions can have the same mean but behave very differently. Variance is the mean squared distance from the mean; squaring prevents positive and negative deviations from cancelling.

Var(X)=σ2=𝔼[(Xμ)2] σ2=𝔼[X2]μ2,σ=σ2

Units

Variance uses squared units. The standard deviation returns to the original units, which makes it easier to interpret.

Transformations

Adding a constant does not change spread. Multiplication by a multiplies standard deviation by |a| and variance by a2.

Sums

Variances add for independent variables. In general, the term 2Cov(X,Y) must be included.

Population or sample?

Divide by N when the data are the whole population. To estimate population variance from a sample, divide by n1; Bessel's correction offsets systematic underestimation.

6. Lab: summarise and compare data

Use a dot for decimals, for example 2.5.

Number of values
8
Mean
5
Median
4.5
Mode
4
Range
7
Interquartile range
2
Population variance
4
Standard deviation
2
Sample variance
4.571
Values distributed around their mean Dots represent the data; the vertical line marks the mean.
Large squared deviations matter most: 2 and 9 contribute more than values close to 5.

7. Standardisation and z-scores

A standard score tells us how many standard deviations a value lies from the mean:

z=xμσ

Standardisation produces a variable with mean 0 and variance 1 when the moments exist and σ>0. It does not make a non-normal distribution normal.

8. Common distributions

DistributionModelSupportMean; variance
Bernoulli Ber(p)One success/failure trial{0,1}p;p(1p)
Binomial Bin(n,p)Successes in independent trials0,,nnp;np(1p)
Geometric Geo(p)Trials until first success1,2,1p;1pp2
Poisson Pois(λ)Events at a constant average rate0,1,λ;λ
Uniform U(a,b)Equal-length intervals are equally likely[a,b]a+b2;(ba)212
Exponential Exp(λ)Waiting time between Poisson eventsx01λ;1λ2
Normal N(μ,σ2)Sums of many small effectsμ;σ2
Assumptions are part of the model. A binomial distribution needs a fixed number of independent trials with a constant success probability; a Poisson model needs a stable rate and independent occurrences.

See concrete examples and distribution simulations →

9. Lab: change the parameters

Mean
5
Variance
2.5
Standard deviation
1.581
Chart of the selected distribution The chart changes as the parameters change.
The binomial distribution counts successes in a fixed number of independent trials.

10. How to choose a distribution

  1. What is measured?Yes/no outcome → Bernoulli; successes in fixed trials → binomial; events in an interval → Poisson; waiting time → geometric or exponential.
  2. Does the support fit?A count cannot be negative. A normal model allows every real value and may be unsuitable near a physical boundary.
  3. Which assumptions are being made?Check independence, a constant probability or rate, a fixed trial count and whether the quantity is discrete or continuous.
  4. What do the parameters mean?Write them in the problem's units. For a normal distribution, the second parameter is often variance σ2, not standard deviation.