Skip to main content
improved formatting for list in footnote (with blank line after `<sub>`), some re-wording, changed “do a seed” to “use a seed”, removed some odd commas, upgraded some hyphens to em-dashes, added missing colon
Source Link

In mathematics, computer science and physics, a deterministic system is a system in which no randomness is involved in the development of future states of the system. A deterministic model will thus always produce the same output from a given starting condition or initial state.
Deterministic Systems - Wikipedia

Think of a computer like a cook, who has been handed a recipe (a program) to bake a cake. Computers do not deviate from the instructions (input) in a program, meaning that each cake they bake (output) will be identical.

xkcd 221: Random Number
Comic #221: Random Number - xkcd

The problem is, being a mathematical formula - if you give it the same input value, you'll get the same output value. So what a PRNG does, is feed the values it generates back in tointo the formula, to get more values, and so on. But we're left with a problem:

In most games, the seed is determined automatically using a few tricks, like deriving a value from the system clock, or the number of frames generated before user input. But this is also why clock manipulation or frame-counting are popular tactics in speedrunning circles - because they can take the "randomness" out of certain actions, to guarantee a more perfect run.

In otherOther games like Minecraft, which relies heavily on randomness for it's world generation, they allow you to manually specify a seed to get the "same" world generation.

We need to seed Current_Value with something, so let's douse a seed of 1:

and now, let's try a seed of 42:

1. This is true for most computing applications you'll encounter day-to-day. In specialised cases (such as high-security applications) computers can act as non-deterministic systems by utilizing True Random Number Generators (TRNGs). These devices measure unpredictable physical phenomena (such as thermal noise or radioactive decay) to generate data that is truly random and not based on a formula.
Non-deterministic behaviour may also be observed from situations such as multi-core processing (race conditions), hardware faults, or Single-Event Upsets (SEUs) (i.e. cosmic rays flipping bits, etc)
2. This type of PRNG is known as a Linear Congruential Generator (LCG). There are other (more robust) PRNG formulas, this one just serves as a good simple example. This LCG will loop after about 100 iterations, and visit almost every number in the range 0-100, except 16. This is a consequence of the specific parameters chosen for the example. 16 is a "fixed point" for this specific equation (if you use 16 as the seed, you get 16 back: (7*16+5 = 117 -> 117%101 = 16)
 
  1. This is true for most computing applications you'll encounter day-to-day. In specialised cases (such as high-security applications) computers can act as non-deterministic systems by utilizing True Random Number Generators (TRNGs). These devices measure unpredictable physical phenomena (such as thermal noise or radioactive decay) to generate data that is truly random and not based on a formula.
    Non-deterministic behaviour may also be observed from situations such as multi-core processing (race conditions), hardware faults, or Single-Event Upsets (SEUs) (i.e. cosmic rays flipping bits, etc)
  2. This type of PRNG is known as a Linear Congruential Generator (LCG). There are other (more robust) PRNG formulas, this one just serves as a good simple example. This LCG will loop after about 100 iterations, and visit almost every number in the range 0-100, except 16. This is a consequence of the specific parameters chosen for the example. 16 is a "fixed point" for this specific equation (if you use 16 as the seed, you get 16 back: (7*16+5 = 117 -> 117%101 = 16)

In mathematics, computer science and physics, a deterministic system is a system in which no randomness is involved in the development of future states of the system. A deterministic model will thus always produce the same output from a given starting condition or initial state.
Deterministic Systems - Wikipedia

Think of a computer like a cook, who has been handed a recipe (a program) to bake a cake. Computers do not deviate from the instructions (input) in a program, meaning that each cake they bake (output) will be identical.

xkcd 221: Random Number
Comic #221: Random Number - xkcd

The problem is, being a mathematical formula - if you give it the same input value, you'll get the same output value. So what a PRNG does, is feed the values it generates back in to the formula, to get more values, and so on. But we're left with a problem:

In most games, the seed is determined automatically using a few tricks, like deriving a value from the system clock, or the number of frames generated before user input. But this is also why clock manipulation or frame-counting are popular tactics in speedrunning circles - because they can take the "randomness" out of certain actions, to guarantee a more perfect run.

In other games like Minecraft which relies heavily on randomness for it's world generation, they allow you to manually specify a seed to get the "same" world generation.

We need to seed Current_Value with something, so let's do a seed of 1:

and now, let's try a seed of 42

1. This is true for most computing applications you'll encounter day-to-day. In specialised cases (such as high-security applications) computers can act as non-deterministic systems by utilizing True Random Number Generators (TRNGs). These devices measure unpredictable physical phenomena (such as thermal noise or radioactive decay) to generate data that is truly random and not based on a formula.
Non-deterministic behaviour may also be observed from situations such as multi-core processing (race conditions), hardware faults, or Single-Event Upsets (SEUs) (i.e. cosmic rays flipping bits, etc)
2. This type of PRNG is known as a Linear Congruential Generator (LCG). There are other (more robust) PRNG formulas, this one just serves as a good simple example. This LCG will loop after about 100 iterations, and visit almost every number in the range 0-100, except 16. This is a consequence of the specific parameters chosen for the example. 16 is a "fixed point" for this specific equation (if you use 16 as the seed, you get 16 back: (7*16+5 = 117 -> 117%101 = 16)
 

In mathematics, computer science and physics, a deterministic system is a system in which no randomness is involved in the development of future states of the system. A deterministic model will thus always produce the same output from a given starting condition or initial state.
Deterministic Systems Wikipedia

Think of a computer like a cook who has been handed a recipe (a program) to bake a cake. Computers do not deviate from the instructions (input) in a program, meaning that each cake they bake (output) will be identical.

xkcd 221: Random Number
Comic #221: Random Number xkcd

The problem is, being a mathematical formula if you give it the same input value, you'll get the same output value. So what a PRNG does is feed the values it generates back into the formula to get more values, and so on. But we're left with a problem:

In most games, the seed is determined automatically using a few tricks, like deriving a value from the system clock, or the number of frames generated before user input. But this is also why clock manipulation or frame-counting are popular tactics in speedrunning circles because they can take the "randomness" out of certain actions, to guarantee a more perfect run.

Other games like Minecraft, which relies heavily on randomness for it's world generation, allow you to manually specify a seed to get the "same" world generation.

We need to seed Current_Value with something, so let's use a seed of 1:

and now, let's try a seed of 42:

  1. This is true for most computing applications you'll encounter day-to-day. In specialised cases (such as high-security applications) computers can act as non-deterministic systems by utilizing True Random Number Generators (TRNGs). These devices measure unpredictable physical phenomena (such as thermal noise or radioactive decay) to generate data that is truly random and not based on a formula.
    Non-deterministic behaviour may also be observed from situations such as multi-core processing (race conditions), hardware faults, or Single-Event Upsets (SEUs) (i.e. cosmic rays flipping bits, etc)
  2. This type of PRNG is known as a Linear Congruential Generator (LCG). There are other (more robust) PRNG formulas, this one just serves as a good simple example. This LCG will loop after about 100 iterations, and visit almost every number in the range 0-100, except 16. This is a consequence of the specific parameters chosen for the example. 16 is a "fixed point" for this specific equation (if you use 16 as the seed, you get 16 back: (7*16+5 = 117 -> 117%101 = 16)
Whoops. I smort, do numbers good. But yeah, I changed the formula before posting but missed a couple of values. How did noone call this one out lol.
Source Link
Robotnik
  • 39.6k
  • 49
  • 190
  • 322
Current Value Formula Next Value
42 (Seed) (7 * 42 + 5) % 101 97
97 (7 * 97 + 5) % 101 78
78 (7 * 78 + 5) % 101 46
9346 (7 * 9346 + 5) % 101 24
Current Value Formula Next Value
42 (Seed) (7 * 42 + 5) % 101 97
97 (7 * 97 + 5) % 101 78
78 (7 * 78 + 5) % 101 46
93 (7 * 93 + 5) % 101 24
Current Value Formula Next Value
42 (Seed) (7 * 42 + 5) % 101 97
97 (7 * 97 + 5) % 101 78
78 (7 * 78 + 5) % 101 46
46 (7 * 46 + 5) % 101 24
deleted 18 characters in body
Source Link
Robotnik
  • 39.6k
  • 49
  • 190
  • 322

Kinda like this:

xkcd 221: Random Number
Comic #221: Random Number - xkcd

Kinda like this:

xkcd 221: Random Number
Comic #221: Random Number - xkcd

Clarify footnote based on feedback
Source Link
Robotnik
  • 39.6k
  • 49
  • 190
  • 322
Loading
Typo. We use 101 in the formula examples
Source Link
Robotnik
  • 39.6k
  • 49
  • 190
  • 322
Loading
Clarify its not impossible to get, you have to use a specific seed value
Source Link
Robotnik
  • 39.6k
  • 49
  • 190
  • 322
Loading
Clarify that random values are then used to generate more random values
Source Link
Robotnik
  • 39.6k
  • 49
  • 190
  • 322
Loading
I ended up not needing point 3
Source Link
Robotnik
  • 39.6k
  • 49
  • 190
  • 322
Loading
fix a few things - expand e.g. to 'for example' so that the preceding formula is all on one line. Range is actually 0-100; Add more info on this specific PRNG
Source Link
Robotnik
  • 39.6k
  • 49
  • 190
  • 322
Loading
Clarify that computing determinism is not always the case
Source Link
Robotnik
  • 39.6k
  • 49
  • 190
  • 322
Loading
Source Link
Robotnik
  • 39.6k
  • 49
  • 190
  • 322
Loading