Uploaded November 2014 | Updated November 2026, 2 hours ago
How random number generators work and how to get good numbers out of them.
Find the source code here: github.com/BSVino/MathForGameDevelopers/tree/probability-random
New video every Thursday. Question? Leave a comment below, or ask me on Twitter: twitter.com/VinoBS
EXERCISES:
1. Modify the function to pass the current time into the random number seed and verify that a new sequence is always produced.
2. Create a pseudorandom number generator that generates only 1's and 0's, false and true values.
3. How would the difference in probabilities be between outputs if there were only 2^8 input values and 100 output values? What about if there were 2^8 input values and 128 output values?
4. Tricky: How would you design a pseudorandom number generator over arbitrary output ranges where all of the output values are exactly equally likely?
How random number generators work and how to get good numbers out of them.
Find the source code here: github.com/BSVino/MathForGameDevelopers/tree/probability-random
New video every Thursday. Question? Leave a comment below, or ask me on Twitter: twitter.com/VinoBS
EXERCISES:
1. Modify the function to pass the current time into the random number seed and verify that a new sequence is always produced.
2. Create a pseudorandom number generator that generates only 1's and 0's, false and true values.
3. How would the difference in probabilities be between outputs if there were only 2^8 input values and 100 output values? What about if there were 2^8 input values and 128 output values?
4. Tricky: How would you design a pseudorandom number generator over arbitrary output ranges where all of the output values are exactly equally likely?










