--- title: "Nuclear Decay Simulation" id: 76538 type: "computer_media" slug: "nuclear-decay-simulation" url: "http://localhost/computer_media/nuclear-decay-simulation/" markdown_url: "http://localhost/computer_media/nuclear-decay-simulation.md" published_at: "2026-11-11T08:02:28+00:00" modified_at: "2026-11-11T08:02:28+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2026/11/nuclear-decay-simulation-1.png" excerpt: "Simulate a radioactive decay chain with virtual dice on a ZX80, pass by pass, until every atom is stable." post_tag: - name: "Downloadable" slug: "downloadable" taxonomy: "post_tag" url: "http://localhost/tag/downloadable/" - name: "ZX80" slug: "zx80" taxonomy: "post_tag" url: "http://localhost/tag/zx80/" model: - name: "Sinclair ZX80" slug: "zx80" taxonomy: "model" url: "http://localhost/model/zx80/" indiv: - name: "S. Sanderson" slug: "s-sanderson" taxonomy: "indiv" url: "http://localhost/indiv/s-sanderson/" genre: - name: "Science" slug: "science" taxonomy: "genre" url: "http://localhost/type/science/" media_type: "Program" programmers: - name: "S. Sanderson" slug: "s-sanderson" taxonomy: "indiv" url: "http://localhost/indiv/s-sanderson/" download_url: "https://archive.org/download/timex-sinclair-software-archive/Nuclear%20Decay%20Simulation%20%281982%29%28Sanderson%2C%20S.%29%28ZX80%29%28US%29%28Program%29.zip" mediadate: "1982" images: - url: "http://localhost/wp-content/uploads/2026/11/nuclear-decay-simulation-1.png" - url: "http://localhost/wp-content/uploads/2026/11/nuclear-decay-simulation-2.png" article_media: - id: 52523 title: "Nuclear Decay Simulation" type: "article" url: "http://localhost/article/nuclear-decay-simulation/" media_type_tags: "Science" license: false --- # Nuclear Decay Simulation A computer version of the classroom dice experiment for radioactive decay. Enter the number of generations (2 for a parent that decays straight to a stable isotope, up to 5 for a chain), the relative half-life of each generation as the number of faces on its die, and the starting number of atoms. Each pass throws a die for every atom and moves the ones that decay to the next generation, then prints the count in each. Press NEWLINE for the next pass; the program stops with ALL ATOMS STABLE. The article suggests more than 200 atoms for a smooth graph. Published in Syntax February 1982 ([Nuclear Decay Simulation](https://timexsinclair.com/article/nuclear-decay-simulation/)). ## Source Code ``` 10 DIM H(5) 20 DIM A(5) 30 PRINT "NUCLEAR DECAY SIMULATION" 40 PRINT 50 PRINT 60 PRINT "HOW MANY GENERATIONS? (>1)" 70 INPUT G 80 PRINT 90 PRINT "RELATIVE 1/2 LIFE (FACES ON DIE)" 100 FOR I=1 TO G-1 110 PRINT "GEN. (";I;") = "; 120 INPUT H(I) 130 PRINT H(I) 140 NEXT I 150 LET A(G)=0 160 LET K=0 170 PRINT "INITIAL NO. OF ATOMS?" 180 INPUT A 190 LET A(1)=A 200 FOR I=1 TO G-1 210 IF A(I)=0 THEN GO TO 280 220 LET N=A(I) 230 FOR J=1 TO N 240 IF NOT RND(H(I))=1 THEN GO TO 270 250 LET A(I)=A(I)-1 260 LET A(I+1)=A(I+1)+1 270 NEXT J 280 NEXT I 290 LET K=K+1 300 CLS 310 PRINT "PASS ";K 320 PRINT 330 FOR I=1 TO G 340 PRINT "GEN. (";I;") = ";A(I) 350 NEXT I 360 IF A(G)=A THEN GO TO 410 370 PRINT "NL TO CONTINUE" 380 INPUT A$ 390 IF A$="" THEN GO TO 200 400 STOP 410 PRINT 420 PRINT "ALL ATOMS STABLE" ```