Click here to Skip to main content
15,889,216 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
I try to make oracle which predicts next random number in a sequence. I have an array of random generated numbers.

What I have tried:

I know that i should do it linear way.
Posted
Updated 21-Sep-18 6:09am
Comments
Richard MacCutchan 21-Sep-18 11:45am    
No, a crystal ball is the best way to predict the future.

Depending on the range of values for your random number sequence, you are probably on a loser - rand doesn't just have an algorithm, it also has a seed value which is normally initialized from the system clock at some point in the application. Depending on the seed, where the algorithm "starts" and thus the sequence it produces. Even if the range is just 1, 2, or 3 the number of possible sequences rapidly grows out of any possible prediction unless you know the algorithm, and the starting seed, and how many items have been "taken" from the random sequence already.
 
Share this answer
 
Quote:
I try to make oracle which predicts next random number in a sequence.

that is doomed to fail.
Nicolas Cage is the only one able to do this (see movie Next).
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900