Home Archives Search Feed Football Squares How To Use


MLB (Braves @ Phillies): How many RUNS will be SCORED during Innings 1-2?


7:10PM
0 or 1 Run
2 Runs or More


Inputs To Solve

Observed Runs per Game by Team

##### User Estimates #####
ATL_RperGame = 783/146
PHI_RperGame = 705/144

total_runs = ATL_RperGame + PHI_RperGame

print("Braves RUNS per Game is %s" % round(ATL_RperGame,3))
print("Phillies RUNS per Game is %s" % round(PHI_RperGame,3))
print('')
print("The total expected Runs for the game is %s" % round(total_runs,3))
Braves RUNS per Game is 5.363
Phillies RUNS per Game is 4.896

The total expected Runs for the game is 10.259
## Inputs Defined in the Problem
period_of_innings = 2
Runs = [0, 1]

Method to Solve

## [1]

lambda_runs = total_runs * period_of_innings / 9
print("lambda_runs = the total expected RUNS over %s innings" % period_of_innings)
print("lambda_runs = %s * %s / %s" % (round(total_runs,3),period_of_innings,9))
print("lambda_runs ~ %s" % (round(lambda_runs,3)))
lambda_runs = the total expected RUNS over 2 innings
lambda_runs = 10.259 * 2 / 9
lambda_runs ~ 2.28
## [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]")
print(' ')

p0or1 = 0
for i in Runs:
    p0or1 += math.exp(-lambda_runs)*(lambda_runs**(i))/(math.factorial(i))
    
    if(i<=0):
        str_ += str(round(math.exp(-lambda_runs)*(lambda_runs**(i))/(math.factorial(i)),3)) + " + "
        print("e^(-%s) * (%s^%s)/%s! + " % (round(lambda_runs,2),round(lambda_runs,2),(i),(i)))
    else:
        str_ += str(round(math.exp(-lambda_runs)*(lambda_runs**(i))/(math.factorial(i)),3))
        print("e^(-%s) * (%s^%s)/%s!" % (round(lambda_runs,2),round(lambda_runs,2),(i),(i)))

print('')
print('p0or1 = ' + str_)
The probability of k events occurring in a Poisson interval = e^(-lambda) * (lambda^k)/k!
where k = [0,1]
 
e^(-2.28) * (2.28^0)/0! + 
e^(-2.28) * (2.28^1)/1!

p0or1 = 0.102 + 0.233

Solution

print("The probability there are 0 or 1 RUNS scored during Innings 1-2 is ~%s" % round(p0or1,3))
The probability there are 0 or 1 RUNS scored during Innings 1-2 is ~0.336



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 →