Sunday, June 30, 2013

Holy Fukushima: Scaremongering is Everywhere!

It seems like this kind of thing has been doing the rounds:

Bogus Fukushima Radiation Map #1
I got a message on Facebook saying “I'd really like you to do a blog piece on this”, so here it is.

The above image is, in fact, an ocean wave amplitude graphic for the April 2011 Fukushima earthquake from NOAA. It has nothing to do with the “fallout” from the Fukushima Daiichi nuclear plant. I repeat: it has nothing whatever to do with nuclear radiation of any kind — it is an ocean wave amplitude graphic. Somebody took this innocent graphic and maliciously emblazoned it with a scaremongering lie. A slew of ignorant anti-nuclear Internet Luddites then reposted this complete fabrication, which has been swallowed wholesale by some of the more gullible members of the public.

In many cases, the above graphic has been replaced by this one:

Bogus Fukushima Radiation Map #2

Now, this one is actually a particle simulation from the New Zealand based ASR Ltd., a marine consulting company. If you actually go to the original page, it says (in their block capitals): “THIS IS NOT A REPRESENTATION OF THE RADIOACTIVE PLUME CONCENTRATION”. What this graphic actually tells us — if their computer simulation is accurate and reliable — is that, in the year after Fukushima, nothing (radioactive or otherwise) in the ocean surface currents could possibly have gotten much further than about halfway across the Pacific Ocean, which is quite a different thing from what the scaremongers would have you believe, and says nothing whatsoever about dilution or concentration. This was a publicity stunt by a private company showcasing their technology; it is neither peer-reviewed science, nor the report of a competent panel of experts.

So, is radiation from Fukushima killing Americans?

If you look at similar peer-reviewed science [Behrens et al., 2012], whose graphics have also been used for scaremongering, what you find is that the radioactivity of 137Cs — everyone's favorite radioisotope — off the coast of California (blue box IV) due to Fukushima peaks at about 1.2 Bq/m3, while further North it might peak around 2 (cyan box II). To put this in perspective, the background of 137Cs in the Pacific is about 3 Bq/m3, and the background level of radon in the air averages 5–15 Bq/m3, depending on where you live. In other words, this kind of increase — another couple of becquerels per cubic meter — isn't going to make a whole lot of difference to anyone.

The expert consensus is similarly undramatic: by far the most pessimistic part of the WHO's assessment is that the lifetime risk of thyroid cancer for a 1 year old female in the most affected parts of Fukushima prefecture may increase by 70%. Wow! 70%. But here's the thing: the baseline lifetime risk of thyroid cancer for women is 0.75%, 70% of that, the additional lifetime risk, is just 0.5%. I'm not saying I'd like my risk of some kind of cancer to increase by 0.5%, but it's not anything that I'm going to get my knickers in a knot over either.

If you look around, you'll find out that the total Fukushima release was 900 PBq — by any standard an enormous amount of radiation — about one sixth of a Chernobyl, about equivalent to the fallout from a 2Mt nuclear warhead, or approximately bugger all compared to what the Americans, the British, the French, and the Russians were doing throughout the 50's, 60's and 70's in the Pacific, Siberia, and the Nevada desert.

You'll also find that a reasonable estimate of the total number of additional cancer-related deaths attributable to Fukushima is about 130. That's less than half the number of coal-mining deaths over the last 10 years in the US, less than a day-and-a-half's worth of road traffic fatalities, or a few weeks of coal-mining deaths in China. In other words, also bugger all.

The reality is that nuclear power plants are actually pretty safe in the grand scheme of things, it's just that when there is an accident, it's big and it makes a big splash on the news. It's a bit like the way a plane crash that kills 300 people is a major news event, but the 300 people who die on our roads every few days in an unnoticeable trickle never get on CNN.

So, to answer the question, the danger to Americans from Fukushima is essentially zero. If you're going to start washing your vegetables in filtered water — as some of the sensationalist anti-nuclear liars in the lede would have you do — think again… with a little more skepticism and balance.

Monday, June 24, 2013

Announcing “ftrace”

If you've ever had to understand someone else's largely undocumented code, you may have wished there was some way of narrowing down your search through the source to a simple case or two until you had learned your way around.

I'm in that situation with the Linux “perf tools”, which I'm trying to use in my research. I'm reasonably familiar with strace and ltrace, which trace system and library calls, respectively, but I don't really care about these: I just want to trace the “local” function calls so that I can get a handle on how perf works. That should be easy, right?

Mmm... no. It turns out that I'm not the first person to have this problem.

One of the suggestions on StackOverflow, from Johannes Schaub, is to use readelf to identify all the functions symbols, set breakpoints for all of them in gdb, and retrieve the last frame of the backtrace at each breakpoint. Nice idea. Horribly slow, but a nice idea.

So, since I've been using OpenGrok to browse the kernel tools source, so it would be nice to be able to integrate with it, like this:

OpenGrok with 'ftrace'
It would be really nice to have a callgraph from a particular program invocation, like this:

Callgraph from 'ftrace' via GraphViz 'dot'
So, I wrote a few hundred lines of Python to do what Johannes suggested, plus a bit more. After the pattern of strace and ltrace, I called it ftrace, and you can get it from github:
It's horribly slow, it's hacky, but does what I need for the time being.

Friday, June 21, 2013

The NewLeaf Tragedy

Now, anyone who knows me knows that I'm opinionated: I'm not often ambivalent on “issues” because I think about them and decide which side I'm on, and genetically modified organisms — GMOs — are no different. So, here's the thing: I'm generally, though not unreservedly, in favor of GM technology subject to appropriate safeguards. I think most public opposition is a lazy bandwagon, fueled by a Luddite echo-chamber of mindless and ignorant fear-mongering activism that is impervious to evidence and reason. I think GMO-free products and “organic” produce are no more than a brilliant marketing tool to separate the gullible from their money.

One absolutely magnificent scientific achievement, an unqualified good for humanity, was killed by Luddism and ignorance: Monsanto's NewLeaf potato.

To understand what happened, the background begins with a family of pesticides collectively called “Bt” (for the harmless soil bacterium, Bacillus thuringiensis, from which they are derived). Bt is generally regarded as harmless to the extent that it is approved for use on certified “organic” crops with zero wait-time between spraying and harvesting; it is produced by breeding vats of one of a handful of B. thuringiensis strains and extracting the spores or the active pesticidal proteins: the Cry family of δ-endotoxins, and spraying on crops in suspension. Different Cry proteins are toxic to different ranges of insect species, so each different Bt strain yields a fairly narrow-spectrum insecticide depending on what exact Cry protein combination the particular Bt strain expresses. The usual targets are coleoptera (beetles) and lepidoptera (butterflies and moths), the most pestiferous insect classes, but avoiding hymenoptera (bees, wasps, and ants), which are generally benign or even useful (some Bt strains express proteins that are toxic to certain sawflies, but not other hymenoptera). Cry proteins have been confirmed to be entirely non-toxic to vertebrates, but might be immunogenic to humans in high doses. Technical details aside, Bt is, or was, widely used on potatoes to control the Colorado potato beetle, an endemic pest that is devastating to potato crops.

The other piece of background information that you need is that the Russet Burbank potato is the most widely grown potato cultivar in the US, preferred for french fries by fast food chains, and is widely grown on a very large scale for this purpose.

Now, Monsanto succeeded in splicing the Cry3a gene from Bt into the Russet Burbank potato — this was the NewLeaf potato — so that it would express a protein known to be toxic to the Colarado potato beetle at a few ppm (part per million) in the leaves, sufficient to kill them, but totally harmless to us (the Cry3a protein concentration in the tuber is less than 180 parts per billion; at this concentration, it wouldn't matter if it was strychnine). Clever, eh? No, not just clever: a bloody marvel of modern science is what it was. We should've had a ticker-tape parade for these guys.

NewLeaf was a massive success. Half of Idaho grew it. It was in every french fry you ate for several years. Then the Luddite activists stepped in. It was “dangerous”, they said. It was “unnatural”, they said. It was “frankenfood”, they said. It was harmless and brilliant. It contained the same pesticide that's sprayed on their beloved “organic” produce by the ton, the only difference was how it got there.

Unfortunately, the PR campaign to demonize NewLeaf was a massive success too. Misinformed consumers revolted; fast food chains stopped buying NewLeaf potatoes; farmers stopped growing them; and, after a few iterations (there were later “versions” of NewLeaf with different genes), Monsanto stopped producing them altogether because there was no demand any more.


Now, there are basically two purposes for which genes are spliced into crops like potato, soy bean, and corn:
  • Pesticide expression (such as the Cry3a protein in NewLeaf)
  • Herbicide resistance (such as glyphosate resistant “Roundup Ready” soy)
I have no problem with either of these, and I see no way that either of them can plausibly cause any harm. I've explained the situation with NewLeaf in detail, and glyphosate is actually pretty innocuous stuff that basically breaks down readily in the soil.

My concern is that transgenic crops have been so massively successful that, in some cases, it can be difficult for farmers to get seeds that aren't genetically modified, and their choice of what to plant should be preserved. It seems like there may be a risk of a monoculture arising, which history (the Irish Potato Famine of the mid 19th century, for example) suggests is a really bad idea.

Provided that the availability of a wide range of cultivars is preserved, I see no reason to fear GM.

Wednesday, June 19, 2013

What's Cheap At Six Grand per Liter?

So, it seems that most dog owners dose their dogs with “spot-on” topical antiparasitics one a month to prevent fleas and ticks. It looks like I'll have to pick one for Scooter. There are a range of products to choose from, the popular brand names include Frontline, Advantage, and Advantix.

But, boy, are these things expensive!

Look at PetArmor, a generic for Frontline, and one of the cheapest options, in medium dog size. You get 3 doses; each dose is a tiny 1.34 ml plastic pipette, and the cost at Walmart is $25. That's $25 for about 4ml, or $6,250 per liter. OK, so maybe working out a cost per liter is not entirely fair, since it comes in three tiny plastic vials, but if you can get 1ml glass vials for $100/1000, or 10¢ each, online, these little plastic ones can't be all that expensive, so the ingredients must be super-expensive or something, right?

Mmmm… no. The basic Frontline (or PetArmor of Fiproguard) is a 9.8% solution of fipronil in, presumably, some kind of oil (fipronil is only very slightly soluble in water and the mechanism of action suggests a chemically inert edible oil, probably some kind of mineral oil like the stuff you buy in Ikea to rub into your wooden chopping boards at $10/liter or 1¢/ml). Fipronil itself can't be all that expensive, since you can get it in a 9.1% suspension (in water) for about $100/liter for termite control (Termidor SC or Taurus SC). Even if the entire cost of these products was solely in the fipronil, each vial would contain about 15¢ worth. So the material cost for 3 vials of these topical antiparasitics, including packaging, can't reasonably exceed $1, so why does it cost 25 to 60 times that? Inquiring minds want to know.

Friday, June 14, 2013

Introducing Scooter

I was considering a post that mentioned Scooter, and then realized that not everyone knows who, or what, Scooter is:

Hope this clears it up.

Thursday, June 13, 2013

Leaving Certificate Mathematics 2013: Paper 2, Question 8 “Solution”

So, the State Examination Commission in Ireland made a giant cock-up. At issue is a particular mathematics question, so — as someone not entirely ignorant of basic mathematics — I thought I'd explain the problem.

Leaving Cert Mathematics 2013, Paper 2, Question 8

The problem is that a triangle is completely specified by three values — either angles or lengths — provided that at least one of them is a length: one length and two angles, two lengths and one angle, or three lengths. Given one of these, you can compute the missing values: two lengths and one angle, one length and two angles, or three angles, respectively.

The question text specifies two lengths: \(|HR|=80~\text{km}\) and \(|RP|=~110\text{km}\) and one angle: \(\angle{r}=124^\circ\) (or \(\angle{HRP}=124^\circ\) if you prefer the more verbose notation). The diagram shows one angle consistent with the text, \(r=124^\circ\), and — in the English version of the exam — another angle, \(h=36^\circ\), which is inconsistent with the values given in the text.

If we take the text as correct, and ignore the diagram, let's see what happens — the problem now is: find \(\angle h\) given (dropping the units and angle symbols for convenience): \[|HR|=80 \\
|RP|=110 \\
We know that the sum of the internal angles of any triangle is \(180^\circ\), so: \[r+h+p=180 \Rightarrow h+p = 180-r = 56\]
If we drop a line vertically from the apex, \(R\), to a point, \(X\), on the base, we then have two right-angle triangles “back-to-back”, i.e. sharing the line-segment \(RX\).

From the right-angle triangle, \(HRX\), on the left, we have: \[|RX|=|HR|\sin(h)\] and from the right-angle triangle on the right, \(PRX\), we have: \[|RX|=|RP|\sin(p)\] Combining these two: \[|HR|\sin(h)=|RP|\sin(p)\] But we know that \(h+p=56\) or \(p=56-h\), so \[|HR|\sin(h) = |RP|\sin(56-h)\qquad\qquad(1)\] Now, a basic trigonometric relation (listed in the “log tables” that every candidate gets in the exam) is \[\sin(A-B)=\sin(A)\cos(B)-\cos(A)\sin(B)\] Applying this to the RHS of (1), we get \[|HR|\sin(h)=|RP|(\sin(56)\cos(h)-\cos(56)\sin(h))\] Rearranging: \[(|HR|+|RP|\cos(56))\sin(h) = |RP|\sin(56)\cos(h)\] or \[\tan(h) = \frac{\sin(h)}{\cos(h)} = \frac{|RP|\sin(56)}{|HR|+|RP|\cos(56)}\] or \[h = \tan^{-1}\left( \frac{|RP|\sin(56)}{|HR|+|RP|\cos(56)}\right)\] Substituting in the values we know:  \[h = \tan^{-1}\left( \frac{110\times 0.8290}{80+110\times0.5592}\right) = \tan^{-1}(0.6444) = 32.80^\circ\] Therefore \[32.80\neq 36 \Rightarrow \text{The SEC are morons}\]

Now, the question that is actually asked is “Find the distance from R to HP”. There are at least two further problems:

  • the distance from \(R\) to the line-segment \(HP\) is not uniquely defined (we must assume that the perpendicular distance, i.e. \(|RX|\) is intended); and
  • even under the simplifying assumption that the Earth is a sphere, latitude makes a significant difference to the answer (consider point \(R\) being at the North pole vs. line-segment \(HP\) lying on the equator), and non-Euclidean geometry is not on the syllabus.
If one uses the given value for \(h\), the problem becomes utterly trivial: \[|RX|=|HR|\sin(36^\circ)\] If we don't ignore the diagram, we have two angles and two lengths and must decide to discard either one of the angles or one of the lengths (in the foregoing, we discarded \(h\) from the diagram and kept the two lengths and angle \(r\) from the text), so there are actually four choices for how to proceed.

All in all, a gargantuan cock-up and staggering incompetence from the SEC. Imagine that nobody there spotted any of this!

Friday, June 7, 2013

Accuracy in Newspapers

Peter Murtagh had an article in the Irish Times today about a firearm belonging to the late Lord Louis Mountbatten being returned to his family, entitled “Mountbatten handgun returned to family by Defence Forces and Garda”. The firearm is pictured (below) and the original text of the article said that it's a “Barretta” .22 caliber.

A late model FN M1906 chambered for .25 ACP is not a “Barretta .22”

Everything about this description is wrong. First of all, the name of the Italian arms manufacturer in question is “Beretta”, with one “r” and an “a” only at the end. Since the original article was published, they've half-corrected the spelling: it now reads “Berretta”.

Secondly, the firearm pictured was manufactured by the Belgian Fabrique Nationale, better known as “FN”, so it's not a Beretta at all (the first clue is that it has an ordinary ejection port and not the open-top slide that you might expect for an older Beretta). It has the oval “intertwined ‘F’ and ‘N’” logotype of FN, not either of the circular logos used by Beretta (older models have a “PB”, for Pietro Beretta, logotype; more modern ones have a “three arrows” emblem). This can be verified by the simple expedient of turning the damn thing over and reading what it says on the other side:


 Finally, it's chambered for .25 ACP and not .22 caliber.

The particular weapon pictured is actually the third iteration of FN's Model 1906: you can tell this from the flange on the front of the trigger, which was added in the third version. The first version, released in 1905, had only the Colt 1911-style grip safety that you can see in the photograph; a thumb safety was added (on the other side) in the second version, and enlarged in the third version when the front of the trigger was also widened. This is by far the most common version, accounting for over a million of the 1.2 million or so made. The basic design was licensed from legendary firearm designer John Browning by FN, amongst many other manufacturers. A dozen or more firearm manufacturers produced “Baby Brownings” like this between 1905 and 1940 or so.

In fairness, Beretta produced a number of superficially similar pocket pistols during the same period, but they are markedly different in many respects, having an open-top slide, much different grip safety and trigger guard, and, most importantly, a completely different company logo!

Now, I'm not a gun nut by any means, but the ported (rather than open-top) slide and misspelling of the supposed manufacturer's name made me investigate a little further. It took me all of 15 minutes on the Internet to find out the above. If I can do it, so can a professional journalist.