# Playoff and World Series Probability Calculator

## Just Do It

This web page implements a playoff probability calculator. Given assumptions about the probabilities for single games, it calculates probabilities for a 5 or 7 game series.

To check out what it does, just click the submit button below.

Ignore everything but the last six lines, which will look something like

```Rweb:> cat("currently,", n1, w1, n2, w2, "\n")
currently, Yankees 2 Twins 1
Rweb:> cat("probability", n1, "win series:", p1total, "\n")
probability Yankees win series: 0.7525
Rweb:> cat("probability", n2, "win series:", 1 - p1total, "\n")
probability Twins win series: 0.2475
```

To modify what it does, look at the section on modifying the calculation below.

## Modifying the Calculation

The whole calculation is determined by 5 numbers, which are assigned in the statements at the top of the web form and which you can edit.

```ngame <- 7     # number of games in the series
w1 <- 0        # number of wins, team 1
w2 <- 1        # number of wins, team 2
p1home <- 0.55 # probability of team 1 win at home
```

The meaning of these numbers is as follows.

• `ngame` is the number of games in the whole series (including games already played), right now only 5 or 7 is allowed.
• `w1` is the number of wins for team 1 in the games already played. Team 1 is the team with home field advantage in the series (the team at home in the first game).
• `w2` is the number of wins for team 2 in the games already played.
• `p1home` is the probability of team 1 winning a game at home. The default (`0.55`) is about right for two evenly matched baseball teams (the home field/court advantage is much higher in basketball).
• `p1road` is the probability of team 1 winning a game on the road. The default (`0.45`) is about right for two evenly matched baseball teams (the home field/court advantage is much higher

Basically, your opinion only enters the two numbers `p1home` and `p1road`. If you don't believe the teams are evenly matched, change these numbers and see what happens.

You can also edit the team names, but this doesn't affect any calculated numbers.

```n1 <- "Angels" # name of team 1
n2 <- "Giants" # name of team 2
```