**Football (soccer)**

If, during a football match, there is a total of

*k*goals scored (by both teams), we can consider the game as divided into (

*k*+1) time-intervals (the count includes the initial interval before the first goal, as well as the interval after the last goal). During some of those time-intervals there may well be a (temporary) draw. Given the final score, we want to find the expected number of such intervals.

We may assume that, at any stage, the probability of a team scoring the next goal is proportional to the number of goals it has yet to score. For example, if the final score is 3-2 and at some stage during the game the score is 1-1, team A has two more goals to score and team B has one more. So the probability of team A scoring the next goal is 2/3 and that of team B is 1/3.

Given a final score of 3-2, there are 10 different ways that the game may develop (the letters 'a' and 'b' mark the order of scoring by the two teams and asterisks mark the time-intervals during which there is a draw):

*aaabb

*aabab

*aabb*a

*ab*aab

*ab*ab*a

*ab*ba*a

*ba*aab

*ba*ab*a

*ba*ba*a

*bbaa*a

We can see that, if the final score is 3-2, the expected number of time-intervals during which there is a draw is

E(3,2) = E(2,3) = 22/10 = 11/5 = 2.2

Find E(14, 15) giving your answer as a reduced fraction.

Find E(20, 19) as a reduced fraction.

Remarks

1. With a bit of care, 32-bit integers are sufficient for E(14,15) and 64-bit ints are good enough at least up to E(25,25).

2. Up to about E(14,15) one can simply go through all the possible arrangements and count the required cases, with less than one minute cpu time. For the higher numbers, I don't think that this is an option.

3. An equivalent problem is "Counting Votes".

While reading off (at random) and counting the votes of two candidates, there may be one or more instances when both of them have the same number of votes.

Given the final count of votes that the two candidates received (x and y), calculate the expected number of such instances E'(x,y).

[ Now, however, it is perhaps appropriate to skip the time-interval before the counting starts, so the asterisks at the beginning of each line must be deleted and E(x,y) should be reduced by 1, ie E'(2,3)=E'(3,2)=12/10=6/5 ].

**Variant B.**(I found it much harder to get to grips with this version.)

Instead of assuming that "...at any stage, the probability of a team scoring the next goal is proportional to the number of goals it has yet to score", we might say:

"At any stage, the probability of a team scoring the next goal is:

(a) 0.5, if neither team has reached their final score yet,

(b) zero, if a team has reached their final score, and

(c) one, if a team has not reached their final score yet, whereas their opponents have."

For the 3-2 case, the same ten sequences exist as previously listed, but now each sequence has a different probability.

So, this is a different problem with different answers (and it cannot be realistically converted to a corresponding "counting votes" problem).

Find F(2,3), F(14,15), F(20,19).