When we leave our homes we might check a weather app to give us predictions from number-crunching computers, to see if we’ll need an umbrella, but in the mid-1800s the appropriately named George Merryweather thought he’d make use of the alleged weather predicting properties of leeches to create a ‘leech barometer’ to measure the weather. His notion relied on the belief that leeches, kept inside small glass bottles, would try and escape when a storm was due (because they might be more sensitive to subtle changes in electrical conditions in the air that we humans would miss). The escaping leeches would trigger a small hammer placed above the bottles which would strike a bell and alert everyone in earshot that a storm might be imminent and also that your living room was about to be overrun with leeches. Not surprisingly it wasn’t very popular, though Merryweather claimed to have great success with it.
Quipu (the Quechua word for ‘knot’) are knotted, and sometimes differently coloured, strings, made from the hair fibres of llamas or alpacas. They were used by people, such as the Incas, living hundreds of years ago in Andean South America. They used the quipu to keep numeric trade or military records. A ‘database’ was formed of several of the strings tied together at one end. Each string stored numbers as different kinds of knots at different positions along the strings, with positions for ones, tens, hundreds, etc. It worked a bit like an abacus, but with much less danger of losing your work if you turn it upside down. The number ‘1’ was represented as a figure-of-eight knot in the ones position and ‘40’ could be indicated by four simple knots in the tens position. Not many quipu survive and even fewer have been decoded, but anthropologists have begun to find evidence that they might contain not just numbers but a written (well, a tactile) form too.
Make your own Quipu
Make your own Quipu decoration or necklace that represents something by tying knots in coloured string or ribbons.
It could keep track of important numbers for you, such as how much pocket money you have at the end of each week, making a new string (or ribbon) for each week, or
Store some sequence of numbers in a sequence of quipu like the 3 times table or the square numbers or the Fibonacci numbers…, or
Invent a code such as A=1, B=2, … and store a message on your Quipu by spelling it out in numbers and so knots.
A Quipu showing 26 or if using a simple number-letter code, Z
To make your Quipu more colourful tie different coloured strings together end to end to make a single Quipu. One colour string then represents ones and the next tied to it represents tens for a single number and so letter (and so on). Use different colours for your next Quipu.
Mark Rober, an engineer and YouTuber who worked for NASA, has created a dartboard that jumps in front of your dart to land you the best score. Throw a dart at his board and infra-red motion capture cameras track its path, and, software (and some maths) predicts where it will land. Motors then move the dartboard into a better position to up the score in real time!
In 1952 computer scientist and playful inventor, Marvin Minsky, designed a machine which did one thing, and one thing only. It switched itself off. It was just a box with a motor, switch and something to flip (toggle) the switch off again after someone turned it on. Science fiction writer Arthur C. Clarke thought there was something ‘unspeakably sinister’ about a machine that exists just to switch itself off and hobbyist makers continue to create their own variations today.
A pat on the shoulder In lockdown, during the Covid-19 pandemic, inventor and roboticist Simone Giertz created a coin-operated ‘proud parent machine’ which, for 25 US cents, would pat her on the shoulder and give a few words of encouragement. Putting in a coin sent a signal to a microcontroller that turned a motor on which lowered a 3D-printed arm (to pat her shoulder), then played a pre-recorded audio file telling her how proud of her the automaton was. Making the machine involved skills in woodworking, computer-aided design, mechanics and electronics. She also gave a TED Talk called “Why you should make useless things”.
Superheroes always have an origin myth that describes how they emerged as a hero. Spider-man has his spider bite and death of his uncle; Batman, his fall into a cave full of bats and the murder of his parents; Captain Marvel was exposed to an alien energy source… Why not work out your own origin myth? Everyone should have one. Mine involves a beach, a book of programs, and before that a missionary. It is the backstory of how I became a computer scientist.
The beach
My origin myth usually begins with a beach and a book containing some programs, some articles about computers and some computing cartoons. The articles were vaguely interesting, some of the cartoons were funny, but the program listings were fascinating: a whole new language that made computers tick.
At that point computers were way too expensive for me to dream of owning one (and in any case back then there were no mobile computers so unlike now, you certainly couldn’t take one to the beach). All I had was my imagination, but that was enough to get me started.
With nothing else to do on the beach (it was too hot to move), I spent my time lying in the sun reading programs and trying to work out what they did and how they did it. With no computer, all I could do was pretend to be the computer myself, stepping through the listings line by line with paper and pen, writing out the changing numbers stored (their variables) and what they printed. I then moved on to writing some simple game programs myself, like a cricket game. I wrote them in my notebook and again pretended I was the computer to make them work. By the end of the holiday I could program.
Ada Lovelace
I didn’t discover this till decades later but Ada Lovelace, the famous Victorian computer pioneer working with Charles Babbage was in a similar position (well sort of … she was a rich countess, I wasn’t). She also had no computer as Babbage hadn’t managed to fully build his. She had no programming language either to write programs in, or for that matter any actual programs to read. However, she had some algorithms written by Babbage that he intended his machine’s programs would be based on. Just like me, she stepped through the algorithms on paper, working out what they would do (should Babbage ever build his computer), step by step. As a result she learnt about the machine and as it happens also found a mistake in one algorithm. The table she drew of the computer working is often taken as proof she was the ‘first programmer’, though as Ursula Martin, who studied her papers, has pointed out, it is not a program. It is an execution trace or ‘dry run table’. She was actually the first ‘execution tracer’ or ‘dry-runner’.
The importance of dry running code
Dry running programs like this on paper is not just a useful thing for people with no computer, it is also a critical thing for anyone learning to program to do – a way of actively reading programs. You didn’t learn to write English (or any other language) by just writing, you read lots too and the same goes for programming. It turns out that the way I taught myself to program is a really, really powerful way to do so.
Just as importantly dry running programs on paper in this way is also important as a way of checking that programs work as Lovelace found. The modern version is the code walkthrough – a powerful technique that complements testing programs as a way of discovering problems.
The missionary
While that is the point in time when I learnt to program, there was someone earlier who originally inspired me about computation: a missionary. Sadly I don’t know his name, but he came to our school to talk about his life as a missionary in Papua New Guinea. He told us that one of the problems of travelling there was that communities were isolated from each other and each village spoke its own language. That meant that, as he travelled around, he had a big problem speaking to anyone. Every time he moved on he had a new language to learn or an old one of many to remember. It wasn’t the idea of converting people, or travelling to exotic places that means I remember him more than 40 years later. It was what he showed us next: how he solved the problem. He pulled out a massive pile of cards with holes punched round the edges, labelled with letters. Each had a word written on it in English as well as words in other languages from different places. He spelled out a word a letter at a time (pig was the example he used) by putting a knitting needle through a hole in all the cards next to the letter. Those that fell out were used for the next letter and so on. After three rounds just the card for pig fell out, as if by magic. It wasn’t magic though, it was computation. On the pig card he had cut notches in the holes for p, i and g. As that was the only word with those letters, it was the only card that could fall out for all three letters and then he could read off the translation for the village he was in..
Bitten by a bug
What the missionary was showing us was an edge-notched card system (see the ‘Wood computer’, page 16). I was fascinated and have been ever since about computation, especially when it’s done physically. It was that general fascination for algorithms that led me to want to learn to program.
In my origin story, I was bitten by a bug: the missionary converted me… to computer science.
An edge-notched card for Bob Marley and the Wailers notched as a Reggae Group with initials B-M-W: those three letters are notched, the other letters are un-notched.
Why not create an edge notched card system for something you are interested in, for identifying birds perhaps or quickly finding details of films, or music or of something you collect?
Edge-notched cards (see the Wood Computer) implement a physical, but still powerful, version of a database: an organised way of storing data. Information about some specific thing is represented on the card by cutting notches into holes around the edges following a set of codes.
Databases consist of lots of records each storing the information about one thing like one kind of timber. Each card in our pack corresponds to a record. A whole pack of records about one thing (like our pack of cards) is a database table. Records consist of fields with each field describing some aspect of the data like what the grain of the timber is like. Each group of related notches therefore acts as a database field.
In a relational database you do not have one gigantic set of records, so not just one gigantic pack of cards. You have a series of different sets of records/cards. Each has fewer fields so fewer holes as they no longer need to store details of every possible feature. Each smaller pack of cards is a table describing a specific thing (so if the cards store information about trees, the smaller packs might be about features of leaves and bark). There is also still a master pack describing trees as a whole. The tree cards no longer have to include all the details of leaves and bark, however. Instead each table includes a unique identifier field. Leaf cards include a leaf identifier that is also on the tree’s card. Bark cards similarly include a bark identifier. Once you have identified the leaf, you can use the leaf identifier on the tree cards to find any trees with that set of properties of leaf, then narrow it down further once you know the bark identifier. The smaller packs of cards still do the job but in a much more convenient way.
Punch cards inspired Babbage as he invented the first Victorian computer, and were a way the first computers stored data a hundred years later. Variations, called edge-notched cards, had their uses before the first working computers, though. They provided an efficient way to look up information. One use was to help identify timber: Oxford’s human-operated ‘wood computer’ was used in forests world-wide.
Interested in nature and enjoying a nice walk, you come across an unfamiliar tree, and want to identify it. How do you do it? You might work through a set of questions, first looking at the leaves: what shape are they, what colour, do they have stalks, do they sit opposite each other on a twig or are they diagonally placed, and so on. You then move to questions about the bark… Gradually, you narrow it down to one tree. What, though, if your job is to check that your company is buying the right timber and the tree is cut up into logs (no leaves or bark)? The task is the same, going through a checklist of questions, just harder unless you are an experienced botanist. Now you consider things like the pattern of the grain, the hardness, the colour and any scent from the tree’s oils.
Historically, one way of working out which piece of timber was in front of you was to use a wood identification kit or ‘wood computer’. This was prepared (programmed!) from a pack of index cards with 60 or more features of timber printed on them. However, they weren’t just cards to read but cards to compute with.
Holes and notches
The cards were special because they had regularly placed holes round all four sides. Each card had notches cut into different holes. Each feature of the timber was linked to one or more holes. The features were grouped together around related properties: so, for example, all the possible colours of timber might be grouped together on one section of the card. Properties about how fine-grained the timber is would be grouped in another section.
Each card represented one type of wood and the ‘programmer’ of the cards would notch the holes next to the features that defined it. If a particular type of timber was fine-grained you would add the notch to the hole next to “fine-grained”, if it wasn’t that hole would be left un-notched. Notches were added for all relevant timber properties making each card unique, with a slightly different pattern of notches, uniquely describing the features of the tree it represents. (See an example of an edge-notched card below.)
How it works
To use a wood computer, take the pile of cards, pick a feature of the timber in front of you and insert a thin knitting needle into the hole linked to the feature. Then lifting the pile up shake out any cards with notches in that hole. All of the cards for timber that don’t have that feature will have an un-notched hole and will hang from your knitting needle. All cards representing timber that does have that feature are now sitting on the table. Yours is somewhere amongst them. If your timber is NOT fine-grained then instead, when you put the knitting needle in the fine-grained hole, keep those left on the knitting needle.
You repeat the process several times to whittle (sorry!) your cards down, each time choosing another feature of the timber in front of you. Eventually you have only one card left and have identified your timber.
Just the cards for the job
The cards are incredibly low tech, requiring no electricity or phone signal and are very easy to use even without specialist botanical knowledge. All the knowledge is programmed into them. You also find the answer very quickly. Margaret Chattaway, a botanist at the Imperial Forestry Institute, Oxford, in the 1930s realised that was exactly what was needed for their team inspecting timber and so the original wood computer was created.
So next time you are out for a walk, make sure you have your knitting needle and a suitable pile of cards with you. Then identifying trees, birds, fungi or even animal poo will be so much quicker and simpler.
An edge-notched card for Bob Marley and the Wailers notched as a Reggae Group with initials B-M-W: those three letters are notched, the other letters are un-notched.
Why not create an edge notched card system for something you are interested in, for identifying birds perhaps or quickly finding details of films, or music or of something you collect?
by Adrian Johnstone, Royal Holloway, University of London and Paul Curzon, Queen Mary University of London
Image by Monika Schröder from Pixabay
Despite his hatred of Barrel organs, Babbage used barrels with relocatable pins in his machines. They worked in a similar way to a music box, where the pins flip the teeth of a metal comb to sound a note and by moving the pins you get a different tune. In Babbage’s version the barrel’s pins push levers that send information round the machine, determining what it does.
By programming the positions of the pins, different overall operations are created from the combinations of lever pushes. This is a similar idea to what later became called microcoding, in modern computers, where very simple low level instructions are used to program the operations available in a computer’s instruction set.