STAT 200 – Introductory Statistics
October 15, 2026
A random variable with only two possible outcomes follows a Bernoulli distribution with success probability parameter, \(p\).
Examples:
Recall that the probability mass function (pmf) provides the probability of each element of the sample space.
For a Bernoulli random variable, there are only two outcomes: failure and success – 0 and 1.
From this, the probability mass function for a Bernoulli random variable is always
\[ \mathbb{P}[X = x] = \begin{cases} p & \textrm{if } x = 1 \\ 1 - p & \textrm{if } x = 0 \\ 0 & \textrm{otherwise} \end{cases} \]
This can also be written as
\[ \mathbb{P}[X = x] = p^x\, (1 - p)^{1 - x}, \qquad x \in \{0, 1\} \]
Why should we use this form? It helps create a closely-related distribution later on.
The expected value of a Bernoulli random variable is:
\[ \begin{aligned} \mathbb{E}[X] &= \sum_{x \in S} x\,\mathbb{P}[X = x] \\ &= \left( 0 \times \mathbb{P}[X = 0] \right) + \left( 1 \times \mathbb{P}[X = 1] \right) \\ &= 0\,(1 - p) + 1\,(p) \\ &= p \end{aligned} \]
Question: Does this result seem reasonable?
The variance of a Bernoulli random variable, where \(\mu = p\), is:
\[ \begin{aligned} \mathbb{V}[X] &= \sum_{x \in S} (x - \mu)^2 \, \mathbb{P}[X = x] \\ &= (0 - p)^2 \left( \mathbb{P}[X = 0] \right) + (1 - p)^2 \left( \mathbb{P}[X = 1] \right) \\ &= p^2\,(1 - p) + (1 - p)^2\,p \\ &= p\,(1 - p)\,\left( p + (1 - p) \right) \\ &= p\,(1 - p) \end{aligned} \]
Question: For what value of \(p\) are we most uncertain of a Bernoulli outcome?
Recall the probability mass function (pmf):
\[ \mathbb{P}[X = x] = \begin{cases} p & \textrm{if } x = 1 \\ 1 - p & \textrm{if } x = 0 \\ 0 & \textrm{otherwise} \end{cases} \]
The cumulative distribution function (CDF) is the function defined as \(F(x) = \mathbb{P}[X \le x]\). The CDF for a Bernoulli is:
\[ \mathbb{P}[X \le x] = \begin{cases} 0 & x < 0 \\ 1 - p & 0 \le x < 1 \\ 1 & x \ge 1 \end{cases} \]
The median depends on the Bernoulli parameter, \(p\). When \(p \ne 0.5000\), the rule to calculate the median is to start low and calculate the cumulative probability until that sum is at least 0.5000. This is most easily done with a cumulative distribution function.
Thus, the median of a Bernoulli random variable is:
\[ \widetilde{X} = \begin{cases} 0 & p < 0.5000 \\ [0,1] & p = 0.5000 \\ 1 & p > 0.5000 \end{cases} \]
Why is that the formula for the median?
Think: As I increase \(x\), when does the cumulative probability attain 0.500, when \(p < 0.500\) (as here)? That will be the median, \(\widetilde{X} = 0\).
Why is that the formula for the median?
Think: As I increase \(x\), when does the cumulative probability attain 0.500, when \(p > 0.500\) (as here)? That will be the median, \(\widetilde{X} = 1\).
Why is that the formula for the median?
Think: As I increase \(x\), when does the cumulative probability attain 0.500, when \(p = 0.500\)? That will be the median, \(0 \le \widetilde{X} \le 1\) (or \(\widetilde{X} = \frac{1}{2}\) by convention).
A binomial random variable is the sum of \(n\) independent and identically distributed Bernoulli random variables.
Note that this means the sample space is \(S = \{ 0, 1, \dots, n \}\).
This definition leads to the five requirements of a Binomial random variable:
Examples of Binomial random variables are:
The difference between Binomial random variables and Bernoulli random variables:
Recall that a Binomial random variable is just the sum of \(n\) Bernoulli random variables. From this, we will be able to determine the pmf of the Binomial distribution:
\[ \mathbb{P}[X = x] = \binom{n}{x}\, p^x\, (1 - p)^{n - x}, \qquad x = 0, 1, \dots, n \]
The expected value and variance of a Binomial are easily calculated from its statistical definition:
Let \(X_i \stackrel{\textrm{iid}}{\sim} \text{Bernoulli}(p)\). Define \(Y = \sum_{i=1}^n X_i\). Then \(Y \sim \text{Binomial}(n, p)\).
In English: Suppose we have a sample of \(n\) independent and identically distributed Bernoulli random variables. Define \(Y\) as the sum of those random variables. By definition, \(Y\) follows a Binomial distribution with parameters \(n\) and \(p\).
The expected value of a linear combination of random variables is the sum of the expected values of the random variables:
\[ \mathbb{E}[aX + bY + c] = a\,\mathbb{E}[X] + b\,\mathbb{E}[Y] + c \]
Using this property and the definition of the Bernoulli distribution, we can show:
\[ \begin{aligned} \mathbb{E}(Y) &= \mathbb{E}\left(\sum_{i=1}^n X_i\right) \\ &= \sum_{i=1}^n \mathbb{E}(X_i) \\ &= \sum_{i=1}^n p \\ &= n\,p \end{aligned} \]
The variance of a linear combination of independent random variables is the sum of the variances of the random variables:
\[ \mathbb{V}[aX + bY] = a^2\,\mathbb{V}[X] + b^2\,\mathbb{V}[Y] \]
Using this property and the definition of the Bernoulli distribution, we can show:
\[ \begin{aligned} \mathbb{V}(Y) &= \mathbb{V}\left(\sum_{i=1}^n X_i\right) \\ &= \sum_{i=1}^n \mathbb{V}(X_i) \\ &= \sum_{i=1}^n p\,(1 - p) \\ &= n\,p\,(1 - p) \end{aligned} \]
RIn R, there are a set of four functions to calculate various quantities from the Binomial distributions
dbinom(x, size, prob) is the PMF, giving \(\mathbb{P}(X = x)\).pbinom(x, size, prob) is the CDF, giving \(\mathbb{P}(X \le x)\).qbinom(p, size, prob) is the quantile function, i.e. the smallest \(x\) with \(\mathbb{P}(X \le x) \ge p\).rbinom(n, size, prob) generates \(n\) random values from a Binomial(size, prob) distribution.Let \(Y\) be the number of heads flipped in \(n = 10\) flips of a coin. If the coin is fair, then it is clear that \(Y \sim \text{Binomial}(n = 10, p = 0.500)\).
A Knox student studied a type of canine cancer (hemangiosarcoma) and a medicine that is supposed to increase longevity. Without the medicine, the median survival time for the dog is 90 days from detection.
She wanted to determine if the medicine helped dogs live longer. To do this, she gave the treatment to 10 dogs with the cancer and measured how long they lived. Of the 10 dogs given the new treatment, eight lived longer than 90 days.
What is the probability of observing eight or more dogs living longer than 90 days if the medicine doesn’t work?
A researcher has a theory that climate change is causing the intensity of hurricanes in the Atlantic Ocean to increase. Historical data shows that 43% of all Atlantic hurricanes are determined to be a “major hurricane” (Category 3, 4 or 5).
The researcher looks at 40 Atlantic hurricanes from the last three seasons, and finds that 20 of them were named “major hurricanes”.
Is this evidence that the amount of “major hurricanes” in the Atlantic has increased in recent years?
The Poisson distribution is used to model a random variable that is the count of successes over an area or a time period.
Examples:
Recall that the probability mass function (PMF) provides the probability of each element of the sample space.
For a Poisson random variable, there are an infinite number of possible outcomes:
\[ S = \{ 0, 1, 2, \dots \} \]
Using some calculus, it can be proven that the probability mass function is:
\[ \mathbb{P}(X = x) = \begin{cases} \dfrac{e^{-\lambda}\, \lambda^x}{x!} & x \in S \\[10pt] 0 & \textrm{otherwise} \end{cases} \]
The parameter \(\lambda\) (“lambda”) represents the average rate (successes per time period, per area, per volume, etc.).
The graph of the probability mass function of a \(\text{Poisson}(\lambda = 2)\) distribution looks like this:
The expected value of a \(\text{Poisson}(\lambda)\) random variable is:
\[ \mathbb{E}(X) = \lambda \]
I state this without proof. If you would like the proof, come see me. The proofs only require infinite sums, but I am not sure it is helpful in understanding statistics.
The variance of a \(\text{Poisson}(\lambda)\) random variable is:
\[ \mathbb{V}(X) = \lambda \]
I state this without proof. If you would like the proof, come see me. The proofs only require infinite sums, but I am not sure it is helpful in understanding statistics.
RIn R, there are a set of four functions to calculate various quantities from the Poisson distributions.
dpois(x, lambda) is the pmf, giving \(\mathbb{P}(X = x)\).ppois(x, lambda) is the CDF, giving \(\mathbb{P}(X \le x)\).qpois(p, lambda) is the quantile function, i.e. the smallest \(x\) with \(\mathbb{P}(X \le x) \ge p\).rpois(n, lambda) generates \(n\) random values from a Poisson(lambda) distribution.Let \(X\) be the number of heads flipped in a minute, given that I average 24 flips per minute. If the coin is fair, then it is clear that \(X \sim \text{Poisson}(\lambda = 12)\).
We would like to develop a system to determine if the crime rate in Galesburg has significantly increased. To do this, we will compare the crime rate from last year with the number of crimes reported over the past week.
According to the US Department of Justice, the number of violent crimes reported in Galesburg in 2020 was just 96.
For the sake of using this information, let us assume that Galesburg experienced 4 violent crimes last week.
Does this suggest that there is a significant increase in the violent crime rate?
Let’s extend the previous example and illustrate the importance of sample size on our conclusions.
Suppose that there were 16 violent crimes in Galesburg over the past four weeks (so the same rate, but over a longer period of time).
With this new information, is there significant evidence of an uptick in the crime rate?
Note that the previous example had the same rate (4 per week) but with a shorter period of time (1 week). Here, we are measuring over a longer period of time (4 weeks), meaning we have more data now.
Now let’s suppose there were 208 violent crimes in Galesburg this year (so the same rate, but over a year rather than a month).
With this new information, is there significant evidence of an uptick in the crime rate?
Now we have much more data than we did before.