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 p
k, 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?
The ways in which Jimmy can win the match:
'www' p^6
'lwww' (1-p)*p^9 = p^9 - p^10
'wlww' p^8*(1-p^2) = p^8 - p^10
'wwlw' p^7*(1-p^3) = p^7 - p^10
'llwww' (1-p)*(1-p^2)*p^12
'lwlww'
'lwwlw' etc.
'wllww'
'wlwlw'
'wwllw'
The program:
clc; clearvars
ways= {'www' ;
'lwww' ;
'wlww' ;
'wwlw' ;
'llwww' ;
'lwlww';
'lwwlw';
'wllww';
'wlwlw';
'wwllw'};
low=0.5; high= 0.9;
for iter=1:30
for p=low:(high-low)/10:high
tprob=0;
for i=1:length(ways)
w=ways{i};
wprob=1;
for j=1:length(w)
if w(j)=='w'
wprob=wprob*p^j;
else
wprob=wprob*(1-p^j);
end
end
tprob=tprob+wprob;
end
%disp([iter p tprob])
if tprob>.5
break
end
prev=tprob;
prevp=p;
end
low=prevp; high=p;
disp([p tprob])
if prevp==p
break
end
end
finding at the end
p = 0.777861493498069 gives a match win probability of 0.5.
|
Posted by Charlie
on 2023-12-29 13:11:42 |