Category: Statistics Level: 301
mean = (∑ x)/n
The mean is what each value gets if you pool the total and share it out evenly. Cut the extra off the tall bars and use it to fill the short ones.
Seven bars with heights 2, 3, 3, 4, 5, 6, 12. They are far from even.
total = 2 + 3 + 3 + 4 + 5 + 6 + 12 = 35
Share 35 blocks among 7 bars and each gets 5. Draw that level across all bars.
35/7 = 5
Blocks above the line are extra (red). Gaps below it are missing (dashed). The counts match, which is the whole trick.
extra = 8 = missing
Cut the extra blocks (now dashed) and drop them into the gaps. Every bar ends at 5, and the total stays 35.
7 × 5 = 35
cd svg-generator python3 -m svgmath render mean-fair-share --out /tmp/mean-fair-share
Source: svgmath/diagrams/statistics.py