Random number generating

misi

Growing Little Guru
Re: Free Software from Microsoft

biggles said:
Please tell me you have a backup.:eek2
I do not.:eek
I do have a very sophisticated early version somewhere,have to find it.
I worked years on it.
I simplified it,it worked perfectly well but I wasn't satisfied with it.
Needed only to build in the millisecond function because using it with microseconds made it slow.
I made the microsecond function from measuring part of a second with a loop.
Milliseconds with our home computers are not precise,cannot rely on them.
 

foxidrive

Retired Admin
Re: Free Software from Microsoft

D'oh! backup, backup and then backup more, Misi.
You know that!.

WRT random numbers a fellow mentions this, in part, below:

From: Ted Davis <tdavis@gearbox.maem.umr.edu>
Newsgroups: alt.msdos.batch.nt
Subject: Re: random numbers
Date: Mon, 07 Nov 2005 08:50:11 -0600


wget can be found at
<http://gnuwin32.sourceforge.net/packages/wget.htm>.

www.random.org is a source of true random numbers in the range -1,000,000,000 to +1,000,000,000. The Windows %RANDOM% pseudo random number is limited to the range 0-32767 which does not meet your requirements.
 

misi

Growing Little Guru
Re: Free Software from Microsoft

foxidrive said:
D'oh! backup, backup and then backup more, Misi.
You know that!.
:eek :eek :eek

www.random.org is a source of true random numbers in the range -1,000,000,000 to +1,000,000,000. The Windows %RANDOM% pseudo random number is limited to the range 0-32767 which does not meet your requirements.
No it does not.

<<The way the random.org random number generator works is quite simple. A radio is tuned into a frequency where nobody is broadcasting. The atmospheric noise picked up by the receiver is fed into a Sun SPARC workstation through the microphone port where it is sampled by a program as an eight bit mono signal at a frequency of 8KHz.>>

Simple?Very sophisticated,difficult.
The range of my function is 0-4 billion(2 ^ 32).And it is simple.(It was...)
No need for any radio frequency,the user randomize it with a keystroke(mouse).No buffering,the effect is immediate.The result is stored for the future.
With milliseconds the possible randomizing result is less than 1000.
(Milliseconds are not updated 1000 times in a second in the systems clock)
Make it a round 100.
Do it twice. 100 * 100 =1 00 00(10 000)
Is it possible to hit the keyboard more than twice? 5 times?
100 ^ 5=1 00 00 00 00 00(10 000 000 000)
Actually it is going to be larger because of the seconds involved.
According to the stored results in the future new samples will be taken randomly.I can say now randomly.
Not pseudo randomly.
 

foxidrive

Retired Admin
Re: Free Software from Microsoft

misi said:
:eek :eek :eek


No it does not.

<<The way the random.org random number generator works is quite simple. A radio is tuned into a frequency where nobody is broadcasting. The atmospheric noise picked up by the receiver is fed into a Sun SPARC workstation through the microphone port where it is sampled by a program as an eight bit mono signal at a frequency of 8KHz.>>

Simple?Very sophisticated,difficult.
The range of my function is 0-4 billion(2 ^ 32).And it is simple.(It was...)
No need for any radio frequency,the user randomize it with a keystroke(mouse).No buffering,the effect is immediate.The result is stored for the future.
With milliseconds the possible randomizing result is less than 1000.
(Milliseconds are not updated 1000 times in a second in the systems clock)
Make it a round 100.
Do it twice. 100 * 100 =1 00 00(10 000)
Is it possible to hit the keyboard more than twice? 5 times?
100 ^ 5=1 00 00 00 00 00(10 000 000 000)
Actually it is going to be larger because of the seconds involved.
According to the stored results in the future new samples will be taken randomly.I can say now randomly.
Not pseudo randomly.

I see... but it requires user input. An unattended batch file couldn't use it, for example.
 

misi

Growing Little Guru
Re: Free Software from Microsoft

foxidrive said:
I see... but it requires user input.
Requires once only on the beginning.And not necesserily.
An unattended batch file couldn't use it, for example.
You decide.
We have two computers.They are exactly the same.
Their real time clock shows exactly the same time.(Internet)
Let's presume it is 0.000 in seconds.(Note the 3 zeros for precision)
They start doing their job from a batch file.
Randomizing the generator in the same time.
Later they will randomize it again in the same time.
Time:1.888(1)
Again.Time:2.123(2)
Again.Time:3.999999(3)on one Time:4.000000(4)on number two.
A little difference in time or processor speed and the two computer start producing different numbers.(A few instructions difference only)
Any delay somewhere in the system(harddisk,Internet,etc.)is fatal.
It is still pseudo but a user can make it real.
 

foxidrive

Retired Admin
Re: Free Software from Microsoft

misi said:
Requires once only on the beginning.And not necesserily.

You decide.
We have two computers.They are exactly the same.
Their real time clock shows exactly the same time.(Internet)
Let's presume it is 0.000 in seconds.(Note the 3 zeros for precision)
They start doing their job from a batch file.
Randomizing the generator in the same time.
Later they will randomize it again in the same time.
Time:1.888(1)
Again.Time:2.123(2)
Again.Time:3.999999(3)on one Time:4.000000(4)on number two.
A little difference in time or processor speed and the two computer start producing different numbers.(A few instructions difference only)
Any delay somewhere in the system(harddisk,Internet,etc.)is fatal.
It is still pseudo but a user can make it real.

I'm happy with pseudo random. :happy Seed it once from the time and let it go!
 
C C

Cheeky Chef

Guest
[off topic maybe]
The first programme I made using BASIC was a Bingo game.
I first worked on the random number generator and defined the lowest number {1} and the highest number which I made as a variable number to be entered by the user to suit different bingo card layouts.
Then I worked on the way it displayed numbers on the telly.
Next was the number sort to display the drawn numbers in numerical order to make checking the bingo cards easy.. The game was a big hit with my family as we all liked Bingo..
The computer I used at the time was a 'SHARP' which was very similar to a Commodore 64 except that the SHARP had a small built in printer and built in tape drive..
[/off topic maybe]
 

misi

Growing Little Guru
Swedish Chef said:
[off topic maybe]
The first programme I made using BASIC was a Bingo game.
I first worked on the random number generator and defined the lowest number {1} and the highest number which I made as a variable number to be entered by the user to suit different bingo card layouts.
Then I worked on the way it displayed numbers on the telly.
Next was the number sort to display the drawn numbers in numerical order to make checking the bingo cards easy.. The game was a big hit with my family as we all liked Bingo..
The computer I used at the time was a 'SHARP' which was very similar to a Commodore 64 except that the SHARP had a small built in printer and built in tape drive..
[/off topic maybe]
No,it is not off topic Chef!
Most important use of "random":games and gambling.
 

misi

Growing Little Guru
16 bit version is ready.
Range: 0 - 65535 = 65536

Equal distribution of numbers:
From 65 536 000 nums : 95% accuracy (1 000 * 65536 nums)
From 65 536 000 000 nums : 99.5 % accuracy (1 000 000 * 65536 nums)
From 131 072 000 000 nums : 99.8 % accuracy (2 000 000 * 65536 nums )

Numbers to be generated without a repeat of the sequence:

( (65536 ! ) * (65536 ^ 65536) ) ^ 8 (8 could be expanded up to available memory)

Interrupt the generation anywhere, a new sequence of random numbers start.No repeats of the previous sequences.

Starting to work on the 32 bit version.
 
Back
Top