All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Probability
Pete and Jimmy (Posted on 2023-12-29) Difficulty: 3 of 5
Old Jimmy and young Pete are both tennis champions. They have played each other many times, each winning exactly half of the matches. When both are fresh Jimmy is much the better player, but he tires rapidly so his probability of winning the kth set is pk, where p is the probability that he wins the first set.

If they always play best-of-five matches, what is the value of p?

See The Solution Submitted by K Sengupta    
Rating: 5.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Some Thoughts Solution | Comment 2 of 8 |
[Edit:  this is incorrect; I correctly solved the equation below, but it is the wrong equation]
Goal:  find p such that p^1 + p^2 + p^3 + p^4 + p^5 = 2.5

Wolfram Alpha: 0.777307

Spreadsheet goal seek:
1 0.777306976482763  <-- approximate answer
2 0.604206135688774
3 0.469653644504575
4 0.365065054403961
5 0.283767613658258
0.499999884947666  (average with goal seek 0.5)

I previously wrote a program to find the zeros of a polynomial using the Newton-Raphson method:
result = 0.7773070477563763

Program output
Estimate for p, using Newton-Raphson 0.7773070477563763
Average for 5 sets 0.5

(But I am not sure to what precision level these are accurate beyond the first 6 places)

"""
def pwin(p):
    ans = 0
    for k in range(1,6):
        ans += p**k
    return ans/5

def findzero(poly,lo= -100000,hi= +100000):
    """ poly is a list of coefficients of a polynomial and lo and hi are limits
    on where to look for a zero of the function  
    e.g poly = [1,4,3,6] means x^3 + 4x^2 + 3x + 6  
    Use Newton-Raphson method   """
    revPoly = poly[::-1]
    guess = lo
    revDeriv = []
    for i,v in enumerate(revPoly):
        if i == 0:
            continue
        revDeriv.append(i*v)
    def f(x):
        ans = 0
        for i,v in enumerate(revPoly):
            ans += v*x**i
        return ans
    def fPrime(x):
        ans = 0
        for i,v in enumerate(revDeriv):
            ans += v*x**i
        return ans 
    finished = False
    while not finished:
        error = abs(f(guess)/fPrime(guess))
        guess = guess - f(guess)/fPrime(guess)
        if error < 10** -10:
            finished = True
    return guess

p_estimate = findzero([1,1,1,1,1,-2.5])
print('Estimate for p, using Newton-Raphson', p_estimate )
print('Average for 5 sets', pwin(p_estimate) )

Edited on December 29, 2023, 3:06 pm
  Posted by Larry on 2023-12-29 11:52:55

Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (3)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information