AI Computer Institute
Expert-curated CS & AI curriculum aligned to CBSE standards. A bharath.ai initiative. About Us

Probability Distributions: From Asteroid Prediction to Medical Diagnosis

📚 AI Mathematics⏱️ 21 min read🎓 Grade 10
✍️ AI Computer Institute Editorial Team Updated: August 2026 CBSE-aligned · Peer-reviewed · 21 min read
Content curated by subject matter experts with IIT/NIT backgrounds. All chapters are fact-checked against official CBSE/NCERT syllabi.

On 22 December 2032, an asteroid designated 2024 YR4 has a small but nonzero chance of striking Earth. When NASA's Center for Near-Earth Object Studies (CNEOS) publishes a number like "1 in 550," that number is not a guess pulled from a hat. It is the output of a probability distribution: a mathematical object that assigns a likelihood to every possible outcome of an uncertain quantity. Telescopes cannot pin down an asteroid's exact future position — measurement error, gravitational perturbations from other planets, and the asteroid's own irregular shape all inject uncertainty into the tracking. What CNEOS actually has is a spread of possible positions where the asteroid could pass Earth, each with its own likelihood. The "1 in 550" figure comes from asking: what fraction of that spread lands inside Earth's disk?

The same machinery — a variable whose exact value is unknown, but whose pattern of unknown-ness can be modeled precisely — sits underneath a doctor reading a blood test, a bank flagging a fraudulent transaction, and a spam filter judging an email. This chapter builds probability distributions from first principles, works two of the distributions you will use constantly in applied machine learning (binomial and normal), and then uses exactly the same normal-distribution machinery to (a) estimate an asteroid's impact probability and (b) catch the single most common reasoning error in medical diagnosis: confusing "the test is 90% accurate" with "I'm 90% likely to have the disease."

What a probability distribution actually is

A random variable is a quantity whose value is determined by chance — the number of students in a class of 30 who catch a cold this week, or the exact glucose reading on a blood test. Random variables come in two flavors that matter for how you compute with them:

  • Discrete random variables take a countable set of values — 0, 1, 2, 3 positive test results out of 10 patients. You can list every possible outcome.
  • Continuous random variables take any value in a range — a glucose reading of 91.3 mg/dL is just as valid as 91.4 or 91.35. You cannot list every possible outcome; there are infinitely many between any two numbers.

A probability distribution is the rule that assigns likelihood to every possible value of a random variable. For a discrete variable, this rule is called a probability mass function (PMF), written P(X = k), and it must satisfy two conditions: every value is non-negative, and the values across all possible k sum to exactly 1. For a continuous variable, the rule is a probability density function (PDF), written f(x). A PDF's height at a single point is not itself a probability — with infinitely many possible values, the "probability" of hitting one exact value is zero. Instead, probability is the area under the PDF curve between two points: P(a ≤ X ≤ b) is the integral of f(x) from a to b, and the total area under the whole curve must equal 1.

This distinction — mass at discrete points versus area under a continuous curve — is the single most important idea in this chapter. Everything below is one of two things: counting how mass is distributed across discrete outcomes, or measuring how area is distributed across a continuous range.

Worked example 1 — the Binomial distribution (discrete)

A rural health camp screens 10 patients from a high-risk group for a disease. Based on prior camp data, each patient independently has a 30% chance of testing positive (p = 0.3). Let X be the number of patients (out of 10) who test positive. X is discrete — it can only be 0, 1, 2, ..., 10 — and each patient's result is an independent trial with the same two possible outcomes (positive/negative). This is exactly the setup the binomial distribution is built for.

The binomial PMF is:

P(X = k) = C(n, k) · p^k · (1-p)^(n-k)

where n is the number of trials, p is the success probability per trial, and C(n, k) = n! / (k! (n-k)!) counts the number of different orders in which k successes can occur among n trials. Let's hand-compute P(X = 3) — the probability that exactly 3 of the 10 patients test positive:

C(10, 3) = 10! / (3! · 7!) = 120
P(X = 3) = 120 × (0.3)^3 × (0.7)^7
         = 120 × 0.027 × 0.0823543
         = 0.26683 (about 26.7%)

Running this same formula for every k from 0 to 10 gives the full distribution:

k :  0       1       2       3       4       5       6       7       8       9      10
P : 0.0282  0.1211  0.2335  0.2668  0.2001  0.1029  0.0368  0.0090  0.0014  0.0001  0.0000
                                     (sum ≈ 1.0000, as required)

Two summary numbers matter for any binomial distribution: the expected value E[X] = n · p = 10 × 0.3 = 3 (on average, 3 of the 10 test positive — matching the peak of the table above), and the variance Var(X) = n · p · (1-p) = 10 × 0.3 × 0.7 = 2.1, giving a standard deviation of √2.1 ≈ 1.449. That standard deviation tells you how much the actual count will typically wander from 3 in any given camp.

Worked example 2 — the Normal distribution (continuous)

Fasting blood glucose across a healthy adult population is well approximated by a normal (Gaussian) distribution with mean μ = 90 mg/dL and standard deviation σ = 15 mg/dL — write this as X ~ N(90, 15). The normal PDF is the familiar bell curve:

f(x) = (1 / (σ√(2π))) · e^(-(x-μ)² / (2σ²))

You rarely integrate this by hand. Instead you convert any value x to a z-score — the number of standard deviations x sits from the mean — and read the probability off the standard normal distribution (mean 0, standard deviation 1), which every statistics tool has built in:

z = (x - μ) / σ

A clinical threshold for diagnosing diabetes from a fasting reading is 126 mg/dL. What fraction of the healthy population (mean 90, σ 15) would incorrectly cross that threshold on a given day, purely from natural variation?

z = (126 - 90) / 15 = 36 / 15 = 2.4

A z-score of 2.4 is 2.4 standard deviations above the mean — deep in the right tail. Looking this up (or computing it with the error function, shown in code below) gives P(X > 126) ≈ 0.0082, about 0.82%. Roughly 1 in 122 healthy people would read above 126 on a given test purely by chance — a number every lab and doctor needs to know, because it sets the false-positive rate of the threshold itself, before any disease enters the picture at all.

Worked example 3 — estimating an asteroid's impact probability

Now return to the opening hook. Simplify CNEOS's real pipeline (which uses Monte Carlo sampling across a six-dimensional orbital-uncertainty ellipsoid) down to its one-dimensional core: telescope tracking gives an asteroid's predicted closest-approach distance from Earth's center as a normal distribution, say with mean μ = 50,000 km and standard deviation σ = 15,000 km (illustrative figures, chosen to make the arithmetic traceable — real Sentry-system uncertainties come from orbit-fitting software, not hand calculation). Earth's radius is about 6,371 km, so an "impact" means the asteroid's actual passage distance falls below 6,371 km — inside the planet.

z = (6371 - 50000) / 15000 = -43629 / 15000 = -2.9086

This says the impact threshold sits 2.91 standard deviations below the mean predicted distance — a large negative z, meaning "very far into the unlikely tail," but not so far as to be dismissed. Converting to a probability (area under the curve to the left of z = -2.9086):

P(impact) = Φ(-2.9086) ≈ 0.00182, i.e. about 0.18%, or roughly 1 in 550

This is precisely the shape of number planetary-defense agencies publish, and precisely why it changes from week to week: every new telescope observation tightens σ (the uncertainty), which moves the z-score and therefore the probability — usually toward 0% as the orbit becomes better known, occasionally upward for a few observations before more data arrives. The distribution isn't describing an asteroid that is "18% pregnant" with impact; it is describing how confidently we know where the asteroid will actually be.

The common misconception: "90% accurate" does not mean "90% likely to have it"

Suppose a diagnostic test correctly flags 90% of people who truly have a disease (sensitivity = 0.90) and correctly clears 95% of people who don't (specificity = 0.95, so its false-positive rate is 5%). A patient tests positive. Most students — and, historically, most working doctors surveyed on this exact question — estimate the patient's chance of actually having the disease at somewhere near 90%. This is wrong, and the size of the error depends entirely on one number the "90% accurate" headline never mentions: the disease's prevalence (base rate) in the population being tested.

Say the disease affects 1% of the screened population (prevalence = 0.01). Out of 10,000 people: 100 actually have the disease, and 9,900 don't. Sensitivity means the test catches 90 of the 100 true cases. Specificity means it correctly clears 95% of the 9,900 healthy people — but that leaves 5% of 9,900 = 495 healthy people who test positive anyway (false positives). Total positives = 90 + 495 = 585. Of those 585 positive results, only 90 are real:

P(disease | positive) = 90 / 585 ≈ 0.1538, i.e. about 15.4%

A "90% accurate" test, on a 1%-prevalence population, leaves a positive patient only about 15% likely to actually have the disease — because false positives from the enormous healthy majority swamp true positives from the tiny sick minority. This is Bayes' theorem in its most consequential everyday form: P(disease | positive) = [P(positive | disease) · P(disease)] / P(positive), and the prevalence term P(disease) is not optional — drop it and you get the 90% intuition, which is the misconception. The correction: always ask "accurate compared to what base rate?" before trusting a single test's headline accuracy figure, and note that the fix for a rare disease is testing twice, or combining tests, or screening only a pre-filtered higher-prevalence population — exactly why doctors don't order expensive confirmatory tests on everyone, only on those already flagged by a cheaper first-pass filter.

Computing distributions in code

Hand-computing binomial coefficients and the normal CDF's error function does not scale past a handful of numbers. In practice you use scipy.stats, which every step below has already been verified against the hand calculations above:

import numpy as np
from scipy.stats import binom, norm

# Worked example 1: binomial PMF, n=10 trials, p=0.3
n, p = 10, 0.3
k_values = np.arange(0, n + 1)
pmf = binom.pmf(k_values, n, p)
print(round(pmf[3], 5))          # 0.26683  (matches the hand calc for k=3)
print(round(pmf.sum(), 5))       # 1.0      (a valid PMF always sums to 1)
print(n * p, n * p * (1 - p))    # 3.0 2.1  (expected value, variance)

# Worked example 2: normal distribution, glucose ~ N(90, 15)
mu, sigma = 90, 15
z = (126 - mu) / sigma
print(round(z, 2))                       # 2.4
print(round(1 - norm.cdf(126, mu, sigma), 5))  # 0.0082 (matches worked example 2)

# Worked example 3: asteroid impact probability
mu_dist, sigma_dist, earth_radius = 50000, 15000, 6371
p_impact = norm.cdf(earth_radius, mu_dist, sigma_dist)
print(round(p_impact, 5))                # 0.00182 (matches worked example 3)

# Monte Carlo cross-check: sample 1,000,000 possible passage distances
# and count what fraction fall inside Earth
rng = np.random.default_rng(seed=42)
samples = rng.normal(mu_dist, sigma_dist, size=1_000_000)
monte_carlo_estimate = np.mean(samples < earth_radius)
print(round(monte_carlo_estimate, 4))    # approximately 0.0018, confirming the analytic answer

That last block is worth pausing on. Rather than integrating the normal PDF by hand, you can simply draw a million random samples from the same distribution and count what fraction fall below the impact threshold — the fraction converges to the true probability as the sample count grows. This is essentially what CNEOS's Sentry system does for real, except sampling six orbital parameters jointly instead of one distance, and it is the same core idea — repeated random sampling to estimate a quantity you cannot solve for cleanly by hand — that underlies techniques you will meet again in later machine-learning work, from bootstrap resampling to Monte Carlo dropout.

Diagram: from discrete mass to continuous area

Two views of the same idea: probability as mass, then as area Discrete: Binomial PMF, n = 10 patients, p = 0.3 chance each tests positive P(X = k) 0.267 peak = mode (k=3) 0 1 2 3 4 5 6 7 8 9 10 k = number of patients testing positive (mass sums to exactly 1 across all bars) as n grows large, the bars smooth into a curve (Central Limit Theorem) Continuous: standard Normal PDF, z = (x − μ) / σ −3σ −2σ −1σ μ +1σ +2σ +3σ z=−1.5 shaded area = P(Z ≤ −1.5) ≈ 6.68% total area under curve = 1

Read the diagram top to bottom. The top panel is the discrete case from Worked example 1: eleven bars, one per possible count k, and their heights (proportional to actual computed probabilities, not decoration) sum to exactly 1 — that's what a valid PMF must do. The bottom panel is the continuous case from Worked examples 2 and 3: instead of separate bars for every possible value, there's a smooth curve, and probability is read off as shaded area under a slice of it, not the height of any single point. The dashed red line marks a threshold z-score; the shaded region to its left is the tail probability — exactly the calculation that produced 0.82% for the glucose threshold and 0.18% for the asteroid's impact probability. Same mechanism, different threshold, different numbers.

Active recall

Attempt each question before reading its answer.

  1. A binomial random variable has n = 10, p = 0.3 (same setup as Worked example 1). What is P(X ≤ 1) — the probability that at most 1 of the 10 patients tests positive?
  2. In Worked example 3, if better telescope tracking shrinks the standard deviation of the asteroid's predicted passage distance from 15,000 km to 5,000 km (mean μ = 50,000 km unchanged), does the impact probability go up or down? Estimate why before computing.
  3. In Worked example 3, suppose instead a new observation shifts the standard deviation the other way, from 15,000 km up to 25,000 km, with the mean still 50,000 km. Recompute the z-score and the impact probability. What does a larger σ mean physically about what the telescopes currently know?
  4. In the Bayes' theorem misconception example, if the disease's prevalence were 10% instead of 1% (same test: 90% sensitivity, 95% specificity), what is P(disease | positive) now? Is the "90% accurate ≈ 90% likely" intuition closer to correct at higher prevalence?
  5. True or false, with a one-sentence justification: "The height of a normal distribution's PDF at x = μ is the probability that X equals exactly μ."
  6. A factory's screening machine has sensitivity 99% and specificity 99% for a defective component, and only 0.1% of components are actually defective. A component flags positive. Without doing the exact arithmetic, is P(defective | positive) closer to 99%, 50%, or under 10%? Then compute it exactly.

Answers

1. P(X ≤ 1) = P(X=0) + P(X=1). From the table in Worked example 1: P(X=0) = C(10,0)(0.3)^0(0.7)^10 = 0.02825, and P(X=1) = C(10,1)(0.3)^1(0.7)^9 = 0.12106. Sum ≈ 0.1493, about 14.9%.

2. Down. A smaller σ means the distribution is tighter around the mean (50,000 km) — less spread means less of the distribution's tail reaches down to Earth's 6,371 km radius, so less probability mass sits in the "impact" region. Physically: more precise tracking data narrows where the asteroid could be, and since the best estimate (50,000 km) is well clear of Earth, narrowing the uncertainty pulls the probability toward zero. Computing it: z = (6371-50000)/5000 = -8.73, and Φ(-8.73) is astronomically small (effectively 0) — confirming the intuition.

3. z = (6371 − 50000) / 25000 = −1.7452. P(impact) = Φ(−1.7452) ≈ 0.0405, about 4.0% — roughly 22 times larger than the original 0.18%. A larger σ means the position is less well known — the mean estimate hasn't moved, but the spread of plausible passage distances has widened, so more of that spread now overlaps Earth's radius. This is the ripple effect of a single parameter change: it doesn't just scale the answer proportionally, because probability in a tail is extremely sensitive to how many standard deviations away the threshold sits — moving σ from 15,000 to 25,000 changed z from −2.91 to −1.75, and because the normal tail shrinks roughly exponentially as z moves further out, that ~67% increase in σ produced a ~22x increase in probability.

4. Redo the 10,000-person table with prevalence 10%: 1,000 have the disease, 9,000 don't. True positives = 0.90 × 1,000 = 900. False positives = 0.05 × 9,000 = 450. P(disease | positive) = 900 / (900 + 450) = 900/1350 ≈ 0.667, about 66.7%. Yes — at higher prevalence the intuition gets much closer to correct, because there are now far more true cases relative to the healthy population generating false alarms. This is exactly why the same test is far more trustworthy when used to confirm a diagnosis a doctor already suspects (higher effective prevalence in that pre-filtered group) than when used to screen an entire unselected population.

5. False. The PDF's height at any single point of a continuous distribution is a density, not a probability — a continuous variable has zero probability of landing on any exact value. f(μ) ≈ 0.399/σ tells you the curve is tallest there, meaning outcomes near μ are the most likely region, but "probability of exactly μ" is meaningless for a continuous variable; only areas over a range are probabilities.

6. Closer to under 10% — the extremely low prevalence (0.1%) means healthy components vastly outnumber defective ones, so even a 1% false-positive rate among the huge healthy majority can generate more false alarms than the tiny defective minority generates true ones; this is the same base-rate structure as question 4 but pushed further. Exact arithmetic on 100,000 components: 100 are defective, 99,900 are not. True positives = 0.99 × 100 = 99. False positives = 0.01 × 99,900 = 999. P(defective | positive) = 99 / (99+999) = 99/1098 ≈ 0.0902, about 9.0%.

Think About It

Think about this: How would you explain probability distributions: from asteroid prediction to medical diagnosis to a friend who has never seen a computer? What real-world analogy would you use? Imagine you had to build a system using these concepts — what would be your first step? Try this: before moving on, write down three things you learned and one question you still have.

← CI/CD Pipelines: Automating Software DeliveryLinear Algebra Foundations: The Hidden Math Behind Netflix and Google →

Found this useful? Share it!

📱 WhatsApp 🐦 Twitter 💼 LinkedIn