Saturday Night Science: Simulated Annealing

Your browser does not support HTML5 canvas.
path length   River cost

Travelling Salesman

(Click Read More to view the interactive simulation in this post.)
The travelling salesman problem is one of the most-studied problems in combinatorial optimisation. It couldn’t be easier to state:

Given a list of cities and their locations (usually specified as Cartesian co-ordinates on a plane), what is the shortest itinerary which will visit every city exactly once and return to the point of origin?

Easy to ask, but devilishly difficult to answer…. The obvious way to solve the travelling salesman problem would be to write down all of the possible sequences in which the cities could be visited, compute the distance of each path, and then choose the smallest. But the number of possible itineraries for visiting n cities grows as the factorial of n, which is written, appropriately as “n!”. The factorial of a positive integer is the product of that number and all smaller numbers down to one. Hence 2!=2, 3!=6, 6!=720, and 10!=3,628,800. As you can see, these numbers grow very rapidly, so as you increase the number of cities, the number of paths you have to compare blows up in a combinatorial explosion which makes finding the optimal path by brute force computation a hopeless undertaking.

“But”, you ask, “computers are getting faster every year. Why not just be patient and wait a few years?” Neither you, nor I, nor the universe has sufficient patience. The box at the top of this page contains thirty cities represented by red balls placed at random in the grey square, connected by a path drawn in blue lines in the order in which they were placed. Every time you press the “Place” button, thirty new randomly-placed cities are generated; you can change the number by setting the box to the right of the button. But let’s stick with thirty cities for the nonce.

The number of possible paths along which we can visit the thirty cities is equal to the number of permutations of a set of thirty distinct members, which is equal to the factorial of the number of members, or 30!. This is a breathtakingly large number.

30! = 265,252,859,812,191,058,636,308,480,000,000 ≈ 2.6525×1032

Now, let’s assume you had a supercomputer which was able to compute the value of a billion (109) paths per second. Chugging away at this task around the clock, without a day of rest, it would take 2.65×1023 seconds to get through the list. How long is that? About 8.4 quadrillion (1015) years, or about 600,000 times the present age of the universe. And if you modestly increased the number of cities to fifty? Prepare to wait eight thousand billion billion times the age of the universe for the answer.

Solution for 30 citiesNow scroll back up to the top of the page and click the “Solve” button Almost instantaneously, you’ll see a near-optimal path to tour the thirty cities with the least distance of travel. Try clicking “Place” and then “Solve” several times to create and solve new problems, then increase the number of cities to 50 and then 100 and try solving those problems. In each case, the solution appears in a fraction of a second. Now, these solutions are not guaranteed to be absolutely optimal; they may be a percent or two longer than the absolute best path (if you click “Solve” multiple times, you may see several different solutions, all of which are close in total path length). They’re not perfect, but then you don’t have to wait huge multiples of the age of the universe for the result. How did we do it?

Simulated Annealing

This page attacks the travelling salesman problem through a technique of combinatorial optimisation called simulated annealing. By analogy with the process of annealing a material such as metal or glass by raising it to a high temperature and then gradually reducing the temperature, allowing local regions of order to grow outward, increasing ductility and reducing stresses in the material, the algorithm randomly perturbs the original path to a decreasing extent according to a gradually decreasing logical “temperature”.

In simulated annealing, the equivalent of temperature is a measure of the randomness by which changes are made to the path, seeking to minimise it. When the temperature is high, larger random changes are made, avoiding the risk of becoming trapped in a local minimum (of which there are usually many in a typical travelling salesman problem), then homing in on a near-optimal minimum as the temperature falls. The temperature falls in a series of steps on an exponential decay schedule where, on each step, the temperature is 0.9 times that of the previous step.

The process of annealing starts with a path which simply lists all of the cities in the order their positions were randomly selected (this is the path you’ll see after pressing the “Place” button). On each temperature step, a number of random transformations of the path are made. First of all, a segment of the path is selected, with its start and end cities chosen at random. Then, a software coin is flipped to decide which kind of transformation to try: reverse or transport.

If reverse comes up, an alternative path is generated in which the cities in the chosen segment are reversed in order of visit. If transport, the segment is clipped out of its current position in the path and spliced in at a randomly chosen point in the remainder of the path. The length of the modified path is then calculated and compared to the path before modification, producing a quantity called the cost difference. If negative, the modified path is shorter than the original path and always replaces it. If there is an increase in cost, however, the exponential of its negative magnitude divided by the current temperature is compared to a uniformly distributed random number between 0 and 1 and, if greater, the modified path will be used even though it increased the cost. Note that initially, when the temperature is high, there will be a greater probability of making such changes, but that as the temperature falls, only smaller increases in cost will be accepted. The total number of changes tested at each temperature level is arbitrarily set to 100 times the number of cities in the path, and after ten times the number of changes which decrease the path length as the number of cities are found, the temperature is decreased and the search continued. If, after trying all of the potential changes at a given temperature level, no changes are found which reduce the path length, the solution is considered “good enough” and the resulting path is displayed.

Watching it Happen

To watch the optimisation process as it unfolds, instead of pressing the “Solve” button, press the “Step” button to see the path evolve at each level of decreasing temperature. The “Animate” button will automatically show the path evolving at one second per temperature level. Check the “Trace solution” box to display the temperature, cost (path length), and number of changes made to the path at each step in the optimisation. After a solution is found, the chosen itinerary will be shown listing the cities in order, their co-ordinates, and the cost of the path from each city to the next (wrapping around at the bottom) and, if the path crosses the river (see below), an “R” to indicate that it does.

Instead of using the “Place” button to randomly place cities, you can place them manually by pressing “New” to clear the map and then click the mouse in the map to indicate the city locations. They will initially be connected by paths in the order you placed the cities. You can also add cities to maps created by the “Place” button by clicking in the map.

Minimise or Maximise?

30 cities, maximise path lengthThe travelling salesman problem is usually formulated in terms of minimising the path length to visit all of the cities, but the process of simulated annealing works just as well with a goal of maximising the length of the itinerary. If you change the goal in the drop-down list from “Minimise” to “Maximise”, the cost function being optimised will be the negative of the path length, resulting in a search for the longest path. Try it, and see how the annealing process finds a star-like pattern that chooses the longest inter-city paths.

A River Runs through It

30 cities, river cost 50%We can add another wrinkle to the cost function by adding a “river” that runs through the map from top to bottom halfway across it. If you set the “River cost” nonzero, the river will be drawn as a dark blue line, and any path from one city to another which crosses it is assessed a penalty given by the river cost as a percentage of the size of the map. If you set the river cost high, say to 50%, you’ll find a strong preference for paths which only cross the river twice, finding a near-minimum path length independently on each side of the river. (This may be more apparent if you place a large number of cities, say 100 or 250.)

100 cities, river cost −25%You can also set the cost of crossing the river negative, which turns the travelling salesman into a peripatetic smuggler who profits from carrying goods between Freedonia and Grand Fenwick. Try placing 100 cities and setting the river cost to −25: the smuggler will settle on an efficient path on each side of the river, but prefer river crossings between cities close to the river where the benefit of the crossing is significant compared to the distance between them.

100 cities, river cost −100%, maximise costFinally, try setting the goal to Maximise path length, the river crossing cost to −100 (benefit from crossing the river), and place 100 cities. When you solve, you’ll find the solution produces two star-like patterns on each side of the river which maximises the travel distance on each side, but avoids river crossings at all costs.

Other Optimisation Techniques

Here we’ve explored one technique of combinatorial optimisation: simulated annealing. This is only one of the many approaches which have been taken to problems of this kind. These include exact approaches such as branch and boundlinear programming, and cutting-plane algorithms.

There are many approximation techniques which find near-optimal solutions, of which simulated annealing is but one. One algorithm even models how ants find the shortest path between their anthill and a source of food.


Press, William H., Saul A. Teukolsky, William T. Vetterling, and Brian P. Flannery. Numerical Recipes in C, 2nd ed. Cambridge: Cambridge University Press, [1988] 1992. ISBN 978-0-521-43108-8. Section 10.9, pp. 444–451. (A third edition of this book with algorithms in C++ is available.)

Like 11+

Users who have liked this post:

  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar

Hot Shots: A Radioactive Lens

Leica M6 with Summicron 50 mm f/2 lens

Between the 1940s and 1970s, a number of camera manufacturers designed lenses employing thoriated glass in one or more elements. Incorporating as much as 40% thorium dioxide (ThO2) in the glass mixture increases the index of refraction of the glass while maintaining low dispersion. Thoriated glass elements allowed lenses to deliver low levels of aberration and distortion with relatively simple and easy to manufacture designs.

As with everything in engineering, there are trade-offs. Thorium is a radioactive element; it has no stable isotopes. Natural thorium consists of 99.98% thorium-232, which has a half-life of 1.4×1010 years. While this is a long half-life, more than three times that of uranium-238, it is still substantially radioactive and easily detected with a Geiger-Müller counter. Thorium decays by alpha emission into radium-228, which continues to decay through the thorium series into various nuclides, eventually arriving at stable lead-208.

Leica Summicron 50 mm f/2 lensAttached to my Leica M6 film camera above is a Leica Summicron 50 mm f/2 lens which contains thoriated glass. Its serial number, 1041925, indicates its year of manufacture as 1952. This lens was a screw mount design, but can be used on more recent bayonet mount Leica cameras with a simple adapter. Like many early Leica lenses, it is collapsible: you can rotate the front element and push the barrel back into the camera body when not in use, making the camera more compact to pack and carry. Although 66 years old at this writing, the lens performs superbly, although not as well as current Leica lenses which are, however, more than an order of magnitude more expensive.

To measure the radiation emitted by this thoriated glass lens I used a QuartaRAD RADEX RD1706 Geiger-Müller counter and began by measuring the background radiation in my office.

Radiation monitor: 0.12 μSv/h

This came in (averaged over several measurement periods) as 0.12 microsieverts (μSv) per hour, what I typically see. Background radiation varies slightly over the day (I know not why), and this was near the low point of the cycle.

I then placed the detector directly before the front element of the lens, still mounted on the camera. The RADEX RD1706 has two Geiger tubes, one on each side of the meter. I positioned the meter so its left tube would be as close as possible to the front element.

Radiation monitor: 1.14 μSv/h

After allowing the reading to stabilise and time average, I measured radiation flux around 1.14 μSv/h, nearly ten times background radiation. Many lenses using thoriated glass employed it only for the front element(s), with regular crown or flint glass at the rear. This limits radiation which might, over time, fog the film in the camera. With such lenses, you can easily detect the radiation from the front element, but little is emitted backward in the direction of the film (and the photographer). This is not the case with this lens, however. I removed the lens from the camera, collapsed it so the back element would be closer to the detector (about as far as the front element was in the previous measurement) and repeated the test.

Radiation monitor: 1.51 μSv/h

This time I saw 1.51 μSv/h, more than twelve times background radiation. What were they thinking? First of all the most commonly used films in the early 1950s were slower (less sensitive) than modern emulsions, and consequently less prone to fogging due to radiation. Second, all Leica rangefinder cameras use a focal-plane shutter, which means the film behind the lens is shielded from the radiation it emits except for the instant the shutter is open when making an exposure, which would produce negligible fogging. Since the decay chain of thorium consists exclusively of alpha and beta particle emission, neither of which is very penetrating, the closed shutter protects the film from the radiation from the rear of the lens.

Many camera manufacturers used thoriated lenses. Kodak even used thoriated glass in its top of the line 800 series Instamatic cameras, and Kodak Aero-Ektar lenses, manufactured in great quantity during World War II for aerial reconnaissance, are famously radioactive. After 1970, thoriated glass ceased to be used in optics, both out of concern over radiation, but also due to a phenomenon which caused the thoriated glass to deteriorate over time. Decaying thorium atoms create defects in the glass called F-centres which, as they accumulated, would cause the glass to acquire a yellowish or brownish tint. This wasn’t much of a problem with black and white film, but it would cause a shift in the colour balance which was particularly serious for the colour reversal (transparency) film favoured by professional photographers in many markets. (My 1952 vintage lens has a slight uniform yellow cast to it—much lighter than a yellow filter. It’s easy to correct for in digital image post-processing.) Annealing the glass by exposing it to intense ultraviolet light (I’ve heard that several days in direct sunlight will do the job) can reduce or eliminate the yellowing.

Thorium glass was replaced by glass containing lanthanum oxide (La2O3), which has similar optical properties. Amusingly, lanthanum is itself very slightly radioactive: while the most common isotope, lanthanum-139, which makes up 99.911% of natural lanthanum, is stable, 0.089% is the lanthanum-138 isotope, which has a half-life of 1011 years, about ten times that of thorium. Given the tiny fraction of the radioisotope and its long half-life, the radiation from lanthanum glass (about 1/10000 that of thorium glass), while detectable with a sensitive counter, is negligible compared to background radiation.

If you have one of these lenses, should you be worried? In a word, no. The radiation from the lens is absorbed by the air, so that just a few centimetres away you’ll measure nothing much above background radiation. To receive a significant dose of radiation, you’d have to hold the front element of the lens up against your skin for an extended period of time, and why would you do that? Even if you did, the predominantly alpha radiation is blocked by human skin, and the dose you received on that small patch of skin would be no more than you receive on your whole body for an extended period on an airline flight due to cosmic rays. The only danger from thorium glass would be if you had a telescope or microscope eyepiece containing it, and looked through it with the naked eye. Alpha radiation can damage the cornea of the eye. Fortunately, most manufacturers were wise enough to avoid thoriated glass for such applications, and radioactive eyepieces are very rare. (Still, if you buy a vintage telescope or microscope, you might want to test the eyepieces, especially if the glass appears yellowed.)


Users who have liked this post:

  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar

Saturday Night Science: Life 3.0

“Life 3.0” by Max TegmarkThe Earth formed from the protoplanetary disc surrounding the young Sun around 4.6 billion years ago. Around one hundred million years later, the nascent planet, beginning to solidify, was clobbered by a giant impactor which ejected the mass that made the Moon. This impact completely re-liquefied the Earth and Moon. Around 4.4 billion years ago, liquid water appeared on the Earth’s surface (evidence for this comes from Hadean zircons which date from this era). And, some time thereafter, just about as soon as the Earth became environmentally hospitable to life (lack of disruption due to bombardment by comets and asteroids, and a temperature range in which the chemical reactions of life can proceed), life appeared. In speaking of the origin of life, the evidence is subtle and it’s hard to be precise. There is completely unambiguous evidence of life on Earth 3.8 billion years ago, and more subtle clues that life may have existed as early as 4.28 billion years before the present. In any case, the Earth has been home to life for most of its existence as a planet.

This was what the author calls “Life 1.0”. Initially composed of single-celled organisms (which, nonetheless, dwarf in complexity of internal structure and chemistry anything produced by other natural processes or human technology to this day), life slowly diversified and organised into colonies of identical cells, evidence for which can be seen in rocks today.

About half a billion years ago, taking advantage of the far more efficient metabolism permitted by the oxygen-rich atmosphere produced by the simple organisms which preceded them, complex multi-cellular creatures sprang into existence in the “Cambrian explosion”. These critters manifested all the body forms found today, and every living being traces its lineage back to them. But they were still Life 1.0.

What is Life 1.0? Its key characteristics are that it can metabolise and reproduce, but that it can learn only through evolution. Life 1.0, from bacteria through insects, exhibits behaviour which can be quite complex, but that behaviour can be altered only by the random variation of mutations in the genetic code and natural selection of those variants which survive best in their environment. This process is necessarily slow, but given the vast expanses of geological time, has sufficed to produce myriad species, all exquisitely adapted to their ecological niches.

To put this in present-day computer jargon, Life 1.0 is “hard-wired”: its hardware (body plan and metabolic pathways) and software (behaviour in response to stimuli) are completely determined by its genetic code, and can be altered only through the process of evolution. Nothing an organism experiences or does can change its genetic programming: the programming of its descendants depends solely upon its success or lack thereof in producing viable offspring and the luck of mutation and recombination in altering the genome they inherit.

Much more recently, Life 2.0 developed. When? If you want to set a bunch of paleontologists squabbling, simply ask them when learned behaviour first appeared, but some time between the appearance of the first mammals and the ancestors of humans, beings developed the ability to learn from experience and alter their behaviour accordingly. Although some would argue simpler creatures (particularly birds) may do this, the fundamental hardware which seems to enable learning is the neocortex, which only mammalian brains possess. Modern humans are the quintessential exemplars of Life 2.0; they not only learn from experience, they’ve figured out how to pass what they’ve learned to other humans via speech, writing, and more recently, YouTube comments.

While Life 1.0 has hard-wired hardware and software, Life 2.0 is able to alter its own software. This is done by training the brain to respond in novel ways to stimuli. For example, you’re born knowing no human language. In childhood, your brain automatically acquires the language(s) you hear from those around you. In adulthood you may, for example, choose to learn a new language by (tediously) training your brain to understand, speak, read, and write that language. You have deliberately altered your own software by reprogramming your brain, just as you can cause your mobile phone to behave in new ways by downloading a new application. But your ability to change yourself is limited to software. You have to work with the neurons and structure of your brain. You might wish to have more or better memory, the ability to see more colours (as some insects do), or run a sprint as fast as the current Olympic champion, but there is nothing you can do to alter those biological (hardware) constraints other than hope, over many generations, that your descendants might evolve those capabilities. Life 2.0 can design (within limits) its software, but not its hardware.

The emergence of a new major revision of life is a big thing. In 4.5 billion years, it has only happened twice, and each time it has remade the Earth. Many technologists believe that some time in the next century (and possibly within the lives of many reading this review) we may see the emergence of Life 3.0. Life 3.0, or Artificial General Intelligence (AGI), is machine intelligence, on whatever technological substrate, which can perform as well as or better than human beings, all of the intellectual tasks which they can do. A Life 3.0 AGI will be better at driving cars, doing scientific research, composing and performing music, painting pictures, writing fiction, persuading humans and other AGIs to adopt its opinions, and every other task including, most importantly, designing and building ever more capable AGIs. Life 1.0 was hard-wired; Life 2.0 could alter its software, but not its hardware; Life 3.0 can alter both its software and hardware. This may set off an “intelligence explosion” of recursive improvement, since each successive generation of AGIs will be even better at designing more capable successors, and this cycle of refinement will not be limited to the glacial timescale of random evolutionary change, but rather an engineering cycle which will run at electronic speed. Once the AGI train pulls out of the station, it may develop from the level of human intelligence to something as far beyond human cognition as humans are compared to ants in one human sleep cycle. Here is a summary of Life 1.0, 2.0, and 3.0.

Life 1.0, 2.0, 3.0

The emergence of Life 3.0 is something about which we, exemplars of Life 2.0, should be concerned. After all, when we build a skyscraper or hydroelectric dam, we don’t worry about, or rarely even consider, the multitude of Life 1.0 organisms, from bacteria through ants, which may perish as the result of our actions. Might mature Life 3.0, our descendants just as much as we are descended from Life 1.0, be similarly oblivious to our fate and concerns as it unfolds its incomprehensible plans? As artificial intelligence researcher Eliezer Yudkowsky puts it, “The AI does not hate you, nor does it love you, but you are made out of atoms which it can use for something else.” Or, as Max Tegmark observes here, “[t]he real worry isn’t malevolence, but competence”. It’s unlikely a super-intelligent AGI would care enough about humans to actively exterminate them, but if its goals don’t align with those of humans, it may incidentally wipe them out as it, for example, disassembles the Earth to use its core for other purposes.

But isn’t this all just science fiction—scary fairy tales by nerds ungrounded in reality? Well, maybe. What is beyond dispute is that for the last century the computing power available at constant cost has doubled about every two years, and this trend shows no evidence of abating in the near future. Well, that’s interesting, because depending upon how you estimate the computational capacity of the human brain (a contentious question), most researchers expect digital computers to achieve that capacity within this century, with most estimates falling within the years from 2030 to 2070, assuming the exponential growth in computing power continues (and there is no physical law which appears to prevent it from doing so).

My own view of the development of machine intelligence is that of the author in this “intelligence landscape”.

The landscape of intelligence

Altitude on the map represents the difficulty of a cognitive task. Some tasks, for example management, may be relatively simple in and of themselves, but founded on prerequisites which are difficult. When I wrote my first computer program half a century ago, this map was almost entirely dry, with the water just beginning to lap into rote memorisation and arithmetic. Now many of the lowlands which people confidently said (often not long ago), “a computer will never…”, are submerged, and the ever-rising waters are reaching the foothills of cognitive tasks which employ many “knowledge workers” who considered themselves safe from the peril of “automation”. On the slope of Mount Science is the base camp of AI Design, which is shown in red since when the water surges into it, it’s game over: machines will now be better than humans at improving themselves and designing their more intelligent and capable successors. Will this be game over for humans and, for that matter, biological life on Earth? That depends, and it depends upon decisions we may be making today.

Assuming we can create these super-intelligent machines, what will be their goals, and how can we ensure that our machines embody them? Will the machines discard our goals for their own as they become more intelligent and capable? How would bacteria have solved this problem contemplating their distant human descendants?

First of all, let’s assume we can somehow design our future and constrain the AGIs to implement it. What kind of future will we choose? That’s complicated. Here are the alternatives discussed by the author. I’ve deliberately given just the titles without summaries to stimulate your imagination about their consequences.

  • Libertarian utopia
  • Benevolent dictator
  • Egalitarian utopia
  • Gatekeeper
  • Protector god
  • Enslaved god
  • Conquerors
  • Descendants
  • Zookeeper
  • 1984
  • Reversion
  • Self-destruction

Choose wisely: whichever you choose may be the one your descendants (if any exist) may be stuck with for eternity. Interestingly, when these alternatives are discussed in chapter 5, none appears to be without serious downsides, and that’s assuming we’ll have the power to guide our future toward one of these outcomes. Or maybe we should just hope the AGIs come up with something better than we could think of. Hey, it worked for the bacteria and ants, both of which are prospering despite the occasional setback due to medical interventions or kids with magnifying glasses.

Let’s assume progress toward AGI continues over the next few decades. I believe that what I’ve been calling the “Roaring Twenties” will be a phase transition in the structure of human societies and economies. Continued exponential growth in computing power will, without any fundamental breakthroughs in our understanding of problems and how to solve them, allow us to “brute force” previously intractable problems such as driving and flying in unprepared environments, understanding and speaking natural languages, language translation, much of general practice medical diagnosis and routine legal work, interaction with customers in retail environments, and many jobs in service industries, allowing them to be automated. The cost to replace a human worker will be comparable to a year’s wages, and the automated replacement will work around the clock with only routine maintenance and never vote for a union.

This is nothing new: automation has been replacing manual labour since the 1950s, but as the intelligence landscape continues to flood, not just blue collar jobs, which have already been replaced by robots in automobile plants and electronics assembly lines, but white collar clerical and professional jobs people went into thinking them immune from automation. How will the economy cope with this? In societies with consensual government, those displaced vote; the computers who replace them don’t (at least for the moment). Will there be a “robot tax” which funds a basic income for those made redundant? What are the consequences for a society where a majority of people have no job? Will voters at some point say “enough” and put an end to development of artificial intelligence (but note that this would have to be global and enforced by an intrusive and draconian regime; otherwise it would confer a huge first mover advantage on an actor who achieved AGI in a covert program)?

The following chart is presented to illustrate stagnation of income of lower-income households since around 1970.

Income per U.S. household, 1920–2015

I’m not sure this chart supports the argument that technology has been the principal cause for the stagnation of income among the bottom 90% of households since around 1970. There wasn’t any major technological innovation which affected employment that occurred around that time: widespread use of microprocessors and personal computers did not happen until the 1980s when the flattening of the trend was already well underway. However, two public policy innovations in the United States which occurred in the years immediately before 1970 (1, 2) come to mind. You don’t have to be an MIT cosmologist to figure out how they torpedoed the rising trend of prosperity for those aspiring to better themselves which had characterised the U.S. since 1940.

Nonetheless, what is coming down the track is something far more disruptive than the transition from an agricultural society to industrial production, and it may happen far more rapidly, allowing less time to adapt. We need to really get this right, because everything depends on it.

Observation and our understanding of the chemistry underlying the origin of life is compatible with Earth being the only host to life in our galaxy and, possibly, the visible universe. We have no idea whatsoever how our form of life emerged from non-living matter, and it’s entirely possible it may have been an event so improbable we’ll never understand it and which occurred only once. If this be the case, then what we do in the next few decades matters even more, because everything depends upon us, and what we choose. Will the universe remain dead, or will life burst forth from this most improbable seed to carry the spark born here to ignite life and intelligence throughout the universe? It could go either way. If we do nothing, life on Earth will surely be extinguished: the death of the Sun is certain, and long before that the Earth will be uninhabitable. We may be wiped out by an asteroid or comet strike, by a dictator with his fat finger on a button, or by accident (as Nathaniel Borenstein said, “The most likely way for the world to be destroyed, most experts agree, is by accident. That’s where we come in; we’re computer professionals. We cause accidents.”).

But if we survive these near-term risks, the future is essentially unbounded. Life will spread outward from this spark on Earth, from star to star, galaxy to galaxy, and eventually bring all the visible universe to life. It will be an explosion which dwarfs both its predecessors, the Cambrian and technological. Those who create it will not be like us, but they will be our descendants, and what they achieve will be our destiny. Perhaps they will remember us, and think kindly of those who imagined such things while confined to one little world. It doesn’t matter; like the bacteria and ants, we will have done our part.

The author is co-founder of the Future of Life Institute which promotes and funds research into artificial intelligence safeguards. He guided the development of the Asilomar AI Principles, which have been endorsed to date by 1273 artificial intelligence and robotics researchers. In the last few years, discussion of the advent of AGI and the existential risks it may pose and potential ways to mitigate them has moved from a fringe topic into the mainstream of those engaged in developing the technologies moving toward that goal. This book is an excellent introduction to the risks and benefits of this possible future for a general audience, and encourages readers to ask themselves the difficult questions about what future they want and how to get there.

In the Kindle edition, everything is properly linked. Citations of documents on the Web are live links which may be clicked to display them. There is no index.

Tegmark, Max. Life 3.0. New York: Alfred A. Knopf, 2017. ISBN 978-1-101-94659-6.

This is a one hour talk by Max Tegmark at Google in December 2017 about the book and the issues discussed in it.

Watch the Google DeepMind artificial intelligence learn to play and beat Atari Breakout knowing nothing about the game other than observing the pixels on the screen and the score.

In this July 2017 video, DeepMind develops legged locomotion strategies by training in rich environments.  Its only reward was forward progress, and nothing about physics or the mechanics of locomotion was pre-programmed: it learned to walk just like a human toddler.

Users who have liked this post:

  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar

Saturday Night Science: Apparent Diurnal Variation in Background Radiation

Aware Electronics RM-80 sensorSince October 16th, 1998, I’ve run an Aware Electronics RM-80 radiation monitor pretty much continuously, connected to a serial port on a 1992 vintage 486/50 machine. The RM-80 uses a 7313 pancake Geiger-Müller tube. The tube is halogen quenched and has a minimum dead time of 30 µS, with a mica window which allows alpha particles to pass. The computer interface generates high voltage for the tube from the Data Terminal Ready and Request to Send pins of the serial port and toggles the state of the Ring Indicator line whenever a count is detected. The serial port can be programmed to interrupt on changes in the state of this signal, making it straightforward to implement radiation monitoring in software. Tube sensitivity, calibrated with Cesium-137 (137Cs), is 3.54 µR/hour per count per minute.

The second generation HotBits generator uses an RM-80 detector illuminated by a 5 microcurie 137Cs check source. I decided to attach the HotBits spare detector to a PC and let it run as a background radiation monitor, as much as anything to let the detector run for a while to guard against “infant mortality” in any of its components, should it have to take over for the in-service detector. Aware Electronics supplies the detector with a DOS driver program called AW-SRAD, which I used to log the number of counts per minute, logging the collected data to files in CSV format.

Database Coverage

Here’s a plot that shows the extent of coverage by month over the period I monitored background radiation. The month of May, for example, has just about one year’s complete data (this doesn’t necessarily mean all of May for one year—it might be half of May in 1999 and half in 2000, for example). November has the greatest coverage, in excess of 2.5 years of data. The summer months have the least coverage due to vacations and other circumstances which caused me to shut down the machine connected to the detector. Since we’re examining only diurnal variations—change in flux within a day—the uneven coverage over the months shouldn’t be a problem. If we wanted to explore, for example, whether any diurnal variation we detected varied from month to month, it would be best to extract a subset of the data weighted equally by month, ideally with full coverage of each day of the solar year even though the days may be taken from different years.

Database Coverage

Counts per Minute Histogram

The first obvious step in reducing the data is to plot a histogram showing the distribution of counts per minute; the vertical axis is the number of minutes in the database in which the number of counts on the horizontal axis were recorded. The histogram table is plotted below.

Counts per minute histogram

At first glance, this looks like the Gaussian “bell curve” you’d expect for a random process. At second glance, however, it doesn’t…note that the “tail” on the right hand side, corresponding to larger numbers of counts per minutes appears distinctly longer and “fatter” than the tail on the left side. Still, let’s proceed for the moment on the assumption that we do have a Gaussian distribution and calculate the mean and standard deviation from the data set. Crunching the numbers, we find a mean value of 56.65 counts per minute with a standard deviation of 9.31. We can then plot this Gaussian (normal) distribution as a red line superimposed on the histogram of experimental results.

Histogram vs. normal distribution

This makes it even more apparent that there’s something happening which isn’t “perfectly normal”. Note how the excess on the high end of the histogram pulls the best-fit normal distribution to the right of the actual data distribution, with the histogram bars to the left of the mean consistently exceeding the value of the normal curve and those to the right falling below.

You might be inclined to wonder just how closely we should expect experimental results like these to approximate a normal distribution. Could the observed deviation be nothing more than a statistical fluke? No…compare the fit of the background radiation histogram above with the the plot below of a data set of comparable size collected using the same detector but, instead of monitoring background radiation in counts per minute, measuring counts per second with the detector illuminated by the HotBits Cesium-137 source. Although this data set necessarily includes background radiation as well as counts due to the radiation source, with about 2000 counts per second from the 137Cs source, the roughly one count per second from background radiation has a negligible influence on the results.

Detector illuminated by Cs-137 source

In the radiation source data set we see an essentially perfect fit of the expected normal distribution to the experimental data. This makes it quite clear that there’s something curious going on with the background radiation data. But what?

The Two Population Hypothesis

One way we might end up with the kind of asymmetrical distribution we observe for the background radiation is if the radiation flux we’re measuring is composed of two separate components, or populations, each individually normally distributed, but with different peak value, mean, and standard deviation. Suppose, for example, that the background radiation the detector measures is the sum of that due to decay of heavy elements (principally thorium and daughter nuclides) in the immediate vicinity (the earth beneath the detector and the structure of the building in which it is located) and a less intense cosmic ray flux which occurs in sporadic bursts with a greater mean value than the terrestrial flux. (At this point I’m simply suggesting these sources to illustrate how the background radiation might be composed of two (or more) separate populations with different statistics; I’m not identifying them as the actual components.)

Here’s a “toy model” which illustrates how this might work.

Two population model

Let the brown curve labeled “Population 1” represent the terrestrial component of background radiation. It has a mean value of around 58 counts per minute and exhibits a precisely Gaussian distribution with total flux equal to the area under the brown Population 1 curve. We take the red “Population 2” curve to represent the supposed cosmic ray flux. This also has a normal distribution, but with a mean value of about 70 counts per minute, a greater standard deviation (resulting in a broader distribution curve), and a total flux only about one tenth that of Population 1.

Since counts resulting from the two populations cannot be distinguished by our simple detector, what we observe is the sum of the two populations, shown as the orange “Combined Flux” curve. Note the strong resemblance between this curve and the histogram plot from the detector; while Population 1 dominates the result, the contribution of Population 2 lifts and extends the high end of the combined distribution, precisely as we observed in the experimental data set.

Radiation by Local Solar Time

Next I tried binning the results hourly by local solar time. The following chart shows the results, plotted in terms of average background radiation flux in micro-Roentgens per hour. (The average background radiation of 16.2 µR/hr—142 mR per year—may seem high, but my detector is located at an altitude of 800 metres above sea level. Both the soft and hard [primarily muon] components of cosmic rays are absorbed by the atmosphere, so at a higher altitude more they are more intense. At sea level, cosmic rays contribute about 30 mR/year, but at the 10 km altitude commercial jet aircraft fly, cosmic radiation accounts for about 2000 mR/year; more than 60 times as intense.) When I plotted the hourly local time averages, I obtained the following result.

Radiation by local solar time

I’ve read about variations in cosmic ray flux varying with latitude, in Easterly and Westerly incidence, the solar cycle, and changes in the geomagnetic field, without a mention of a diurnal cycle, yet this plot appears to show a sinusoidal variation, with a magnitude variation between the highest three-hour period and the lowest of almost 6% of the mean value and, further, the trough in the curve seems to be about 12 hours from the peak.

To explore whether this might be nothing but an artifact or statistical fluctuation, I then re-binned the same data minute by minute, resulting in the following plot, in which the blue curve is the raw minute-binned data and the red curve is the same data filtered by an exponentially smoothed moving average with a smoothing factor of 0.9.

Radiation minute-by-minute, smoothed

Randomly selected data subsetWell, it still looks credibly sinusoidal, with the maximum and minimum at about the same point. As we all know, the human eye and brain are extraordinarily adept at seeing patterns in random data. So let’s try another test frequently applied as a reality check when apparently significant results appear in a data set. The chart at the left was created by randomly selecting 25% of the points appearing in the complete data set and plotting them hour by hour. We find that the selection has little effect on the shape of the curve or the location of its maximum and minimum.

Outliers removedNext, I decided to explore whether the apparent sinusoidal variation might disappear if I discarded outlying values, which might conceivably vary differently in time than those which make up the bulk of the database. I pruned the bell curve at one standard deviation, then used the remaining data to prepare the plot at the left. As you can see, the case for a sinusoidal variation is eroded somewhat, but the general shape, magnitude, and location of extrema is conserved.

Outliers and Populations

The fact that removing the outlying values reduced the diurnal variation in the above plot suggests that we may indeed have two populations contributing to the observed flux, with the population responsible for the outlying values containing more diurnal variation than that near the mean. To investigate this further, I passed the data set through a variety of filters and prepared the following plot.

Outliers and populations

In the Stars?

Finally, I decided to plot the average radiation flux against local sidereal time. Sidereal time tracks the position of the distant stars as viewed from a given point on the Earth. At the same sidereal time, the same celestial objects (external to the solar system) will cross the celestial meridian above a given place on the Earth. Because the viewpoint of the Earth shifts as it orbits the Sun, the sidereal day (time between successive meridian crossings of a given star) is about 4 minutes shorter than the solar day (mean time between solar meridian crossings). Correlation with the sidereal period is powerful evidence for a distant source as the cause of a given effect. For example, it was correlation with the sidereal period which provided early radio astronomers evidence the centre of the galaxy and Crab Nebula were celestial sources of the noise they were monitoring. Here’s a plot of average radiation flux by sidereal time.  There is no significant evidence for a correlation of flux with sidereal time.

Background radiation by sidereal time


What’s Going On Here?

Darned if I know! The floor is open to inference and speculation.

First of all, I think it’s reasonable to assume that any diurnal variation, should such exist, is due to cosmic rays. The balance of background radiation is primarily due to thorium, radon, and daughter nuclides in the local environment. Where I live, in the Jura mountains of Switzerland, subterranean rocks are almost entirely limestone, which has little or no direct radioactivity (as opposed to, for example, granite), nor radon precursors. In such an environment, it’s hard to imagine a background radiation component other than cosmic rays which would vary on a daily basis. (This would not be the case, for example, in a house with a radon problem, where you would expect to see a decrease when doors and windows were opened during the day.)

If the effect is genuine, and the cause is cosmic ray flux, what are possible causes? The two which pop to mind are atmospheric density and the geomagnetic field. During the day, as the Sun heats the atmosphere, it expands. If you’re at sea level, the total absorption cross section remains the same, but the altitude at which the primary cosmic ray first interacts with an atmospheric atom may increase. Further, an increase in atmospheric temperature may change the scale height of of the atmosphere, which would perturb values measured at various altitudes above sea level. We could explore temperature dependence by comparing average background radiation in summer and winter months.

Let’s move on to the geomagnetic field. It’s well documented that the Earth’s magnetic field and its interaction with the Sun’s create measurable changes in cosmic ray incidence, since the proton and heavy ion component of primary particles is charged and follows magnetic field lines. As any radio amateur or listener to AM radio in the 1950s knows, the ionosphere changes dramatically at night, allowing “skip propagation” of medium- and high-frequency signals far beyond the horizon. Perhaps this effect also modifies the geomagnetic field, affecting the number of charged cosmic rays incident at a given location.

If there is a diurnal effect, why on Earth should it peak around 07:00 local time? Beats me.


  1. Clay, Roger, and Bruce Dawson. Cosmic Bullets. Reading, MA: Addison-Wesley, 1997. ISBN 978-0-7382-0139-9.
  2. Wheeler, John Archibald, and Kenneth Ford. Geons, Black Holes, and Quantum Foam: A Life in Physics. New York: W.W. Norton, 1998. ISBN 978-0-393-31991-0.

Download Raw Data and Analysis Programs

If you’d like to perform your own investigations of this data set, you can download the data and programs used in preparing this page. The 2.8 Mb Zipped archive contains the raw data in rad5.csv and a variety of Perl programs which were used to process it in various ways. There is no documentation and these programs are utterly unsupported: you’re entirely on your own.

Users who have liked this post:

  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar

Saturday Night Science: Fun with Cosmic Rays

I took an international flight today, and did something I’ve intended to do for some time: monitor the background radiation flux as the plane changed altitudes.  I brought along a QuartaRAD RADEX RD1706 Geiger-Müller counter which detects beta particles (high energy electrons) and photons in the x-ray and gamma ray spectra and displays a smoothed moving average of the radiation dose in microsieverts (μSv) per hour.  The background radiation depends upon your local environment: areas with rocks such as granite which are rich in mildly radioactive thorium will have more background radiation than those with rocks such as limestone.

One important component of background radiation is cosmic rays caused by high energy particles striking the Earth’s atmosphere.  The atmosphere is an effective radiation shield and absorbs many of these particles before they reach sea level, but as you go to higher altitudes, fewer particles are absorbed and you experience a higher background radiation dose from cosmic rays.  Background radiation at sea level is usually around 0.10 to 0.13 μSv/h.  At Fourmilab, at an altitude of 806 metres above mean sea level, it usually runs around 0.16 μSv/h.

I waited until the flight was at cruising altitude before turning on the detector and placing it on my tray table near the window of my window seat.  This was not a high-flyer: the plane was a Bombardier Q400 Dash 8 regional turboprop on a medium-range flight within Europe, with a cruising altitude of 7000 metres  (the plane’s service ceiling is 8229 metres, modest compared to the Boeing 747-8’s ceiling of 13,000 m).  My first reading was:

Radiation monitor: 1.24 μSv/h

Wow!  1.24 microsieverts per hour is almost ten times the usual reading near sea level.  And this was inside the fuselage of an airplane cruising at a modest altitude.

About half way through the flight, we encountered moderately high turbulence (enough to turn on the seat belts sign, but nothing really scary), and the pilot in command requested a lower altitude to try to escape it.  Air traffic control approved a descent to 6000 metres.  During the descent, the background radiation level smoothly decreased.  Here is part way down the slope.

Radiation monitor: 0.86 μSv/h

And now we’re at at the new cruising altitude of 6000 m.

Radiation monitor: 0.67 μSv/h

Finally the plane began its descent for landing.  Here are readings on the way down, with the last one on final approach over water shortly before touchdown on the runway on the coast.

Radiation monitor: 0.20 μSv/h

Radiation monitor: 0.13 μSv/h

Now the radiation level has fallen to that around sea level.  But wait, there’s more!

Radiation monitor: 0.07 μSv/h

This is at an altitude of just dozens of metres, still over water, seconds before touchdown.  Background radiation is now around half the usual at sea level.  (This wasn’t a fluke—I got this reading on several consecutive measurement cycles.)  But think about it: the contribution to background radiation from terrestrial sources (such as thorium and uranium in rocks) and cosmic rays are about the same.  But in an airplane flying low over water, the terrestrial component is very small (since the sea has very few radioactive nuclides), so it’s plausible that we’ll see around half the background radiation in such a situation as on terra firma.  Indeed, after landing, the background radiation while taxiing to the terminal went back up to around 0.13 μSv/h.

It would be interesting to repeat this experiment on an intercontinental flight at higher altitude and through higher latitudes, where the Earth’s magnetic field provides less shielding against cosmic rays.  But the unpleasantness of such journeys deters me from making them in anything less that the most exigent circumstances.  There is no original science to be done here: extensive monitoring and analysis of the radiation dose experienced by airline passengers and crews has been done.  This is a Fourmilab “basement science” experiment (well, not in the basement, but in a shrieking aluminium death tube) you can do yourself for amusement.  If you do this on a crowded flight, your seatmate may inquire what’re you’re up to.  “Measuring the cosmic radiation dose we’re receiving on this flight.”  This can either lead to a long and interesting conversation about atmospheric absorption of cosmic rays, background radiation, and radiation hormesis or, more likely, your having an empty seat next to you for the remainder of the flight.  Think of it as win-win.  There were only seven passengers on this flight (I don’t go to places that are too crowded—nobody goes there), so this didn’t come up during this experiment.

Return Flight

A couple of weeks later, the return flight was on an Embraer E190 regional turbofan airliner. The altitude of the flight was never announced en route, but this aircraft has a service ceiling of 12,000 m and usually cruises around 10,000 m, substantially higher than the turboprop I took on the outbound flight. I expected to see a higher radiation level on this flight, and I did.

Return flight: 5.07 μSv/hour

Did I ever! Most of the readings I obtained during cruise were around 3.8 μSv/h, more than thirty times typical sea level background radiation. (I’d show you one of these readings, but there was substantial turbulence on the flight and all of my attempts to photograph the reading are blurred.) During the cruise, I got several substantially higher values such as the 5.07 μSv/h shown above—more than forty times sea level.

Why was there such variation in background radiation during the cruise? I have no idea. If I had to guess, it would be that at the higher altitude there is more exposure to air showers, which might account for the greater variance than observed at sea level or lower altitude in flight. Or, maybe the gremlin on the wing was wearing a radioactive bracelet.

Users who have liked this post:

  • avatar
  • avatar
  • avatar