NCF (North Carolina @ Wake Forest): Which will OCCUR FIRST in the 1st Quarter?
6:05 PM
Passing Touchdown
Rushing Tuchdown or Neither occur
Inputs To Solve
North Carolina Touchdown Stats
Wake Forest Touchdown Stats
##### User Estimates #####
passing_TDs = 1.3 + 1.9
rushing_TDs = 1.7 + 1.6
print('The total number of observed Passing TOUCHDOWNS per Game for both teams is %s' % passing_TDs)
print('The total number of observed Rushing TOUCHDOWNS per Game for both teams is %s' % rushing_TDs)
The total number of observed Passing TOUCHDOWNS per Game for both teams is 3.2
The total number of observed Rushing TOUCHDOWNS per Game for both teams is 3.3
## Inputs Defined in the Problem
period_of_game = .25
neither_happens = 0
first_to = 1
Method to Solve
- [1] Estimate lambda_pass - expected arrival rate of a Passing TD per Quarter
- [2] Estimate lambda_rush - expected arrival rate of a Rushing TD per Quarter
- [3] Use the Poisson Distribution to compute the probability neither a Passing or Rushing TD occur (p_neither).
- [4] Use the Poisson Distribution assumptions and this equation to compute the probability of a Rushing TD occuring before a Passing TD (p_rush).
- [5] Compute the probability a Rushing TD occurs before a passing TD including the probability neither occur. P_RUSH
## [1]
lambda_pass = passing_TDs * period_of_game
print("lambda_pass ~ the total expected Passingn TD per Quarter")
print("lambda_pass ~ %s * %s" % (round(passing_TDs,3),round(period_of_game,3)))
print("lambda_pass ~ %s" % (round(lambda_pass,3)))
lambda_pass ~ the total expected Passingn TD per Quarter
lambda_pass ~ 3.2 * 0.25
lambda_pass ~ 0.8
## [2]
lambda_rush = rushing_TDs * period_of_game
print("lambda_rush ~ the total expected Passingn TD per Quarter")
print("lambda_rush ~ %s * %s" % (round(rushing_TDs,3),round(period_of_game,3)))
print("lambda_rush ~ %s" % (round(lambda_rush,3)))
lambda_rush ~ the total expected Passingn TD per Quarter
lambda_rush ~ 3.3 * 0.25
lambda_rush ~ 0.825
## [3]
import math
p_p = math.exp(-lambda_pass )*(lambda_pass **neither_happens)/(math.factorial(neither_happens))
p_r = math.exp(-lambda_rush )*(lambda_rush **neither_happens)/(math.factorial(neither_happens))
p_neither = p_p * p_r
print('The probability that neither a Passing or Rushing TD occur in the 3rd Quarter is %s' % round(p_neither,3))
The probability that neither a Passing or Rushing TD occur in the 3rd Quarter is 0.197
## [4]
n = first_to
m = first_to
p_rush = 0
for k in range(n,n+m):
ans = math.factorial(n+m-1)/(math.factorial((n+m-1)-k)*math.factorial(k))
ans1 = (lambda_rush/(lambda_rush+lambda_pass))**k
ans2 = (lambda_pass/(lambda_rush+lambda_pass))**(n+m-1-k)
p_rush += (ans*ans1*ans2)
print('The probability a Rushing TD occurs before a Passing TD in the 3rd Quarter is %s' % round(p_rush,3))
The probability a Rushing TD occurs before a Passing TD in the 3rd Quarter is 0.508
## [5]
P_RUSH = p_neither + p_rush*(1-p_neither)
Solution
print("The probability a Rushing Touchdown occurs before a Passing Touchdown or neither occur in the 3rd Quarter is ~%s" % round(P_RUSH,3))
The probability a Rushing Touchdown occurs before a Passing Touchdown or neither occur in the 3rd Quarter is ~0.605
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 9/13/2019