NFL Preseason (49ers @ Broncos): How many TOUCHDOWNS will be SCORED in the 1st Half?
8:10PM
2 or Fewer
3 or More
Inputs To Solve
##### User Estimates #####
SF_TDperG = 2.2
Den_TDperG = 2.4
total_TD = SF_TDperG + Den_TDperG
print("The total expected TOUCHDOWNS for both teams per game is is %s." % (round(total_TD,3)))
The total expected TOUCHDOWNS for both teams per game is is 4.6.
## Inputs Defined in the Problem
period_of_game = .5
TDs = [0,1,2]
Method to Solve
- [1] Estimate lambda_td - expected number of a TOUCHDOWNS scored over one half for both teams.
- [2] Use the Poisson Distribution to compute the probability of 0, 1 or 2 TOUCHDOWNS (p_2orless) being scored in the 1st Half.
## [1]
lambda_td = total_TD * period_of_game
print("lambda_td ~ the total expected TOUCHDOWNS over one half by the both teams")
print("lambda_td ~ %s * %s" % (round(total_TD,3),period_of_game))
print("lambda_td ~ %s" % (round(lambda_td,3)))
lambda_td ~ the total expected TOUCHDOWNS over one half by the both teams
lambda_td ~ 4.6 * 0.5
lambda_td ~ 2.3
## [2]
import math
str_ = ""
print("The probability of k events occurring in a Poisson interval = e^(-lambda) * (lambda^k)/k!")
print("where k = [0,1,2]")
print(' ')
p_2orless = 0
for i in range(TDs[2]+1):
p_2orless += math.exp(-lambda_td)*(lambda_td**(i))/(math.factorial(i))
if(i<TDs[2]):
str_ += str(round(math.exp(-lambda_td)*(lambda_td**(i))/(math.factorial(i)),3)) + " + "
print("e^(-%s) * (%s^%s)/%s! + " % (round(lambda_td,2),round(lambda_td,2),(i),(i)))
else:
str_ += str(round(math.exp(-lambda_td)*(lambda_td**(i))/(math.factorial(i)),3))
print("e^(-%s) * (%s^%s)/%s!" % (round(lambda_td,2),round(lambda_td,2),(i),(i)))
print(' ')
print(str_)
The probability of k events occurring in a Poisson interval = e^(-lambda) * (lambda^k)/k!
where k = [0,1,2]
e^(-2.3) * (2.3^0)/0! +
e^(-2.3) * (2.3^1)/1! +
e^(-2.3) * (2.3^2)/2!
0.1 + 0.231 + 0.265
Solution
print("The probability 2 or Fewer TOUCHDOWNS are scored in the 1st Half is ~%s" % round(p_2orless,3))
The probability 2 or Fewer TOUCHDOWNS are scored in the 1st Half is ~0.596
Info
download markdown file
email: krellabsinc@gmail.com
twitter: @KRELLabs
import sys
print(sys.version)
3.6.5 |Anaconda, Inc.| (default, Mar 29 2018, 13:32:41) [MSC v.1900 64 bit (AMD64)]
Posted on 8/19/2019