Lesson 2.1: Probabilities of Events
Software Lab 2.1
Probability Basics
The goal of this lab is to work through some basic probability calculations using the examples of rolling a die and selecting a playing card.
As you work through the lab, answer the ungraded exercises in the shaded boxes. Check your answers by consulting the Software Lab 2.1 Solutions.
Remember to complete the graded Software Lab Questions for this section in Moodle.
Rolling a Die
Data representing 10,000 simulated rolls of a fair, six-sided die are stored in a dataset called dice
, which you can download from dice [CSV file] (OpenIntro, n.d.). The dataset contains a single variable, y
, which represents the outcome (a number from 1 to 6) for each die roll.
Once you’ve downloaded the dice
dataset, open the jamovi menu (the three horizontal lines in the top-left corner), select Open
, then Browse
, and select the file in the location you downloaded it to. Explore the data by clicking the Analyses
tab, then clicking Exploration > Descriptives
, then selecting y
as the Variable
, and checking Frequency tables
and Plots > Bar plot
. Confirm that the number of times a 1 was rolled was 1,671, the number of times a 2 was rolled was 1,680, and so on.
Section 3.1 in OpenIntro Statistics defines the probability of an outcome as “the proportion of times the outcome would occur if we observed the random process an infinite number of times” (Diez et al., 2019) CC BY-SA 3.0. We can expand this definition to events consisting of a set of outcomes, i.e., the probability of an event is “the proportion of times the event would occur if we observed the random process an infinite number of times.”
If we let A represent the event where a die roll results in 1 or 2, then the probability of event A is P(A) = 2/6 = 1/3, since there are six equally likely outcomes (rolling 1, 2, 3, 4, 5, or 6), two of which are in event A (rolling a 1 or 2). We’ve only observed 10,000 die rolls rather than an infinite number of die rolls, so the proportion of die rolls in event A isn’t exactly 1/3, but it’s fairly close: (1,671+1,680) / 10,000 = 3,351 / 10,000 = 0.3351.
Selecting a Playing Card
Data representing 10,000 simulated draws of a playing card from a regular deck of 52 cards are stored in a dataset called cards
, which you can download from cards [CSV file] (OpenIntro, n.d.). The dataset contains two variables: rank
, which takes one of the values (2, 3, 4, 5, 6, 7, 8, 9, 10, Jack, Queen, King, Ace) and suit
, which takes one of the values (Club, Diamond, Heart, Spade).
Once you’ve downloaded the cards
dataset, open the jamovi menu using the three horizontal lines in the top-left corner, select Open
, then Browse
, and select the file in the location you downloaded it to. Explore the data by clicking the Analyses
tab, then clicking Exploration > Descriptives
, then selecting rank
and suit
as the Variables
, and checking Frequency tables
. Confirm that the card was a queen 761 times, and the card was a heart 2,509 times.
suit
from the Variables
box to the Split by
box to create a contingency table. How many times was the card a queen of hearts?Next, let A represent the event where the card is a queen and B represent the event where the card is a heart. Note that the probability the card is a queen is P(A) = 1/13, the probability the card is a heart is P(B) = 1/4, and the probability the card is the queen of hearts is P(A and B) = 1/52. These probabilities satisfy the condition for independent events since P(A) x P(B) = 1/13 x 1/4 = 1/52 = P(A and B).
Remember that the probability of an event is “the proportion of times the event would occur if we observed the random process an infinite number of times.” In the cards
dataset we’ve only observed the random process 10,000 times, so the proportion of times the card was the queen of hearts won’t be exactly equal to the product of the proportion of times the card was a queen and the proportion of times the card was a heart, but it should be fairly close.
Finally, let A represent the event where the card is a face card and B represent the event where the card is a king or an ace. Note that the probability the card is a face card is P(A) = 3/13, the probability the card is a king or an ace is P(B) = 2/13, and the probability the card is a jack, a queen, a king, or an ace is P(A and B) = 4/13.
Diez, D. M., Çetinkaya-Rundel, M., Barr, C. D. (2019). OpenIntro Statistics (4th ed.). OpenIntro. https://www.openintro.org/book/os/
OpenIntro. (n.d.). Data sets [Data sets]. https://openintro.org/data/