In which The Author does some calculations
I expect most of you have come across Mondrian-like artworks like this recently:
These so-called QR Codes are everywhere at the moment, from newspapers and magazines, through product packaging and point-of-sale, to advertising hoardings. For example, I found this particular example on the Arriva Trains Wales Valleys Lines Summer 2013 timetable. (It’s only valid for another week, so don’t get too excited!)
QR stands for Quick Response, and people with smartphones can use them as a short cut to associated websites. Mother pointed one out to me the last time we were in Brecon, wondering what on Earth it was (see Granotechnology.
) It turned out that they’re dotted all over the place, giving visitors a handy personalized at-a-scan tourist guide to the sights and history of a fascinating city.
It’s very difficult to walk down a shopping street in 2013 without finding at least one QR code somewhere within easy zapping distance. Along with many aspects of life in the Twenty-First Century, these abstract digital badges seem to have arisen from nowhere, almost under everyone’s nose. It came as a bit of a shock last week, therefore, when I came across an early reference to QR codes in an old SF novel.
In Missing, Presumed Lost
I told you how I’d been inspired to re-read Isaac Asimov’s book The Naked Sun
, after a gap of three decades (at least.)
[A digression: I had a message from my old friend and regular blog follower Neil R. this morning. He’d read the list of books which have vanished from my personal library over the course of time, and he’s bought three of them as a Xmas present for me. One of them is The Caves of Steel, the prequel to The Naked Sun. He’s going to call over with them next week. How kind is that? In the meantime, I’ve thought of another half a dozen books which have vanished without trace. Swings and roundabouts…]
Anyway, to cut a medium-length novel short, Dr Asimov’s protagonist is an Earth policeman named Elijah Baley. He is seconded to investigate a murder on the planet Solaria. It’s a very long way from Earth, in terms of both distance and culture. The Earth of The Caves of Steel is hugely overpopulated, with megacities bursting at the seams with the vast burden of humanity. There’s no privacy, no sense of individuality, and no room to breathe. Everything is artificially lit, and it’s been several generations since anyone saw the sky.
On the other hand, Solaria is one of many planets where the colonists have turned their back on their collective history and decided to plough their own furrows. In particular, the Solarians have developed strange taboos and phobias about the human body. The inhabitants live alone on vast estates which make Australian sheep stations look like window boxes. The sun shines down on their huge dwellings, and there’s a pattern of day and night to which Baley is quite unaccustomed.
Any physical contact with other humans is shunned unless it’s totally unavoidable; they prefer to ‘view’ each other via real-time holograms (although the idea predates the technology by a decade or so.) Their idea of child-rearing owes much to Huxley’s Brave New World, and prefigures Ursula K. Le Guin’s The Dispossessed. Artificial insemination and in vitro fertilization are becoming the favoured methods of reproduction – and even sex only happens once the potential parents have been genetically matched. The extended lifespan of the population allows them adequate scope to pursue their interests wherever they may lie.
It should be a utopia. But it isn’t, of course. Arriving on the sparsely-populated and undeveloped planet, Baley finds himself terrified by the open spaces, endless sky, and lack of company. This culture clash provides much of the tension throughout the story.
The key feature of life on Solaria, however, lies a the heart of the novel: a planet slightly larger than Earth is home to only twenty-five thousand people.
Needless to say, Solaria could never be a thriving economy with such a tiny population (it’s smaller than that of my home town, spread across the entire globe.) The Solarians have hit upon a simple and elegant solution to this: everybody who would usually have worked on farms, in factories, in hospitals, in schools, or in the service sector, has been replaced by robots.
[A digression: I promised my pals in the band Replaced By Robots that I’d mention them in my blog again before the month was out. Well, I’ve done it – just
! Their last gig of the year is tonight, in Porth. If you’re reading this afterwards, I’m sorry you missed it. You can get a taste of their sound in Robot Invasion of Earth (Phase II)
in the meantime.]
It was while I was reading about Baley’s struggle to come to terms with this alien world that I came across a curious passage. The Earthman notices that each robot has a little identification plate fixed to it: a six-by-six square composed of silver and gold squares – something like this:
So that we can see what Dr Asimov had in mind, I made this up myself, using the random number tables in H.R. Neave’s Statistical Tables to determine the distribution of yellow and grey squares. (I couldn’t be arsed to try and apply a metallic effect to the picture.)
Anyway, according to the story, Baley does a quick calculation in his head and comes up with a ball-park figure for the maximum possible number of individual robots on Solaria, based on this simple identification system. (He’s a better mathematician than I am, obviously!) It’s nothing short of staggering. In fact, I spent some time using smaller squares to prove to myself that I wasn’t imagining it.
With one square (the simplest case) it’s child’s play. If we use the figure 0 to represent silver and 1 to represent gold, we’re using binary notation. The square is 1 × 1. The number of outcomes is 2(1×1). That’s a total of two. Easy!
Let’s move up to a 2 × 2 grid and see what happens. Try it for yourself – buy some squared paper and draw little boxes, then shade them in. Start with a blank sheet (0000) and work your way through to a totally shaded grid (1111.) Remember that the orientation of the grid is significant. In other words, any asymmetrical pattern rotated through 180º, reflected vertically or horizontally, or reflected along the line y = x, counts as two different results, like these two.
Think about a football match – Cardiff v Swansea isn’t the same as Swansea v Cardiff. Same players, different situation. Make a cup of tea and have a potch. See you in a bit…
Welcome back. By now, if you’ve worked through the example, you should have sixteen different patterns on your piece of squared paper. We have 2(2×2) possibilities. 24 = 16. If you’re feeling brave, or foolish, or if (like me) you suffer from chronic insomnia, try a 3 × 3 grid.
Actually, don’t! There are 2(3×3) possible permutations available with just two colours. That’s 29, or 512. If you don’t believe me, leave a comment – I can email you a folder containing every last one of them. (See, I told you I wasn’t sleeping!)
I admit that I bottled out of the next step up – 216 is way too big to try and work out by hand. You get the general idea?
That brings us back to the planet Solaria, and the robots’ identification badges. Using only two colours (in other words, a binary code) in a 6 × 6 square, and bearing in mind that the orientation is significant, the total number of permutations is 236 – or 68,719,476,736! That’s about ten robots for every man, woman and child alive on Planet Earth today, with a few left over for spare parts.
Have a look at that QR code again. All the ones I’ve seen have two solid blocks at the top and one at the bottom, which I presume is Machine Speak for ‘this way up.’ Take a closer look. Count the tiny squares, each of which contains a bit (binary digit) of information. How many permutations are there? More than the grains of sand on the beach? More than the number of stars in the Milky Way? Who knows?
In Predictions (Part 2)
I talked about the way the phone network keeps growing and growing, just by adding an extra number. When we start running out of QR codes, we can just add another row and another column and start again. If that doesn’t cause you a sleepless night or two, you haven’t thought about it hard enough.