Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

You should be able to solve this

Name: The Silent Wind of Doom 2009-01-09 15:55

A common algorithm for generating pseudorandom numbers is a "linear congruential generator" which uses the following procedure:

1) A positive integer m and two integers a and b between 0 and m−1 are fixed.

2) A seed r(0) between 0 and m−1 is input.

3) After that, numbers are generated by the recurrence r(n+1) = ar(n)+b (mod m).  (So that 0 <= r(n+1) <= m−1).


The following sequence of numbers was generated in this way.

6543
6331
9584
9025
3911

Find a,b, and m.

(crossposted from /sci/, cuz i herd u liek math).

Name: Anonymous 2009-01-09 21:10

>>20
r is the element in the psuedo-random sequence. It is defined as a function of previous r's, with r(0) being the initial 0

ar = a*r
In maths and CS, the * character is often used to denote multiplcation

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List