Skip to content

If you add up two randomly generated numbers, is the result more random than if you just generated a single random number?

Notifications You must be signed in to change notification settings

robertocarlosmedina/random-question

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 

Repository files navigation

Random Question

If you add up two randomly generated numbers, is the result more random than if you just generated a single random number?

Introduction

Random numbers can be generated by a computer, but these are pseudorandom, this because of the hardware components, which does not allow them to be pure random numbers, and what matters to us is to have a more random number possible, because when more random is the most unpredictable number it is. but try to think about it, if we add random numbers, will the result be more random? this is the meaning of this repo, to resolve this issue. The code upstairs already has the answer, but here is a brief explanation of the answer.

Solution to the problem

To solve this problem, I created a program using the Pygame library (whit Python). Basically, what I did was just a window where there is a graphics that will be drawn by the random values generated. When one of the values is generated, an item is added to the rectangle related to the value, and the more, this value is generated, more items are added to the rectangle and increasing its height.

Generating a random value

Generated a single random value in a range of values, it can be seen that the graph made is uniform. Which means that in this range of values it is very unpredictable to guess the value to be generated, this because the graphic can have values in any value of the x-axis, and looking at the graph below you can see this behavior.

Imagem de grafico

Generating a value from the sum of two random

Generating a value from the sum of two random numbers in a range of values the graph takes an almost rectangular structure, with a slightly higher concentration in the center of it.

Imagem de grafico

Generating a value from the sum of eight random

Testing for the sum of eight random numbers in a range of values the graph takes almost gaussian form, with a higher concentration in the center of it, making it impossible to have values at the extremes as shown in the graph.

Imagem de grafico

Generating a value from the sum of thirty-two random

The behavior in the sum of thirty-two random numbers is the same only with much higher concentration the tenter to the center, as shown in the graph below.

Imagem de grafico

Conclusion

As it is possible to see for the random value generated by the sum of 2 or more random values, the higher the numbers to be summed, the more predictable it is possible to guess the value to be generated, and there will be a limit where the value to be generated will only be a single number, because increasing the values added more to the center converges the graph. Answering the question that was raised in this repo, the sum of two or more random values will never be more random than a single randomly generated value.

Thanks for reading.

Any question, fill free to ask them.

It is open to new opinions.

About

If you add up two randomly generated numbers, is the result more random than if you just generated a single random number?

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages