Python Forum
Real Random Number Generator
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Real Random Number Generator
#1
The following has been copyrighted. If you don't understand it. It's new knowledge. Making an Indeterminate System from a Determinate System.

import time
import random

number_of_needed_numbers = 10000
lower_value = 0
upper_value = 1
count = 0
short_time = 0.00000000000001  
OFFSET_TIME = 0.03258312993051001  

while count < number_of_needed_numbers: 
    start_time = time.time()
    start_time2 = start_time - OFFSET_TIME
    time.sleep(short_time)
    end_time = time.time()
    total_seed = end_time - start_time2
    random.seed(total_seed)
    random_number = random.randint(lower_value, upper_value)
    count = count + 1
    print(random_number)
Reply
#2
I want the best random numbers I can get. I'm looking at what defines a random number set. There is no definitive standard for random numbers according to NIST. I think that "Best Possible Mean minus Standard Deviation" may be the way to get great random numbers.

Define “Best Possible Mean: Is the same as Mean, add all numbers in list and divide by number of items. I write it this way so it is understood that the best it can be is “Best Possible Mean”. Working with binary the “Best Possible Mean” is: 0 + 1 = (1 / 2) = 0.5.

Define Standard Deviation: A standard deviation (or σ) is a measure of how dispersed the data is in relation to the mean. Low, or small, standard deviation indicates data are clustered tightly around the mean, and high, or large, standard deviation indicates data are more spread out.

The closer to “Best Possible Mean” and random is what the goal is. Therefore “Best Possible Mean” minus Standard Deviation is a concrete base for random. It gives a definitive way of working with random numbers.

I'm looking at what makes a random number random, as well as how to qualify random numbers.
I'm looking for the best base to work from. I challenge everything. I believe that digital computers CAN make "real" random numbers. I know digital computers are deterministic as understood today. If you add an unknowable properly the deterministic system becomes indeterminate.
When you use a stopwatch to time an event for example. You push the button to start the 'event', you cannot know the exact nanosecond that the event started. All you know is that you marked the beginning of the event. Even on a computer you can't know the exact nanosecond an event started. If this is true, then good so far.
This 'time' at the start of an event is what we want for the 'seed' for random numbers. It's how 'time' is used to make the seed that is important. Using 'time' alone does not work at all. I've found out how to use 'time' Nanosecond time to make perfect 'seeds'.

As far as I know this is the best definition of "Random".

1. It looks random. This means that it passes all the statistical tests of randomness that we can find.

2. It is unpredictable. It must be computationally infeasible to predict what the next random bit will be, given complete knowledge of the algorithm or hardware generating the sequence and all of the previous bits in the stream.

3. It cannot be reliably reproduced. If you run the sequence generator twice with the exact same input (at least as exact as humanly possible), you will get two completely unrelated random sequences.



The output of a generator satisfying these three properties will be good enough for a one-time pad, key generation, and any other cryptographic applications that require a truly random sequence generator.

The following data is from my twenty-two line “real random number generator” program in Python 3.7.

This is the Standard Deviation of 400 sets of 10,000 random binary bits (0,1) broken into four equal parts. Each part comprises of 100 sets of 10,000 random bit, 1,000,000 bits total. The four groups together is 4,000,000 bits. The best that can be achieved is 0.5., and that is not random, it is in order.

0.499993153 - 0.5 = -0.000007

0.500000244 – 0.5 = 0.00000002.44

0.499995232 – 0.5 = -0.000005

0.4999945 – 0.5 = -0.000006

I always give data from a data set so it can be verified if needed. There is going to be a very small remainder because it IS random (example 0.00000). Doesn’t get any better than this.

This knowledge will affect: Number Theory; Linear and Multilinear Algebra; Potential Theory; Statistics; Numerical Analysis; Statistical Mechanics, Structure of Matter.

As soon as it is recognized as correct, then I can explain what and how this program came into being. There is a lot of great research to be done now. I just opened the door to a place to investigate. Random numbers are very interesting. This advancement will make digital computers much more powerful.

I am hoping my work will inspire others to explore and challenge everything. Must follow the laws of nature and logic. A word about ‘logic’. It is the one thing that I use that is not taught in schools. It is as important as understanding the laws of nature or physics.

Any thoughts are welcome. The facts will stand up to the ‘hard look’ by anyone. There is more that I have learned but cannot be understood till ‘real random numbers’ CAN be made by digital computers is understood as fact.
Reply
#3
(Jan-03-2024, 12:03 AM)woodturner550 Wrote: It looks random. This means that it passes all the statistical tests of randomness that we can find.
I think this is what you have to do to prove that your way of generating random numbers has any value at all: find many existing statistical tests of randomness and run them against your random number generator. Then provide numerical evidence that the generator generates random numbers.

That's not enough: you need to compare your random number generator with existing RNGs and provide numerical evidence that it is better in some sense. Otherwise all of this is just idle talk.
« We can solve any problem by introducing an extra level of indirection »
Reply
#4
Thanks for your feed back. I have the data file to share. Need a way to show to forum. As for compared to other ways of getting random numbers. They can be checked against my check for randomness. Please, understand when a "random number generator" is tested: How can you get better than this? This IS the goal. I've been working on this problem for thirty-five years.
0.499993153 - 0.5 = -0.000007

0.500000244 – 0.5 = 0.00000002.44

0.499995232 – 0.5 = -0.000005

0.4999945 – 0.5 = -0.000006

PM with your email and I will send the data file.
Reply
#5
Radioactivity is unpredictable.

https://www.sparkfun.com/tutorials/132
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Reply
#6
"Radioactivity is unpredictable."

You miss the point. Digital computers do it very well and fast if done correctly.

Think what can be done with everybody being able to have real random numbers. Encryption on the fly. Data stored encrypted, no more ransom for data. All the would have is encrypted files that they cannot read. This is just one gain from this.
Reply
#7
Logical Explanation:
Define: Unknowable, not able to be known. Lying beyond the limits of human experience or understanding, unknowability.
If the argument is that the variable being used is knowable, the following is the rebuttal.
When you use a stopwatch to time an event for example. You push the button to start the 'event', you cannot know the exact nanosecond that the event started. All you know is that you marked the beginning of the event. Even on a computer you can't know the exact nanosecond an event started because time moves only one direction. One cannot measure something that has not happened yet. If this is true, then good so far.

If not, it is your turn to explain exactly how it is knowable.

Define: Determinate, having exact and discernible limits or form, conclusively determined : DEFINITIVE.
There is no question digital computers are determinate as understood today. A poor example of a Determinate System: A pail of white paint. As long as only white paint is put into the pail and only white paint taken out it can represent a Determinate System. If this is understood as true, then good so far.

Define: Indeterminate, not exactly known, established, or defined. Not definitely or precisely determined or fixed, vague. Not known in advance. Not leading to a definite end or result. MATHEMATICS:(of a quantity) having no definite or definable value, conclusively indetermined.

Using the determinate white paint example. We can make it indeterminate by adding a colored paint. Now the unwhite paint is not a deterministic system any more.

I hope this will help with understanding these principles. I want to be clear an concise. I believe my work will be important. It is of no use if it is not able to be explained properly.
Reply
#8
The following is more concisely put!

First thing we must do is make sure everyone is using the same definitions. Deductive Logic is used. Distinguishing correct reasoning from incorrect reasoning is the task of logic.

Define: Unknowable, not able to be known. Lying beyond the limits of human experience or understanding, unknowability.
If the argument is that the variable being used is knowable, the following is the rebuttal.
When you use a stopwatch to time an event for example. You push the button to start the 'event', you cannot know the exact nanosecond that the event started. All you know is that you marked the beginning of the event. Even on a computer you can't know the exact nanosecond an event started because time moves only one direction. One cannot measure something that has not happened yet. If this is true, then good so far.
If not, it is your turn to explain exactly how it is knowable.

Define: Determinate, having exact and discernible limits or form, conclusively determined : DEFINITIVE.
There is no question digital computers are determinate as understood today. A poor example of a Determinate System: A pail of white paint. As long as only white paint is put into the pail and only white paint taken out it can represent a Determinate System. If this is understood as true, then good so far.

Define: Indeterminate, not exactly known, established, or defined. Not definitely or precisely determined or fixed, vague. Not known in advance. Not leading to a definite end or result. MATHEMATICS:(of a quantity) having no definite or definable value, conclusively indetermined.
Using the determinate white paint example. We can make it indeterminate by adding a colored paint. Now the unwhite paint is not a deterministic system any more.

I want the best random numbers I can get. I'm looking at what defines a random number set. There is no definitive standard for random numbers according to NIST. I think that "Best Possible Mean minus Standard Deviation" may be the way to get great random numbers.

Define “Best Possible Mean: Is the same as Mean, add all numbers in list and divide by number of items. I write it this way so it is understood that the best it can be is “Best Possible Mean”. Working with binary the “Best Possible Mean” is:
0 + 1 = (1 / 2) = 0.5.

Define Standard Deviation: A standard deviation (or σ) is a measure of how dispersed the data is in relation to the mean. Low, or small, standard deviation indicates data are clustered tightly around the mean, and high, or large, standard deviation indicates data are more spread out.

The closer to “Best Possible Mean” and random is what the goal is. Therefore “Best Possible Mean” minus Standard Deviation is a concrete base for random. It gives a definitive way of working with random numbers.

I'm looking at what makes a random number random, as well as how to qualify random numbers.
I'm looking for the best base to work from. I challenge everything. I believe that digital computers CAN make "real" random numbers. I know digital computers are deterministic as understood today. If you add an unknowable properly the Deterministic System becomes an Indeterminate System.

What does “unknowable” mean? The future is unknowable because the future is dependent on everything that has happen before. Unless you can “know” the future, you cannot know an “unknowable”.

Deterministic System is a system in which no randomness is involved in the development of future states of the system.

Fact: All digital computers run by deterministic programs! However, when you add an unknowable the Deterministic System becomes indeterminate. Poor Example: You have a bucket of white paint to represent a Deterministic System. As long as you only take white paint out or put white paint in it’s deterministic, you will get white paint. Now when you throw a little unknown colored paint into the mix what do you get but an Indeterminate System.

When you use a stopwatch to time an event for example. You push the button to start the 'event', you cannot know the exact nanosecond that the event started. All you know is that you marked the beginning of the event. Even on a computer you can't know the exact nanosecond an event started. If this is true, then good so far.
This 'time' at the start of an event is what we want for the 'seed' for random numbers. It's how 'time' is used to make the seed that is important. Using 'time' alone does not work at all. I've found out how to use 'time' Nanosecond time to make perfect 'seeds'.

As far as I know this is the best definition of "Random".

1. It looks random. This means that it passes all the statistical tests of randomness that we can find.

2. It is unpredictable. It must be computationally infeasible to predict what the next random bit will be, given complete knowledge of the algorithm or hardware generating the sequence and all of the previous bits in the stream.

3. It cannot be reliably reproduced. If you run the sequence generator twice with the exact same input (at least as exact as humanly possible), you will get two completely unrelated random sequences.


The output of a generator satisfying these three properties will be good enough for a one-time pad, key generation, and any other cryptographic applications that require a truly random sequence generator.

The following data is from my twenty-two line “real random number generator” program in Python 3.7.

This is the Standard Deviation of 400 sets of 10,000 random binary bits (0,1) broken into four equal parts. Each part comprises of 100 sets of 10,000 random bit, 1,000,000 bits total. The four groups together is 4,000,000 bits. The best that can be achieved is 0.5., and that is not random, it is in order.

0.499993153 - 0.5 = -0.000007

0.500000244 – 0.5 = 0.00000002.44

0.499995232 – 0.5 = -0.000005

0.4999945 – 0.5 = -0.000006

I always give data from a data set so it can be verified if needed. There is going to be a very small remainder because it IS random (example_0.00000). Doesn’t get any better than this.

This knowledge will affect: Number Theory; Linear and Multilinear Algebra; Potential Theory; Statistics; Numerical Analysis; Statistical Mechanics, Structure of Matter.

The following is Copyrighted: Copyrighted owner data is public data.

#80462747

Python 3.7 - By: Leonard Dye, P.O.Box 1456, Waldport, Or. 97394, [email protected]

Real Random Number Generator

import time
import random


number_of_needed_numbers = 10000
lower_value = 0
upper_value = 1
count = 0
short_time = 0.00000000000001
OFFSET_TIME = 0.03258312993051001


while count < number_of_needed_numbers:
start_time = time.time()
start_time2 = start_time - OFFSET_TIME
time.sleep(short_time)
end_time = time.time()
total_seed = end_time - start_time2
random.seed(total_seed)
random_number = random.randint(lower_value, upper_value)
count = count + 1
print(random_number)
_________________________________________________________

As soon as it is recognized as correct, then I can explain what and how this program came into being. There is a lot of great research to be done now. I just opened the door to a place to investigate. Random numbers are very interesting. This advancement will make digital computers much more powerful.

I am hoping my work will inspire others to explore and challenge everything. Must follow the laws of nature and logic. A word about ‘logic’. It is the one thing that I use that is not taught in schools. It is as important as understanding the laws of nature or physics.

Any thoughts are welcome. The facts will stand up to the ‘hard look’ by anyone. There is more that I have learned but cannot be understood till ‘real random numbers’ CAN be made by digital computers is understood as fact.

Think what can be done with everybody being able to have real random numbers. Encryption on the fly. Data stored encrypted, no more ransom for data. All the would have is encrypted files that they cannot read. This is just one gain from this.
Reply
#9
(Jan-05-2024, 12:34 AM)woodturner550 Wrote: You miss the point. Digital computers do it very well and fast if done correctly.

Knowing the initial-state, kills pseudo random number generators.

import random

random.seed(1337) # <- initial state
# is used for unit tests

print([random.randint(0, 10) for _ in range(10)])
Output:
[9, 8, 5, 9, 9, 2, 5, 6, 10, 5]
Real entropy comes from nature. Everything else, is not real entropy.
Another example of an entropy source is an ADC with noise.

But be aware of side channel attacks.
If you can fake or listen to an entropy source, it's possible to calculate all values from PSRNG.

Desktop PCs do have many entropy sources to improve the situation.
Embedded systems do not have as many entropy sources as a Desktop PC.

This is a problem, if cryptographic algorithms are used, which require a high entropy.
Larz60+ likes this post
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Reply
#10
Estimation and hypothesis testing: When reporting statistical results,
it is important to answer three questions: How big is the effect?
How much variability should we expect if we run the same measurement
again? Is it possible that the apparent effect is due to chance?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Random Passcode Generator function romeo777 2 2,623 Jan-06-2021, 01:46 PM
Last Post: buran
  random two-word domain name generator rootVIII 0 2,125 Aug-06-2019, 03:15 AM
Last Post: rootVIII
  Infinate Number Generator Larz60+ 6 4,189 Sep-18-2018, 06:23 AM
Last Post: wavic

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020