SHORT
VERSION
Two
teams are about to play a Best-of-seven series. The team that wins 4 games wins the series.
If both teams have a 50% chance of winning the game, then both teams have a
50% chance of winning the series.
However, what are the odds that Team 1 wins the series if Team 1 has a 60% of
winning a game.
Write a program that will simulate 1000s of series to see what the
odds are. This program will allow you
to use programming to solve a complex mathematical problem.
LONG VERSION
Click
here for the longer version of this problem.
HINTS
Create the methods:
public int predictGame(double
team1Odds)
This method returns the winning team of a game based on the odds of Team 1
winning a game. So if the odds are
0.5, it should return 1 half the time and 2 the other half of the time.
public int predictSeries()
This method calls the first method 7 times.
If Team 1 wins 4 or more games, it wins the series. Otherwise, Team 2 wins.
public static void main(String[] args)
Inside the main method, you need to simulate 1000s of series using a loop and
keep track of the results. At the end,
you output the results.
|