Why Garbage value can't be considered as random number | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Why Garbage value can't be considered as random number

Why a garbage value can't be considered as random value? Why we have to go through algos to generate a random number instead of creating a garbage value?

13th Jul 2022, 4:18 AM
Gurmeet Singh
Gurmeet Singh - avatar
2 Answers
+ 4
What is a garbage value? Where do you take it from? How did it get there? According to the definition of random: "Random numbers are numbers that occur in a sequence such that two conditions are met: (1) the values are uniformly distributed over a defined interval or set, and (2) it is impossible to predict future values based on past or present ones. Random numbers are important in statistical analysis and probability theory." https://www.techtarget.com/whatis/definition/random-numbers You cannot guarantee uniform distribution of memory garbage, nor its unpredictability. Hence we have pseudorandom generator algorithms, typically built into the core of programming languages.
13th Jul 2022, 6:33 AM
Tibor Santa
Tibor Santa - avatar
+ 3
Why garbage value can!t be considered as random number. Random numbers are intentionally generated by us for our own program need. The algorithm also supports range bounds, something no one can expect from garbage values. Garbage values are just bytes left in memory by other programs or system after they are done with whatever they do (hence the name). These values are not intentionally generated by or for our program.
13th Jul 2022, 7:22 AM
Ipang