FIGURE 3.1 A random variable maps the sample space into the real line.
Definition 3.1.1 (Random variable).
Example 3.1.2 (Coin tosses)
Definition 3.2.1 (Discrete random variable)
Definition 3.2.2 (Probability mass function).
h 3.2.3.In writing P(X = x), we are using X = x to denote an event
Example 3.2.4 (Coin tosses continued)
Example 3.2.5 (Sum of die rolls).
Example 3.2.6 (Children in a U.S. household). proportional
Theorem 3.2.7 (Valid PMFs)
Example 3.2.8. Returning to Example 3.2.5
3.3 Bernoulli and Binomial
Definition 3.3.1 (Bernoulli distribution).
the parameter of the distribution
a family of Bernoulli distributions, indexed by p. For example, if X ∼ Bern(1/3), it would be correct but incomplete to say “X is Bernoulli”;
Definition 3.3.2 (Indicator random variable).
Story 3.3.3 (Bernoulli trial).
Story 3.3.4 (Binomial distribution).
Notice that we define the Binomial distribution not by its PMF, but by a story about the type of experiment that could give rise to a random variable with a Binomial distribution.
the Bernoulli is a special case of the Binomial.
Theorem 3.3.5 (Binomial PMF).
skewed: 在统计学中,“偏度”是指数据集合相对于正态分布的不对称程度。如果数据是偏斜的,意味着它不是对称的。对于二项分布,当成功概率不为1/2时,概率质量函数(PMF)会变得偏斜。这意味着分布在其均值周围不对称,分布的形状会倾向于一侧而不是另一侧。
FIGURE 3.6 Some Binomial PMFs.
Theorem 3.3.7. Let X ∼ Bin(n, p), and q = 1 − p (we often use q to denote the failure probability of a Bernoulli trial). Then n − X ∼ Bin(n, q).
Corollary 3.3.8. Let X ∼ Bin(n, p) with p = 1/2 and n even. Then the distribution of X is symmetric about n/2,
Example 3.3.9 (Coin tosses continued).
3.4 Hypergeometric
Story 3.4.1 (Hypergeometric distribution)
Theorem 3.4.2 (Hypergeometric PMF)
Example 3.4.3 (Elk capture-recapture).
Example 3.4.4 (Aces in a poker hand)
Theorem 3.4.5. The HGeom(w, b, n) and HGeom(n, w + b − n, w) distributions are identical. That is, if X ∼ HGeom(w, b, n) and Y ∼ HGeom(n, w + b − n, w), then X and Y have the same distribution.(X and Y have the same PMF)
h 3.4.6 (Binomial vs. Hypergeometric) Bernoulli trials involved are independent. The Bernoulli trials in the Hypergeometric story are dependent,
3.5 Discrete Uniform
Story 3.5.1 (Discrete Uniform distribution).
Choose one of these numbers uniformly at random
Example 3.5.2 (Random slips of paper).
3.6 Cumulative distribution functions
the CDF is defined for all r.v.s
FX(x) = P(X ≤ x)
From PMF to CDF:
From CDF to PMF:
Theorem 3.6.3 (Valid CDFs)
Increasing:
Right-continuous:
Convergence to 0 and 1 in the limits:
P(X ≤ x) = P(X ≤ bxc),
where bxc is the greatest integer less than or equal to x.
3.7 Functions of random variables
a function of a random variable is a random variable.
Definition 3.7.1 (Function of an r.v.).
try to express the r.v. as a one-to-one function of an r.v. with a known distribution.
Example 3.7.2 (Random walk)
Theorem 3.7.3 (PMF of g(X)).
Example 3.7.4. Continuing as in the previous example, let D be the particle’s distance from the origin after n steps.
Definition 3.7.5 (Function of two r.v.s)
Example 3.7.6 (Maximum of two die rolls)
h 3.7.7 (Category errors and sympathetic magic).
Definition 3.8.1 (Independence of two r.v.s)
Definition 3.8.2 (Independence of many r.v.s).
Theorem 3.8.5 (Functions of independent r.v.s)
Definition 3.8.6 (i.i.d.).
Theorem 3.8.8. If X ∼ Bin(n, p), viewed as the number of successes in n independent Bernoulli trials with success probability p, then we can write X = X1+· · ·+Xn
Theorem 3.8.9. If X ∼ Bin(n, p), Y ∼ Bin(m, p), and X is independent of Y , then X + Y ∼ Bin(n + m, p).
Definition 3.8.10 (Conditional independence of r.v.s).
Definition 3.8.11 (Conditional PMF)
Independence of r.v.s does not imply conditional independence
Example 3.8.12 (Matching pennies)
Example 3.8.13 (Two friends).
Example 3.8.14 (Mystery opponent).
3.9 Connections between Binomial and Hypergeometric
Example 3.9.1 (Fisher exact test).
Theorem 3.9.2. If X ∼ Bin(n, p), Y ∼ Bin(m, p), and X is independent of Y , then the conditional distribution of X given X + Y = r is HGeom(n, m, r).
Theorem 3.9.3. If X ∼ HGeom(w, b, n) and N = w + b → ∞ such that p = w/(w + b) remains fixed, then the PMF of X converges to the Bin(n, p) PMF.