Statistics Question? Monte Carlo Simulation? Combinatorics?

267 Views Asked by At
  • A term in an NBA team's lease agreement states that it must pay a penalty fee every time it fails to reach $17,000$ attendees in three consecutive home games.
  • The onerous fee has caused the team to request assistance in assessing its risk. The team estimates the probability it will reach $17,000$ attendees in a home game is $75$%, and each game has an equal likelihood of eclipsing the $17,000$ threshold.
  • Given the $75\ \%$ likelihood of hitting that number each game, what are the odds that the team will avoid a three-game streak with attendance under $17,000$ for the entire season ?.
  • Please build a simple simulator to determine your answer ( note that there are $41$ regular season home games; assume each game is independent ).

How do I approach this problem and simulate, perhaps with python script ?.

3

There are 3 best solutions below

4
On

If I understand correctly,assuming independence, you can find $1-P$(1 or 2 games only will fall below $75 \%$). The probability that exactly one game will miss out is $41C1(.25)(.75)^{40}$ ( $41C1$ ways of choosing that one game, with probability $.25\%$ and for $2$ games, it is $41C2 (.25)^2(.75)^{39}$ ; choose the 2 games that will not hit the target in $41C2$ ways , each combination having probability $(0.25)^2 (.75)^{39}$ , where $nCm$ stands for "$n$ Choose $m$". EDIT: As pointed out, I missed the part on consecutive games. Will be back to reqrite ASAP.

0
On

Note: I checked StackOverflow for this question but could not find it, which is why I am posting code in a mathematics stack exchange

The following python program should accurately simulate the scenario you've explained over a user inputted number of seasons. I don't program in python often so I apologize if this is not conventional or neat. Because I quickly wrote this, I did not add documentation to the code.

#!/usr/bin/env python
"""simulaiton.py, by B. Standage. 2017-07-26"""

from random import randint

def main():

    lossStreak = 0
    loosingStreaks = 0
    seasonsAvoided = 0
    seasons = input("Number of seasons you wish the simulation to run for: ")

    while (seasons > 0):
        avoidedLoosingStreak = "Yes"
        count = 0

        for x in range (0, 40):
            if(randint(0,100) <= 75):
                lossStreak = 0
            else:
                lossStreak += 1
                if(lossStreak == 3):
                    avoidedLoosingStreak = "No"
                    count += 1


        if(avoidedLoosingStreak == "Yes"):
            seasonsAvoided += 1
        else:
            loosingStreaks += count
        seasons -= 1

    print("Total seasons avoiding a three game loosings treak: " + str(seasonsAvoided))
    print("Total seasons facing a three game loosings treak: " + str(loosingStreaks))
    print("In a total of " + str(seasons) + " the experimental odds of having less than 17,000 fans in attendance for at leas$

if __name__ == "__main__":
        main()
0
On

Let an attendance over (or equal to) 17000 be a success and anything fewer a failure.

Let $a_n$ be the probability that after n games so far there hasn't been a run of 3 consecutive failures and that the nth game was a success. Similarly let $b_n$ be the probability that after n games so far there hasn't been a run of 3 consecutive failures, the nth game was a failure but the (n-1)th was a success and let $c_n$ be the probability that after n games so far there hasn't been a run of 3 consecutive failures, the nth game was a failure and the (n-1)th was also a failure.

This gives us the recurrance relationship:

$$a_n = \frac{3}{4}(a_{n-1} + b_{n-1} + c_{n-1})\\b_n = \frac{1}{4}a_{n-1}\\c_n = \frac{1}{4}b_{n-1}\\(a_2=\frac{3}{4}, b_2=\frac{3}{16}, c_2=\frac{1}{16})$$

Then the probability of going the entire season (41 games) without three consecutive failures is $a_{41} + b_{41} + c_{41}$

Then using the following python code I got the probability to be approximately 0.61866:

a = 3/4
b = 3/16
c = 1/16
for x in range(39):
    a, b, c = 3/4*(a+b+c), 1/4*(a), 1/4*(b)
print(a+b+c)