I am not a baseball fan myself, but in another context I was looking at streaks of events and had an example like below in my presentation. You can use the fibonachi series. I attached an Rmarkdown document with Rcode if anyone is interested.
```{r}
library(dplyr)
library(tidyverse)
nk=crossing( n = seq(2, 500, 2),
k = c(5,7,9) )
p=.5
q=1-p
fibonacci <- function(order) {
reduce(seq_len(1200), ~ c(., sum(tail(., order))), .init = c(1, 1))
}
nk %>%
group_by(k) %>%
mutate(exact = 1-fibonacci(k[1])[n + 2] / 2 ^ n) %>%
ggplot(aes(n)) +
geom_line(aes(y = exact, group = k, color = factor(k)), size=1) +
scale_y_continuous(labels = scales::percent) +
labs(y = "Probability of at least one head streak",
x = "Number of Coin Flips",
color = "Length of streak")
n=100
k=5
exact5 = 1-fibonacci(k[1])[n + 2] / 2 ^ n
k=6
exact6 = 1-fibonacci(k[1])[n + 2] / 2 ^ n
k=9
exact9 = 1-fibonacci(k[1])[n + 2] / 2 ^ n
```
The probability we have at least one streak of five heads in a row if we flip a coin 100 times is `r round(exact5,3)`. The probability we have at least one streak of nine heads in a row if we flip a coin 100 times is `r round(exact9,3)`.
The probability we have at least one streak of five heads in a row if we flip a coin 100 times is 0.81. The probability we have at least one streak of nine heads in a row if we flip a coin 100 times is 0.088.
------------------------------
Laura Kapitula
Senior Biostatistician
------------------------------
Original Message:
Sent: 07-20-2022 10:38
From: Michael Sack Elmaleh
Subject: Interesting Baseball Streak
For those of you who do not follow baseball, yesterday the American League all stars beat the National League all stars for the 9th year in a row. This streak captures our attention because given the apparent parity of the talent in both leagues we would intuitively not expect to see this result. For you stats teachers out there this is a very salient real-world example that you can point to in trying to convince students that in tossing a fair coin multiple times seemingly anomalous streaks of all heads or all tails will occur.
But the idea of ordinary natural seemingly non-random processes like competitive games giving rise to streaks associated with random processes like coin flipping and coin tossing…well it is not just Einstein that rebels against the thought that randomness is a real, though perhaps emergent property, of world events. We will search usually in vain for some causal story rather than accept the idea that randomness really exists and plays an important role in the world we live in.
------------------------------
Michael Sack Elmaleh
Principal
------------------------------