Before you readWhy would heights, measurement errors and exam marks all have roughly the same bell shape?
Watch: Binomial distributions · 3Blue1Brown · Probabilities of probabilities, part 1
A Bernoulli variable is one yes-or-no trial: X=1 with probability θ, else 0. Its mean is θ and its variance is θ(1−θ). Every binary label, such as diseased or healthy, is one.
The binomialK∼Bin(n,θ) counts the successes in n independent Bernoulli trials:
P(K=k)=(kn)θk(1−θ)n−k,E[K]=nθ,Var(K)=nθ(1−θ).
The mean and variance follow from adding n independent copies of the Bernoulli.
The Gaussian (normal) X∼N(μ,σ2) has density
p(x)=2πσ21exp(−2σ2(x−μ)2).
It peaks at μ, and about 68% of its mass lies within σ of the mean and 95% within 2σ. The z-scorez=(x−μ)/σ says how many standard deviations x is from the mean. The central limit theorem says a sum of many small independent effects is close to Gaussian, which answers the question above.
In d dimensions, x∼N(μ,Σ) has density
p(x)=(2π)ddetΣ1exp(−21(x−μ)TΣ−1(x−μ)),
with Σ the covariance matrix. Most models in this course assume one of these: logistic regression treats labels as Bernoulli, and least squares treats errors as Gaussian.
mean nθ = 3variance nθ(1 − θ) = 2.10
Bars are P(K = k), the chance of k successes in n independent trials. The purple curve is the Gaussian with the same mean and variance. Raise n and the bars take its shape: a sum of many small independent effects is close to Gaussian.
Recall
Give the mean and variance of a Bernoulli(θ) variable.
Recall
What does Bin(n,θ) count, and what is its mean?
Recall
Why are Gaussians so common in data?
Exercise
Flip a fair coin 4 times. What is the probability of exactly 2 heads?
Exercise
K∼Bin(10,0.3). Give E[K] and Var(K).
Exercise
X∼N(10,4), where 4 is the variance. How many standard deviations above the mean is x=13?