How to Think About Money

Have you heard of the Riddle of the Missing Dollar? It goes like this.
Three friends are sharing a hotel room. The hotel manager tells them the bill for the night is $30, so each of the three friends pays $10. Later on, the manager realizes she made a mistake; the nightly rate is in fact only $25. So she gives $5 to the bellhop to take to their room. The bellhop figures that $5 is hard to split three ways, so he pockets $2, and returns $3 to the three hotel guests, $1 to each. Now each of the three friends have actually effectively paid $9, (since they each got back a dollar) and the bellhop got $2, for a total of $9+$9+$9+$2 = $29. But there were $30 at the beginning of the story. What happened to the extra dollar?

The point of this note is to explain a way of thinking about money and debts and obligations that makes answering this riddle completely straightforward. In fact, what it does is make the sneaky part of the riddle very hard to hide. Also it's useful in real life for things like keeping track of money you've loaned to friends, dividing bills on road trips, coordinating utility bill payments with roommates, and so on.

It's not a new way of thinking at all. It's double-entry bookkeeping, which got invented hundreds of years ago, probably in Italy, but depending on who you ask (or what you consider to be the fully working idea) it can be traced back to earlier times and other cultures.

But I'm going to try to put my own spin on it, and bias the description toward examples that I (and hopefully you) find relevant as an ordinary person. Most of the other explanations I've seen online and in textbooks are more about the accounting in a company, with revenues and profits and sales and inventory and so on. I don't have any of those things; I have things like gas bills and a checking account and paychecks and security deposits and personal income tax and friends that I owe money to.

So that's the plan: double-entry bookkeeping, for ordinary people. Plus there'll be some pretty diagrams to look at.

Basic Ideas

I'm a logician, so I like reducing ideas to as few axioms as I can possibly get away with. I'm going to try to explain everything below in terms of two principles, and one Thing That Should Go Without Saying, Because This Isn't 14th-Century Italy For Crying Out Loud.

Principle I

Money is conserved. Money is neither created or destroyed, but merely moves from place to place. One chunk of money moving from one place to another is called a transaction. The place the money moved from is called the source of the transaction, and the place it moved to is called the target.

Principle II

You can group together sources and targets of transactions however you like. Such a grouping is called an account.

Thing That Should Go Without Saying, Because This Isn't 14th-Century Italy For Crying Out Loud

Negative numbers are ok.

That last one there is me (over)reacting to the standard terminology about 'debits' and 'credits' and 'debit accounts' and 'credit accounts'. I find it confusing and unnecessary to name them different things, no matter how useful it was back in the day when negative numbers were new and mysterious. We all learned about negative numbers in elementary school, so let's use them.

Diagrams

We can draw diagrams to show how money moves around. A transaction looks an arrow from one place to another:
A transaction This means $10 has moved from point on the left, the transaction's source, to point on the right, the transaction's target.

To count up how much money is in a certain place, we want to group together the sources and targets into accounts. An account generally looks like a blobby sort of shape drawn to enclose an area:
An account We give every account a name so that we can conveniently talk about it. This one is called 'checking'. All the transactions on the left are money flowing into the checking account, the ones on the right depict money flowing out of it, and the ones below are transactions that take place entirely outside the checking account, and don't affect it.

Finding out how much money is in an account is quite simple: add up all the transactions that show money moving into the account, minus all the transactions that show money moving out of it. We ignore transactions that have both points inside or outside the account. So, for example, the amount of money in the 'checking' account in this diagram is:
Summing accounts

For the techniques that are going to show up later, it's important that we allow accounts to overlap each other. In the most general case, the situation might look like this:
Overlapping accounts However, at any given time we'll mostly be talking about accounts that don't overlap partially, but entirely contain one another, like so:
Nested accounts Anyhow we can start by explaining the missing dollar riddle without any overlap at all.

What Missing Dollar?

Let's see how to solve the riddle. We will have five accounts, Friend1, Friend2, Friend3, Bellhop, and Manager.
Missing dollar We step through the story, adding transactions to the picture. We're going to omit the dots at the endpoints of arrows from now on, since they aren't strictly necessary, and clutter up the picture.

"The hotel manager tells them the bill for the night is $30, so each of the three friends pays $10."
Missing dollar

"Later on, the manager realizes she made a mistake; the nightly rate is in fact only $25. So she gives $5 to the bellhop to take to their room."
Missing dollar

"The bellhop figures that $5 is hard to split three ways, so he pockets $2, and returns $3 to the three hotel guests, $1 to each."
Missing dollar Now we apply the rule for determining how much money is in an account. Each of the friends comes away with -$10 + $1 = -$9 following all the transactions we listed. This makes sense: they each spent effectively $9 after receiving their partial refund. Meanwhile, the bellhop has gained $5-$1-$1-$1=$2, and the hotel manager has gained $10+$10+$10-$5=$25. The special thing about all of the accounts we drew in this picture is they cover all of the endpoints of all transactions without any overlap. This means that we should expect the sum of all of the money in all accounts to be zero. And indeed, $25 + $2 - $9 - $9 - $9 = $0. This reflects that we have been correctly careful about the conservation of money at every step. This fact is worth putting a fancy box around.

Fact

Suppose you have a collection of non-overlapping accounts that together cover all transactions. To put it another way, suppose you have a collection of accounts such that every endpoint of every transaction belongs to one of those accounts. Then the sum of all money in those accounts is zero.

This is a sort of global 'conservation law' that is derived from the 'local conservation' property that each transaction only subtracts money from one place and adds money somewhere else. It is where the name 'double-entry' in double-entry bookkeeping comes from, historically: if every account has its own account book, then every valid transaction causes two entries, one in the account it's taking money from, and the other in the account it's putting money into. And if you faithfully make double-entries for each transaction, then at the end of the day, all of your books are 'balanced', and all accounts sum to zero.

So finally we can conclude that the trick of the 'missing dollar' comes from expecting the wrong sort of conservation law. It's not even clear what principle is behind it: the storyteller incorrectly adds up $9 + $9 + $9 + $2 (note how sneakily ignored the minus sign is on the -$9 gained by each hotel guest) and getting $29, and asks innocently why this is close (but not quite equal!) to the $30 that participated in a few transactions early on in the story. The 'riddle' is really just a bit of misdirection, persuading you that some fact that should hold has been violated.

No such thing has happened! The Fact listed above is the thing that should hold, and it does.

To be continued...