I have the probabilities for Team X beating Team Y in a game. Each team has two separate probabilities - the probability of winning at home and the probability of winning away.
These probabilities can then be used to calculate the expected winner of a best-of-7 series between the two team. Based on whether or not a team finished higher in the standings, they'll either play a maximum of 4 games at home, or a maximum 3. The format for these games is 2-2-1-1-1, with the higher seed playing twice at home, twice on the road, once at home (if necessary), once on the road (if necessary), and once at home (if necessary).
How could I find the probability that team one wins the series (wins 4 games) in X number (ranging from 4 to 7) of games? My initial thought was to multiply binomial probabilites, like so in R:
games.out <- function(ph, pa) {
df <- data.frame(w = NA, x = NA, y = NA, z = NA)
for(games.played in 4:7){
home.games <- ceiling(games.played/2)
away.games <- floor(games.played/2)
home.wins <- 4 - away.games
away.wins <- away.games
loops <- games.played - 4
win.prob <- (dbinom(home.wins, home.games, ph)*dbinom(away.wins, away.games, pa))
home.wins <- home.wins + 1
away.wins <- away.wins - 1
for(i in 1:loops) {
temp.prob <- (dbinom(home.wins, home.games, ph)*dbinom(away.wins, away.games, pa))
home.wins <- home.wins + 1
away.wins <- away.wins -1
win.prob <- temp.prob + win.prob
}
df[1,games.played-3] <- win.prob
colnames(df)[games.played-3] <- paste0("Win", games.played)
}
return(df)
}
But, when summed, this code gave values that were much too large to make sense.
> games.out(.5, .5)
HW4 HW5 HW6 HW7
1 0.0625 0.15625 0.234375 0.2734375
> sum(games.out(.5, .5))
[1] 0.7265625
A similar question was asked here (How to calculate probability of winning best of 7 series), but that problem simply deals with one probability associated with all seven games - here, I'm looking at two different probabilities associated with potentially different numbers of games.
Any help is definitely appreciated - I've been banging my head against the wall for a couple of hours on this.
HWN
, whereN
is the number of games before the home team wins the series, is the value0.5^N * choose(N, 4)
. This overestimates the probability. Instead, you should calculate0.5^N * (choose(N, 4) - choose(N-1, 4))
. This is because the number of games where the home team wins 4 games inN
games includes the winning pathways where the home team wins 4 games inN-1
games. E.g. ifN = 5
then the sequenceWWWWL
is counted... $\endgroup$choose(5,4)
. You need to exclude these games that terminate early. $\endgroup$