Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"True" Random Number Generator 1

Status
Not open for further replies.

SgtJarrow

Programmer
Apr 12, 2002
2,937
US
Anyone have a "true" number generator???

I am currently using Randomize and the Rnd function and it just doesn't seem to be "truly" random....

Platforms: Windows 98,NT,2000
Versions: Access 97, 2000 The secret to creativity is knowing how to hide your sources. - Albert Einstein [spin]

Robert L. Johnson III, A+, Network+, MCP
Access Developer/Programmer
 
Hmmmmmmmmmmmmmm,

What doesn't "seem" random?

I did some looking into the subject a while ago and more-or-less 'proved' that the sequence doesn't repeat for ~ 16M iterations. I did not check into the actual sequencing as in the generic issue whth specific subset portions (e.g. repeating least significant byte repeating more frequently, but I did compare the results to several of the examples from "Numerical Recipies" and the ones I tried for 32 bit values seemed to be quite similar.

If you have additional information, please re-post with specifics.

MichaelRed
m.red@att.net

There is never time to do it right but there is always time to do it over
 
MichaelRed,

As I value your opinion, I took a closer look at this process...

I created a sample table and function to create some numbers and came up with the following results:

Using Int((9 - 0 + 1) * Rnd + 0)

2500 Records 10000 Records
============ =============
0 250 0 994
1 255 1 1028
2 251 2 1031
3 245 3 989
4 255 4 982
5 252 5 987
6 262 6 1031
7 239 7 994
8 237 8 982
9 254 9 982


So it seems to be quite random.....I was just feeling that the lower number (0-4) were showing up more in my code....guess I was wrong.

Thanks a bunch. The secret to creativity is knowing how to hide your sources. - Albert Einstein [spin]

Robert L. Johnson III, A+, Network+, MCP
Access Developer/Programmer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top