I generate Random numbers, using a seed e.g
int randomNumber
int seed=532;
int intBound=800;
Random rand = Random(seed);
randomNumber=rand.nextInt(intBound);
System.out.println("The generated Random number using the above seed and int bound is:- "+randomNumber);
//Results is: The generated Random number using the above seed and int bound is: 235
The question is: Knowing the final result is 235 and the seed number 532, how can I get the intBound number in java?
A simple analogy version of the question is: Knowing only two values of a mathematical formula how do you produce the third value? e.g 1+2=3 which also means if we only know 2 values, we can easily get the third value knowing the formula used in getting the result.
Aucun commentaire:
Enregistrer un commentaire