A Thousand Rolls
Twenty rolls were too ragged to trust. Change one number — 20 to 1000 — and the bell stops hiding. The counts climb, 7 pulls ahead, the edges stay low, and a clear shape emerges from pure chance. That's the law of large numbers.
The tally worked, but twenty rolls was too little to trust — the shape was lumpy and half-formed. The fix is the smallest change in the whole game: roll more. The array and the tally line stay exactly as they were; only the loop count changes, from 20 to 1000.
10 PRINT CHR$(147)
20 DIM T(12)
30 FOR I=1 TO 1000
40 D=INT(RND(1)*6)+1+INT(RND(1)*6)+1
50 T(D)=T(D)+1
60 NEXT I
70 FOR F=2 TO 12
80 PRINT "TOTAL";F;"-";T(F)
90 NEXT F
Only line 30 changed — FOR I = 1 TO 1000. That's the lesson hiding in a single digit: with
enough rolls, the ragged lumps of twenty smooth into a clear curve. Read the counts top to
bottom and you can see it — 7 is the tallest, the numbers slope down evenly to either side, and
the edges (2 and 12) are smallest, just as the "six ways versus one way" counting predicted.
This is emergence: a pattern no single roll contains, appearing only across many. You never wrote "make 7 the biggest" — the program just rolls fair dice and counts. The shape comes from the number of trials, not from any instruction. Statisticians call it the law of large numbers; you've just made the C64 show it. (It takes a moment — a thousand rolls is real work for BASIC — so let it run.)
Try this
- Find the tipping point. Try 50 rolls, then 100, then 500. Somewhere in there the lumps become a curve. How many rolls does convincing take?
- Sum it. The eleven counts should still add up to exactly 1000. The bell didn't lose any rolls — it just arranged them by how likely each total is.
What's next
The bell is clear in the numbers — but a column of figures isn't a picture. In Unit 5 you draw the counts as bars, POKEd straight to the screen, and see the bell.