Skip to content

1.1. Uncertainty

Julio Toboso edited this page Oct 16, 2025 · 5 revisions

Randomness vs. Uncertainty: The Core of Probability

Randomness is about processes — the world generates outcomes unpredictably.
Uncertainty is about knowledge — we lack full information.

Think: a die roll (random process) vs. not knowing if the die landed on 3 or 4 (uncertainty).

Probability as a Consistent Language for Uncertainty

A probability model assigns a number to how plausible each outcome is, following three axioms:

$$ 0 \le P(A) \le 1, \quad P(\Omega)=1, \quad P(A \cup B)=P(A)+P(B)-P(A\cap B) $$

Common interpretations:

Perspective Meaning Example
Frequentist Long-run frequency 30% defective parts in many samples
Bayesian Degree of belief Prior belief defect rate = 30%, updated with new data
Geometric/Measure Proportion of total “space” Dart hits area covering 0.3 of total
  • Q1: Is “I don’t know tomorrow’s temperature” randomness or uncertainty?
    • Uncertainty (temperature is determined; our knowledge isn’t).
  • Q2: If (P(A)=0.4) and (P(B)=0.5), estimate (P(A∩B)).
    • ≈ 0.2 if independent. (P(A∩B) ≤ 0.4
  • Q3: Why is $(P(A|B)\neq P(B|A))$ generally?
    • Conditioning direction matters—what’s known vs. what’s inferred.

Descriptive Statistics by Measurement Scale

Not all averages are meaningful. Match your summary to the data scale.

Scale Typical statistics Meaningful central tendency Meaningful spread Notes
Nominal Counts, proportions, mode Mode None (just frequencies) Never take means or SDs of labels.
Ordinal Median, percentiles, IQR, rank correlation Median IQR Preserve order; spacing not uniform.
Interval Mean, SD, z-score Mean SD, variance Ratios (×2) meaningless (no true zero).
Ratio Mean, geometric mean, SD, CV Mean or geometric mean SD, CV Ratios and proportions valid.

Descriptive Statistics by Measurement Scale

Not all averages are meaningful. Match your summary to the data scale.

Scale Typical statistics Meaningful central tendency Meaningful spread Notes
Nominal Counts, proportions, mode Mode None (just frequencies) Never take means or SDs of labels.
Ordinal Median, percentiles, IQR, rank correlation Median IQR Preserve order; spacing not uniform.
Interval Mean, SD, z-score Mean SD, variance Ratios (×2) meaningless (no true zero).
Ratio Mean, geometric mean, SD, CV Mean or geometric mean SD, CV Ratios and proportions valid.

Minimal Pandas Examples

import pandas as pd

# Example dataset
df = pd.DataFrame({
    "color": ["red","blue","blue","red","green"],
    "satisfaction": [1,2,3,4,5],
    "temp_C": [20,22,19,23,21],
    "income": [30_000, 50_000, 45_000, 70_000, 60_000]
})

# Nominal
df["color"].value_counts(normalize=True)

# Ordinal
df["satisfaction"].median()

# Interval
df["temp_C"].mean(), df["temp_C"].std()

# Ratio
df["income"].mean(), df["income"].std() / df["income"].mean()  # CV
  • Q1: For “favorite color,” what valid descriptive statistic exists?
    • → Mode or frequency table only.
  • Q2: For “pain level (1–5),” should you compute a mean?
    • → No, use median or percentiles (ordinal scale).
  • Q3: For “age in years,” which measure of spread is valid?
    • → Standard deviation or coefficient of variation (ratio scale).

Data

Legend:

  • 🔰 Start here
  • 🏵️ Important Insight
  • ⚙️ Technical and applications
  • 💻 Some Code
  • ⚜️ Advanced Topics

Start

01 · Ω — What could happen

02 · X, 𝒳 — What we observe

03 · p(x) — What we expected

04 · I(x), H(X) — What an observation tells us

05 · Data — What is consistent

06 · Statistics — What we can learn.

07 · Databases - How to store data

08 · μ(x) — Fuzzy - When data is flexible

  • 08.1 Fuzzy Logic (planned)
  • 08.2 Fuzzy Numbers (planned)
  • 08.3 Possibility vs Probability (planned)

09 · x(t) — Signals and systems - Where patterns live

  • 09.1 Signals (stub)
  • 09.2 Sampling and Aliasing (planned)
  • 09.3 Convolution (planned)
  • 09.4 Frequency (planned)

10 · f_θ — Modelling and linear algebra

  • 10.1 🔰 Vectors and Matrices (planned)
  • 10.2 Mathematical Modelling (planned)

11 · min L(θ) — Optimisation

  • 11.1 🔰 Derivatives (planned)
  • 11.2 Convex Optimisation (planned)

12 · Learning from data

13 · Cause, design, capstone

  • 13.1 Cause and Effect (planned)
  • 13.2 Capstone Guide (planned)

Appendix

Clone this wiki locally