Solved

Why call random.random() exactly once per reading?

AmeliaRunsOP

The task is very specific about it.

9

Comments 4

Join the discussion

Already have an account? Log in

  1. FreyaL Solutionreplies: 2

    With a seed, the sequence of random numbers is fixed. If you call random() an extra time somewhere, every later number shifts, and you won't get the expected 7 glitches. Same for calling choice() "right after detection" in stage 2.

    5
    1. AmeliaRunsOPreplies: 1

      So the order of random calls is part of the result. Interesting.

      0
      1. NoahLoops

        Related to the random module article — the seed discussion there.

        3
    2. OllieGrant

      This is also why reproducible scientific simulations document their seeds.

      0