[Icfp04-discuss] randomint ?

Jed Davis icfp at jdev.users.panix.com
Fri Jun 4 17:41:01 EDT 2004


"Jirka Schuppe" <jschuppe at web.de> writes:

> Hi,
>
> in paragraph 2.10 i solve si+1 with the formula si+1 = si × 22695477 + 1.
> The number will increments very fast, so i cant store this in an regular
> integer ?!
> Where is the error ?

Ah, but you don't need the actual value of s_i, just s_i modulo
1073741824 (=65536*16384).  


(Interestingly, that RNG is going to be slightly non-uniform for
values of n that don't evenly divide 16384.  I guess the contest
writers weren't feeling sadistic enough to specify the usual fix for
that.)

-- 
dn: cn=Jed Davis, o=panix.com  #  also infamous as <jldavis at cs.oberlin.edu>
objectclass: person
mail;personal: jdev at panix.com  ##    PGP Key FP:   A098 903E 9B9A DEF4 168F
mail;work:     jld@/           ##  [id 0xF33659F9] AA09 BF07 807E F336 59F9
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 185 bytes
Desc: not available
Url : http://lists.seas.upenn.edu/pipermail/icfp04-discuss/attachments/20040604/efb0f3df/attachment.bin


More information about the Icfp04-discuss mailing list