This program will simulate the bead model for exponent growth. The program
asks for an input of the number of censuses and a probability - a number
between 0 and 1. Each member of the current census adds one to the current
population with the chosen probability, independent of the other members.
The census number is stored in L1, the population total iss
stored in L2 and the population change is stored in
L3.
PROGRAM:EXPONENT
:Disp "CENSUSES"
:Input C
:Disp "PROBABILITY"
:Input P
:0 -> L1(1)
:1 -> L2(1)
:For(I,1,C,1)
:0 -> J
:For(K,1,L2(I),1)
:If rand < P
:J+1 -> J
:End
:J -> L3(I)
:I -> L1(I+1)
:J+L2(I) -> L2(I+1)
:End