Home Archives Search Feed Football Squares How To Use


MLB (Yankees @ Tigers): Will a HIT be recorded in the TOP of the 4th Inning?


2:10PM
Yes: At least 1 hit in Top of 4th Inning
No: No hits in Top of 4th Inning


Inputs To Solve

HITS per Game by Team

##### User Estimates #####

NYY_HperG = 9.27
## Inputs Defined in the Problem
period_of_innings = 1
HITS = 0

Method to Solve

## [1]

lambda_h = NYY_HperG * period_of_innings / 9
print("lambda_h = the total expected XBH over %s innings" % period_of_innings)
print("lambda_h = %s * %s / %s" % (round(NYY_HperG,3),period_of_innings,9))
print("lambda_h ~ %s" % (round(lambda_h,3)))
lambda_h = the total expected XBH over 1 innings
lambda_h = 9.27 * 1 / 9
lambda_h ~ 1.03
## [2]

import math

p0 = math.exp(-lambda_h)*(lambda_h**HITS)/(math.factorial(HITS))

print("The probability of k events occuring in an Poisson interval = e^(-lambda) * ((lambda^k)/k!)")
print('where k = 0 and lambda = %s' % round(lambda_h,3))
print('')
print("p0 = e^(-%s) * (%s^%s)/%s!" % (round(lambda_h,2),round(lambda_h,2),HITS,HITS))
The probability of k events occuring in an Poisson interval = e^(-lambda) * ((lambda^k)/k!)
where k = 0 and lambda = 1.03

p0 = e^(-1.03) * (1.03^0)/0!

Solution

print("The probability that there are no HITS in the top of the 4th Inning is ~%s" % round(p0,3))
The probability that there are no HITS in the top of the 4th Inning is ~0.357



Info

download md 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/12/2019






← Next post    ·    Previous post →