Home Archives Search Feed Football Squares How To Use


Spanish Copa del Rey - Rd of 16 (Leganes @ Barcelona): Will Lionel Messi (BAR) SCORE a GOAL in the 1st Half?


1:00PM
Yes: Messi Scores 1+ Goals in 1st Half
No: Messi doesn’t Score Goal in 1st Half


Inputs To Solve

Messi anytime goal score odds (sportsineraction)

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

p_anytime_goal = 1/1.4

print("The probability of a Lionel Messi scoring a GOAL is ~%s" % round(p_anytime_goal,3))

The probability of a Lionel Messi scoring a GOAL is ~0.714     


Method to Solve

[1] Assume the probability of Messi scoring a goal in the 1st Half is approximately the same as the probability of Messi scoring a goal in the 2nd Half (p).

[2] Break Messi scoring down into halves:

1st Half 2nd Half
GOAL GOAL
NO GOAL GOAL
GOAL NO GOAL


1st Half 2nd Half odds
p p p^2
1-p p (1-p)*p
p 1-p p*(1-p)

The sum of the odds of the above must equal p_anytime_goal

[3] Solve the quadratic equation p^2 - 2p + p_anytime_goal = 0 to estimate the probability Messi scores in the 1st Half

[3]

import math

a = 1
b = -2
c = p_anytime_goal

d = b**2-4*a*c # discriminant

if d < 0:
    print ("This equation has no real solution")
elif d == 0:
    x = (-b+math.sqrt(b**2-4*a*c))/2*a
    print ("This equation has one solutions: "), x
else:
    x1 = (-b+math.sqrt((b**2)-(4*(a*c))))/(2*a)
    x2 = (-b-math.sqrt((b**2)-(4*(a*c))))/(2*a)
    print ("This equation has two solutions: ", round(x1,3), " or", round(x2,3))

This equation has two solutions: 1.535 or 0.465     


Solution

print("The probability that Lionel Messi scores a GOAL in the 1st HALF is ~%s" % round(x2,3))

The probability that Lionel Messi scores a GOAL in the 1st HALF is ~0.465     




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 1/30/2020






← Next post    ·    Previous post →