Skip to main content

Section 6.1 Introduction to Probability

Preview Activity 6.1.1.

When flipping a fair coin, it's equally likely to land on Heads or Tails. Consider the following scenarios and their likelihoods of occuring.

(a)

If a coin is flipped twice, is it more likely to be the same result both times, or different both times? Why do you think so?

(b)

What if the coin is flipped three times? Is it more likely to be the same result on all tosses, or sometime different?

(c)

If a coin was flipped one hundred times, would you be surprised if the result was the same on all tosses? Why?

(d)

Is it possible to flip a fair coin ten thousand times and always get the same result?

Activity 6.1.2.

In probability, an experiment is an action with a measurable result. Taking this action is called a trial, and each possible result of a trial are called an outcome. The set of all possible outcomes for an experiment is known as the sample space for that experiment.

Flipping a coin is an example of an experiment. Tossing the coin is a trial for that experiment, with the possible outcomes of \(H\) (Heads) or \(T\) (Tails). Therefore the sample space for flipping a coin is the set \(\left\{H,T\right\}\text{.}\) We say the coin is fair because the results of Heads and Tails are equally likely to happen during a trial.

Consider the experiment of rolling a six-sided die, with sides labeled by the positive counting numbers one through six. (For short, such dice are known as D6.)

(a)

What action would constitute a trial of this experiment?

(b)

What are the possible outcomes of such a trial?

(c)

What is the sample space for this experiment?

(d)

What word might you use to describe the die if each possible outcome of the trial is equally likely?

(e)

How might you decide that each possible outcome of a trial is equally likely?

Activity 6.1.3.

Suppose a fair coin is flipped twice. The sample space for such an experiment could be described as \(\left\{HH,HT,TH,TT\right\}\text{.}\)

(a)

Describe the sample space for an experiment where a fair coin is tossed three times. (Hint: there are eight possible outcomes.)

(b)

Describe the sample space for an experiment where a fair D6 is rolled twice.

(c)

Describe the sample space for an experiment where a fair coin is flipped, and then a fair D6 is rolled.

(d)

How might this sample space change if the D6 was rolled before flipping the coin? What if both actions occurred at the same time?

Activity 6.1.4.

The cardinality or size \(|A|\) of a set \(A\) counts the number of items inside the set.

An event \(E\) is a subset of outcomes taken from a sample space \(S\text{.}\) Assuming each outcome in the sample space is equally likely, the probability of an event is given by the formula:

\begin{equation*} P(E) = \frac{\text{# outcomes in }E}{\text{# outcomes in }S} = \frac{|E|}{|S|} \end{equation*}

For example, consider flipping a fair coin twice, and the event “at least one flip lands on Heads”. Then \(E=\left\{HH,HT,TH\right\}\text{,}\) and the probability of this event is:

\begin{equation*} P(E) = \frac{|\{HH,HT,TH\}|}{|\{HH,HT,TH,TT\}|}=\frac{3}{4} \end{equation*}

Put another way, the probability of this event occurring is three out of four.

(a)

Write this probability \(\frac{3}{4}\) as a decimal number \(0.\square\square\text{.}\)

(b)

When placed after a number, the percentage sign \(\%\) says to divide that number by \(100\text{.}\) (Literally, “per-cent” means “per one hundred”.) Write the probabilty \(\frac{3}{4}\) using a percentage sign.

(c)

Consider the rolling of a fair D6, and the event “an even number is rolled”. Write this event as a set of possible outcomes.

(d)

Show how to compute the probability of rolling an even number on a fair D6. Give this probability as an unsimplified fraction, a simplified fraction, a decimal, and percentage.

(e)

What are some different ways to communicate this probability as an English sentence? Give at least three examples.

Activity 6.1.5.

While probability measures the ratio of event outcomes over all possible outcomes, an experimental probability is obtained by actually running the experiment several times, and calculating the number of trials that fit the event divided by the total number of trails run. That is, it follows the following formula:

\begin{equation*} \hat P(E) = \frac{\text{# trials that belong to }E}{\text{# trials run}} \end{equation*}

For example, to compute experimental probabilities from flipping a fair coin, one might flip that coin five times. If the results were H-T-T-H-H, then the experimental probability for obtaining Heads would be \(\frac{3}{5}=60\%\text{,}\) and obtaining Tails would be \(\frac{2}{5}=40\%\text{.}\)

(a)

Flip a fair coin ten times and record the results of each trial. Then give the experimental probabilities for obtaining Heads and Tails respectively.

(b)

Do it again. Did you obtain the same results? Should you have? Explain your reasoning.

(c)

Find all possible experimental probabilities of flipping Heads using five trials. (Hint: there are six of them, including the \(\frac{3}{5}\) mentioned above.) Explain your reasoning, and explain which of these probabilities you'd expect to see most often in actual experiments.

(d)

Bugfix the SageMath for-loop in 6.1.1 to see how the experimental probability of flipping Heads can change as 1000 coinflips are simulated.

heads = 0
total = 0
points = []

for _ in range(1000):
    # re-arrange the following lines, fixing indentation as needed
    heads = heads + 1
    points.append( (total,ex_prob) )
    if flip == "H":
        ex_prob = heads/total
    total = total + 1
    flip = choice(['H','T'])

show(
    line(points, color="blue")+line([(1,0.5),(1000,0.5)], color="red"),
    axes_labels=["Trials","Exp. Prob."],
    ymin=0,
    ymax=1
)
Listing 6.1.1. Buggy code to simulate flipping coin 1000 times

(e)

Create a few copies of that same Code cell to run additional experiments. What do these graphs mean, and how do they illustrate the fairness of the simulated coin flips?

Activity 6.1.6.

Consider the experiment of rolling two fair D6, and the events \(E_6\) “The sum of the dice is six” and \(E_{11}\) “The sum of the dice is eleven”.

(a)

Do you expect these events have equal or different probabilities? Explain your reasoning.

(b)

Modify the simulated experiment from the previous activity to illustrate experimental probabilities for \(E_6\) and \(E_{11}\) over 1000 trials, using roll_a = randrange(1,7) and roll_b = randrange(1,7) to obtain two random D6 rolls.

(c)

Do these simulations confirm or contradict your earlier guess? Explain why.

(d)

Find the (non-experimental) probabilities for \(E_6\) and \(E_{11}\) by listing and counting all the possible outcomes matching each event, and computing \(|E_6|/|S|\) and \(|E_{11}|/|S|\text{.}\) (Hint: Rolling a \(4\) and \(2\) is a different outcome than rolling a \(2\) and \(4\text{.}\))

(e)

Explain how these probabilities match your simulations.

Exercises Exercises

1.

Consider the experiment of rolling an eight-sided die with sides labeled one through eight, also known as a D8. Describe a trial of this experiment, all the possible outcomes, and the sample space.

2.

Consider the event “the D8 rolls a number more than \(3\)”. Describe this event as a set of outcomes.

3.

Show how to compute the probability of this event. Give this value as a fraction, decimal, and percentage.

4.

Modify the code used in class to simulate similar experiments to illustrate the experimental probability of this event over 1000 trials.

5.

Consider the experiment of both flipping a fair coin and rolling a fair D6. Show how to find the probability that the coin is Tails and the D6 isn't four.

6.

Verify this probability experimentally by modifying your simulation code.