Who will win the next match? Motivation: This question is motivated by Federer-Nadal; tennis rivalry. I observed that when Federer was ranked No.1 and Nadal was ranked No. 2 or lower, they played each other about 20 times and Nadal had the upper hand. So ideally we expect a higher ranked player to have a winning record against a lower ranked player but this is not always true, especially when the ranks of the two players are close by. 
Question: Two tennis players $t_1$ and $t_2$ ranked $r_1$ and $r_2$ respectively have played against each other in the past and have won $w_1$ and $w_2$ games respectively. For the sake of simplicity assume that they had always been ranked $r_1$ and $r_2$ respectively in all their head to head encounters. Assume that the likelihood of a win is proportional to the ranking of the player as well as their past head to head record. What is the probability, in terms of $r_1,r_2, w_1$ and $w_2$, that $t_1$ wins the next match? 
The reason I am asking in terms of all the parameters is because if $t_1$ is ranked higher than $t_2$ then $t_1$ will have an advantage due to ranking, but if $w_2$ is greater than $w_1$ then the ranking advantage of $t_1$ will be negated by the head to head advantage of $t_2$.
Note: If anything needs to be added or modified to the question to make it meaningful or solvable please feel free to add it to the question.
 A: The is a broad question, but it isn't just academic: there are several companies I've heard of that make money out of sports betting models. In general terms, for a basic model, try a logistic regression model.
$$P(t_1\text{ wins}) = F(\beta_0 + \beta_1f(w_1,w_2) + \beta_2g(r_1,r_2))$$
where $F(t)$ is the logistic function
$$ F(t) = \frac1{1+e^{-t}} $$
which transforms its argument, the linear predictor, into a probability between 0 and 1. The coefficients $\beta_i$ are to be determined by logistic regression using a sample of players. You would clearly need to hold back some data for the response. E.g. take the previous season as the explanatory variable and the current season as the response.
The functions $f$ and $g$ would be chosen by experimentation, including plotting the functions against the response. Sensible options could include $f(w_1,w_2) = w_1-w_2$, or $w_1/w_2$, or $\log(w_1/w_2)$, etc.
Finally, as the ranking is just a proxy for performance against other players, the next obvious step to improve the model would be to discard the ranking and generalize the model to taking as input a matrix of win ratios (say) between all players. This would allow the model to detect structure amongst the players, e.g. similarities between players, so that if player A always wins against B and B is similar to C, then player A is likely to beat C even if player A's ranking is lower than C's.
