# it generates N integers (positive or negative) between A and B;
# it multiplies them all by R;
# then it adds S to all the values obtained.
• Some examples:
• Another example: 1000 throws of three balanced dice.
1000 throws of one die:
I put the sequence in the script to add 2 sequences (in a1, a2, ...):
I click "Start" again in the script to generate random numbers.
I put the second sequence in the script to add 2 sequences (in b1, b2, ...).
I click "sum".
I copy the result and put it in "a1, a2, ...".
I click "Start" again in the script to generate random numbers.
I put the third sequence in the script to add 2 sequences (in b1, b2, ...).
I click "sum".
I put the result in the pocket calculator-2:
I get the previous histogram.
• Another example: how the time to order N data increases as N increases (with the algorithm present here).
I generate 1000, 2000, 4000, 8000 random number:
I order then, and I record the time taken:
If I had: 1000 numbers, 89 ms; 2000 numbers, 313 ms; 4000 numbers, 1223 ms; 8000 numbers, 4898 ms.
313 / 89 = 3.52, 1223 / 313 = 3.91, 4898 / 1223 = 4.00.
Doubling N the time approximately fourfold.
I can deduce that
For much larger N values, another algorithm agrees, whose time grows as N·log(N).