Auctions, Matching and Bookkeeping: The Maths of Markets

Why bidding your true value works in some auctions, how doctors get matched to hospitals, and why debits always equal credits. Three new labs to try.
Markets are more than prices on a shelf. Some things are sold in auctions, some are shared out by preference lists, and every business has to keep its books straight. Three new labs let you try the ideas behind all three.
Auction lab: how much should you bid?
The Auction lab runs four kinds of auction on the same bidders:
- English: the price rises until one bidder is left.
- Dutch: the price falls until someone shouts "mine".
- Second-price sealed bid: everyone bids once in secret, and the winner pays the second-highest bid.
- First-price sealed bid: the winner pays their own bid.
In a second-price auction, the best plan is to bid exactly what the item is worth to you. In a first-price auction you should bid less, because you pay your own bid. With four bidders, the textbook bid is three quarters of your value.
The surprise is that, in this simple model, all four formats bring the seller the same price on average. Economists call it revenue equivalence. With 4 bidders and values between 0 and 100, the expected price is 100 × 3 ÷ 5 = 60 in every format. Run the lab and watch the four averages land close together.
Matching lab: pairs that stay together
Some things cannot be bought, like a place at a school. The Matching lab uses the method David Gale and Lloyd Shapley published in 1962:
- Everyone in one group asks their favourite in the other group.
- Each person who is asked keeps the best offer so far and says no to the rest.
- Anyone turned down asks the next name on their list.
When nobody is left without a partner, the result is stable: no two people would both rather be together than with their partners. Versions of this method match junior doctors to hospitals in several countries. Try swapping which side asks. The side that does the asking always does at least as well.
Double-entry bookkeeping lab: why the books balance
The Double-entry bookkeeping lab writes every transaction twice. If a shop pays 700 in rent, that is a debit of 700 to rent expense and a credit of 700 to the bank account. Because both sides are always equal, the trial balance must balance.
The lab follows a bike repair shop's first week, from the owner's savings to the first paid invoice. It then builds the profit and loss account and checks that assets = liabilities + owner's equity.
Debit does not mean "minus". It simply means the left-hand side of an account.
These are teaching models, not financial advice. If you enjoy them, the game theory and voting labs beside this post explore more of the maths behind everyday choices.