Posts Tagged "pseudorandom"

Randomness

Take a look at the following puzzle: “Given a function which produces a random integer from 1 to 5, write one that produces a random integer from 1 to 7″ I immediately thought of this: ... function naiveRand(){ return (given() + given()) % 7 + 1; } ... It is...

Read more