Showing posts sorted by relevance for query bayesian. Sort by date Show all posts
Showing posts sorted by relevance for query bayesian. Sort by date Show all posts

Wednesday, 8 January 2025

A Pearson Person

All my post-grad life I've been buying up 25c copies of MJ Moroney's book Facts From Figures (1951) and giving them to younger people who have numbers to crunch. Because statistics is a) essential for effective science b) usually taught so poorly across these islands. Moroney strikes an agreeable balance between correct and accessible, but it's dated by being written before calculators, let alone Excel SPSS and R. As a 12 y.o. could calculate the variance of a [small] dataset with the help of a pencil, squared paper and Charlier's Checks. Nobody would consider teaching the skill to Gdau.I at the same age.

I was in Wexford Town Library early before Science Cafe in mid-December and found a copy of David Spiegelhalter's The Art of Statistics, Learning from Data (2020) call out to me from the 519.5 shelving. Spiegelhalter is frequently wheeled on stage for the Tim Harford's More of Less podcast when some egregious numerical bloomer needs to be exposed and explained to Joe Public . . . without being either stodgy, geeky or patronising.

There are some arresting patriarch-involving images. In explaining the prosecutor's fallacy, Spiegelhalter uses the following as a reductio ad absurdem: if you're the pope, then you're a Catholic is not the same as if you're a Catholic then you're the pope. Later, in a discussion of Bayesian statistics, he considers likelihood ratio = (the prob of dealing himself a royal flush, assuming the Archbishop of Canterbury is cheating) ÷ (the prob of royal flush assuming the ABofC is lucky). Which was funnier because absurd when the sentence was written than now with the 2024 Archbishop of Canterbury sheltering abusive paedophiles and resigning only with reluctance.

The self-styled Chevalier de Méré was a 17thC rake who gambled A Lot. He wanted to know which of two dicey games of chance was mostly likely to make him long-term money: a) throw a single dice 4x to get a single ⚅ or b) throw pairs of dice 24x to land ⚅ [wrong wrong almost R]. Neither he, nor anybody else at the time, knew the correct mathematical way to calculate the odds, so he set to and rolled a heckuva lot of dice to [correctly] determine the answer. Hanc marginis exiguitas non caperet This is exactly what I did to determine the likelihood of winning while playing Klondike patience. The Chev wanted the right answer mathematically to save other gamblers from doing a similar multiple trial experiment and presented it to Blaise "God's Wager" Pascal [prev] who in turn shared it with Pierre "Hanc marginis exiguitas non caperet" de Fermat [prev]. Between them they started the modern ride in probability theory. People like me, who started calculating means standard deviations on paper ~60 years ago are now trying to get their heads around Bayesian stats and  prior and posterior probabilities. Spiegelhalter 2020 is helpful in this regard, while Moroney1950  ignored the issue entirely.

Reveal. Pearson Person? Both Karl "correlation" Pearson and son Egon "confidence" Pearson get a shout. But really, at heart, Spiegelhalter is a Bayesian Bloke

Wednesday, 19 November 2014

Nate Silver Signal Noise

I don't know if it's The Blob, old age, a full teaching schedule or the misplacing of my glasses but I don't read books like I used to.  From about the age of 13, when I learned to read, I've been ploughing through 2 to 4 books a week.  This is nothing to Dau.I who knocks off a book-a-day and has done since she learned to read in the month after her sixth birthday.  But it's a habit that has been quite abruptly shaken loose over the last couple of years. During that time, I'd pick up a book and almost immediately fall into a slobbery doze; and when I woke a short while later I'd have to start that section again.  It was much easier to write 600 words than read them.

Nevertheless in 2014 I have struggled through The Signal and the Noise: The Art and Science of Prediction by Nate Silver.  It has taken me about 10 months which is a pathetic 2 pages a day.  Part of the problem is that the 450 pages of text are printed in a mean minuscule font that requires bright lights and extra levels of concentration to get into the run of it.  Despite this, I was never tempted to fire the book out of the window: I knew I was getting gold and it was worth sticking at the project. What Silver does is apply mathematics, experience and probability to a number of problems which hinge on telling the future.  How good are we at forecasting:
  • the weather (really rather good over the next 4 or 5 days)
  • determining when earthquakes will happen (really no better than guesswork)
  • who will win this Saturday's sport's fixture (fair if you work hard at having a good model)
  • rise and fall in the stock market (hopeless unless you are trading inside)
He has the best explanation of how the currently trendy Bayesian statistics work in the real world, so I'm grateful for that alone.  Bayesian stats require you to do something that is, on the narrow face of it, a bit unscientific: you are required to have a punt at what you think the outcome of a test or experiment will be, rather than like Darwin "I worked on true Baconian principles, and without any theory collected facts".  The results of the test are used to modify your 'priors' to come closer to the truth. It's mathematically very simple and quite powerful in its predictive power - IF you are good at guesstimating what the likelihoods of several related events are.  I think we can get much better at these estimates if we practice making them.

Typical of the book is an analysis of just how unexpected the tragedy of 9/11 was and the answer is: well actually could/should have been expected. In 2002 Donald Rumsfeld was pilloried for his WTF? oracular statement "there are known knowns; there are things we know we know. We also know there are known unknowns; that is to say we know there are some things we do not know. But there are also unknown unknowns -- the ones we don't know we don't know."  But the idea of unknown unknowns is key to making sense of a complex and potentially violent world.  It's the core, and indeed the title, of Nassim Taleb's 2007 book The Black Swan. A lot of people, who should have done better to protect US citizens, stoutly maintained that the 9/11 attacks were unknown-unknowns - so far beyond imaginings in scope that they couldn't (nobody could) have predicted such a Series of Unfortunate Events. Nate Silver shows in two graphs that this is a wretched excuse for dereliction of duty.  That's why the American tax-payer pays the big bucks to the TLAs (three-letter acronyms) NSA, CIA, FBI: so that they have some big ideas and deliver big solutions.  Here's the first one which indicates that, in 30 years, we have had one several-thousand-killer event in the catalogue of terrist attacks against NATO countries.  It's way out there on the bottom right:
Xeroxed straight out of S&N, so a little skew.  On the following page, Silver plots "# of attacks killing this many people" vs "# of fatalities" just as above except on a log scale for both axes. Extrapolating the now straightish line down and to the right, it shows that an attack taking out 2500 people, far from being unimaginable, was to be expected about once every 80 years. Or a lot more likely than a Richter 8.2 earthquake in California.

The most readable chapter tells how, in his 20s, Silver dropped out of a well paid job as an economic consultant for KPMG and made a modest fortune at poker. He got good at it because he worked really hard for several years getting to know when to fold and when to hold. This skill hinges in part on knowing the basic probabilities but the money lies in getting to predict what other players will do given a particular hand.  I've picked up on the language to this extent: when I'm in class getting the students to think about what the outcome of an experiment, I'll say something like "I lay €5 on the test-tube turning pink".  If I was unscrupulous and needed money, I'd actually slap folding money down on the bench-top, because my knowledge of biology (the priors) having been in the game for 4 decades is much more extensive than theirs who haven't yet served for four years.

I won't drop any more spoilers but urge you to lay hints among your loved ones to get you S&N for Christmas . . . and also suggest that a magnifying glass would be handy too. While waiting, you might check out Silver's blog FiveThirtyEight which is heavy on politics [538 is the number of seats in the US Electoral College] but has thoughtful essays on scientific and other issues.

Saturday, 17 January 2015

Paco el de la bomba

Francisco Simó Orts was a humble prawn fisherman from Murcia is SE Spain. After 17th Jan 1966 he became known and renowned locally as Paco el de la bomba, and eventually secured a fortune in the process.  On the fateful January day, while Simó was put at sea fishing, the USAF were playing with matches (tsk!) in Operation Chrome Dome.
This was part of a cunning plan to ensure cold-war ascendancy by maintaining fully armed B-52 [L] bombers continuously in the air within striking distance of the USSR.  Except where depopulated Alaska comes perilous close to depopulated Siberia, the USA is a long way from the USSR and it was at the edge of technical engineering capability to fly the heavily laden bombers such a distance on the amount of fuel they could carry. The cunning plan accordingly required mid-air refuelling.  Air-travel is, in terms of passenger miles, the safest form of transport that we are likely to encounter.  But if you are in the air for an infinite amount of time there is certain to be an accident.  If the engineering is pushing the envelope then it's more likely that something will go wrong, somewhere in the system. There were 5 military nuclear mishaps in 1950 alone, only counting those involving the USAF and only those over North America or the adjacent ocean. We know nothing of the parallel cock-ups that were happening in the USSR and may speculate that Things Happened further away from US sovereignty which the New York Times didn't need to know about. And it was all hideously expensive: in today-money, it cost about $10,000/hr to keep these monster planes in the air. B-52s have the same wing-span as a 747.

On the day in question, the B-52 required two aerial refuellings and on the second of these the plane managed to rear-end the K-135 stratotanker which blew up and carried away the left wing of the B52.  Remarkably 4 members of the crew were able to parachute to safety; everyone on the tanker died in the conflagration. The four surviving crew floated to earth: three drifting out to sea. Four armed-and-ready nuclear bombs also came down: three just outside the village of Palomares in Eastern Andalusia where two exploded, while the 4th drifted out to sea on its parachute.  It took 45 minutes for the last ditched flyer to be picked up - by Francisco Simó. 

The explosions on the ground had not initiated a chain-reaction but had nevertheless blurfed radioactive plutonium over at least 260 hectares of tomato farms, woods and residences. The cleanup required 6,000 250lt barrels full of grossly contaminated topsoil but areas with lower levels of radioactivity were simply ploughed to shift the glowing bits initially out of sight.  It has to be said that, although you can still find snails that cause Geiger-counters to fizz, there is no evidence of cancer clusters amongst the human population. That should give pause to people who still want to blame fall-out from Windscale for a cluster of Down's Syndrome in County Louth.

The US authorities were happier engaging in the tech-happy problem of locating the 4th bomb than in the tedious business of bagging and shipping tonnes of contaminated soil. In Franco's Spain, it was largely a public relations exercise. But finding the lost bomb before the Russkies sent out their own subs was a matter of high priority. The USN deployed two dozen USN ships and thousands of crewmen to quarter the sea-bed looking for a very large hot cigar. They invited Simó the eye-witness to accompany their search vessels, paying him 8000 pesetas/d [~= $130] which was much more than he got from shrimping. Nevertheless it took two months of fruitless scuba diving before they brought Bayesian statistics into the equation and realised that Simó's testimony pointed to a different, deeper, area of the sea-bed. On St Patrick's Day 1966, the DSV Alvin [L] located the errant bomb 800m below the surface and started lifting it.  Someone dropped the ball >!oops!< however, and the prize plummeted to the bottom again. It wasn't until 7th April that the bomb was secured safely aboard USN Petrel.

Sr. Simó was given a medal at the American Embassy in Madrid but felt hard done by and eventually secured the services of an American lawyer and former Attroney General called Herbert Brownell . . . or Brownell hunted down the contract from Simó in search of his cut.  The law of the sea says that, if a witness provides information that leads to the salvage of sunken ships, then s/he is entitled to a percentage of the proceeds; usually a token 1-2%.  As the bomb was bloat-valued at $2billion, Simó and Brownell made a case for a token $20 million.  The USAF settled out of court for an undisclosed sum.

Sunday, 21 March 2021

Sun day Bee Day

Equinox!

Thursday, 1 October 2015

A coherent life

Two days ago I read a long form article in the Atlantic that was just smashing and after the first couple of paragraphs I looked at the author's name - Alison Gopnik - and said Gopnik . . . Gopnik . . . I've heard of her: she must have done something impressive.  But I was really conflating three separate Gopniks:
It turns out that they are all members of the same family. Myrna is an emeritus professor of linguistics at McGill University in Canada and the others are two of her five children. Adam's webpage quotes with approval from Harper Lee's book Go Set a Watchman: "Atticus killed several birds with one stone when he read to his children, and would probably have caused a child psychologist considerable dismay: he read to Jem and Jean-Louise whatever he happened to be reading, and the children grew up possessed of an obscure erudition. They cut their back teeth on military history, Bills to Be Enacted into Laws, True Detective Mysteries,The Code of Alabama, the Bible, and Palgrave's Golden Treasury." That gave me a frisson of recognition because that's a bit like we treated Dau.I and Dau.II when they were educating themselves at home. We took no prisoners when it came to language or ideas: lots of stuff was batted around the kitchen table but we never hauled our wind or talked down to them. And they were not slow to tell me I were talking nonsense. I suspect that's what it was like in the Gopnik household in Montreal: two Professors and a parcel of bright and eager kids reading anything and talking about everything.

Turns out that Alison the firstborn was trained as a philosopher - D.Phil, Oxford under Jerome Bruner.  We have a copy of Bruner's The Process of Education on the shelf where we keep our education, home, important books: "knowing how something is put together is worth a thousand facts about it." As it happens it's Bruner's 100th Birthday today and he's still with us as a Senior Research Fellow at NYU. At college Gopnik read all the philosophers, because she could: it's a field much more limited than, say, science where nobody since Henri Poincaré has been able to read/know everything and he's been dead 100 years. It's a man's world is Philosophy, more so than engineering or physics, and it was really difficult for Gopnik to reconcile her ambition to be a hot-shot philosopher with a genuine and consuming interest in children. It was all too easy to get written off as "a girl" if she was interested in such dull, light-weight creatures who were sporadically incontinent and couldn't spell Kant let alone Teilhard de Chardin.

But Gopnik achieved the reconciliation by morphing from the philosophy of the mind to cognitive psychology and starting to make profound observations and design nifty experiments to open a window on the minds of children. By structuring the investigative situation just-so and being prepared to be surprised, she and her students and colleagues were able to devise hypotheses about such seemingly nebulous concepts as empathy and the sense of self and then test them. The non-verbal responses they elicited from pre-verbal children were reproducible and general. One concept that acquired legs was the idea that these kids were Bayesian in their thought processes: perpetually modifying a series conditional probabilities to get to grips with the world.  Because they know nothing, children are always trying things out to see if some solution will work or such a theory has explanatory power. This has become known as Gopnik's Theory Theory, the idea that kids are constantly developing theories and testing them against reality. A theory is a not a random punt, life is too short and potentially dangerous for that; it is an idea informed by previous experience. When they get to school all that is stopped; in 'science' they are no longer allowed to find stuff out for themselves; they are required to absorb the corpus of knowledge laid down in text books and religiously repeat the experiments [attaching weights to springs and rolling things down inclined planes] that laid down The Laws. If you stop and look with attention, you'll have to accept that children, far from being rather dull and often noisy and demanding, are in fact far more interesting, engaged and thoughtful than almost any adult. Particularly they are generalists not specialists. The process of education seems to be a steady process of knocking the sparkle and inquisitiveness out of us so that we finish up dull, dull, dull and only good for mowing the lawn at the weekends.  Check out Alison Gopnik's TED talk How Babies Think.

Mais revenons a notre Atlantic long-form! One of the philosophers that Gopnik read with empathy and affection in college was David Hume who wrote A Treatise of Human Nature in 1739 before he was 30. Reading it in college in the 1980s, she realised that this was an important contribution to our understanding of ourselves, not least because Hume denied the existence of 'Self'. Re-reading ATOHN after a couple of decades in California, Gopnik realised that Hume seemed to be channeling the Buddha in several of his key ideas. Not since the Name of the Rose has there been such a gripping yarn from the groves of academic philosophy. It's got all the ingredients: old manuscripts, amazing coincidence, some peripheral girl-on-girl, the roots of modern philosophy, diligent research, a left-field computer pioneer and of course the Buddha. Sherlock Holmes would be featuring except that he's dead. But then so is le bon David Hume. Is Cumberbach available for the film?

Alison Gopnik was born on 16th June 1955, an auspicious day with a clatter of scientists who share that birthday, including Barbara McClintock who also had to work hard to succeed in a man's world.

Sunday, 15 June 2014

Mary Somerville, the first scientist

Mary Fairfax was born in 1780, the daughter of a British admiral Sir William Fairfax. In keeping with her times and class, her brothers were educated for university while she was expected to learn how to sew and look pretty enough to secure a husband. Unfortunately for everyone's peace of mind she developed a passion for mathematics and physical science while still a child.  Her father returned from yet another stint at sea to find that his elder daughter was 'a savage' and sent her across the Firth of Forth to a boarding school for ladies at Musselburgh.  She spent her tenth year there learning the rudiments of French and English grammar and little else. When she was allowed to leave she felt "like a wild animal escaped out of a cage", and that was the end of her formal education.  A few years later, her art teacher introduced her to Euclid, so that she could master perspective, but she found the mathematics a much more interesting challenge than getting her painting correct.  She scrabbled an education eavesdropping on her brother's lessons with m'tutor and was often quicker at the answers than he was.

She married a naval officer, Samuel Grieg, in 1804 who shortly afterwards died leaving her with a substantial inheritance and two sons. This gave her an independence uncommon in those days when a woman might be transferred from father to husband at marriage along with some furniture and couple of horses. In 1812 she married William Somerville an army doctor with an interest in science and he was much more positive in his support of her researches than the men of her previous lives.  The couple travelled and met many of the great men of science of the day, including Jean-Baptiste Biot and Pierre-Simon LaPlace.  Laplace was a giant of science in his day, called the French Newton, le meilleur mathématicien de son temps en France and other flattering terms.  All you chaps who have jumped on the Bayesian statistics band-wagon should realise that it was Laplace who really thrashed out this branch of probability.  After an earnest to-fro about the physics of space between Mary Somerville and Laplace he is supposed to have said "There have been only three women who have understood me. These are yourself, Mrs Somerville, Caroline Herschel and a Mrs Greig of whom I know nothing."  Ho ho: make that two women, M.Laplace.

Mary Somerville went on to translate Laplace's Mécanique céleste into English, but more importantly her The Mechanism of the Heavens elaborated and illustrated Laplace's great work so that it was readily understandable by people who didn't have a brain the size of a planet: it was read with advantage by people who were fluent in French. This provided an enormous service to the progress of science: making things easier to understand is not the same as dumbing it down.  Or as she said "I translated Laplace's work from algebra into common language". She had found her métier - the exposition of science.  She went on to write three more immensely readable books "On the Connection of the Physical Sciences" (1834); "Physical Geography" (1848); "Molecular and Microscopic Science" (1869) which all made money for their publishers.

In his review of  On the Connection of the Physical Sciences in 1834, William Whewell coined the word scientist because clearly "men of science" was no longer able to ring-fence all the workers at the coal-face of science.  I think she was a woman you had to know to appreciate. The record shows that she didn't make any big discoveries herself but she made an enormous impression upon her contemporaries.  Shortly after her death, a committee of Oxford dons named a new non-denominational college for women after her.  Somerville College is now co-educational but has a startling list of alumni including Britain's only female Nobel scientist  Dorothy Hodgkin.

The Blob's Women in Science listing.

Friday, 17 July 2015

The maths of war

The Art of War 孙子兵法 was a treatise written by Sun Tzu who was a contemporary of Confucius and Socrates: Gautama Buddha used to be considered coeval but modern scholarship now puts him a couple of generations younger. The art of war is mostly about putting one over on your enemy. It would be no fun for boys if you could push a button and the host across the valley were vaporised. Getting to a key position firstest with the mostest could win the battle even if it meant embracing risk by stripping soldiers from another part of your front. Generals, famously Patton,  read about ancient battles to better understand the psychology of opposing generals: it didn't matter if their soldiers carried spears or carbines.

But all generals acknowledged that they needed quants to run the commissariat: no food at the front, no battle; archers need a lot of arrows; tanks need diesel.  Not only must you be confident that you have sufficient materiel at your disposal, you also have to have some idea of how much the other chap has.  The Irish word faisnéis, at the root of bithaisnéisíochta [bioinformatics] originally meant military intelligence - knowing whether there was an army the other side of that hill. And not only the existence of an army but how many regiments. In Sun Tzu's time and for the next 2500 years,
faisnéis was obtained by sending out a well-connected young chap, in a very smart uniform, on a horse to count camp-fires

In the run up to D-Day in WWII, one of the logistical problems that needed urgent solution was an estimate of the number of tanks the Germans had at their disposal.  Not only the gross number but a strong indication of what types: Tigers I & II were not as worrying as the new Panzer V.  It's a problem that could be given over to 'intelligence' but it turned out that good statistics got a far more accurate account.  The base data was serial numbers from tanks, destroyed or captured, that were accessible to the Allies in other theatres of the war: notably North Africa and Italy. The German war-machine was obsessive in its accounting and numbered each gearbox and each chassis sequentially.  The Allied quants had, therefore, long strings of numbers with a lot of gaps and were required to estimate the total size of the tank 'population' that had come off the assembly-lines in The Ruhr valley. They also needed to know how many would be available to the opposition, in 3, 6, 12 months time.  So the key parameter was how many tanks could be produced in the Panzer factories each month.  Clearly it was unlikely that the highest serial number available was the sum total of tanks up to the day that tank was destroyed. Nevertheless that was a minimum number.
Q. How much bigger was the true total?
A [simple]. N ~= m + m/k -1; where N is the total number estimated from m, the highest serial number and k the number of tanks in the sample.
A [more complicated Bayesian solution]:
where N, m and k are defined as above.  Another edge was to look carefully at the wheels of the tanks and determine how many different moulds were available to cast these out of steel. From the number of different moulds and the experience of Allied tank factories, Logistics could estimate the maximum number that could be produced per month. One of the insights from this scrutiny of the logistics, convinced the Allied high command that ball-bearings were a limiting resource for the Axis war-machine.  This resulted in numerous attacks on the ball-bearing factories of the Schweinfurter Kugellagerwerke in Schweinfurt, Bavaria. Numerous attacks resulted in the loss of numerous bombers and their crews. The Germans bought the entire ball-bearing output from neutral Sweden and also recovered thousands of usable ball-bearings from the ashes.  Similar analyses were applied to other munitions including the V-2 flying bombs. With access to German records after the war, it turned out that the statistical solution to the problem was remarkably accurate and much lower than the arm-waving worry-wart estimates from 'Intelligence'.  As with Abraham Wald, not to mention Alan Turing, a bit of insight and a lot of maths solved the Tank Problem goodo.

Saturday, 30 May 2015

The Numbers behind Numb3rs

In the last year or so of her education, Dau.II spent much of her waking life sitting on the sofa facing the 24" screen absorbing information like it was going out of fashion.  In this sense, she was very like her father who is, even in his declining years, a Prince of Pub-Quiz.  The difference is that my folks paid a king's ransom for me to acquire a headful of triv, whereas Dau.II only cost money once when she downloaded so many GB that we had to pay punitive rates to our ISP for a month. She would watch boxed-sets if she could borrow them but failing that youtube was her lifeline. She was only a week behind Baltimore in watching the latest episode of Masterchef. We also went from Desperate Housewives to House to Scrubs in a sort of free-association word connexion. I say "we" because, although I didn't have the stamina to do a six-hour half-series binge, I was up for sitting down to watch a single episode [not Desperate Housewives, mind, I had to fling out of the room after 5 minutes of that].

47 50m3 57463 w3 4l50 3nc0un73r3d numb3r5 wh1ch w45 r1v3771n6 f0r 4 7u7hr33 3p150d35 bu7 7h3n 607 70 b3 4 l177l3 f0rmul41c.  7h3r3 15 4n fb1 br07h3r wh0 h45 4n 4b5urdly 3xc171n6 l1f3: 3v3ry w33k h3 15 45516n3d 70 4 dr4m471c c453: nucl34r b0mb5, 4554551n4710n5, 53r14l k1ll3r5, 1n73rn4710n4l 5h1pp1n6 5c4m5, dru6 b4r0n5, c3n7r4l 4m3r1c4n w4rl0rd5. h3 15 n3v3r 5h0wn f1ll1n6 0u7 h15 3xp3n53 cl41m5, cl34r1n6 h15 d35k up 0r f1l1n6 l457 w33k5 p4p3rw0rk.
You should be able to read that as we've met l33t before in intriguing road-signs, but it's not fair on you to read wodges of l33t-text when my Ukrainian followers are possibly struggling enough with my idiosyncratic English.

At some stage we also encountered Numb3rs which was rivetting for tuthree episodes but then got to be a little formulaic.  The show, which CBS ran through six TV series between 2005-2010, features an FBI brother who has an absurdly exciting life: every week he is assigned to a dramatic case: nuclear bombs, assassinations, serial killers, international shipping scams, drug barons, trafficked girls. He is never shown filling out his expense claims, clearing his desk-drawers or filing last week's paperwork.  He has a younger brother who, as a childhood math prodigy, left Princeton with a degree at about the same age that normal people are going there. At about minute 15 in every episode, the screen will fade to sepia and a swirl of Greek letters and math-symbols will blurf out to a voice-over of bamboozling science-speak. For light relief, the boys will visit their widowed father for beer and lasagna and Charlie the math-whizz has a mumbling and less symmetrical math-pal who serves as a foil to allow the math to be 'explained'. To leaven the male geeks there are a few attractive women, some of whom are math-anxious but some are clearly as familiar with Riemann zeta functions, Cantor's infinities and Gödel incompleteness as the boy genius. Oh, and there is the obligatory token black. All good fun and far richer than Desperate Suburbia. Rather like House [which was running at the same time over on Fox] really, with a different subset of sciency words: I guess if you watched both series long enough you'd dream of an episode where a topologist developed lupus or a number theorist had a brain tumor.

This post is not really about the TV series, it is about the book of the TV series but I see that Wolfram has also contributed to the math of the series.  I've read a few books about the science behind some other cultural series: the Science of Discworld, co-authored by Sir Pratchett; The Science of Philip Pullman’s His Dark Materials by John and Mary Gribben.  These are often a little wooden and consciously didactic: the kind of stuff that would have my home-educated daughters rolling their eyes at being taught something that they should know, rather than something that the author thinks is really neat.  The Numbers behind Numb3rs leans much more to the second option and although each chapter starts from a Numb3rs episode, the trigger is often left in the dust as the authors zoom off where their passions or obsessions take them. A bit like a good blog, really. Some of the themes:
  • A good explanation of Bayesian statistics (although not as good as Nate Silver's)in evaluating the likelihood that a particular black dude committed a crime, rather than just being the first black dude caught up by a razzia through the nearest ghetto. 
  • A critical investigation of the USA being in a 15 year lock-down trying to protect itself from terrists and how much that might cost and how cost-effective it might be.
  • An important if 100 years too late evaluation of the reliability of finger-prints as evidence.  Nobody seems to have tested the statement that "all fingerprints are unique" or more importantly that the way we code fingerprints give a unique signature for all 70 billion finger-prints that are attached to living people this weekend.
  • For where the paranoia of lock-down met sketchy probability and fingerprints, check out the infamous Brandon Mayfield case where the FBI sacrificed one of their [white] citizens to show that they were on the 2004 Madrid train-bombing case.  Possibly because he is white, Mr Mayfield's prosecution was quashed.
  • An investigation of the 1868 Howland will case, which hinged on two signatures on successive pages of a last-will-and-testament being suspiciously similar. A father and son team of mathematicians called Peirce gathered a few dozen authenticated signatures and analysed the lengths of the 30 down-strokes to determine their distribution. The two contested sigs were far more similar than any other pair of genuine signature . . . therefore one was a tracing of the other. 
I didn't anticipate how much I enjoyed the book; it was published in 2007 - how come nobody gave it to me for Christmas?
I'll mention one

Saturday, 25 February 2017

cartographie des affaires de corruption

Sweetener, dash, kick-back, pot-de-vin, brown envelope, whenever you want something done you can find someone who will expedite your case if you grease the wheels of the bureaucracy. I'm not sure if I have actual readers in France, rather than a particularly active [deranged] scan-bot, but my page-views from that country currently out-number the rest of the world. Alors, mes gars, I thought you'd be interested in this graphical display of cartographie des affaires de corruption in the sea-green incorruptible [a reference to Robespierre the revolutionary with rectitude] Republic. Because you never know when you might need a little help.  According to the perception of corruption survey 2016, France is up 2 places to #23 nudging out Chile but still behind Estonia. Despite my pal Pepe's proud assertion Spain is less corrupt than Syria or Sudan.

You're out of luck if you live in, or are thinking of moving to, Ardennes [77], Cantal [97], Cher [73], Creuse [100], Gers [90], Loir-et-Cher [71], Nièvre [87], or  Sarthe [46]. These departments have 0 [nul nix nada zonders] cases of corruption. The numbers [N] are the position in the list of the 101 départements when sorted by order of population.  You will note that only one of these corruption-free zones is in the top half of the country as regards number of people. Sarthe is located between Paris and Brittany. Its biggest centres are Le Mans, La Flèche, and Sablé-sur-Sarthe: it's okay if you've not heard of the other two because they muster rather less that 30,000 inhabitants [all scrupulously honest] between them.  The first case cited in the Big Think study is that of Roland Dumas who ripped off the family of Giacometti - but I scooped that story earlier this month.

I'm currently reading Thinking, Fast and Slow by Daniel Kahneman which looks under the stones to find the basis of bias: some of the case-studies expose the fallability of our minds but some are just errors due to statistics: such as the Law of Small Numbers. If corruption - or whatever you're having yourself - is rare then you're unlikely to find any cases in a small population. If you're formulating policy, it is clearly more sensible to report the thing you're interested in as a rate [count/population] rather than a raw count. But even if you do that, the small number problem doesn't go away; indeed it tends to get magnified because of the rule of extreme events.

If you have a friend you can carry out an experiment to show this:
  1. get an urn
  2. throw out your grand-father's ashes
  3. put 100 red and 100 white marbles in the urn
  4. you draw out 4 marbles and note their colours
  5. your oppo draws out 7 marbles and note their colours 
  6. both of you note and count the cases where you get all one colour
Q1. Who will get more extreme [all red or all white or NO cases of corruption] events?
Bonus Q: How much more?
Turns out that the 4 marble case will have 8 times ! the number of all-same events compared to the 7 marble draw. You do the math after you have recovered from your surprise. One example cited by Kahneman is the hot spots of kidney cancer rate in US counties. Educated epidemiologists were concerned and surprised when it transpired that cancer rates were disproportionately high in small rural counties [example for most dangerous counties see R from] but they manfully found just-so explanations about exposure to pesticides because farmers are thick as pig-dribble and won't wear protective clothing. Until someone flipped the data and showed that small rural counties also headed the pack for areas which had the lowest rates of kidney cancer; which, of course, you can explain with a story about fresh vegetables, clean water and attendance at church.

Except that there is nothing to explain because the rate is going to fluctuate wildly in small communities.  These data are just data until you start to sink money into some cunning plan on the basis of the numbers. As did the Gates Foundation on foot of a finding that small school were disproportionately represented in the top 'successful' schools; they invested $1,7 billion in dismembering mega-schools into smaller units until someone pointed out that small schools were also packing the opposite tail of the distribution. One smart kid, from a class of 20 high-school graduates, making it to Harvard will rocket her school into the elite category. Next year the school's success will have rapidly regressed to the mean.

Interesting [with maps!] investigation of the Law of Small Numbers using Canadian and US data and suggesting that Bayesian [bloboprev] methods can be used to calculate 'surprisingness' as a second order function from the raw counts. I have to work really hard to get my head round conditional probability and Saturday is my Sofa-time, so I'll leave the heavy lifting to you cher lecteur.