Advanced Physics‹⌂ 0:00 studied

Module 22 · 8 min read · Free chapter

Probability, errors and numerical methods: binomial, Poisson and normal distributions, propagation of errors, least-squares fitting, root finding, interpolation, trapezoidal and Simpson's rules, Runge-Kutta method, dimensional analysis

What are you preparing for? We show the practice and previous year questions of your exam.

Start from zero: every measurement has a spread

Time a pendulum ten times with a stopwatch and you get ten slightly different answers. Count clicks from a radioactive source in one-second windows and the count jumps around. Physics needs ways to say what the true value probably is and how sure we are.

Probability distributions describe that spread. Error analysis tells us how uncertainties combine, and least squares picks the best line through scattered data. When equations have no neat formula solution, numerical methods let a computer find roots, areas and trajectories to any accuracy we need.

Probability distributions

Random variable X with probabilities P(x): mean μ=⟨x⟩=∑xP(x)\mu = \langle x\rangle = \sum xP(x), variance σ2=⟨x2⟩−⟨x⟩2\sigma^2 = \langle x^2\rangle - \langle x\rangle^2, standard deviation σ.

Binomial distribution. n independent trials, each with success probability p (q = 1 − p):

P(k)=(nk)pkqn−k,μ=np,σ2=npqP(k) = \binom{n}{k}p^kq^{n-k}, \qquad \mu = np, \qquad \sigma^2 = npq

Example: the number of heads in 10 coin tosses has μ = 5 and σ ≈ 1.58. In a 1D random walk of N steps of length l, the net displacement has mean 0 and root-mean-square value lNl\sqrt{N}, the basis of diffusion and Brownian motion.

Poisson distribution. Let n → ∞ and p → 0 with np = λ fixed:

P(k)=λke−λk!,μ=σ2=λP(k) = \frac{\lambda^ke^{-\lambda}}{k!}, \qquad \mu = \sigma^2 = \lambda

It describes rare independent events: radioactive decays in a fixed time, photons arriving at a detector, earthquakes above a magnitude in a year. A count N therefore has an uncertainty of about N\sqrt{N} (counting statistics).

Worked example. A source gives on average 3 counts per second. The chance of zero counts in a second is e−3≈0.050e^{-3} \approx 0.050, and of exactly 3 counts is 27e−36≈0.224\dfrac{27e^{-3}}{6} \approx 0.224.

Normal (Gaussian) distribution. For large n the binomial approaches

P(x)=1σ2πexp⁡[−(x−μ)22σ2]P(x) = \frac{1}{\sigma\sqrt{2\pi}}\exp\left[-\frac{(x - \mu)^2}{2\sigma^2}\right]

About 68% of values lie within ±σ of the mean, 95% within ±2σ and 99.7% within ±3σ. The central limit theorem explains why it is so common: the sum of many small independent effects is normally distributed whatever their individual distributions.

Bayes' theorem. P(A∣B)=P(B∣A) P(A)P(B)P(A\mid B) = \dfrac{P(B\mid A)\,P(A)}{P(B)} updates a prior belief with data; it is the basis of probabilistic geophysical inversion.

Errors, dimensional analysis and least squares

Kinds of error. Systematic errors (zero error, calibration, parallax) shift every reading the same way and are not reduced by repetition. Random errors scatter readings both ways and shrink on averaging. Accuracy is closeness to the true value; precision is the closeness of repeated readings to each other.

Mean and its error. For N readings with standard deviation σ, the best estimate is the mean xˉ\bar{x}, with standard error

σxˉ=σN\sigma_{\bar{x}} = \frac{\sigma}{\sqrt{N}}

Four times as many readings halve the error.

Propagation of errors. For independent x, y and q=f(x,y)q = f(x, y):

σq2=(∂f∂x)2σx2+(∂f∂y)2σy2\sigma_q^2 = \left(\frac{\partial f}{\partial x}\right)^2\sigma_x^2 + \left(\frac{\partial f}{\partial y}\right)^2\sigma_y^2

Special cases: for sums and differences, absolute errors add in quadrature. For q=xaybq = x^ay^b, fractional errors combine as (σqq)2=a2(σxx)2+b2(σyy)2\left(\dfrac{\sigma_q}{q}\right)^2 = a^2\left(\dfrac{\sigma_x}{x}\right)^2 + b^2\left(\dfrac{\sigma_y}{y}\right)^2.

Worked example. g=4π2LT2g = \dfrac{4\pi^2L}{T^2} with L = 1.000 ± 0.002 m and T = 2.006 ± 0.004 s. Then σgg=(0.002)2+(2×0.002)2≈0.0045\dfrac{\sigma_g}{g} = \sqrt{(0.002)^2 + (2 \times 0.002)^2} \approx 0.0045. So g = 9.81 ± 0.04 m s⁻²; the period error dominates because T is squared.

Dimensional analysis. Every term in a valid equation has the same dimensions in M, L, T (and current, temperature). This checks formulas and predicts forms. Example: the period of a pendulum can depend only on l, g and m; matching dimensions forces T∝lgT \propto\sqrt{\frac{l}{g}}, independent of m. The constant 2π2\pi cannot be found this way, and dimensionless groups (like the Reynolds number) are the starting point for scaling laws.

Least-squares straight line. For data (xi,yi)(x_i, y_i), minimise S=∑(yi−mxi−c)2S = \sum(y_i - mx_i - c)^2. Setting ∂S∂m=∂S∂c=0\dfrac{\partial S}{\partial m} = \dfrac{\partial S}{\partial c} = 0 gives the normal equations, with solution

m=N∑xiyi−∑xi∑yiN∑xi2−(∑xi)2,c=yˉ−mxˉm = \frac{N\sum x_iy_i - \sum x_i\sum y_i}{N\sum x_i^2 - \left(\sum x_i\right)^2}, \qquad c = \bar{y} - m\bar{x}

The line passes through the centroid (xˉ,yˉ)(\bar{x}, \bar{y}). Curves like y=aebxy = ae^{bx} or T2∝LT^2 \propto L are fitted by linearising first (plotting ln y or T2T^2). The correlation coefficient r measures how well a line fits. With unequal errors each point is weighted by 1σi2\dfrac{1}{\sigma_i^2}, and the general matrix form is the inversion formula of matrices.

Numerical methods

Root finding.

  • Bisection: if f(a) and f(b) have opposite signs, halve the interval and keep the half with a sign change. It always converges, gaining one binary digit per step.
  • Newton-Raphson: follow the tangent to the axis:
xn+1=xn−f(xn)f′(xn)x_{n+1} = x_n - \frac{f(x_n)}{f'(x_n)}

The error roughly squares each step (quadratic convergence), but a bad start or f′ ≈ 0 can make it fail.

Worked example. 2\sqrt{2} as the root of f=x2−2f = x^2 - 2: xn+1=12(xn+2xn)x_{n+1} = \dfrac{1}{2}\left(x_n + \dfrac{2}{x_n}\right). From x0x_0 = 1: 1.5, 1.41667, 1.414216, already correct to six figures in three steps.

Interpolation. Through n + 1 points passes one polynomial of degree n. Lagrange's form is p(x)=∑yiℓi(x)p(x) = \sum y_i\ell_i(x), where ℓi(x)=∏j≠ix−xjxi−xj\ell_i(x) = \prod_{j\neq i}\dfrac{x - x_j}{x_i - x_j}. For equal spacing h, Newton's forward-difference formula is used. Extrapolation beyond the data range is far less reliable than interpolation.

Numerical integration with n strips of width h and fi=f(a+ih)f_i = f(a + ih):

  • Trapezoidal rule: ∫abf dx≈h2[f0+2(f1+f2+⋯+fn−1)+fn]\int_a^bf\,dx \approx \dfrac{h}{2}\left[f_0 + 2(f_1 + f_2 + \cdots + f_{n-1}) + f_n\right], error of order h2h^2.
  • Simpson's one-third rule (n even), fitting parabolas through each three points:
∫abf dx≈h3[f0+4(f1+f3+⋯ )+2(f2+f4+⋯ )+fn]\int_a^bf\,dx \approx \frac{h}{3}\left[f_0 + 4(f_1 + f_3 + \cdots) + 2(f_2 + f_4 + \cdots) + f_n\right]

error of order h4h^4; exact for polynomials up to degree 3.

Worked example. ∫01dx1+x2=π4=0.785398\int_0^1\dfrac{dx}{1 + x^2} = \dfrac{\pi}{4} = 0.785398. With h = 0.25, Simpson gives 0.253[1+4(0.94118+0.64)+2(0.8)+0.5]=0.785392\dfrac{0.25}{3}\left[1 + 4(0.94118 + 0.64) + 2(0.8) + 0.5\right] = 0.785392. The trapezoidal rule with the same points gives 0.782794.

ODEs: Euler and Runge-Kutta. For y′=f(x,y)y' = f(x, y), y(x0)=y0y(x_0) = y_0:

  • Euler: yn+1=yn+hf(xn,yn)y_{n+1} = y_n + hf(x_n, y_n), global error of order h; simple but drifts.
  • Fourth-order Runge-Kutta (RK4):
k1=hf(xn,yn),k2=hf(xn+h2,yn+k12),k3=hf(xn+h2,yn+k22),k4=hf(xn+h,yn+k3)k_1 = hf(x_n, y_n), \quad k_2 = hf\left(x_n + \tfrac{h}{2}, y_n + \tfrac{k_1}{2}\right), \quad k_3 = hf\left(x_n + \tfrac{h}{2}, y_n + \tfrac{k_2}{2}\right), \quad k_4 = hf(x_n + h, y_n + k_3)
yn+1=yn+16(k1+2k2+2k3+k4)y_{n+1} = y_n + \frac{1}{6}(k_1 + 2k_2 + 2k_3 + k_4)

It matches the Taylor series up to h4h^4 (global error of order h4h^4) without needing derivatives of f.

Worked example. y′=yy' = y, y(0) = 1, one step h = 0.1: k1k_1 = 0.1, k2k_2 = 0.105, k3k_3 = 0.10525, k4k_4 = 0.110525, so y(0.1) = 1.1051708, against the exact e0.1e^{0.1} = 1.1051709. Euler gives 1.1.

Second-order equations such as x¨=−ω2x\ddot{x} = -\omega^2x are written as two first-order equations for x and v and stepped together. This is how orbits, seismic ray paths and circuit transients are computed.

Mains lens: how UPSC asks this

Geo-Scientist Geophysics B1 lists probability distributions, numerical techniques (roots, interpolation, trapezoidal and Simpson's rules, Runge-Kutta), least squares and dimensional analysis explicitly. NET Part A asks short numericals on them, and CSE practical-style questions test error propagation and Poisson counting statistics.

Expect:

  • Derive the Poisson distribution as a limit of the binomial and find its mean and variance (10 marks).
  • Propagate errors in a formula such as g=4π2LT2g = \dfrac{4\pi^2L}{T^2}.
  • Derive the least-squares formulas for a straight line and fit given data.
  • Evaluate an integral by Simpson's rule, or solve an ODE step by RK4 (10 marks).
  • Find a root by Newton-Raphson to a given accuracy.

Model answer plan: "Show that the binomial distribution reduces to the Poisson distribution for large n and small p, and prove that its mean and variance are both λ." (10 marks).

  1. Write the binomial with p = λn\dfrac{\lambda}{n}.
  2. Use n!(n−k)! nk→1\dfrac{n!}{(n-k)!\,n^k} \to 1 and (1−λn)n→e−λ\left(1 - \dfrac{\lambda}{n}\right)^{n} \to e^{-\lambda} to get λke−λk!\dfrac{\lambda^ke^{-\lambda}}{k!}.
  3. Mean: ∑kP(k)=λ\sum kP(k) = \lambda by shifting the index.
  4. ⟨k(k−1)⟩=λ2\langle k(k-1)\rangle = \lambda^2, so variance =λ2+λ−λ2=λ= \lambda^2 + \lambda - \lambda^2 = \lambda.
  5. Application: counting error N\sqrt{N} in radioactivity.

Quick revision

  • Binomial: np, npq; Poisson: mean = variance = λ, counting error N\sqrt{N}; normal: 68-95-99.7.
  • Standard error σN\dfrac{\sigma}{\sqrt{N}}; errors add in quadrature; powers multiply fractional errors.
  • Dimensional analysis: pendulum T∝lgT \propto\sqrt{\frac{l}{g}}; constants not found.
  • Least squares: line through centroid; slope formula from normal equations; weights 1σi2\dfrac{1}{\sigma_i^2}.
  • Newton-Raphson quadratic; bisection always safe; Lagrange interpolation.
  • Trapezoid O(h2)O(h^2), Simpson O(h4)O(h^4) (even strips); Euler O(h)O(h), RK4 O(h4)O(h^4).

Mains answer practice

Write your answer first, then open the points a good answer should cover.

  1. Show that the binomial distribution reduces to the Poisson distribution when n is large and p small with np = λ fixed. Prove that the mean and variance of the Poisson distribution are both λ.

    Show answer points
    • Binomial with p = λ/n: n!/[k!(n−k)!] (λ/n)ᵏ (1 − λ/n)^(n−k)
    • n!/[(n−k)! nᵏ] → 1 and (1 − λ/n)ⁿ → e^(−λ)
    • P(k) = λᵏ e^(−λ)/k!
    • Mean Σ k P(k) = λ by shifting the index
    • ⟨k(k−1)⟩ = λ², so variance = λ² + λ − λ² = λ; counting error √N
  2. In a simple pendulum experiment L = 1.000 ± 0.002 m and T = 2.006 ± 0.004 s. Find g and its uncertainty.

    Show answer points
    • g = 4π²L/T² = 9.81 m s⁻²
    • Fractional errors: σL/L = 0.002, σT/T = 0.002
    • (σg/g)² = (σL/L)² + (2σT/T)²
    • σg/g ≈ 0.0045, so σg ≈ 0.04 m s⁻²
    • g = 9.81 ± 0.04 m s⁻²; period error dominates
  3. Derive the least-squares formulas for the slope and intercept of the best straight line y = mx + c through N data points. Show that the line passes through the centroid of the data.

    Show answer points
    • Minimise S = Σ (yᵢ − mxᵢ − c)²
    • ∂S/∂c = 0 gives Σyᵢ = mΣxᵢ + Nc, so ȳ = m x̄ + c: centroid lies on line
    • ∂S/∂m = 0 gives Σxᵢyᵢ = mΣxᵢ² + cΣxᵢ
    • Solve: m = [NΣxᵢyᵢ − ΣxᵢΣyᵢ]/[NΣxᵢ² − (Σxᵢ)²], c = ȳ − m x̄
    • Non-linear laws linearised first; unequal errors weighted by 1/σᵢ²
  4. Evaluate the integral of 1/(1 + x²) from 0 to 1 using Simpson's one-third rule and the trapezoidal rule with h = 0.25. Compare with the exact value and explain the difference in accuracy.

    Show answer points
    • Ordinates: 1, 0.94118, 0.8, 0.64, 0.5
    • Simpson: (0.25/3)[1 + 4(0.94118 + 0.64) + 2(0.8) + 0.5] = 0.785392
    • Trapezoidal: (0.25/2)[1 + 2(0.94118 + 0.8 + 0.64) + 0.5] = 0.782794
    • Exact π/4 = 0.785398
    • Simpson fits parabolas, error O(h⁴); trapezoid straight lines, error O(h²)
  5. Describe the fourth-order Runge-Kutta method. Use it with one step h = 0.1 to find y(0.1) for y′ = y, y(0) = 1, and compare with Euler's method and the exact value.

    Show answer points
    • k1 = hf(xn, yn), k2 = hf(xn + h/2, yn + k1/2), k3 = hf(xn + h/2, yn + k2/2), k4 = hf(xn + h, yn + k3)
    • yn+1 = yn + (k1 + 2k2 + 2k3 + k4)/6, matches Taylor series to h⁴
    • k1 = 0.1, k2 = 0.105, k3 = 0.10525, k4 = 0.110525
    • y(0.1) = 1.1051708 vs exact e^0.1 = 1.1051709
    • Euler gives 1.1; RK4 needs no derivatives of f

Previous year questions

Previous year questions for UPSC CSE will appear here once each one is checked word for word against the official question paper.

Learn with AI

A tutor that asks instead of telling, a partner that argues the other side, and this chapter told through your own district.

Tell the tutor what you are stuck on. It will guide you with questions and give the answer after a few tries.

🙋 Raise a doubt or feedback

Stuck somewhere, or spotted a mistake? Write to the ExamHike team. We usually reply within a day, and you will see the reply on My progress.

Log in to ask a doubt or send feedback →

More in this module: Mathematical physics

Official sources

Facts in this chapter were checked against these official sources.

  1. IGNOU PHE-14 Mathematical Methods in Physics III: probability and numerical methods
  2. NPTEL Numerical Methods (IIT)