Python Forum
Real Random Number Generator
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Real Random Number Generator
#11
Understanding the Formula to Qualify Random Numbers​




“Best Possible Mean” minus Standard Deviation:
  • 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.

Now to deal with RANDOM with mathematics:

  • It looks random. This means that it passes all the statistical tests of randomness that we can find.
  • 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.
  • 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.

I hope this makes things clearer.
Reply
#12
Update on “Real Random Numbers”
Because of the lack of interest in the subject I will be suspending further work on this problem. The knowledge is good and not wanted.
This is what is lost. Because I proved that real random numbers CAN be created easily. It is a fast program, I’m able to calculate 2600 real random numbers a second. This means that what was a problem, cost of generating real random numbers, is gone. This allows encryption on the fly! That means no more ‘ransomware’ attacks because everything is stored encrypted in the file system. If they steal the data it is of no use.
Now the bad actors win again because this won’t be able to happen. I still have the Copyright, it cannot be used commercially.
I at least tried to fix problems.
Reply
#13
What happened with the University of Oregon? Any news from there?

See: https://discuss.python.org/t/understandi...rs/41332/7
Sig:
>>> import this

The UNIX philosophy: "Do one thing, and do it well."

"The danger of computers becoming like humans is not as great as the danger of humans becoming like computers." :~ Konrad Zuse

"Everything should be made as simple as possible, but not simpler." :~ Albert Einstein
Reply
#14
(Jan-31-2024, 03:12 AM)rob101 Wrote: What happened with the University of Oregon? Any news from there?

See: https://discuss.python.org/t/understandi...rs/41332/7
No! I'm very shocked. If I'm wrong, prove it. I think that the group that will be interest in this is the bad people! Always someone interested in secrecy.
Reply
#15
I've run a test on your code, based on a test the I did (some time back) for the random.randint() function.

I've incorporated your code (that you posted at the beginning of this thread) in a function that I've named prng() and clearly marked the code that you posted, and commented the changes needed in order to have it work with my app.

In order to get some 'density', with my app, it was necessary to have an iteration count up at 10.000.000, which means that the process takes about 30 minutes to run. By contrast, using the random.randint() function as is (that is to say, with a zero to 800 range), an iteration count of 100.000 is as high as you need, because if you go much higher than that, the 800 x 600 window would be completely filled and as such, no pattern would be seen.

The point here is that if one can see a 'pattern', then the results are not random, but if the window is filled with what looks like 'noise', then there is some semblance of 'randomness'.

I've posted a screen grab here, so that you (or anyone else) does not have to wait around for a half hour, to see the results, but, of course, one can choose to do that. Simply running this, with the first set of r1 and r2 takes, seconds, with the iteration count set to 100000.

As you can see, from the screen grab, there is a pattern, which (to my mind) suggests that this is far from a random number generator.

Is this a valid test, or is it flawed?

import random
import tkinter as tk
from tkinter import Canvas

#=======<WT550 CODE START>======#
import time
number_of_needed_numbers = 10000
lower_value = 0
upper_value = 800  # I've changed this from 1 to 800, so that it fits this app
short_time = 0.00000000000001
OFFSET_TIME = 0.03258312993051001

def prng():
    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)
    return random_number
#======<WT550 CODE STOP>=======#

root = tk.Tk()

# creat the root window
root.geometry("800x600")
root.title("Random Plot")
root.resizable(False, False)

C = Canvas(root, bg="#BABDB6", height=600, width=800)

for p in range (100000): # change this to > 1000000 to use the prng() function.

    # use this with a iteration of apx 100000
    r1=random.randint(0,800)
    r2=random.randint(0,800)

    # ... or this with a iteration of 10000000 to reproduce what I've posted here
    #r1 = prng()
    #r2 = prng()

    r3=r1+1
    r4=r2+1
    p = C.create_rectangle(r1,r2,r3,r4, fill='black')

C.grid()

root.mainloop()
Gribouillis likes this post

Attached Files

Thumbnail(s)
   
Sig:
>>> import this

The UNIX philosophy: "Do one thing, and do it well."

"The danger of computers becoming like humans is not as great as the danger of humans becoming like computers." :~ Konrad Zuse

"Everything should be made as simple as possible, but not simpler." :~ Albert Einstein
Reply
#16
(Jan-31-2024, 03:20 AM)woodturner550 Wrote: If I'm wrong, prove it.

As I understand it, you want to offer the code commercially and insist on your copyright.

If you offer proprietary/protected code to companies for money, you have to prove that your algorithm works.

If your life depends on this code, you might as well shoot yourself in the head. Then you get the result faster.
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Reply
#17
If you check, which I know you have not done. The random numbers used commercially will have patterns just like you show. you only have two states.
It is easy to say "OH! I can calculate the next ten numbers". Logic STATES that it can't be done, unless you can KNOW the future. This is why they don't teach "Deductive Logic" in school. Logic creates clear thinking.
Those who are really interested need to learn deductive logic. This is so you know when you are correct. If you are incorrect, it will be shown in math that it is incorrect. Then you correct your understanding of of your logic that was flawed.
Failure is how we really learn.
Reply
#18
(Jan-31-2024, 06:04 PM)woodturner550 Wrote: If you check, which I know you have not done. The random numbers used commercially will have patterns just like you show.

If you run my code, with my r1 and r2 values (which I know you have not done), you'll see no pattern at all; simply something that looks like 'noise', unlike what is produced by your code.

Does my code not use commercially generated random numbers? Is that not what Python produces?

If my test is flawed, that tell me why, rather than getting all defensive about it and avoiding the issue.

Unlike some, I'm not trying to put you down, I'm trying to understand what you've produced, and why my test shows (to my eyes and mind) that your code does not produce any kind of a random pattern, which is counter to your claim.
Sig:
>>> import this

The UNIX philosophy: "Do one thing, and do it well."

"The danger of computers becoming like humans is not as great as the danger of humans becoming like computers." :~ Konrad Zuse

"Everything should be made as simple as possible, but not simpler." :~ Albert Einstein
Reply
#19
(Jan-31-2024, 06:04 PM)woodturner550 Wrote: If you check, which I know you have not done.

I am neither a security expert nor a mathematician. But I do know that many developers overestimate their abilities. You're not the first or the last to think you've got it all figured out.

If your life depended on it, would you use your code? I certainly wouldn't.
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Reply
#20
I am not following this conversation because it is a waste of time and energy. One question. Do you think that foreign countries have not seen this data? Do you think they will use it? If you say no, you are deluded. My works has been watched by several countries. Not friendly ones.

It's a shame America is so dense they don't know you can't know the future. You only think you do.

Bye.
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