ASA Connect

 View Only
Expand all | Collapse all

Interesting Baseball Streak

  • 1.  Interesting Baseball Streak

    Posted 07-20-2022 10:38

    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
    ------------------------------


  • 2.  RE: Interesting Baseball Streak

    Posted 07-20-2022 14:32
    One thing is that I strongly suspect that results in the All-Star Game are NOT independent year to year.  Once a streak gets going there's likely to be some expectation that the streak will continue and this can affect the play.

    Also differences can develop between the leagues in what sorts of strategies and tactics etc. are favored which could give one league or the other an advantage in the All-Star setting.

    There's also the rules difference between the leagues (and the changes in how the All-Star game handled this) from 1973-2021 on the Designated Hitter.

    ------------------------------
    Michael Ikeda
    ------------------------------



  • 3.  RE: Interesting Baseball Streak

    Posted 07-21-2022 08:50
    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
    ------------------------------



  • 4.  RE: Interesting Baseball Streak

    Posted 07-22-2022 08:45
    Issue:

    Games are not independent. Also, it implies people are retrospectively creating and testing a hypothesis on the same data.  The Seattle Mariners have a 13 game winning streak with a mediocre team. More impressive, the weak Baltimore Orioles had a 10 game win streak.

    Many of the same players are on the rosters year after year, and the American League has had more clutch players.

    Best,

    Jon Shuster


    ------------------------------
    Jonathan Shuster
    ------------------------------



  • 5.  RE: Interesting Baseball Streak

    Posted 07-22-2022 11:31
    There have been a total of 89 All Star Games which ended with a winner (List of Major League Baseball All-Star Games - Wikipedia)

    The AL has won 46, and the NL 43. Assuming independence between games (not unreasonable since a year elapses between games), and assuming each league has p = 0.5 probability of winning, one should probably compute the probability that at least one of the two leagues has a winning streak of at least 9 games. This can be done using probability generating functions. The details may be found in Feller, Volume 1, Chapter 13 ("Recurrent Events. Renewal Theory"). Using wxMaxima on my Ubuntu laptop I obtained a probability of 0.1502, not a particularly low probability.

    On this topic there was an amusing story in the NY Times some years ago. Professor Ted Hill at Georgia Tech used to ask his students to toss a coin 200 times, and write down the sequence of heads and tails. He knew that some of the students would cheat, and simply make up a sequence. This was his criterion for deciding which sequences were genuine and which were not: if a sequence contained at least one run of six or more consecutive heads or six or more consecutive tails he assumed it was genuine. In fact the probability of this happening is around 0.96.

    ------------------------------
    Anthony Giles Warrack
    (Retired)
    NC A&T State University
    ------------------------------



  • 6.  RE: Interesting Baseball Streak

    Posted 07-23-2022 14:45
    Note that the 9 game winning streak is NOT the longest winning streak.  The longest streak is an 11 game National League winning streak (1972-1982).

    There's also an 8 game NL streak (1963-1970) and a streak with 12 AL wins and one tie (1997-2009, tie in 2002).

    (Based on the Wikipedia page "List of Major League Baseball All-Star Games.)

    ------------------------------
    Michael Ikeda
    ------------------------------



  • 7.  RE: Interesting Baseball Streak

    Posted 07-24-2022 15:48
    Well the probability of either league having a streak of 11 or more wins in 89 games is  0.0385. Quite a small probability, but not startlingly so (IMHO)

    ------------------------------
    [Giles] [Warrack]
    [Retired]
    [North Carolina A&T State University]
    ------------------------------



  • 8.  RE: Interesting Baseball Streak

    Posted 07-25-2022 09:02
    But is isn't just that you have one 11 game streak.  The eight game NL streak is just before the 11 game NL streak and just before that is another streak where the NL goes 4-0-1, for a total of 23 NL wins in 26 games (with one tie).  The 12-0-1 AL run is near the current 9 game streak (although separated by a 3 game NL streak), for a total of 21 AL wins in 25 games (again with one tie).  And the whole thing begins with the AL going 12-4.  There's a LOT of streaky behavior.

    (If I counted correctly, not including the four games that are either ties or just before ties, there are only 28 games where the winner of the next game is the other league.)

    ------------------------------
    Michael Ikeda
    ------------------------------



  • 9.  RE: Interesting Baseball Streak

    Posted 07-25-2022 09:41
    I do not know if my past post got on, but games are not independent events.  Even all-star games have many of the same players, so there is huge potential for interaction.  To make a team, the player usually need good numbers. My impression is that AL teams field more clutch players than NL teams.  Reggie Jackson, for those of you old enough to remember, was dubbed Mr. September.  He came to life in the playoffs often with mediocre numbers. Stephen Strasburg had a so-so season but was unhittable in the 2019 playoffs.

    Best wishes,


    Jon

    ------------------------------
    Jonathan Shuster
    ------------------------------



  • 10.  RE: Interesting Baseball Streak

    Posted 07-25-2022 12:30
    I agree with you Michael (& Don),
    In fact if you look at the 90 games where there was a winner, there are a total of 29 "streaks" (this includes singleton streaks of one game). But if you generate 90 Bernoulli variables (p = 0.5), the expected number of streaks is about 45.5 with standard deviation about 4.7. So 29 is more than 3 standard deviations below the mean, which would indicate the model of independent Bernoulli trials is not very plausible.

    ------------------------------
    [Giles] [Warrack]
    [Retired]
    [North Carolina A&T State University]
    ------------------------------



  • 11.  RE: Interesting Baseball Streak

    Posted 07-26-2022 09:01
    The following may be useful regarding such streaks.  As I recall, Feller Volume 1 has a whole section devoted to fair coin tossing (the arcsine law, etc) and has an example of 10,000 tosses of a fair coin.  Such data is very trendy since it is a null recurrent random walk.  In addition Erdos-Renyi laws of large numbers also address this trendiness.

    ------------------------------
    James Lynch
    ------------------------------



  • 12.  RE: Interesting Baseball Streak

    Posted 07-26-2022 11:39
    Your last sentence is important but needs to be expanded to ". . . the model of independent identically distributed Bernoulli trials with p = 0.5 is not very plausible." The "p = 0.5" part relates to other comments that were made, but the "identically distributed" part is also. I suspect the advantage in the all-star game, and hence the value of p, has shifted over time as the teams have changed. While I have not followed sports statistics much, much of what I have seen on analyzing streaks has started with i.i.d. Bernoulli trials as a null model, testing for dependence. The "identically distributed" part is typically not believable. For example, it makes no sense for basketball shooting streaks where it assumes equal probabilities of success for wide open layups, for contested 3-point attempts at the end of a shot clock, and for heaves from beyond half court at the end of a quarter. I haven't done any formal analysis, but wouldn't we suspect that widely varying success probabilities could camouflage dependence in Bernoulli trials. Has anyone tried to account for varying success probabilities in things like shooting streaks?

    ------------------------------
    William Bell
    ------------------------------



  • 13.  RE: Interesting Baseball Streak

    Posted 07-27-2022 08:33
    William,
    I would agree with that amendment to the last sentence.
    As far as computing streaks with varying independent Bernoulli probabilities I think would be quite easy to use simulations to obtain approximations, if you knew the probabilities, or could estimate them. Not sure about dealing with dependence.

    ------------------------------
    [Giles] [Warrack]
    [Retired]
    [North Carolina A&T State University]
    ------------------------------



  • 14.  RE: Interesting Baseball Streak

    Posted 07-24-2022 18:12
    Your method is very interesting. I had no idea that there was a connection between Fibonacci sequences and success runs. Using probability generating functions I get exactly the same answers as you do for k = 5 and k = 9 (n = 100). My question is, can you compute probabilities using this method for streaks in sequences of Bernoulli trials where p, the probability of success on each trial, is different from 0.5?

    ------------------------------
    [Giles] [Warrack]
    [Retired]
    [North Carolina A&T State University]
    ------------------------------



  • 15.  RE: Interesting Baseball Streak

    Posted 07-21-2022 08:52
    Hi,

    For a discussion of the phenomenon of "streaks" in sports, see the following link:
    https://theconversation.com/momentum-isnt-magic-vindicating-the-hot-hand-with-the-mathematics-of-streaks-74786

    ------------------------------
    David Zucker
    Hebrew University, Jerusalem
    ------------------------------