Archive for the 'Numbers' Category

BEYES AND BENFORD

2010-10-21

I was reminded today of a couple of ideas that had (and still have) a profound impact on my thinking, and my approach to life.

The two concepts are from the field of numbers — statistics, odds, likelihood, chance.  It’s nothing to be afraid of; it’s not mathematics — nor even arithmetic.

The first is Benford’s Law.

I love this.  It is also known as “The First Digit Law”. In lists of numbers from almost all real-life sources, the first digit is 1 almost a third of the time, and larger digits occur as the leading/ first digit with ever  lower frequency, until the point where nine occurs less than once time in twenty as the first digit.

Benford’s Law applies well to a wide variety of data sets, like electricity bills, street addresses, stocks and shares, population and death rates, lengths of rivers, physical and mathematical constants, and processes described by power laws (which are very common in nature).

Now, this is pretty amazing.  Well, it was to me anyway; it is somewhat counter-intuitive after all.  Yet it works. The first digit is likely to be the number “1” in over 30% of the cases, not because of mathematical theory, or classical ideas, but as a result of real-world evidence.  The real world is imperfect, and far from the purity of academia.

The second idea is Bayes’s Theorem.

What Tom Bayes did was link two things when it comes to probability.  This is somewhat important in that people are either innocent or guilty, something works or doesn’t, and so forth.  Bayes is often important for understanding gambles and gamblers.

The key idea is that the probability of an event A given an event B. And this is exactly the way the mind works —  in a coin toss (for example), there’s a 50 % chance of a head or tail result according to classical statistics, but the coin is not perfect and the bias becomes more evident with each toss, so the results are actually linked, and the odds change (and the bias becomes more obvious) with each result, until the outcome is predictable; nothing is pure and unbiased in the classical mathematical sense.

The notion that each piece of evidence in a court of law, has an effect on the jury’s verdict, that guilt or innocence depends on each and every witnesses’ testimony in turn, is amazing.  Human nature cannot wait until the end to decide on guilt, it works like Bayes’s, becoming more and more guilty or increasingly guilty depending on the evidence as it arrives.  So classical statistics suggests that each coin has a fifty per cent chance of turning up, while Bayes — like us — reckons it’s been tails too long, and it’s time for a heads!

§

TOWERS AND HORIZONS

2010-04-17

[Picture of aerial view of Piazza Del Campo, Siena, Tuscany]I remember studying (many years ago now) Tuscan towns. I loved visiting San Gimignano, Pisa, Siena, Florence and the rest.

I am especially glad to have visited Siena with the girl I since married. I will never forget the heat of the day as Ruth and I stood with the crowds on the Piazza del Campo, right outside the Palazzo Comunale’s tower as [Picture of the New York style towers of ancient San Gimignano,  Tuscany]the cars for the Mille Miglia came and went.  We didn’t go up the tower as I had been up years before.

San Gimignano is probably the most famous place for towers — there are loads, but not for us on this trip. We didn’t go up the famous Leaning Tower of Pisa either.

That’s the way it is with us; we hate standing in queues and deplore being shepherded around with crowds of tourists.

[Picture iof The Eiffel Tower, Paris, France]It struck me that people (or should I say, tourists) love towers.  It seems to me that they will travel across the world to climb up the Eiffel Tower or The Empire State Building.

I wonder why that is. I can fully understand why we have towers and lighthouses, it is so that we can see enemies approaching. The higher the tower, the further you can see.

I can just about recall the formula too.  It starts off with a right-angled triangle, Pythagoras’s Theorem, and some facts — such as Planet Earth’s radius being 6378 km.

  • The formula is simply the square root of double the product of the Earth’s Radius and the tower height (m) divided by a thousand to get the answer in kilometres. ([2.6378] . h /1000)0.5

You wind up with a very simple formula for your tower/horizon relationship.

[Picture of Horizon at sea]The distance (km) to the vanishing point on the horizon is the square root of thirteen times the height (m) of your tower.

  • Let’s say you are standing on the beach looking at the horizon of the sea against the sky. Your height will be 1.8m or thereabouts, which means that the horizon is (13 . 1.8)0.5 away — which is — (23.4)0.5 which is 4.837 km.

You can immediately see the advantage of putting your castle up on a hill, building towers, and understanding lighthouses.  Naturally, you can work out how far a tower is (as long as you know it’s height) — you just wait until the tower’s top appears on the horizon!

Check out the height of statues here. Easterners seem to be obsessed with extremely tall structures and statues; a 128m tall Chinese Buddha simply dwarfs the 46m Statue of Liberty.

The Empire State Building is 443.2m high, The Eiffel Tower is 324m, these are cultural icons that are not religious, and as such are nearer the Tuscan towers’ in meaning and intent — mainly showing off, but also for broadening horizons.

The commerce and the wealth behind the towers of Tuscany and the skyscrapers of New York show that you are financially successful if you can see far ahead, see things coming, know when change is imminent, being able to see your enemies approach.  This elevated, lofty position — like the gods on Mount Olympus — shows a physical rise above peers to rival the career path rise.

I often wonder why these days governments stay so low to the ground.  It cannot be about the Twin Towers.  The White House is far from being a tower.  Number Ten Downing Street, Buckingham Palace and many others are not even up on hills.

Towers and tall structures these days are for tourists, capitalists and a  few others who like to expand their horizons.

§

BATTLE OF TRAFALGAR

2008-03-21

This is what made Admiral Nelson great. It all came down to basic game theory.  It is a wonderful and beautiful thing.  I love this, and I hope you all enjoy it too.

Here’s the scene: The French Navy and the English Navy are sailing toward each other and there’s going to be a battle. Nelson is leading 40 English ships, but he counts 46 French ships in the distance.

The mathematics is simple enough – for each side in a battle, multiply the number of units by the kill rate then square the product. Then subtract the answers from each other. The square root is the number of winners/survivors.

His first calculation was as follows:

1. The Big Battle.

FRENCH: (46 . 1)2 = (46)2=2116

NELSON: (40 . 1)2 = (40)2=1600

2116-1600 =516

square root of 516 = 23.

Nelson’s first calculation shows that at the end of the battle, if they went head-on, all the English ships would be lost and there would be 23 French ship surviving.

Note that Nelson allocated a kill rate of one, and thought that the French ships were no better or worse than his (the kill rates cancel out).

Well, this was bad news for Nelson, he needed to do something.  He couldn’t get six or more ships, and he had no secret weapon to improve the kill rate by enough to match six ships.  He needed to divide and conquer, the question is in what proportion.  He did another calculation:

2. Three Battles to lose

Nelson splits the French in two exactly. He allocates 31 ships to fight one half, and the remaining 9 English to fight the other half.

BATTLE A
(9)2=81
(23)2=529
529-81 = 448
square root of 448 is 21.16 French
So all 9 of the English ships would be sunk and about 22 French ships survive Battle A.
meanwhile…

BATTLE B
(31)2=961
(23)2=529
1024-529= 432
square root of 432 is 20.78
So all of the 23 French ships would be sunk, and about 21 English ships would survive Battle B.

BATTLE C
After the first two battles, we have this one final battle to see who wins overall. But this is no good as it is between 22 French and 21 English ships; the French are likely to win!

At this point Nelson realised that by dividing the French he has improved his chances, so he decided to try another calculation, but instead of the proportion being 9-31, he tried 8-32…

3. Three Battles to Even the Odds

BATTLE A
(8)2=64
(23)2=529
529-64 = 465
square root of 465 is 21.56
So all 8 of the English ships would be sunk (sacrificed) and about 22 French ships would survive Battle A.
meanwhile…

BATTLE B
(32)2=1024
(23)2=529
1024-529= 495
square root of 495 is 22.25
So all of the 23 French ships would be sunk, and about 22 English ships would survive Battle B.

BATTLE C
This was an evens-Stevens match between 22 French and 22 English ships.

This was what Nelson had been looking for — he found a method of evening out the odds and making the battle more fair — it would be down to fate and the kill rate.

And that is how the Battle of Trafalgar was won.

Divide and Conquer (in the right proportion) will even things up when the odds seem to be stacked against you.

The only other variable is the kill rate.

Example of Kill Rate Calculation:

Three trained men fight 12 untrained men. What should their kill rate be to win? 2 or 4?

KILL RATE 2:

(3.2)2=62=36
(12.1)2=122=144
144-36 = 108
square root of 108 is 10.39 untrained survivors

KILL RATE 4:

(3.4)2=122=144
(12.1)2=122=144
144-144= equal chance of either group winning
so 3 trained men will win against 12 untrained men if their kill rate is more than 4.

There are valuable lessons to be learned from this. First, sailors or soldiers should not be told why and how, just given orders that they must blindly carry out.  Imagine how it would feel to be on one of the sacrificial ships, one of the eight — deliberately sent to your death for the bigger picture. Hence: “England expects every man to do his duty”.  You need blind obedience to win battles.

Second, that kill rate is very important in evening up odds.  You can see why a Gattling gun gave such an advantage over traditional guns. Martial Arts experts and other training gives an edge.  If you have more weapons, or more speed, the advantage is obvious.

A mixture of both is sometimes used to great advantage — divide and conquer can reduce your casualties if the kill rate is available. It’s obvious really, if you are going to fight a man, kill rate is the factor.  If you are fighting two men, it’s evens if you have double their kill rate.  If you don’t you have to divide and conquer.

I covered this on a course I did back in the early 1980s, and it has informed me ever since; I appraise outcomes of movies, review action novels, games and films in the light of the ideas and wee calculations.  You know the difference if you get the division wrong, in Nelson’s case, victory depended on a margin of error of just one ship. Oh, it could all have ended so differently.

It certainly has assisted me in understanding the world around me, so I hope you get as much out of it as I have.

§