[R] can you tell what .Random.seed *was*?

Dirk Eddelbuettel edd at debian.org
Fri May 15 21:07:22 CEST 2009

On 15 May 2009 at 13:08, G. Jay Kerns wrote:
| Thanks very much to Warren and Stavros for their additional insight.
| Putting all of this together, I think I am now ready to formulate my
| question intelligently:
| Using Sweave, I want to distribute randomly generated problems AND
| answers to both teacher AND student.
| More precisely, I want to distribute:
| 1) the .Rnw file
| 2) the .RData file saved near the end of the Sweave process.
| I want it to be *easy* for the Instructor to change my seed and
| generate new problems.
| I want it to be *difficult* for students to figure out the seed and
| automatically generate solutions on their own.
| Of course, "difficult" is a relative term, since what is "difficult"
| for them may well be "easy" for me, and what is difficult for me will
| be trivial to cryptographers and some people on this list.  The
| audience would be, say, upper division undergraduate students at a
| public university.
| What is clear so far: a brute force search of set.seed() is really
| pretty easy and fast... even for students at this level.
| However, relating to Duncan's second remark:  what if the Instructor
| inserted an *unknown* very large number of calls to the RNG near the
| beginning of the .Rnw (but after the set.seed)...  and did not
| distribute this information to the students...  that would make it
| much harder, yes?
| Any ideas that are even better than this?

You could use (one or more) seeds from a hardware RNGs.

The website http://random.org by Mads Haahr distributes such numbers (and my
CRAN package 'random' gets them for you in a convenient fashion).  Have a
look at the docs at random.org, and the two vignettes in the random package:

   RANDOM.ORG offers true random numbers to anyone on the Internet. The
   randomness comes from atmospheric noise, which for many purposes is better
   than the pseudo-random number algorithms typically used in computer
   programs. People use RANDOM.ORG for holding drawings, lotteries and
   sweepstakes, to drive games and gambling sites, for scientific
   applications and for art and music.  

Hth, Dirk

Three out of two people have difficulties with fractions.

More information about the R-help mailing list