[1] 0.828125
Families of Distributions
Trent University
A Bernoulli trial is one of the simplest distributions – it has two possible outcomes:
Example 1: Flipping a coin where getting a heads is a “success” and tails is “failure”.
Example 2: Check a tire to see if it is flat (“success”), or inflated (“failure”).
The distribution (sometimes called a Probability Mass Function) of a Bernoulli random variable (R.V.) is:
\[ P(X = x) = p(x) = \begin{cases}1 - p & \text{if } x = 0 \\ p & \text{if } x = 1 \\ 0 & \text{else} \end{cases} \]
So two cases: “success” (probability \(p\)) and “failure” (probability \(1-p\)).
This is the mathematical model for our simplest probability example: coin flips! This is general enough to allow for non-fair coins - the probability of heads does not have to be the same as the probability of tails. They just have to add up to 1.
A very important discrete distribution is the binomial distribution, which results when we have:
Definition: the binomial distribution counts the number of successes in \(n\) independent trials of an experiment with fixed probability of success, \(p\). In other words, a binomial is what happens when we have a number \(n\) of independent Bernoulli trials.
If \(X\) is a Binomial random variable then we would use the notation:
\[ X \sim \text{Binomial}(n, p) \]
Suppose you have no idea how to answer the questions on a True/False test with 10 questions, and you decide to just flip a coin for each one. You then count how many questions you actually got correct.
In this situation, what is the probability of getting at least 6/10?
According to Statistics Canada, as of the last census in 2016, 86.3% of Canadians between the ages of 25 and 64 have a completed high school diploma, or equivalent. If we randomly select 15 Canadians aged 25-64, what is the probability distribution of the number of sampled people who have completed a high school diploma?
Find the probability that at least 8 out of 15 randomly selected Canadians aged 25-64 will have such a diploma.
Example:
This gives the probability of getting six or less correct answers in ten trials, with a 50/50 probability (like Example 1).
Example:
This gives the probability of getting MORE THAN SIX correct answers in ten trials, again with a 50/50 probability (like Example 1).
Note: this is not “greater than or equal to”, it is strictly greater than 6.
For the probability associated with a specific number of successes:
For the probability associated with observing one of a set of successes:
We would use a vector to represent the “set of successes”.
Either c(1,9,10) or, if we have a sequence of successes, 3:6.
OR, both! c(1, 3, 8:10)

Since height is a continuous numerical variable, its probability density function is a smooth curve. We’re not all rounded exact cm in height. I might be 172.143cm, and you might be 172.196cm, but on this graph, we’d be the same rectangle.

Therefore, the probability that a randomly sampled US adult is between 180 cm and 185 cm can also be estimated as the shaded area under the curve.
Important
This is an incredibly important idea. There are two probabilities here: the discrete estimate, computed using the areas of the rectangles and summing; and the continuous estimate, computed using calculus.

Since continuous probabilities are estimated as “the area under the curve”, the probability of a person being exactly 180 cm (or any exact value) is defined as 0.




“When we looked into the data for women, we were surprised to see height exaggeration was just as widespread, though without the lurch towards a benchmark height.”1


When \(X\) is a normally distributed random variable with mean \(\mu\) and standard deviation \(\sigma\), we would write:
\[ X \sim N(\mu, \sigma) \]
The basic probability expressions that we can calculate in R are: \[ \text{Find Probabilities:} \quad\qquad P(X \leq q) \quad \text{or} \quad P(X > q) \]
\[ \text{Find Percentiles:} \quad P(X \leq q) = p \quad \text{or} \quad P(X > q) = p \]
Assuming \[ X \sim N(\mu = 1500, \sigma = 300) \] We could find: \[ P(X < 1800) \] R:
At the Heinz ketchup factory, the amounts which go into bottles of ketchup are supposed to be normally distributed with mean 36 oz. and standard deviation 0.11 oz. Once every 30 minutes a bottle is selected from the production line, and its contents are noted precisely. If the amount of ketchup in the bottle is below 35.8 oz. or above 36.2 oz., then the bottle fails the quality control inspection. What percent of bottles have less than 35.8 ounces of ketchup?

We have that \(X\) is the amount of ketchup in a bottle where \[ X \sim \mathcal{N}(\mu = 36, \sigma = 0.11) \]
Then, we want to find: \[ P(X < 35.8) \]
We have that \(X\) is the amount of ketchup in a bottle where \[ X \sim \mathcal{N}(\mu = 36, \sigma = 0.11) \]
Then, we want to find: \[ P(X < 35.8) \]
The normal distribution is the most famous distribution in statistics. However, it’s also one of the most error-prone. We will not use it directly in very many places.
Instead, we will use the distribution we’ll talk about next most of the time. For this course, MATH 1051H, there are actually only two distributions we care about:
In MATH 1052H you’ll also spend some time using the:
| Discrete RVs | Continous RVs |
|---|---|
| “Space” between values | \(\infty\) number of values in any interval |
| \(P(X = x) = p(x)\); | \(P(X = x) = 0\) |
| \(P(X \leq x) =\) a sum of values | \(P(X \leq x) =\) area under \(f(x)\) to left of \(x\) |
sum(dbinom(x, size, prob)) |
pnorm(x, mean, sd) |
For any Normally distributed RV, \(X\).
\[ X \sim N(\mu = m, \sigma = s) \]
In R,
pnorm(q, m, s, lower.tail = TRUE)qnorm(p, m, s, lower.tail = TRUE)For any Normally distributed RV, \(X\). You have (or want)
\[ P(X > q) \]
In R,
pnorm(q, m, s, lower.tail = FALSE)qnorm(p, m, s, lower.tail = FALSE)\[ P(X > q) = 1 - P(X \leq q) \]
[1] 0.6305587
[1] 0.6305587
\[ P(X < q) = P(X \leq q) \] \[ P(X > q) = P(X \geq q) \]
\[P(a \leq X \leq b) = P(X \leq b) - P(X \leq a)\]

\[ P(X \leq b) \qquad - \qquad P(X \leq a) \qquad = \qquad P(a\leq X \leq b) \]
e.g., pnorm for \(P(12 \leq X \leq 20)\) for \(\mu = 16\), \(\sigma = 3\):
\[ P(12 \leq X \leq 20) = P(X \leq 20) - P(X \leq 12) \]

In the previous slides we were finding probabilities from quantiles
\[
P(X \leq x) = {\color{red}p}
\]
The inverse problem is also interesting: given a probability (area!), what must the cutoff(s) have been to make that work?
The functions to do this in R are quantile functions (q), e.g.,
qnorm(p = prob, mean = m, sd = s)
Note
Inverse functions undo the effect of the original function.
E.g., \(f(x) = 2x\) and \(f^{-1}(x) = x/2\) then we would have: \(f^{-1}(f(x)) = x\)
Consider:
qnorm for \(P(X \leq x) = 0.37\)
qnorm for \(P(X > x) = 0.63\)
Next week, we will continue working with these ideas. It’s secretly integration (shhhh!) … but this is a non-calculus course, so we’re just going to say “Heyyyy, computer! Do this for me!” and if we do it just right, our computers will compute the integrals (“area under the curves”) for us!
We’ve done all our examples with normals so far, and will continue to do so on Friday, but next week we’re going to expand the ideas into a couple of other directions, as setup for our first major topic of statistics.
