Topic 5: Discrete Probability Distributions (Spreadsheets, Static)

About

This activity provides an introduction to discrete probability, including basic probability through counting outcomes, and calculating probabilities associated with outcomes of binomial experiments using the binomial distribution.

Note. The button above resets multiple choice and checkbox questions. Currently, resetting answer entry cells must be done manually via hitting the Start Over button on each individual interactive cell.

Using a Spreadsheet Program

There are times throughout this activity where you’ll be asked to do work inside of your favorite spreadsheet program.

Discrete Probability Distributions

Throughout this activity you’ll be introduced to the notion of probability and will explore applications of probability and discrete random variables. After developing some intuition using foundational probability ideas, we’ll focus on binomial experiments and using the binomial distribution to find probabilities of prescribed outcomes.

Limitations

There are entire courses devoted to probability – we will only cover probability to the extent that it is necessary for use in this course. If you are interested in a more detailed treatment of probability, seek out one of the many great courses available.

Objectives

Activity Objectives: After completing this workbook you should be able to:

  • Define, discuss, and interpret the probability of an event as its likelihood.
  • Apply fundamental counting principles and the notion of independence to compute the probability associated with the occurrence of a sequence of independent events.
  • Use the definition of binomial experiments to identify scenarios to which the binomial distribution can be applied.
  • Apply the binomial distribution in appropriate scenarios to find probabilities associated with specified outcomes using spreadsheet software.
  • Given a binomial experiment, compute the expected number of successful outcomes as well as the standard deviation for number of successes.

Basic Probability

Definition of Probability (frequentist): For a given random process, the probability of an event \(A\) is the proportion of time we would observe an outcome satisfying \(A\) if the random process were repeated an infinite number of times.

Example: Given a fair coin, the probability of a flip turning up heads is \(0.5\) (or 50%). Similarly, given a fair six-sided die, the probability of a roll resulting in a number greater than four is \(1/3\) (or about 33.3%) because there are two outcomes satisfying the criteria (rolling a 5 or rolling a 6) out of the six total possible outcomes.

Try It! Now it is your turn. Try the next few problems. Be sure to note any questions you have as you work through them.

Check Your Understanding: Basic Probability I

Given one fair, six-sided die, what is the probability of rolling a three?

Check Your Understanding: Basic Probability II

Given one fair, six-sided die, what is the probability of rolling a two, four, or six?

Check Your Understanding: Basic Probability III

Given two fair, six-sided dice, which is larger?

Good work on that last set of questions. In those problems you could find the probability by counting the number of ways the desired outcome could occur and then dividing that number by the total number of outcomes possible. In the last question, there were simply more ways to roll a five (four ways to do it) than to roll a two (just one way).

What if we try doing something a bit more complicated? Say we wanted to know the probability of rolling at least a two on a single roll of a die and then flipping a “tails” on a single flip of a coin?

Probability and Independent Events

If \(A\) and \(B\) are independent events (that is, the probability that \(B\) occurs does not depend on whether or not \(A\) occurred, and vice-versa), then the probability of \(A\) and \(B\) occurring is the product of the probability of \(A\) occurring and the probability of \(B\) occurring. Mathematically, we write: \(\mathbb{P}\left[A~\text{and}~B\right] = \mathbb{P}\left[A\right]\cdot\mathbb{P}\left[B\right]\).

Check Your Understanding: Probability and Independent Events I

Given a single roll of a fair, six-sided die, what is the probability of rolling at least a two?

Check Your Understanding: Probability and Independent Events II

Given a single flip of a fair coin, what is the probability of the coin landing with tails facing upwards?

Check Your Understanding: Probability and Independent Events III

Use your spreadsheet to compute the probability that in a single roll of a fair die and a flip of a coin we observe a roll of at least two and a flip of tails. Enter your result below.

Hint 1

Use the probabilities you identified in the two questions above. You can multiply values together in a spreadsheet cell by typing = followed by the values separated by *.

As an example, typing =(1/4)*(1/3) and pressing Enter gives the product of those two fractions.

Hint 2

The flip of a coin and roll of a fair die are independent events, so we can multiply their individual probabilities together. In a blank spreadsheet cell, start with = and multiply the two probabilities.

Hint 3

In a blank cell, type =(___)*(___) – filling in the blanks with your probabilities – and press Enter. The result is the probability of rolling at least a two and flipping tails.

Hint 4 (Solved)

You can obtain the probability by typing =(5/6)*(1/2) in an empty cell on your spreadsheet and pressing Enter. The result is the probability of rolling at least a two and flipping tails.

(5/6)*(1/2)

(5/6)*(1/2)

Good work so far. Let’s say you forgot to study for your chemistry quiz today. It is a four question multiple choice quiz with answer options \(a)\) - \(e)\) on each question. You decide that your best option is to guess randomly on each of the questions. Answer the following, using your spreadsheet to carry out any necessary computations.

Check Your Understanding: Guessing on a Quiz I

For a single question, what is the probability that you get that question correct?

Check Your Understanding: Guessing on a Quiz II

What is the probability that you get every one of the questions correct? Use your spreadsheet to compute this, then select your answer.

Hint 1

There are five answer options and only one is correct, so the probability of guessing correctly on one question is 1/5 = 0.20. The questions are independent of one another.

Hint 2

Because the questions are independent, multiply the probability of getting each individual question correct together. In a spreadsheet cell, type =0.20*0.20*0.20*0.20 and press Enter.

Check Your Understanding: Guessing on a Quiz III

What is the probability that you get every one of the questions wrong? Use your spreadsheet to compute this, then select your answer.

Hint 1

If the probability of getting a single question correct is 0.20, what is the probability of getting it wrong? These two outcomes cover every possibility, so they must add up to 1.

Hint 2

The probability of getting a single question wrong is 1 - 0.20 = 0.80. Because the questions are independent, multiply this probability four times — once for each question. In your spreadsheet, type =0.80*0.80*0.80*0.80 and press Enter.

Check Your Understanding: Guessing on a Quiz IV

What is the probability that the first one you get wrong is question three? Use your spreadsheet to compute this, then select your answer.

Hint 1

If the first wrong answer is on question three, what must have happened on questions one and two? And what do we know about question four?

Hint 2

Questions one and two must both have been answered correctly (probability 0.20 each), question three must have been answered incorrectly (probability 0.80), and question four’s outcome doesn’t matter — whether right or wrong, the event of interest has already occurred. The probability of “right or wrong” on question four is 1.

Hint 3

Multiply the four probabilities together. In your spreadsheet, type =0.20*0.20*0.80*1 and press Enter.

Check Your Understanding: Guessing on a Quiz V

What is the probability that you get exactly two questions right?

So in the last question, none of the choices were correct – but why? There are lots of ways that we could get two of the questions right. We could get the first two right, the first and last right, the middle two right, and more! We need to account for all of these possibilities.

Binomial Experiments and the Binomial Distribution

Binomial Experiments: A binomial experiment satisfies each of the following three criteria:

  • There are \(n\) repeated trials.
  • Each trial has two possible outcomes (usually called success and failure for convenience)
  • The trials are independent of one another. That is, for each trial, the probability of success is \(p\) (which remains constant).

Binomial Distribution: Let \(X\) be the number of successes resulting from a binomial experiment with \(n\) trials. We can compute the following probabilities using the BINOM.DIST() function in Excel or Google Sheets:

  • The probability of exactly \(k\) successes is given by
    \(\displaystyle{\mathbb{P}\left[X = k\right] = \binom{n}{k}\cdot p^k\left(1 - p\right)^{n-k} \approx \tt{BINOM.DIST(k,\ n,\ p,\ FALSE)}}\)
  • The probability of at most \(k\) successes is given by
    \(\displaystyle{\mathbb{P}\left[X \leq k\right] = \sum_{i=0}^{k}{\binom{n}{i}\cdot p^i\left(1 - p\right)^{n-i}} \approx \tt{BINOM.DIST(k,\ n,\ p,\ TRUE)}}\)

In the equations above, \(\binom{n}{k} = \frac{n!}{k!\left(n-k\right)!}\) counts the number of ways to arrange the \(k\) successes amongst the \(n\) trials. The BINOM.DIST() function in your spreadsheet allows you to bypass the messy formulas – but you’ll still need to understand what the function does in order to use it correctly!

Tip: Using BINOM.DIST() in a Spreadsheet

The BINOM.DIST() function takes four arguments, in order:

  1. Number of successes (\(k\)) — the outcome count you are interested in
  2. Number of trials (\(n\)) — the total number of independent trials
  3. Probability of success (\(p\)) — the probability of success on a single trial
  4. Cumulative — use FALSE for exactly \(k\) successes; use TRUE for at most \(k\) successes

For example, =BINOM.DIST(2, 7, 0.5, FALSE) gives the probability of exactly 2 heads in 7 coin flips (since the probability of flipping heads is 0.50).

Tip: Binomial Distribution

We need to use the binomial distribution to find probabilities associated with numbers of successful (or failing) outcomes in which we do not know for certain the trials on which the successes (or failures) occur.

In your spreadsheet, use BINOM.DIST() to find the probability that you got exactly two of the four chemistry quiz questions from earlier correct. As a reminder, there were five answer options for each question and you were guessing randomly. Enter your result in the cell below.

Hint 1

In a blank spreadsheet cell, begin by typing =BINOM.DIST(. The four arguments you need to supply are: number of successes, number of trials, probability of success, and whether to use the cumulative form.

Hint 2

We want exactly two correct, so the last argument should be FALSE. The first argument is 2 (the number of correct answers we’re interested in). Fill in the other two.

Hint 3

The quiz has four questions, so the number of trials is 4. What is the probability of guessing correctly on a single question?

Hint 4

Since each question has five possible choices (a–e), one of which is correct, the probability of guessing correctly on one question is 0.2. In your spreadsheet, type =BINOM.DIST(2, 4, 0.2, FALSE) and press Enter.

dbinom(2, 4, 0.2)

dbinom(2, 4, 0.2)

Good work. Now you’ll get to try a few more problems! As you work through the next set of questions, you may want to check out this example and solution. Note that in that document, I mention that drawing a simple picture for each problem will help you decide which form of BINOM.DIST() to use and whether you might need to combine multiple calculations. This is a really important strategy that will help you in developing a strategy to solve each problem.

Practice: For each of the following, consider a scenario in which a random sample of 18 students is asked (in private) whether they’ve failed to hand in at least one assignment this semester. We assume that about 34% of students fail to hand in at least one assignment.

  1. Given a single, randomly chosen student, what is the probability that the student will have failed to hand in at least one assignment this semester?
Hint 1

If we had 100 randomly chosen students, how many might you expect to have failed to hand in at least one assignment? How did you arrive at that number?

Hint 2

We might expect about 34 students out of 100 to have failed to hand in at least one assignment, since 34% of 100 is 34. The percentage given in the problem statement directly tells you the probability for a single randomly selected student — no spreadsheet formula is needed here.

Hint 3

34% as a decimal is 0.34. You can type this value directly into the answer cell.

0.34

0.34
  1. Find the probability that exactly 7 of the 18 students have failed to hand in at least one assignment. Do the calculations in your spreadsheet, then enter your result below.
Hint 1

We don’t know which specific students have failed to hand in an assignment — only the total count. This is a job for BINOM.DIST(). In a blank spreadsheet cell, start by typing =BINOM.DIST(.

Hint 2

We want the probability of exactly 7 students, so the last argument (cumulative) should be FALSE. The first argument is the number of successes we’re interested in — that’s 7 here.

Hint 3

The second argument is the total number of trials (students in the sample), which is 18. What is the third argument?

Hint 4

The third argument is the probability that any single student has failed to hand in an assignment, which is 0.34. In your spreadsheet, type =BINOM.DIST(7, 18, 0.34, FALSE) and press Enter.

dbinom(7, 18, 0.34)

dbinom(7, 18, 0.34)
  1. Find the probability that at most 9 of the 18 students have failed to hand in at least one assignment. Do the calculations in your spreadsheet, then enter your result below.
Hint 1

We want the probability of a range of outcomes (0, 1, 2, … up to 9 students), not just one specific count. The BINOM.DIST() function with its cumulative option can handle this directly. In a blank spreadsheet cell, start by typing =BINOM.DIST(.

Hint 2

“At most” means we want the cumulative probability up through 9. Set the last argument (cumulative) to TRUE. The first argument is the maximum number of successes you are willing to consider — that’s 9 here.

Hint 3

The second argument is the number of students (18) and the third is the probability of a single student having failed to hand in an assignment (0.34). In your spreadsheet, type =BINOM.DIST(9, 18, 0.34, TRUE) and press Enter.

pbinom(9, 18, 0.34)

pbinom(9, 18, 0.34)
  1. Find the probability that at least 11 of the 18 students have failed to hand in at least one assignment. Do the calculations in your spreadsheet, then enter your result below.
Hint 1

BINOM.DIST() with TRUE gives the probability of at most some number of successes. “At least 11” is not quite the same thing — think about how you might use what BINOM.DIST() gives you to get what you need.

Hint 2

Between 0 and 18 students must fail to hand in an assignment — that covers every possibility, so the total probability is 1. If you can find the probability of everything below your threshold, you can subtract it from 1 to get what remains.

Hint 3

You want to subtract the probability of outcomes that are too small — that is, the probability of fewer than 11 students. Be careful: “fewer than 11” means at most 10. Try building a formula of the form =1 - BINOM.DIST(___, 18, 0.34, TRUE).

Hint 4

The attempt =1 - BINOM.DIST(11, 18, 0.34, TRUE) is wrong — why?

Hint 5

The attempt =1 - BINOM.DIST(11, 18, 0.34, TRUE) is wrong — why? It removes the probability of at most 11 students, leaving only the probability of 12 or more. We wanted 11 or more.

Hint 6 (Solved)

Use 10 as the first argument instead. In your spreadsheet, type =1 - BINOM.DIST(10, 18, 0.34, TRUE) and press Enter.

1 - pbinom(10, 18, 0.34)

1 - pbinom(10, 18, 0.34)
  1. Find the probability that between a minimum of 6 and a maximum of 12 out of the 18 students have failed to hand in at least one assignment. Do the calculations in your spreadsheet, then enter your result below.
Hint 1

We want the probability of an outcome somewhere in the middle — not too few, not too many. A single BINOM.DIST() call with TRUE always gives everything from 0 up to some value, so you’ll need to use two calls and combine them.

Hint 2

Start by computing a cumulative probability that is definitely too large. Which first argument gives the bigger result — 6 or 12? Start there.

Hint 3

=BINOM.DIST(12, 18, 0.34, TRUE) is too large because it includes all the outcomes we want plus some below 6. We’ll need to subtract some probability away using a second BINOM.DIST() call.

Hint 4

The formula will look like =BINOM.DIST(12, 18, 0.34, TRUE) - BINOM.DIST(___, 18, 0.34, TRUE). What goes in the blank?

Hint 5

Using 6 in that blank is wrong — it removes the probability of 0 through 6 students, which excludes 6 itself from the answer. We want to include 6, so we need to remove only the outcomes below it.

Hint 6

Use 5 in the second call’s first argument to remove only the outcomes below 6. In your spreadsheet, type =BINOM.DIST(12, 18, 0.34, TRUE) - BINOM.DIST(5, 18, 0.34, TRUE) and press Enter.

pbinom(12, 18, 0.34) - pbinom(5, 18, 0.34)

pbinom(12, 18, 0.34) - pbinom(5, 18, 0.34)
Don’t Memorize Approaches

In several of the previous scenarios, we needed to think carefully about the correct first argument to pass to BINOM.DIST(), and whether to add or subtract a second call. Don’t try to memorize when to subtract one from the threshold, when to leave it as-is, etc. The language of the problem is what matters, and there are lots of ways to express which outcomes we care about. If you insist on memorizing, you’ll become frustrated quickly.

Instead of memorizing, take the time to draw a picture to help you. Examples of what these pictures might look like can be seen in the example and solution document, which I pointed you to earlier.

  1. The expected number of successes in a binomial experiment is sometimes denoted by \(\mathbb{E}\left[X\right]\) and can be computed as \(\mathbb{E}\left[X\right] = n\cdot p\), where \(n\) denotes the number of trials run and \(p\) denotes the probability of success on a single trial. Sometimes it is convenient to think of the expected number of successes as “the mean”. Use your spreadsheet to compute the expected number of students who have failed to hand in at least one assignment, then enter your result below.
Hint 1

Use the formula \(\mathbb{E}\left[X\right] = n\cdot p\) from the problem statement. In a blank spreadsheet cell, type = followed by the values of \(n\) and \(p\) multiplied together.

Hint 2

Here \(n\) is the number of students in the sample (18) and \(p\) is the probability that any one student has failed to hand in an assignment (0.34).

Hint 3

In your spreadsheet, type =18*0.34 and press Enter. Enter the resulting value below.

18*0.34

18*0.34
  1. The standard deviation in the number of successes for a binomial experiment can also be computed. The quantity \(\displaystyle{s_X = \sqrt{n\cdot p\left(1 - p\right)}}\), where \(n\) denotes the number of trials run and \(p\) denotes the probability of success on a single trial, is the standard deviation in number of successes. Use your spreadsheet to compute the standard deviation in number of students who have failed to hand in at least one assignment from random samples of 18 students, then enter your result below.
Hint 1

Use the formula \(s_X = \sqrt{n\cdot p\left(1 - p\right)}\) from the problem statement. As a reminder, you can compute a square root in a spreadsheet using the SQRT() function — for example, =SQRT(9) returns 3.

Hint 2

Here \(n\) = 18 and \(p\) = 0.34. Build your formula inside SQRT() by multiplying \(n\), \(p\), and \((1 - p)\) together.

Hint 3

In your spreadsheet, type =SQRT(18*0.34*(1-0.34)) and press Enter. Enter the resulting value below.

sqrt(18*0.34*(1 - 0.34))

sqrt(18*0.34*(1 - 0.34))

Be sure to write down what questions you had as you worked through these problems and to have a teacher, colleague, or tutor help clarify things for you.

Submit

If you are part of a course with an instructor who is grading your work on these activities, please copy and submit both of the hashes below using the method your instructor has requested.

Question Hash

The hash below encodes your responses to the multiple choice questions in this activity.

Exercise Hash

Click the button below to generate your exercise submission code. This hash encodes your work on the graded exercises in this activity.

You must have attempted the graded exercises before clicking — clicking generates a snapshot of your current results. If you have completed the activity over multiple sessions, please go back through and enter your answer in each graded exercise cell before generating the hash below, to ensure your most recent results are recorded.

Summary

Main Takeaways
  • The probability of an event \(A\) is a measure of its likelihood and is denoted \(\mathbb{P}[A]\). Every probability must be between 0 and 1.
  • If \(A\) and \(B\) are independent events, then \(\mathbb{P}[A \text{ and } B] = \mathbb{P}[A] \cdot \mathbb{P}[B]\).
  • A binomial experiment satisfies: (1) \(n\) repeated trials, (2) each trial has two possible outcomes, and (3) trials are independent with constant probability of success \(p\).
  • If \(X\) counts successes in a binomial experiment with \(n\) trials and success probability \(p\), use BINOM.DIST() in your spreadsheet:
    • =BINOM.DIST(k, n, p, FALSE) — gives the probability of exactly \(k\) successes
    • =BINOM.DIST(k, n, p, TRUE) — gives the probability of at most \(k\) successes
    • Draw a picture to help you see how to combine these to handle “at least”, “more than”, or “between” scenarios. These two forms of BINOM.DIST() are sufficient to handle any binomial probability scenario — the challenge is identifying how to combine them.
  • The expected number of successes is \(\mathbb{E}[X] = n \cdot p\).
  • The standard deviation of number of successes is \(s_X = \sqrt{n \cdot p \cdot (1 - p)}\). Use =SQRT(n * p * (1 - p)) in your spreadsheet.
Looking Ahead

The next activity introduces the normal distribution — a continuous probability distribution that underpins much of classical statistical inference. Our focus will be on learning to compute probabilities and percentiles from this important distribution.