- Joined
- 1/17/11
- Messages
- 2
- Points
- 11
I was aksed this question when having an interview with GS, could not figure out the solution.
Given a generator:
X_{n+1} = ( a * X_{n} + c ) mod m
where Xn is the sequence of pseudorandom values, and
m: 0 < m — the "modulus"
a: 0 < a < m — the "multiplier"
c: 0 <= c < m — the "increment"
X_{0}: 0 < X_{0} < m — the "seed" or "start value"
Now we know the value of X_{0} and X_{50}, find out a, c, and m.
Given a generator:
X_{n+1} = ( a * X_{n} + c ) mod m
where Xn is the sequence of pseudorandom values, and
m: 0 < m — the "modulus"
a: 0 < a < m — the "multiplier"
c: 0 <= c < m — the "increment"
X_{0}: 0 < X_{0} < m — the "seed" or "start value"
Now we know the value of X_{0} and X_{50}, find out a, c, and m.