In order to be useful, data stored in computer need to represent real-world phenomena. However, making the representation go through an extra level of indirection – through the realm of mathematics – can be benefitial.
A tale of a banana plantage
Imagine a banana plantage. Next to the plantage, there is a warehouse where bananas ready for sale are stored. To keep track of the bananas in the warehouse, the owner of the plantage has a computer outside of the warehouse. The computer consists of a single counter (implemented somehow), together with a red lightbulp which is turned on whenever there are no bananas in the warehouse, a green lightbulp which is turned on whenever there are some bananas in the warehouse, a button to be pressed whenever a new banana is added to the warehouse (yey!), and a button to be pressed whenever a banana is taken out of the warehouse (typically associated with a golden coin being added to the owner’s pocket). This primitive computer, if functioning correctly, can already provide a lot of value: the owner does not need to open the warehouse to see if there are any bananas to be sold, and thus it is easier to keep the temperature inside the warehouse regulated.
The counter in the computer thus represents something very real: bananas in the warehouse.
One day, the owner decides he does not want to add bananas to the warehouse one by one, but in batches. Traveling between the plantage and the warehouse with a single banana in hand is getting boring. He tells his engineer, and the engineer comes with an idea: let the owner hire a worker who would pick up bananas at the plantage, put them to a wheeled cart (whose invention is another story), and bring the wheeled cart full of bananas near the warehouse, where the whole batch of bananas would be put to the warehouse at once. The brilliant part of the idea consists of having a button (“new banana”) at the cart, a cable for connecting the cart to the computer, and another new button (“a bunch of bananas has arrived”) on the computer.
Everything is concrete and understandable to all the people involved: the engineer, the worker, and the owner. Until…
A birthday party
One day, a customer comes with a special request. His birthday are coming next weekend, and he wants to give all his friends who will arrive at his party a banana. He has many friends and there are multiple quality banana plantages around; however, his friends can be jealous at times, and so he wants to give all of them a banana from the same plantage - otherwise there might be some disputes between the guests, because banans from each plantage look differently. Does the owner have enough bananas for all the guests?
The owner discusses with his engineer. They could just try to take bananas out of the warehouse one by one and give them to the customer’s friends - but if at the end there were some friends without a banana, they would have to put the bananas back to the warehouse. And the bananas would not be particularly happy about the changes in the temperature and humidity of their environment.
And as if there were not enough problems, the owner finds out that the market currently prefers oranges to bananas. What if he could have a similar system for oranges also? But of course, he does not want to pay the engineer to invent the same system again, just for oranges. “Oranges or bananas”, he says, “what is the difference anyway?”
A beer-fueled conversation
Hopefully it is Friday. The engineer can go to a pub, have a beer, and forget about problems until Monday. Or perhaps not. There is a witch in the pub.
“What is the difference between oranges and bananas? Or is it rather, what is the common thing about a cart of oranges and a cart of bananas?”, she asks. “Besides the cart, the common thing is a quantity. My colleagues have studied these things quite in depth.”
The engineer does not ask how she know what he has been thinking about the whole day. She is a witch, in the end. And she is drinking a beer. The engineer sighs, orders the same beer as the witch, and explains his troubles.
“Hmm…you do not want your machines to be tied specifically to bananas. You want them to operate with natural numbers.”, says the witch. “You cannot see them the same way you see bananas and oranges, but they behave in the same way as quantities of bananas. Or quantities of people”.
Hmm… perhaps the rumours that the witch eats people the same way she eats bananas are true.
Properties of abstract objects
A few weeks later, the engineer has a machine that uses binary encoding of natural numbers to represent both bananas and oranges. The business prospers, the owner is happy, and he hires another worker (for whom the engineers builds another cart). However, the owner starts having bad dreams.
In the dream, the workers compete about who is faster with the banana cart. The younger worker wins, but then a customer comes for bananas and the warehouse does not have enough of them. Can this happen in the real life?
The engineer tries to convince the owner that the order in which the workers arrive at the warehouse does not matter. He tries to explain how his electronic circuit for emptying the cart into the warehouse works, but the owner seems to not understand. What is worse, now the engineers feels like he does not understand it either.
The pub is almost empty that day, only the witch is eating an orange. Oranges, or bananas…. or people… brrr.
“Don’t worry. Addition of natural numbers is commutative”, she says. “Your binary encoding was clever. Of course you find it hard to reason about your sequences of bits and operations. Properties of abstract objects stays the same, no matter what real-life entities you represent with them. And no matter how you represent the abstract objects using other real-world entities.”
Conclusion
It took some time for the engineer to swallow this. He needed to play with his fingers to represent quantities - and natural numbers. The witch even gave him her set of small bones to represent numbers in different bases. But at the end, it clicked.