2. Review of Probability and Statistics

A recap of the probability and statistics needed for simulation: probability axioms, random variables, convergence modes, stochastic processes, and estimation of means and variances.

2.1. Axioms of Probability

  • Sample space Ω\Omega: the collection of all outcomes of a random experiment. Each element ωΩ\omega \in \Omega is called a sample point.
  • Event: any subset of the sample space, AΩA \subseteq \Omega.
  • Probability: a function that assigns to each event AA a number P(A)P(A). It is not an arbitrary function; it must satisfy the following axioms:
    1. 0P(A)10 \le P(A) \le 1
    2. P(Ω)=1P(\Omega) = 1
    3. If A1,A2,A_1, A_2, \dots are pairwise disjoint (AiAj=A_i \cap A_j = \emptyset for iji \ne j), then P(i=1Ai)=i=1P(Ai)P\left(\bigcup_{i=1}^\infty A_i\right) = \sum_{i=1}^\infty P(A_i).

2.2. Random Variables and Their Properties

A random variable is a function that assigns to each ωΩ\omega \in \Omega a numerical value: X:Ω(,)X : \Omega \to (-\infty, \infty).

The cumulative distribution function (c.d.f.) is

F(x)=P(Xx)=P({ω:X(ω)x}).F(x) = P(X \le x) = P(\{\omega : X(\omega) \le x\}).

Properties:

  1. FF is non-decreasing in xx, and right-continuous with left limits. At a jump, the value at the point equals the value after the jump: F(x0)=F(x0+)F(x_0) = F(x_0^+).

    x₀ F(x₀⁻) F(x₀) jump = P(X = x₀)
  2. limxF(x)=1\lim_{x \to \infty} F(x) = 1, limxF(x)=0\lim_{x \to -\infty} F(x) = 0

  3. P(a<Xb)=F(b)F(a)P(a < X \le b) = F(b) - F(a)

2.2.1. Two types of random variables

Discrete: XX takes a countable number of different values. A discrete r.v. is described by its probability mass function (p.m.f.) pX(x)=P(X=x)p_X(x) = P(X = x):

  1. 0pX(x)10 \le p_X(x) \le 1
  2. all xpX(x)=1\sum_{\text{all } x} p_X(x) = 1
  3. F(x)=P(Xx)=yxpX(y)F(x) = P(X \le x) = \sum_{y \le x} p_X(y)
  4. pX(x)=F(x)F(x)p_X(x) = F(x) - F(x^-) (value right after the jump minus value right before the jump)

Continuous: there exists a function ff (the probability density function, p.d.f.) such that F(x)=xf(y)dyF(x) = \int_{-\infty}^{x} f(y)\,dy:

  1. f(x)0f(x) \ge 0
  2. f(x)dx=1\int_{-\infty}^{\infty} f(x)\,dx = 1
  3. P(aXb)=abf(x)dxP(a \le X \le b) = \int_a^b f(x)\,dx
  4. dF(x)dx=f(x)\dfrac{dF(x)}{dx} = f(x)

2.2.2. Expectation and variance

Expectation of a r.v.:

E[X]={all xxpX(x)X discretexf(x)dxX continuous\mathbf{E}[X] = \begin{cases} \displaystyle\sum_{\text{all } x} x\, p_X(x) & X \text{ discrete} \\[6pt] \displaystyle\int_{-\infty}^{\infty} x\, f(x)\,dx & X \text{ continuous} \end{cases}

Expectation of a function of a r.v., Y=g(X)Y = g(X):

E[Y]={all yypY(y)=all xg(x)pX(x)X discreteyfY(y)dy=g(x)fX(x)dxX continuous\mathbf{E}[Y] = \begin{cases} \displaystyle\sum_{\text{all } y} y\, p_Y(y) = \sum_{\text{all } x} g(x)\, p_X(x) & X \text{ discrete} \\[6pt] \displaystyle\int_{-\infty}^{\infty} y\, f_Y(y)\,dy = \int_{-\infty}^{\infty} g(x)\, f_X(x)\,dx & X \text{ continuous} \end{cases}

Variance:

Var(X)=E[(XE[X])2]={all x(xE[X])2pX(x)X discrete(xE[X])2f(x)dxX continuous=E[X2](E[X])2\begin{aligned} \operatorname{Var}(X) &= \mathbf{E}\left[(X - \mathbf{E}[X])^2\right] \\ &= \begin{cases} \displaystyle\sum_{\text{all } x} (x - \mathbf{E}[X])^2\, p_X(x) & X \text{ discrete} \\[6pt] \displaystyle\int_{-\infty}^{\infty} (x - \mathbf{E}[X])^2\, f(x)\,dx & X \text{ continuous} \end{cases} \\ &= \mathbf{E}[X^2] - \left(\mathbf{E}[X]\right)^2 \end{aligned}

Standard deviation: Var(X)\sqrt{\operatorname{Var}(X)}.

2.3. Bivariate Random Variables

Let X:ΩRX : \Omega \to \mathbb{R} and Y:ΩRY : \Omega \to \mathbb{R} be two r.v.s. The pair (X,Y)(X, Y) is called a bivariate r.v., described by the joint c.d.f.

F(x,y)=P(Xx,  Yy).F(x, y) = P(X \le x,\; Y \le y).

Marginal c.d.f.s

FX(x)=P(Xx)=limyF(x,y),FY(y)=P(Yy)=limxF(x,y).\begin{aligned} F_X(x) &= P(X \le x) = \lim_{y \to \infty} F(x, y), \\ F_Y(y) &= P(Y \le y) = \lim_{x \to \infty} F(x, y). \end{aligned}

Discrete case. Joint p.m.f. and marginals:

p(x,y)=P(X=x,  Y=y),pX(x)=all yp(x,y),pY(y)=all xp(x,y).\begin{aligned} p(x, y) &= P(X = x,\; Y = y), \\ p_X(x) &= \sum_{\text{all } y} p(x, y), \qquad p_Y(y) = \sum_{\text{all } x} p(x, y). \end{aligned}

Conditional p.m.f. of XX given Y=yY = y:

pXY(xy)=p(x,y)pY(y),pY(y)>0.p_{X \mid Y}(x \mid y) = \frac{p(x, y)}{p_Y(y)}, \qquad p_Y(y) > 0.

Continuous case. Joint p.d.f. ff and marginals:

F(x,y)=xyf(u,v)dvdu,fX(x)=f(x,y)dy,fY(y)=f(x,y)dx.\begin{aligned} F(x, y) &= \int_{-\infty}^{x} \int_{-\infty}^{y} f(u, v)\,dv\,du, \\ f_X(x) &= \int_{-\infty}^{\infty} f(x, y)\,dy, \qquad f_Y(y) = \int_{-\infty}^{\infty} f(x, y)\,dx. \end{aligned}

Conditional p.d.f. of XX given Y=yY = y:

fXY(xy)=f(x,y)fY(y),fY(y)>0.f_{X \mid Y}(x \mid y) = \frac{f(x, y)}{f_Y(y)}, \qquad f_Y(y) > 0.

Independence. XX and YY are independent iff F(x,y)=FX(x)FY(y)F(x, y) = F_X(x)\, F_Y(y) for all x,yx, y; equivalently

  • discrete: p(x,y)=pX(x)pY(y)p(x, y) = p_X(x)\, p_Y(y)
  • continuous: f(x,y)=fX(x)fY(y)f(x, y) = f_X(x)\, f_Y(y)

Expectation of Z=g(X,Y)Z = g(X, Y):

E[Z]=E[g(X,Y)]={all xall yg(x,y)p(x,y)discreteg(x,y)f(x,y)dxdycontinuous\mathbf{E}[Z] = \mathbf{E}[g(X, Y)] = \begin{cases} \displaystyle\sum_{\text{all } x}\sum_{\text{all } y} g(x, y)\, p(x, y) & \text{discrete} \\[6pt] \displaystyle\int_{-\infty}^{\infty}\int_{-\infty}^{\infty} g(x, y)\, f(x, y)\,dx\,dy & \text{continuous} \end{cases}

Covariance

cov(X,Y)=E[(XE[X])(YE[Y])]=E[XY]E[X]E[Y].\begin{aligned} \operatorname{cov}(X, Y) &= \mathbf{E}\left[(X - \mathbf{E}[X])(Y - \mathbf{E}[Y])\right] \\ &= \mathbf{E}[XY] - \mathbf{E}[X]\,\mathbf{E}[Y]. \end{aligned}

  • If X=YX = Y, then cov(X,Y)=Var(X)\operatorname{cov}(X, Y) = \operatorname{Var}(X).
  • If XX and YY are independent, then cov(X,Y)=0\operatorname{cov}(X, Y) = 0, i.e. E[XY]=E[X]E[Y]\mathbf{E}[XY] = \mathbf{E}[X]\,\mathbf{E}[Y].
  • The converse fails in general: cov(X,Y)=0⇏\operatorname{cov}(X, Y) = 0 \not\Rightarrow independence. But if (X,Y)(X, Y) is jointly normal, then cov(X,Y)=0    X\operatorname{cov}(X, Y) = 0 \iff X and YY are independent.
  • cov>0\operatorname{cov} > 0: positively correlated — when XX is above its mean, YY tends to be above its mean (and below with below).
  • cov<0\operatorname{cov} < 0: negatively correlated — when XX is above its mean, YY tends to be below its mean.

Correlation coefficient

corr(X,Y)=cov(X,Y)Var(X)Var(Y)[1,1].\operatorname{corr}(X, Y) = \frac{\operatorname{cov}(X, Y)}{\sqrt{\operatorname{Var}(X)}\,\sqrt{\operatorname{Var}(Y)}} \in [-1, 1].

2.4. Convergence Modes

Let X1,X2,X_1, X_2, \dots be a sequence of r.v.s. Each XnX_n is a function Xn(ω)X_n(\omega), so “converge to X(ω)X^*(\omega)” is not the ordinary limit of a sequence of numbers like limn1/n=0\lim_{n \to \infty} 1/n = 0; we need to say in what sense the functions converge.

Convergence with probability 1 (a.s. convergence, strong convergence).
Here XnX_n is still a random variable, so the statement is a probability:

P({ω:limnXn(ω)=X(ω)})=1.P\left(\left\{\omega : \lim_{n \to \infty} X_n(\omega) = X^*(\omega)\right\}\right) = 1.

For almost every sampled ω\omega, plugging it into XnX_n gives a sequence of numbers that converges to X(ω)X^*(\omega). The equality may fail on a set of ω\omega of probability zero (e.g. on Ω=[0,1]\Omega = [0,1] with the uniform measure, failing only at ω=0.5\omega = 0.5 still gives probability 1).

Convergence in distribution (weak convergence).
Let FnF_n be the c.d.f. of XnX_n and FF^* the c.d.f. of XX^*. These are ordinary functions, not random, so we take the limit directly:

limnFn(x)=F(x)at all continuity points x of F.\lim_{n \to \infty} F_n(x) = F^*(x) \quad \text{at all continuity points } x \text{ of } F^*.

Theorem (Strong Law of Large Numbers, SLLN).
Let X1,X2,X_1, X_2, \dots be i.i.d. with EX1<\mathbf{E}|X_1| < \infty and E[X1]=μ\mathbf{E}[X_1] = \mu. Let Xˉn=1ni=1nXi\bar{X}_n = \frac{1}{n}\sum_{i=1}^n X_i. Then Xˉnμ\bar{X}_n \to \mu with probability 1:

P({ω:limn1ni=1nXi(ω)=μ})=1.P\left(\left\{\omega : \lim_{n \to \infty} \frac{1}{n}\sum_{i=1}^{n} X_i(\omega) = \mu\right\}\right) = 1.

This is exactly the first mode, with limit XμX^* \equiv \mu a constant random variable. The only assumption is that the mean exists; the variance may be infinite.

(Contrast the Weak LLN, which only gives convergence in probability: P(Xˉnμ>ε)0P(|\bar{X}_n - \mu| > \varepsilon) \to 0 for each fixed ε>0\varepsilon > 0. This is weaker — it does not say that any individual sample path settles down.)

Theorem (Central Limit Theorem, CLT).
Let X1,X2,X_1, X_2, \dots be i.i.d. with E[X1]=μ\mathbf{E}[X_1] = \mu and 0<Var(X1)=σ2<0 < \operatorname{Var}(X_1) = \sigma^2 < \infty. Define

Zn=Xˉnμσ/n,Fn(x)=P(Znx).Z_n = \frac{\bar{X}_n - \mu}{\sigma / \sqrt{n}}, \qquad F_n(x) = P(Z_n \le x).

Then ZnN(0,1)Z_n \to N(0, 1) in distribution:

limnFn(x)=Φ(x)for all x,\lim_{n \to \infty} F_n(x) = \Phi(x) \quad \text{for all } x,

where Φ\Phi is the N(0,1)N(0,1) c.d.f. (Since Φ\Phi is continuous everywhere, every xx is a continuity point.)

Why these two are the canonical examples. Same setup, two different questions, two different modes:

SLLN CLT
object Xˉn\bar{X}_n itself rescaled fluctuation n(Xˉnμ)/σ\sqrt{n}(\bar{X}_n - \mu)/\sigma
mode with probability 1 (strong) in distribution (weak)
limit constant μ\mu N(0,1)N(0, 1)
needs EX1<\mathbf{E}\lvert X_1\rvert < \infty Var(X1)<\operatorname{Var}(X_1) < \infty

SLLN says the average lands on μ\mu; CLT says how it wobbles on the way in — at scale 1/n1/\sqrt{n}. CLT cannot be strengthened to a.s. convergence: for any fixed ω\omega, Zn(ω)Z_n(\omega) does not settle down but keeps oscillating forever. Only its distribution stabilizes. This illustrates that weak convergence is genuinely weaker, not just a technical relaxation.

2.5. Stochastic Processes

A stochastic process is a collection of r.v.s {X(t):tT}\{X(t) : t \in T\} indexed by tt, which usually represents time.

  • If TT is discrete / continuous, we have a discrete-time / continuous-time process.
  • If the values X(t)X(t) take are discrete / continuous, we have a discrete-state / continuous-state process.

Example: single-server FCFS queue. Interarrival times X1,X2,X_1, X_2, \dots are i.i.d. and service times Y1,Y2,Y_1, Y_2, \dots are i.i.d. Let DiD_i be the delay of the ii-th customer. Then D1=0D_1 = 0 and

Dn+1=max{Dn+YnXn+1,  0}(Lindley’s equation).D_{n+1} = \max\{D_n + Y_n - X_{n+1},\; 0\} \qquad \text{(Lindley's equation)}.

For instance D2=max{Y1X2,0}D_2 = \max\{Y_1 - X_2, 0\}: customer 2 waits only if customer 1’s service outlasts the gap between the two arrivals. {Dn}\{D_n\} is a discrete-time, continuous-state process.

Example: Poisson process. Let SnS_n be the arrival time of the nn-th customer, S0=0S_0 = 0, and let the interarrival times Xn=SnSn1X_n = S_n - S_{n-1} be i.i.d. Exp(λ)\text{Exp}(\lambda), so Sn=i=1nXiS_n = \sum_{i=1}^n X_i. The number of arrivals up to time tt is

N(t)=max{n:Snt}.N(t) = \max\{n : S_n \le t\}.

{N(t):t0}\{N(t) : t \ge 0\} is a continuous-time, discrete-state process, called a Poisson process with rate λ\lambda.

2.6. Estimation of Means and Variances

Let X1,,XnX_1, \dots, X_n be i.i.d. with mean μ\mu and variance σ2\sigma^2.

Sample mean

Xˉ(n)=X1+X2++Xnn,E[Xˉ(n)]=μ,\bar{X}(n) = \frac{X_1 + X_2 + \cdots + X_n}{n}, \qquad \mathbf{E}[\bar{X}(n)] = \mu,

so Xˉ(n)\bar{X}(n) is an unbiased estimator of μ\mu.

Sample variance

S2(n)=1n1i=1n(XiXˉ(n))2,E[S2(n)]=σ2,S^2(n) = \frac{1}{n-1}\sum_{i=1}^n \left(X_i - \bar{X}(n)\right)^2, \qquad \mathbf{E}[S^2(n)] = \sigma^2,

so S2(n)S^2(n) is an unbiased estimator of σ2\sigma^2.

Both Xˉ(n)\bar{X}(n) and S2(n)S^2(n) are point estimators, and both are themselves random variables.

Idea. Replace the point estimator by an interval estimator (confidence interval), so that one can assert with a certain degree of confidence that the interval contains the true mean μ\mu.

2.6.1. Confidence Intervals

Case 1. Population distribution arbitrary, σ2\sigma^2 known.

Notation. Let ZN(0,1)Z \sim N(0,1) and define the upper α\alpha-quantile zαz_\alpha by

P(Z>zα)=α.P(Z > z_\alpha) = \alpha.

zα 0 N(0, 1) area = α

By symmetry of the standard normal, P(Z<zα)=αP(Z < -z_\alpha) = \alpha, and hence

P(zα/2Zzα/2)=1α.P\left(-z_{\alpha/2} \le Z \le z_{\alpha/2}\right) = 1 - \alpha.

Derivation. By the Central Limit Theorem, for large nn,

Xˉ(n)μσ/n    ZN(0,1).\frac{\bar{X}(n) - \mu}{\sigma / \sqrt{n}} \;\approx\; Z \sim N(0,1).

Therefore

P(zα/2Xˉ(n)μσ/nzα/2)    P(zα/2Zzα/2)=1α.P\left(-z_{\alpha/2} \le \frac{\bar{X}(n) - \mu}{\sigma/\sqrt{n}} \le z_{\alpha/2}\right) \;\approx\; P\left(-z_{\alpha/2} \le Z \le z_{\alpha/2}\right) = 1 - \alpha.

Rearranging the event inside the probability,

zα/2Xˉ(n)μσ/nzα/2    Xˉ(n)zα/2σnμXˉ(n)+zα/2σn.-z_{\alpha/2} \le \frac{\bar{X}(n) - \mu}{\sigma/\sqrt{n}} \le z_{\alpha/2} \iff \bar{X}(n) - z_{\alpha/2}\frac{\sigma}{\sqrt{n}} \le \mu \le \bar{X}(n) + z_{\alpha/2}\frac{\sigma}{\sqrt{n}}.

Conclusion. An approximate 100(1α)%100(1-\alpha)\% confidence interval for μ\mu is

[Xˉ(n)zα/2σn,  Xˉ(n)+zα/2σn].\left[\, \bar{X}(n) - z_{\alpha/2}\frac{\sigma}{\sqrt{n}},\; \bar{X}(n) + z_{\alpha/2}\frac{\sigma}{\sqrt{n}} \,\right].

Case 2. Population normal, σ2\sigma^2 unknown.

Notation. Let Ttn1T \sim t_{n-1} (Student’s tt with n1n-1 degrees of freedom) and define tα,n1t_{\alpha,\,n-1} by

P(T>tα,n1)=α.P(T > t_{\alpha,\,n-1}) = \alpha.

Since the tt distribution is symmetric about 00,

P(tα/2,n1Ttα/2,n1)=1α.P\left(-t_{\alpha/2,\,n-1} \le T \le t_{\alpha/2,\,n-1}\right) = 1 - \alpha.

Derivation. Let X1,,Xni.i.d.N(μ,σ2)X_1, \dots, X_n \overset{\text{i.i.d.}}{\sim} N(\mu, \sigma^2) with σ2\sigma^2 unknown, and estimate σ2\sigma^2 by S2(n)S^2(n). Replacing σ\sigma by S(n)S(n) in the standardized mean gives

Xˉ(n)μS(n)/n    tn1\frac{\bar{X}(n) - \mu}{S(n)/\sqrt{n}} \;\sim\; t_{n-1}

exactly (not just approximately), because Xˉ(n)\bar{X}(n) and S2(n)S^2(n) are independent under normality, with (n1)S2(n)σ2χn12\frac{(n-1)S^2(n)}{\sigma^2} \sim \chi^2_{n-1}. Hence

P(tα/2,n1Xˉ(n)μS(n)/ntα/2,n1)=1α,P\left(-t_{\alpha/2,\,n-1} \le \frac{\bar{X}(n) - \mu}{S(n)/\sqrt{n}} \le t_{\alpha/2,\,n-1}\right) = 1 - \alpha,

and rearranging as in Case 1 gives:

Conclusion. An exact 100(1α)%100(1-\alpha)\% confidence interval for μ\mu is

[Xˉ(n)tα/2,n1S(n)n,  Xˉ(n)+tα/2,n1S(n)n].\left[\, \bar{X}(n) - t_{\alpha/2,\,n-1}\frac{S(n)}{\sqrt{n}},\; \bar{X}(n) + t_{\alpha/2,\,n-1}\frac{S(n)}{\sqrt{n}} \,\right].

Comparison of the two intervals.

zα/2 tα/2, n−1 N(0, 1) t (dashed): heavier tails

For every nn and every α(0,1)\alpha \in (0,1),

tα/2,n1  >  zα/2,t_{\alpha/2,\,n-1} \;>\; z_{\alpha/2},

because the tn1t_{n-1} distribution has heavier tails than N(0,1)N(0,1). Consequently the tt-interval is wider than the zz-interval with the same S(n)S(n): the extra width is the price of estimating σ\sigma from the data rather than knowing it.

As nn \to \infty, tn1N(0,1)t_{n-1} \to N(0,1) and so tα/2,n1zα/2t_{\alpha/2,\,n-1} \downarrow z_{\alpha/2}; the two intervals coincide in the limit. In practice the difference is negligible for n30n \gtrsim 30.

Which is “better” depends on what is known:

  • σ2\sigma^2 known (Case 1): use zα/2z_{\alpha/2}. The interval is narrower, but only approximately at level 1α1-\alpha unless the population is normal.
  • σ2\sigma^2 unknown and population normal (Case 2): use tα/2,n1t_{\alpha/2,\,n-1}. The interval is exactly at level 1α1-\alpha; substituting zα/2z_{\alpha/2} here would give an interval that is too narrow and under-covers μ\mu, especially for small nn.

2.6.2. Hypothesis Testing Concerning the Mean

Goal: determine whether a claim about μ\mu is true or not.

H0:μ=μ0(null hypothesis)vs.H1:μμ0(alternative hypothesis)H_0: \mu = \mu_0 \quad \text{(null hypothesis)} \qquad \text{vs.} \qquad H_1: \mu \ne \mu_0 \quad \text{(alternative hypothesis)}

Steps in hypothesis testing

  1. Set up H0H_0 and H1H_1.
  2. Specify the significance level α\alpha: the maximum allowed type I error probability, P(reject H0H0 true)αP(\text{reject } H_0 \mid H_0 \text{ true}) \le \alpha.
Accept H0H_0 Reject H0H_0
H0H_0 is true correct type I error
H1H_1 is true type II error correct
  1. Choose the test statistic and the rejection region.
    For a normal population with σ2\sigma^2 unknown, use

    tn=Xˉ(n)μ0S(n)/n,t_n = \frac{\bar{X}(n) - \mu_0}{S(n)/\sqrt{n}},

    which has a tn1t_{n-1} distribution under H0H_0. The rejection region is {tn>tα/2,n1}\{\,|t_n| > t_{\alpha/2,\,n-1}\,\}, so that P(reject H0H0)=αP(\text{reject } H_0 \mid H_0) = \alpha.
  2. Substitute the observed values into the test statistic and make the decision:
    • if tn>tα/2,n1|t_n| > t_{\alpha/2,\,n-1}, reject H0H_0;
    • if tntα/2,n1|t_n| \le t_{\alpha/2,\,n-1}, do not reject H0H_0.

Remark. Rejecting H0H_0 is equivalent to μ0[Xˉ(n)±tα/2,n1S(n)/n]\mu_0 \notin \left[\bar{X}(n) \pm t_{\alpha/2,\,n-1}\, S(n)/\sqrt{n}\right], the CI from Case 2. If instead σ2\sigma^2 is known (Case 1), replace S(n)S(n) by σ\sigma and tα/2,n1t_{\alpha/2,\,n-1} by zα/2z_{\alpha/2}.


2. Review of Probability and Statistics
http://example.com/2026/09/08/2026-09-08-review-of-prob-and-stats/
Author
Wind_like
Posted on
September 8, 2026
Licensed under