True or false (justify your answer):
For all values of A, M, and X_i in the formula
X_{i+1} = A ∗ X_i mod M,
the value of X_{i+1} is always in the range (−M, M)
This is a practice question for a computer science test I have today and I am unsure about the answer? I remember we talked about using this formula in randNumGeneration…? If someone could please help me understand, that would be great. Thanks!
(I think X_{i} is read: X sub i)
This means that (i+1)-th value of sequence X is equal to the value of A multiplied by the i-th (previous) value of the X sequence and then fed to modulus operator, which places the result in the [0, M) interval.
So the answer is true.
Example: