Nuclear Decay Simulation

Author(s): S. Sanderson
Publication: Syntax
Pub Details: Syntax/Syntax ZX80 v3 n2 (Volume 3, Issue 2)
Date: February 1982
Pages: 13

A popular lab exercise uses special dice to simulate radioactive decay. Marked die faces show the decay probability. After shaking and throwing the dice, replace those with marked sides showing with spheres (stable atoms) or dice with different decay probability (radioactive daughters). Use over 200 atoms for a smooth graph.

This program throws, examines and exchanges dice. You get data to plot a decay chain from radioactive parent to stable population.

The prompt asks for the number of generations. Enter 2 to decay to a stable isotope, or 3 to 5 for a decay chain. Next, enter the relative half-life of each generation, corresponding to the total number of faces on the die. For example, 8 denotes a 1 in 8 chance of decay for each atom in that generation during each pass. Then, enter the initial number of atoms. The program stops when the population consists entirely of stable atoms. Graphs derived from this program agree well with experiment.

  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"
Syntactic Sum: -17745, 4K

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.