In: Statistics and Probability
Recently, the ‘‘leap year virus’’ has been spreading over the Internet and infecting the random number generators on many computers. If your computer is infected with this virus, then whenever you attempt to generate a U(0,1) pseudorandom sequence U1, U2, U3, ... the reported value of Ui is forced to be greater than 0.5 (by reporting its ‘‘true value’’ plus 0.5, if necessary) whenever i is divisible by 4, unless it is divisible by 100 but not by 400. Note that the virus only affects the reported values, and does not change the internal state of the generator.
Describe a method for testing your random number generation that will detect this infection. Explain how you would decide whether the random number generator ‘‘passes’’ or ‘‘fails’’ the test. Don’t forget that half the time an uninfected random number generator will also produce a value greater than 0.5 under the same conditions.