Chapter 7: Basic (Discrete) Probability

STAT117: Introduction to Statistics

Introduction

A simple, intuitive example: consider rolling a fair, six-sided die 🎲

  • What is the probability that you roll a 2?

  • What is the probability that you do not roll a 2?

  • What is the probability that you roll a number smaller than or equal to 4?

The answers should be very intuitive, but think about how you arrived at the answers precisely.

Show solution
  • Roll a 2: 1 of the 6 outcomes is a 2, so the probability is 1/6.
  • Do not roll a 2: 5/6.
  • Roll a number less than or equal to 4: 4 of the 6 outcomes (1, 2, 3, 4) qualify, so the probability is 4/6 = 2/3.

Mathematical definitions

When we perform a random experiment (ex: roll a die), we can have different outcomes (ex: 1, 2, 3, 4, 5, 6).

  • An event (denoted E) is a collection (i.e., a set) of outcomes.

Example: the event “rolling a number less than or equal to 4” is the collection of outcomes {1, 2, 3, 4}.

  • The complement of an event E (denoted \(E^C\)) is the event that E does not occur (i.e., the collection of outcomes that are not in E).

Example: the complement of the event “rolling a number less than or equal to 4” is the event “rolling a number greater than 4”, which is the collection {5, 6}.

  • Two events E1 and E2 are disjoint or mutually exclusive if they cannot occur at the same time (i.e., their intersection is empty).

For example, the events “rolling a 1” and “rolling a 2” are disjoint because they cannot occur at the same time.

  • The probability of event E is denoted P(E).

Basic rules of probability

  • Rule 1: if the outcomes of an experiment are equally likely to occur, then P(E) = (number of outcomes in E) / (total number of outcomes).

Example: P(rolling < 5) = 4/6 comes from the fact that there are 4 outcomes in the event {1, 2, 3, 4} and 6 total outcomes.

  • Rule 2: P(E^C) = 1 – P(E)

Example: P (not rolling 2) = 1 – P ( rolling 2) = 1 – 1/6

  • Rule 3: if E1 and E2 are mutually exclusive, then P(E1 or E2) = P(E1) + P(E2)

Example: P (rolling 1 or rolling > 4) = P (rolling 1) + P (rolling > 4) = 1/6 + 2/6

Example 1:

  1. Consider the frequency table for player position (Pos) in the NBAPlayers2024 dataset (download). Position codes are C (center), PF (power forward), PG (point guard), SF (small forward), and SG (shooting guard).
R code (optional)
library(Lock5Data)
library(tidyverse)
NBAPlayers2024 %>%
  group_by(Pos) %>%
  summarise(Counts = n()) %>%
  mutate(Frequency = Counts / sum(Counts))
# A tibble: 5 Ă— 3
  Pos   Counts Frequency
  <chr>  <int>     <dbl>
1 C         36     0.152
2 PF        52     0.219
3 PG        43     0.181
4 SF        53     0.224
5 SG        53     0.224

Assume that one player is selected at random from the dataset. Find the probability that the player is:

  • A center
  • A point guard
  • Not a shooting guard
  • A small forward or shooting guard
  • Both a center and a point guard
Show solution
  • A center: \(36/237 \approx 0.152\), or about 15.2%.
  • A point guard: \(0.181\), or 18.1%.
  • Not a shooting guard: \(1-0.181 \approx 0.819\), or 81.9%.
  • A small forward or shooting guard: \(0.224+0.224 = 0.448\), or about 44.8%.
  • Both a center and a point guard: \(0\); the events are mutually exclusive (i.e., a player cannot be both a center and a point guard at the same time).

Example 2:

  1. The following clustered bar graph compares the ages of centers (C) and point guards (PG) in the NBAPlayers2024 dataset. Player ages are grouped into three categories.
R code (optional)
nba_position_age <- NBAPlayers2024 %>%
  filter(Pos %in% c("C", "PG")) %>%
  mutate(
    AgeGroup = cut(
      Age,
      breaks = c(18, 24, 29, Inf),
      labels = c("19-24", "25-29", "30+")
    )
  ) %>%
  count(Pos, AgeGroup, name = "Count")

ggplot(nba_position_age, aes(x = Pos, y = Count, fill = AgeGroup)) +
  geom_col(position = "dodge") +
  geom_text(
    aes(label = Count),
    position = position_dodge(width = 0.9),
    vjust = -0.3
  ) +
  labs(
    x = "Player position",
    y = "Count",
    fill = "Age group"
  ) +
  theme_minimal()

If I randomly select a Center, what is the chance that he is 30+ years old? What if I randomly select a Point Guard?

Show solution
  • Center: there are 12+16+8 = 36 centers (denominator), and 8 of them are 30+ (numerator), so \(8/36 \approx 0.222\), or about 22.2%.
  • Point guard: there are 14+19+10 = 43 point guards (denominator), and 14 of them are 30+ (numerator), so \(14/43 \approx 0.326\), or about 32.6%.
  • Comment: this is another way to think about the bivariate relationship betweeen NBA player’s age and position. In this case, there is a relationship: if I choose among centers, I have 22.2% chance of getting a 30+ year old, but if I choose among point guards, I have a better chance (32.6%) of getting a 30+ year old.

Discussions on probability

  • Often, we assume the outcomes are equally likely (e.g., fair die). This is also implied when we say random sample or choosing at random, in which case, an outcome is the person you happen to select.
Show more

Random sample means that each person in the population has an equal chance of being selected. A true random sample is often difficult to obtain and we should always be critical about sampling bias.

From a recent article about voting polls: Why haven’t polls overstated Democrats’ chances in recent midterms? One factor seems to be that President Trump excels among a relatively disengaged group of voters who are unlikely to respond to surveys — but who are also unlikely to vote in midterm elections. As a result, the polls — and Democrats — do better in lower-turnout elections, when a highly engaged, poll-taking, Democratic-leaning set of voters shows up. By contrast, in the last three presidential elections, many of these hard-to-reach Trump supporters did show up to vote, creating problems for pollsters.

  • When discussing probability, something has to be random.
Show more

Sometimes the randomness comes from the experiment itself (e.g., rolling a die, attempting a free throw). The randomness can also come from the sampling process, as the point of a random sample is that you don’t know who might end up in the sample.

  • The word “probability” and “percentage” are often used interchangeably.
Show more

Example: if 38 percent of households (in a certain region) own a cat, you might say that the probability of owning a cat is 0.38. What is meant that you imagine selecting a household at random; there is a 38% chance that the household you happen to select owns a cat.

Example: the probability of rolling a 2 on a fair die is 1/6 (or 0.167). You could also understand this as: if you roll a large number of fair dice, about 16.7 percent of them will be a 2.

Example: a statement like “the vaccine is 98% effective” can be interpreted as: when administered to a large number of people, the vaccine is effctive for 98 percent of them.