Chap 4- Summary
md3 min readSummary of chapter 4
-
Sample Space: defining all possible outcomes / can be discrete → number of values is finite, or continuous → infinitely many values in an interval
-
Event: subset of sample space / specific situation. If outcome is in a subset we say event has occurred
- certain event → always occurs ()
- impossible event → never occurs ()
-
Combining events:
- Union (): event that either A or B or both occur
- Intersection (): event that both A and B occur
- Complement (): event that A does not occur
- Difference (): event that A occurs but B does not occur
-
De Morgan's Laws:
-
Conditional Probability of A given B:
- , for
-
Independence of events: meaning knowing one gives us no information about the other
-
Bayes' Theorem: B is true once A is observed
- for
- with:
- prior probability (initial belief in event B before seeing any data)
- likelihood (probability of observed data A, given B being true)
- posterior probability (updated belief in event B after seeing data A)
-
Random Variable: a function that assigns a real number to each outcome in the sample space (denoted by capital letters, e.g., X, Y)
- Discrete RV: finite or countably infinite values (e.g., number of heads in coin tosses)
- Continuous RV: uncountably infinite values (e.g., height, weight), described using PDF: , where is the probability density function
-
Mean (average): denoted by or , tells where the distribution of tends to balance out
- for discrete RV:
- for continuous RV:
-
Variance: denoted by or , measures spread of distribution around the mean
- or
- discrete RV:
- continuous RV:
- high variance = unstable prediction
-
Standard Deviation:
- Law of Large Numbers (LLN): states that more trials = less randomness = truer picture of reality
-
Probability Distributions: how probabilities are distributed across the possible values of a random variable
- Discrete Distributions: e.g., Bernoulli, Binomial, Poisson
- Continuous Distributions: e.g., Uniform, Normal
-
Bernoulli Distribution: denoted , has 2 outcomes random variable,
- PMF: for
- Mean:
- Variance:
-
Binomial Distribution: denoted , represents the number of successes in repeated Bernoulli trials with probability of success
- PMF: for
- Mean:
- Variance:
-
Poisson Distribution: denoted , models the number of events occurring in a fixed interval of time/space with known average rate
- PMF: for
- Mean:
- Variance:
-
Normal (Gaussian) Distribution: denoted , models continuous data with a symmetric bell-shaped curve
- PDF: for
- Mean:
- Variance:
-
Standard Normal Distribution: special case with and , denoted
- PDF: for
- Any normal random variable can be standardized to a standard normal variable using so
-
In scipy.stats, you can use:
scipy.stats.binomfor Binomial distributionscipy.stats.poissonfor Poisson distributionscipy.stats.normfor Normal distributionscipy.stats.bernoullifor Bernoulli distribution- Methods:
.pmf(k)for PMF of discrete distributions.pdf(x)for PDF of continuous distributions.cdf(x)for CDF of both discrete and continuous distributions.rvs(size=n)to generatenrandom samples from the distribution