2026-10-15

Let’s Talk (Power) Ball

Each draw picks 6 numbers from two separate machines:

White balls Red Powerball
Balls drawn per draw 5 1
Possible numbers 1 to 69 1 to 26
Categories \(k\) 69 26
Repeats within a draw? No No

-We use draws from October 7, 2015 onward, when the current 69/26 format began
-Older draws used different ranges, so they are excluded

Utilizing the Chi Squared Distribution

The Chi Square Distribution is used for inferential statistics and confidence interval construction.

In our example, let’s look at winning Powerball numbers. If the choosing of the Powerball balls is sufficiently random, each number has an equal chance of being chosen for the winning numbers. We hypothesize that this data should match that of a uniform distribution. Using Chi-Square Goodness-of-Fit Test, we can determine whether that data does come from the expected pattern.

The Math Behind Chi-Squared

\[\sum_{i=1}^{k}\left(\frac{X_i-\mu_i}{\sigma_i}\right)^2 \sim \chi^2_k\]

This is the density of the chi-square distribution with \(k\) degrees of freedom, and it is the reference distribution for the goodness-of-fit test. If the data matches the expected pattern, the test statistic approximately follows \(\chi^2_{k-1}\), and the p-value is the area to the right of the observed value.

Essentially:

  • Significance level: \(\alpha = .05\)
  • If \(p \ge .05\): fail to reject \(H_0\), so the draws are consistent with a uniform distribution
  • If \(p < .05\): reject \(H_0\), so there is evidence some numbers are drawn more often than chance allows

Let’s next take a look at the goodness-of-fit formula.

The Goodness-of-Fit Statistic

\[\chi^2 = \sum_{i=1}^{k} \frac{(O_i - E_i)^2}{E_i}\]

\(O_i\) = observed count, \(E_i\) = expected count, \(df = k - 1\)

Our steps:

  1. State \(H_0\): every Powerball number is equally likely
  2. Count how often each number was drawn (\(O_i\))
  3. Calculate the expected count if the draw is fair (\(E_i\))
  4. Compute \(\chi^2\) and its p-value
  5. Compare the p-value to \(\alpha = 0.05\) and conclude

R Code Analysis

# read in the expot.csv file and store it in the data frame
pb <- read.csv("export.csv", stringsAsFactors = FALSE)

pb <- pb %>%
  # Drop the double play column and the multiplier. These are not needed
  select(Draw.Date, Winning.Numbers) %>%
  # Convert the date text (e.g. "10/17/2026") into a real date
  mutate(Draw.Date = as.Date(Draw.Date, format = "%m/%d/%Y")) %>%
  # Split "12 13 24 32 35 11" into five white balls and the red Powerball
  separate(Winning.Numbers,
           into = c("n1", "n2", "n3", "n4", "n5", "Powerball"),
           sep = " ", convert = TRUE) %>%
  # Isolate observations from the current 69/26 format (began October 7, 2015)
  filter(Draw.Date >= as.Date("2015-10-07")) %>%
  arrange(Draw.Date)
  

Let’s talk about how this is done computationally. First we read in the Powerball data and store it in a data frame.

The data frame is cleaned of the multiplier column and the doubleplay column so that only the Powerball numbers are isolated. Further splitting the white and red Powerballs with observations only occuring after the year 2015 of October.

Remember, that was a different policy range of numbers for the Powerball.

Let’s take a look at the Powerball frequencies now.

Ball Frequencies

Firstly, let’s take a look at the ball frequencies. Each dot is how many times a number was drawn (\(O_i\)). The gold line is the expected count (\(E_i\)), the frequency each number would have, if the draws came from a uniform distribution.

Next, let’s take a look at the red Powerballs.

Red Powerballs

Here we see the distribution of red Powerball numbers and the expected frequency following a uniform distribution. It seems like a lot of the data is close to the line, however there are some outliers present here.

Next, we will see the goodness-of-fit test.

Running the Test

# Observed counts for each number
O_white <- table(factor(unlist(pb[, c("n1","n2","n3","n4","n5")]), levels = 1:69))
O_red   <- table(factor(pb$powerball, levels = 1:26))

# Goodness-of-fit tests 
white_test <- chisq.test(O_white)
red_test   <- chisq.test(O_red)

white_test
## 
##  Chi-squared test for given probabilities
## 
## data:  O_white
## X-squared = 78.662, df = 68, p-value = 0.177
red_test
## 
##  Chi-squared test for given probabilities
## 
## data:  O_red
## X-squared = 24.15, df = 25, p-value = 0.5107

Analysis of Results

White balls Red Powerball
p-value 0.177 0.511
Significance level \(\alpha\) 0.05 0.05
Comparison 0.177 > 0.05 0.511 > 0.05
Decision Fail to reject \(H_0\) Fail to reject \(H_0\)
  • Both p-values are greater than \(\alpha = 0.05\)
  • The draws are consistent with a uniform distribution, and we found no evidence that some numbers are favored

Conclusion: What did we learn?

So, our conclusion is that, due to failing to reject the null hypothesis, both white balls and the red Powerball numbers are chosen with equal chance. That doesn’t mean you have a high chance of winning though! To win you would need not only the right white balls (out of 69 possibilities), but also the red Powerball (out of 26 possibilities). \[\binom{69}{5} \times 26 = 11{,}238{,}513 \times 26 = 292{,}201{,}338\] So you have a \[\frac{1}{292{,}201{,}338}\] chance of having the winning numbers. That’s CHI-ND of crazy! (A little math distribution pun for ya).

But, if you insist on playing, the next slide is a fun interactive plot which shows you the winning numbers from 2025-2026 within the dataset. You can use this to get an idea of some of the recent winners.

The graph is plotted with the Powerball numbers on the Y axis, and the date on the X axis. Good luck and remember, you can’t win if you don’t play.

2025 to 2026 Winning Numbers