Why Computers Work (part 1)
This is the first of five short blog posts exploring why computers work.
I'm going to present a friendly introductory overview for laypeople, from zero to Turing machines, automata, abstraction and more. My aim is conciseness and clarity, so I've necessarily missed out, glossed over and simplified things. There are plenty of more advanced resources online should you wish to investigate this subject further.
Most importantly, I hope to stimulate your thinking about computers by creating a place to explore ideas.
I hope you enjoy these articles and, as always, I love getting constructive feedback via email. Unless otherwise stated, all images and diagrams were created by the author.
αἰὼν παῖς ἐστι παίζων, πεσσεύων· παιδὸς ἡ βασιληίη.
(The universe is a child's game. A child's kingdom.)
~ Heraclitus (Fragment B52)
Computers are ubiquitous.
They touch all aspects of our lives, from mediating our social interactions to modelling aspects of our culture and managing the everyday infrastructure of society.
Therefore, computers are interesting and, understandably, folks want to know how the machines that automate and control so much of our world work. This is a typical response.
I'm going to take a different approach.
I'm going to explore why computers work.
What's the difference?
Answers to "how?" questions tell us what method or steps make something happen. In contrast, the answers to "why?" questions describe what makes something possible ~ an opportunity to encounter a more fundamental perspective.
It's the difference between a car mechanic who may understand how an engine works (so they can fix broken engines), and a mechanical engineer who understands the physics and chemistry relating to why engines work (so they can improve the design of engines). Knowing how something works means your frame of reference is within the system, whereas if you understand why something works you're not bound by existing products, solutions or cultural practices.
Most importantly, cultivating an understanding of why something is possible is an invitation for playful creativity, fearless exploration and careful refinement of alternatives to the current crop of answers to "how?". It is an opportunity to enlarge and change our world ~ a form of intellectual empowerment and growth.
Knowing how is good, but understanding why is better.
With the scene suitably set, to start our journey, we'll learn all about...
Do you know how to play the children's card game, Snap?
(Bear with me, I promise it'll be worth it.)
Using a standard deck of cards, the aim is to win all the cards by taking turns to play.
Let's follow along as siblings Penelope (11), Sam (8) and Will (5) play a game:
Penelope (for no other reason than she's the oldest) acts as dealer. She shuffles the deck of cards so they're in a random order and deals them, face down and in equal quantity, to each player until there are none left to deal. This is the starting state from which all games of Snap begin.
Sam, the player to the left of the dealer, takes the first turn.
Players take a turn by moving the top card from their face-down stack onto the top of an adjacent stack of face-up cards, so the newly moved card is also facing up. Since this is Sam's first turn, the face-up stack doesn't exist, so a new stack is created with Sam's first face-up card taken from his pile of face-down cards.
So ends Sam's turn.
The next player to the left, William, takes his turn in a similar fashion and so the game continues from one player to the next.
After a while Sam shouts "SNAP". He's noticed that two face-up cards on top of different stacks have the same value (for example, two aces are visible on top of Penelope and Will's stacks). Since he was first to shout "SNAP" he wins all the cards in the matching stacks of cards. He gleefully scoops up all the cards in the face-up stacks belonging to Penelope and Will.
Play continues to the left of the player who turned up the matching card.
A few moments later Penelope shouts "SNAP". But there is a problem: there are no matching face-up cards! William points this out to Penelope and reminds her she has to pay a forfeit by giving one card to each of the other players from her face-down stack. Sam and Will get a card each and Penelope is two cards down.
At this point in the game Sam has the most cards. Will and Penelope have less with only a few cards difference between the quantities in their face-down stacks.
Things are hotting up and the three children become more excited: when two matching face-up cards appear again all three of them shout "SNAP" at the same time. Since nobody can claim to have shouted "SNAP" first, and to avoid arguments, both the matching stacks are placed in the middle and added to the "Snap pool". When "SNAP" is next called unambiguously and correctly, the winner will get both the matching stacks and any cards in the "Snap pool". The stakes have suddenly got higher.
Things quieten down for a few rounds until Penelope runs out of face-down cards to put onto her face-up stack. At this point she simply flips over her face-up stack and it becomes her face-down stack. Play continues as before.
Eventually, after a few more calls of "SNAP", Penelope finds that she's run out of cards and so out of the game.
Sam and Will play together until, through luck and fast reactions, Sam finds himself with all the cards and he's declared the winner of the game.
That's how you play Snap..!
The rules illustrated in this deliberately precise story describe how, given certain states of affairs, such-and-such things must happen. States of affairs unambiguously describe how things are in the world. For example, "there are two stacks of face-up cards whose top cards are of matching value". When I describe how such-and-such must happen, I mean clear and unambiguous instructions describe how play proceeds given a certain state of affairs.
Put simply, this is how the game of Snap is played.
But why is Snap played?
Because, in addition to knowing the rules, we understand that playing the game of Snap means modifying one's behaviour to follow these rules. If everyone modifies their behaviour in accordance with the rules then folks can play together. Obviously, we don't explain card games in such a formal manner to very young children. But, as my description shows, children discover it's lots of fun to informally learn and skilfully follow rules that bring about exciting situations in games.
Knowing how to play Snap is analogous to knowing how computers work. Looking beyond the rules of Snap to appreciate that human behaviour and enjoyment motivates people to follow the rules of the game, shows us why Snap is played. This insight may also inspire us to invent new games. Perhaps we become inspired to explore further aspects of human behaviour relating to following rules, or we may even reflect upon the nature of play or games. In any case, exploring why rather than how provides a fascinating perspective from outside the system (of Snap, in this case).
We need to achieve an analogous enlargement of perspective beyond how computers work in order to understand why computers work. Only by acquiring a perspective outside current norms can we possibly hope to invent or improve technology and explore the nature and use of such devices. The alternative is churn and recycling of existing ideas within the current system ~ a situation that stifles innovation or positive change.
The computing-related rules and states of affairs I'm going to describe are not much more complicated than the game of Snap explained above. However, what follows may include a few brain twists where I expect you to use your imagination to see things in a seemingly unusual or unintuitive way! I'm challenging you to acquire a new perspective about seemingly everyday things. The external world remains as it was before, but you will have changed. Your newly acquired perspective reveals a deeper understanding of what you're observing and why this makes computing possible. It's fun and can result in rather pleasant "aha" moments (if you were a cartoon character, it's that feeling you get when a lightbulb appears above your head).
The next chapter in our story is a beautiful brain twist: to think about thinking...