Loading the engineShared by all simulations, so the next one opens instantly.
The physics

In the yard-sale model, agents meet in pairs and bet part of their wealth on a fair coin. No one has an edge, no wealth is created or destroyed, and yet the wealth concentrates in fewer and fewer hands. Anirban Chakraborti studied this kind of exchange in 2002 and found that it condenses, Brian Hayes named it after the haggling at a yard sale in the same year, and Bruce Boghosian and coworkers later extended it with redistribution and an advantage for the rich, which brings it close to measured wealth distributions.

What you see

10 000 agents in a 100 by 100 grid, one cell per agent. All start with wealth 1, so the canvas starts black. Agents with no more than the starting wealth, which is also the mean, stay black; richer agents run from purple through magenta and orange to yellow on a logarithmic scale that ends at the current richest agent. The box in the top left shows the Gini coefficient G, 0 when everyone owns the same and 1 when one agent owns everything, with a bar that turns from green (G<0.4) to orange and to red (G≥0.7).

Rule

Each step makes 5000 trades between random pairs of distinct agents, so every agent trades once per step on average. In a trade between agents with wealth wi and wj, the stake is a fraction f of the poorer agent’s wealth, and the winner takes it from the loser:

Δw=fmin⁡(wi,wj),wwinner←wwinner+Δw,wloser←wloser−Δw.

The richer agent wins with probability 12+b, where b is its advantage (0 for a fair coin). After the trades, a wealth tax takes the fraction τ of every agent’s wealth and pays the total back in equal shares.

The coin is fair, but the stake is not symmetric for the poorer agent: a win followed by a loss leaves it with (1+f)(1−f)=1−f2 times its wealth. Its logarithmic wealth therefore drifts down by about f2/2 per trade, while the richer agent risks only a small part of its own wealth. Without tax, the model has no steady state: the Gini coefficient rises toward 1 forever, more slowly as it goes.

Presets

Times are at 60 frames per second and one step per frame. All presets use f=0.2.

Fair trades, no tax: τ=0, b=0, also the default. The Gini coefficient reaches 0.66 after 100 steps (under 2 seconds), 0.94 after 1000 steps and 0.99 after 10 000 steps (under 3 minutes). By then 98% of the agents are poorer than the mean and the richest 1% hold 93% of all wealth.

Wealth tax of 2%: τ=0.02, b=0. Taxing 2% of each agent’s wealth per step and paying it back in equal shares stops the condensation. The Gini coefficient settles at about 0.38 within 100 steps and stays there.

Advantage for the rich: τ=0, b=0.3, so the richer agent wins 80% of its trades. Condensation is much faster: the Gini coefficient is 0.88 after 100 steps and 0.99 after 1000 steps, and after 10 000 steps the richest 1% hold practically all the wealth.

Wealth tax of 4%: τ=0.04, b=0. Twice the tax gives a Gini coefficient of about 0.29, reached within 30 steps. Inequality remains: random trades keep spreading the wealth faster than a flat tax can level it.

Parameters

Exchange fraction: the stake f as a fraction of the poorer agent’s wealth, 0.01 to 0.5. Inequality grows at a rate proportional to f2: the Gini coefficient reaches 0.66 after 400 steps with f=0.1, 100 steps with f=0.2 and 25 steps with f=0.4.

Wealth tax (per step): the fraction τ of each agent’s wealth that is collected and redistributed every step, 0 to 0.05.

Advantage of the richer agent: the extra chance b of the richer agent to win a trade, 0 to 0.45.

All three apply immediately to the running economy. Reset gives every agent wealth 1 again.