2
$\begingroup$

After generating thousands of random numbers, I figured out that I didn't used SeedRandom to store the seed. Is there a way for me to know what seed was used to generate these numbers? Thanks in advance.

$\endgroup$
1
  • 2
    $\begingroup$ The short answer, I'm afraid, is no. $\endgroup$ Oct 11, 2014 at 21:41

1 Answer 1

1
$\begingroup$

Because two different seeds could conceivably return the same result (when using RandomInteger or the like), you are not dealing with an invertible function. Thus, it should be impossible to retrieve, with certainty, the seed you actually used.

You may, however, be able to retrieve a seed that would produce the same results you obtained. But I have no idea how, and it would depend on the amount of pseudo-random information you generated.

For instance,

you could easily find a seed that will match the output of

 RandomInteger[{0,1}]

1

But it would take a lot of work to find a seed that will match this result:

RandomReal[{0, 1}, {10, 10}]

{{0.909859, 0.019754, 0.598418, 0.46881, 0.363303, 0.974383, 0.373161, 0.0389442, 0.280414, 0.871585}, {0.536873, 0.289956, 0.379732, 0.116747, 0.772943, 0.638836, 0.424587, 0.349893, 0.603582, 0.968273}, {0.324992, 0.859366, 0.923359, 0.212637, 0.153091, 0.393882, 0.950831, 0.957464, 0.224737, 0.338283}, {0.46381, 0.441082, 0.206503, 0.64097, 0.0944157, 0.988236, 0.507693, 0.253843, 0.0437869, 0.770514}, {0.333459, 0.688359, 0.204823, 0.407652, 0.85256, 0.0788209, 0.870742, 0.133066, 0.909964, 0.121501}, {0.807024, 0.0933079, 0.698381, 0.238103, 0.433662, 0.810945, 0.291785, 0.62881, 0.524679, 0.335714}, {0.296221, 0.815868, 0.013909, 0.49853, 0.302611, 0.598513, 0.741181, 0.618421, 0.262307, 0.922934}, {0.0791353, 0.271012, 0.649114, 0.272003, 0.218575, 0.032464, 0.953329, 0.0650516, 0.877781, 0.337891}, {0.418986, 0.304467, 0.754598, 0.979746, 0.64307, 0.629872, 0.358564, 0.242757, 0.202776, 0.337117}, {0.114745, 0.718172, 0.140185, 0.625528, 0.172481, 0.960298, 0.449554, 0.462206, 0.877355, 0.211334}}

$\endgroup$
3
  • $\begingroup$ Since SeedRandom uses the computer clock when not specified otherwise, do you think it is possible to figure out at what time the numbers where generated and with that back up the seed? Thanks for the clarification, David. $\endgroup$
    – Fred
    Oct 11, 2014 at 16:34
  • $\begingroup$ SeedRandom[n] does not use the time. SeedRandom[] uses system clock plus some unspecified system attributes. From what I understand, you did not use SeedRandom, so we cannot know what state the pseudo-random generator was in. $\endgroup$
    – DavidC
    Oct 11, 2014 at 16:48
  • 4
    $\begingroup$ I cannot answer the original question, but I can say what state the RNG was in. We always keep it in South Dakota. $\endgroup$ Oct 11, 2014 at 21:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.