GeeCON Prague 2014*
The moose likes Java in General and the fly likes random no generator Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Java in General
Bookmark "random no generator" Watch "random no generator" New topic
Author

random no generator

srini Raman
Ranch Hand

Joined: Oct 16, 2006
Posts: 33
Hi,
I want to know the cycle length of Random,SecureRandom for best,worst,average cases.

Thanks,
Srini
John Kelty
Ranch Hand

Joined: Aug 08, 2006
Posts: 33
A stumper of a question, it seems!

http://mindprod.com/jgloss/pseudorandom.html

is a good place to start some research although it doesn't answer your exact question. It does mention that the two low order bits are rather predictable.
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
Another place to look would be in the Java source itself (in src.jar or src.zip, depending on your installation). Not only does it tell you exactly what Random does, but the comments give a reference to where you can look for more info.


"I'm not back." - Bill Harding, Twister
Scott Selikoff
author
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3710
    
    5

Sorry "srini TR" but your name still does not conform to our naming policy. Please try again. This is your second warning.


My Blog: Down Home Country Coding with Scott Selikoff
 
GeeCON Prague 2014
 
subject: random no generator