## Stopping Distance for UK Driving Test

One of the exams that must be passed for a UK driving licence is driving theory. This is a series of multiple choice questions. Most of them are very obvious, but some questions require knowledge. In particular, the stopping distances for a car travelling at various speeds is required to be known. (In reality, one does not actually need to know the answers as guessing suffices, and so few (if any) questions are asked on it that it is permissible to get them wrong.)

The stopping distance is split into ‘thinking distance’ and ‘braking distance’. The official numbers are as follows:

 Speed (mph) Thinking distance (m) Stopping distance (m) Total distance (m) 20 6 6 12 30 9 14 23 40 12 24 36 50 15 38 53 60 18 55 73 70 21 75 96

One interesting thing about these numbers it that the speed is measured in miles per hour, but the stopping distance is in metres. One mile is 1.6 kilometres.

There is no need to memorise these numbers as it is simple to make an approximate formula for them.

The thinking distance should be the speed multiplied by a reaction speed, and this reaction speed should not depend on the speed the car is travelling at. That is, the thinking distance divides by the speed should be a constant. It is, and this constant is 0.3. Thus to calculate the thinking distance, multiply the speed by 0.3. (In practice, one divides the speed by 10 and then multiplies it by three)

For the stopping distance, the force applied by the brakes should not depend (much) on the speed that the car is travelling. Therefore if a(t) represents the acceleration at time t, it should satisfy $a(t) = -b$, where b is some unknown constant. Integrating, this means $v(t) = S-bt$, where v(t) represents the velocity at time t, and S is the initial speed. It thus follows that $s(t) = St - t^2$, where s(t) represents the position of the car at time t. The car stops at time S/b, and so the distance travelled at that point is $s(S/b) = S^2/b - S^2/b^2 = S^2( b - 1 )/b^2$.

We can solve that equation as a quadratic in b, given the speed S and the actual stopping distance s(S/b). Taking the larger root and trying it on the data points on the table above, we find b is approximately 64 (although it does vary between data points). Thus the stopping distance is $\frac{S^2}{64^2} (64-1) \approx \frac{S^2}{64}$. This is good because finding a 64th of something is simple, as you can just repeatedly divide by two.

This means that altogether, the total stopping distance in metres is:

$0.3S + \frac{S^2}{64}$

This gives the following results:

 Speed (mph) Actual total distance (m) Predicted total distance (m) 20 12 12.25 30 23 23.06 40 36 37.00 50 53 54.06 60 73 74.25 70 96 97.56

Which is close enough! (Indeed, it exactly gets these points if one divides by S/60 and takes the nearest whole number)

Note that although the equation is very possible to evaluate by hand, it could be easier. If one assumes that you will only be asked about speeds which are a multiple of ten, then you can let S = 10k. Then the equation becomes the following which is much easier to use:

$3k + 1.5 k^2$

The following question appeared in The Knowledge in the Guardian (see bottom of this page):

“Has any team ever managed the statistical feat of holding a better head-to-head record against each of the other teams in their Champions League section and yet still finished bottom of the group?” muses Mark Wilson. “Presumably home 0-0s, away score draws and some terrible luck would be required but it is a possibility.”

By Team A ‘holding a better head-to-head record’ against Team B, Mark Wilson presumably means that if the scores were added together over the two games, Team A either scored more goals than Team B, or else they scored an equal number of goals but scored more of them as ‘away goals’ (i.e. goals scored in the away game). In particular, this means that Team A can beat Team B ‘head-to-head’ without actually beating them in a match. For instance, a 0-0 draw at home and a 1-1 draw away is enough.

Recall that groups in the Champions League are ordered first by points, and then by the restriction of the league to tied teams. If that is still equal, then goal difference and then goals scored is used – first in the mini-league and then in the whole league.

One way this can happen is for Team A to draw all their home games 0-0 and all their away games 1-1. Then if the rest of the games are home wins, Team A will finish bottom (with 6 points to the other teams 9 points) despite beating the other three teams head-to-head.

There are other possibilities too. For instance, the above still works with the modification that they lost to Team B 1-0 at home, but beat them 2-1 away. Then they have 8 points, still beat everybody else on head-to-head, and still finish last. Indeed, they can lose all their home games 1-0 and win all their away games 2-1 against all the other teams and still finish last. In this case, all teams will finish on 9 points and so the tie-break is goal difference and then goals scored. As Team A has a goal difference of zero, if we want them to finish last the other teams must also have a goal difference of zero (as goal difference sums to zero). By making the games between Teams B, C and D goal-rich but symmetric, we can make Team A finish last.

The final case is more complicated, but it is possible to win/draw against two of the teams and draw/draw the last. To be concrete, let us say Team A beat Team B head-to-head by a 0-0 draw at home and a 1-1 draw away. Against Team C and Team D, they lost 1-0 at home and won 2-1 away from home. This means Team A got 8 points. If , as in the previous examples, all other games were home wins, then Team B would have 8 points and Team C and Team D would have 9 points. This means that Team A and Team B finish with the same number of points, and so it goes to head-to-head record, which Team A won. Thus Team A did not finish last. The solution is for Team C and Team D to actually draw against each other in both their matches. Then each team finishes with 8 points, and again goals scored can be used to make Team A finish bottom.

Has it ever happened in the Champions League? The answer is no. Groups were introduced in 1991-92 and in that time no team has ever even finished last without losing more games than they did win, which makes this situation impossible.

In the 1998-99 Champions League, which was won by Manchester United against Bayern München in the last moments, there was however a very near miss. It was group B, which contained Juventus, Galatasaray, Rosenborg and Athletic Bilbao (of Italy, Turkey, Norwary and Spain respectively). The group finished in that order, letting Juventus qualify for the next round. The top three teams were all level on eight points, and Athletic Bilbao had six.

Nevertheless, Athletic Bilbao held Juventus 1-1 in Turin and 0-0 in Bilbao, beating them head-to-head. They also made up for their 2-1 loss in Turkey by beating Galatasaray 1-0  on Spanish soil – again, winning head-to-head. Unfortunately, their 1-1 home draw with Rosenborg was met with a 2-1 loss in Norway, and so they did not beat Rosenborg head-to-head. So they beat the top two teams (individually) on head-to-head, but not the third place team.

As the top three teams finished on equal points, their league position was decided upon the matches only including them. That is, games without Athletic Bilbao. In this sub-league Juventus came top and so qualified. However, suppose that Rosenborg vs Athletic Bilbao was 2-2 instead of 2-1. Then Athletic would have finished with 7 points, not 6. Rosenborg would have finished with 6, not 8. This wouldn’t be a solution to the posed problem, as then Athletic did not come bottom of the table. What it would do, however, is make Galatasaray go through instead of Juventus.

Galatasaray actually beat Juventus on head-to-head. It was 2-2 in Turin and 1-1 in Istanbul. Therefore, if only Galatasaray and Juventus were equal on points, then Galatasaray would have gone through instead of Juventus. Doesn’t this seem ridiculous? It seems like a fairly non-local effect of a goal.

## Preprocessor Programming (All 9 parts as a PDF)

The recent series of articles about Preprocessor (Meta-)Programming is now available as a PDF file. Hopefully it is easier to read like this. It is about writing code which is evaluated with the C preprocessor.

The original posts have now been removed from the blog as they are all included in this one.

## Deducation to do with knowledge and belief

Knowledge and belief are fairly intractable subjects. Nevertheless, we can give some properties that we believe knowledge and belief have, and deduce from that.

First, any statement about the world can be known or believed (or both, or neither). In addition, if A is something that can be known or believed, then so can the statements ‘I believe A’ and ‘I know A’. That is, it’s possible to have beliefs about your knowledge, or knowledge about your beliefs, etc.

Knowledge ought to be stronger than belief. In particular, if you know something you should also belief it. I cannot sensibly know that apples grow on trees but not believe it. If I don’t believe it, it is because I don’t know for sure.

Whilst ‘doublethink‘ is perfectly possible in reality, it is not a property of a good belief system. It is fair to assume that if you believe something, you do not believe the opposite to it.

If somebody asks you whether you know a statement is true or not, you’re aware if you don’t know, and can tell the person that. You know your ignorance. That is, if you don’t know something, you know you don’t know it.

And finally, the tightest coupling between believe and knowledge comes from the idea that if you believe something, you believe you know it. Let us give an example. I know that apples grow on trees. I also believe that it would be odd for something to both grow on trees and be an animal. Thus, I conclude in my head that I believe apples are not an animal. But I feel my believes are fairly secure, so although I don’t know apples are not animals, I believe I know it.

There are other rules one might want to add. For instance, it might be that knowledge is such a strong condition that it is impossible to know something that is false. Others are to do with you knowing what you believe, and others still to do with being able to deduce things from knowledge and believe of implications (as was done in the example to do with animals and apples). Nevertheless we do not need any more assumptions, so we stop here.

The four assumptions we have listed are enough to prove that if one believes something, then they know it. As one of the assumptions was that knowledge implies belief, together they imply that you believe something if and only if you know it. They are just two words for the same thing. It is possible to conclude different things from this, but I’d just say it implies our axioms do not model the system well. I feel it is the last statement – if you believe something, then you believe you know it. That is far too strong. There are plenty of things I believe – for instance, the truth of certain mathematical conjectures – but I do not believe I know such things. (In fact, I know I do not know them.)

Let us write ¬ for ‘not’, K(A) for ‘I know A’, and B(A) for ‘I believe A’, where A is an arbitrary thing which can be believed and known. The axioms become, in the order they were introduced above:

1. K(A) implies B(A)
2. B(A) implies ¬B(¬A)
3. ¬K(A) implies K(¬K(A))
4. B(A) implies B(K(A))

Let us also assume the usual laws of logic, e.g. that A implies B is the same as ¬B implies ¬A.

Suppose you believe a statement S. That is, B(S). Then you believe you know it, so B(K(S)) – that is rule 3. But B(K(S)) implies ¬B(¬K(S)), where it is an application of rule 2 with the parameter A = K(S). That is, follows that one does not believe that one does not know S.

The contrapositive of rule 2 is that if you don’t believe something, then you don’t know it. Therefore ¬K(¬K(S)) follows. You don’t even know that you don’t know S. But the rule of knowing your own ignorance – rule 4 – implies that this means you know S. Therefore K(S).

Hence, if you believe something, then you know it.

As mentioned above, I feel axiom 4 is the problem. Nevertheless, if one were to change ‘belief’ and ‘knowledge’ to ‘conjecture’ and ‘formal proof/strong evidence’, to model mathematical or scientific reasoning, one sees that axiom 3 is problematic too. Just because there is a lack of evidence for something, doesn’t mean there is evidence that there is a lack of evidence for something.

## Tie-break Criteria and the Manchester Clubs

The 2011/12 Premier League season finished with Manchester United and Manchester City at the top of the table with a joint number of point. Different leagues have different rules on what happens in this situation.

In the past the relevant tie-breaker was ‘goal average’. This is the ratio of goals scored to goals conceded. It has not been used in the English Football League since 1975-76. This seems like an odd measure, as intuitively it is the number of goals you win by which is important, irrespective of offsets. For instance, surely 2-1 is just as good as 1-0?

This is no longer used, presumably for the reason that it makes conceding goals too costly. Goal difference is used instead. This is the difference between the number of goals scored and the number conceded.

In tournaments like La Liga, Serie A, the Champions League group stage and the European Cup group stages, it isn’t immediately used. If two or more teams are equal in points then a new league is considered which contains only these teams and from the games between these teams. This is then ordered first by points, and then by goal difference (and then it will typically continue to goals scored, and so forth). The ordering of this league then orders the joint teams in the original league.

[As an aside, I find it slightly odd that the rules are not applied recursively.]

In other tournaments, like the Bundesliga, the Premier League and the World Cup group stage, then after points goal difference across all games is compared. This is what happened to Manchester United and Manchester City, where Manchester City become the first team to win the league on goal difference. (The only time there was been a draw on points at the top of the table since goal average was abolished was 1988-89, where Arsenal and Liverpool were drawn on both points and goal difference, and Arsenal won it on goals scored)

Both teams won, lost and drew the same number of games, giving them the same score. However, Manchester City had a goal difference of 64 and Manchester United had a goal difference of 54.

Goal difference is better than goal average in that it only cares what the difference in scores is. Nevertheless, it is perhaps too linear. Is winning four games 1-0 and then winning a single game 6-0 better than consistently winning 2-0 over five games? Goal difference treats them as the same. If they aren’t equal, it isn’t particular obvious which is better. The latter team were consistently better, but the former team achieved a large victory. There seems to be an argument either way.

The following is a graph of the distribution of wins of the two Manchester teams. As it is already decided that it is only goal difference in a match which matters, this is all that is graphed. Obviously the total left of ‘0’ denotes the number of losses, and right of it the number of wins.

It should be noted that when the Manchester clubs played each other, United won 1-0 away and lost 6-1 at home. Therefore if a head-to-head system were to be used which went to goal difference, City would still win. Goal average would not help United either – they conceded more goals and scored less, so any sensible combination of these two numbers will see City win. Had the United-City game been 1-0 instead of 6-1, the goal difference delta would have changed by 8, but City still would have won on goals scored.

The graph shows that United did achieve more very large wins than City though. United won of five occasions by five or more goals. City did this ‘only’ twice. Perhaps there is some home for United after all, if we change our values?

Is winning by two goals twice as good as winning by 1? Perhaps not. Winning by one can be luck, but winning by two seems like there might have been some skill involved. Perhaps instead of adding up the games goal differences, one should add up the squares of the games goal differences. Obviously, one would have to subtract instead of add if you lost by that amount, otherwise losing by 2 goals would be just as good as winning by 2 goals!

If this is done, Manchester United get a score of 188, but Manchester City get 212. They will still win.

Okay, let’s say winning by two goals is twice as good as winning by one. But then is winning by three goals only 1.5 times better than winning by 2? Perhaps it is twice as good again. Continuing  5 goals is 16 times better than scoring 1. If you lose, it should be the same as if you win except with the opposite sign, and if it was a draw the value is zero.

If we do this, then Manchester City get 112 points, but Manchester United get 121.

Nevertheless, this method is fairly silly, as it means the game Manchester United won 8-2 at the start of the season screws it all. Perhaps the truth is the opposite: the first goal is very important, but each goal after that becomes less and less important. After all, 5-0 and 6-0 are basically the same score. The last goal doesn’t matter very much at all. Perhaps it shows more like a logarithm than a power.

Using $\log{(1+|d|)} \times \rm{sign}(d)$ gives Manchester United 38.1 points, but Manchester City 32.3.

In summary, there is no easy answer to a tie-breaking criterium that rewards the things you want it to. At least goal difference is simple, and so it seems a good choice.

## A Bit of Graph Theory

I’ve written a document which explains some basic graph theory. In particular, it poses a few puzzle questions related to planar graphs and then solves them using Euler’s Formula.

I tried to write it in a casual style. The idea was that it should be easy to read whilst not giving up any mathematical accuracy. Actually, I’m not sure the style works at all, but it was worth experimenting.

Thank you to Kris for some suggestions to improve it. A version suitable for A5 booklet printing is available on my website.