How Random is Random?

From: Phil Schaechter (Phil.Schaechter_at_datadomain.com)
Date: 03/30/04


To: beginners@perl.org
Date: Tue, 30 Mar 2004 10:48:01 -0800

The documentation on "keys" and "each" says something like the following:

---
Returns a list consisting of all the keys of the named hash. (In scalar 
context, returns the number of keys.) The keys are returned in an apparently 
random order.
---
I have a database (>50,000 items) that I would like to select things from 
randomly.  I would like to "eventually" select all of the items from the 
database, but there are no time constraints.  The database is constantly 
being changed.
If I use keys to select 100 items to process, then come back at a later date 
and pick another 100, and so on, will I eventually hit "most" of the items?
My own experiments show this to be more or less true - but I'd like to know if 
anyone can explain to me how random is random.
-Phil


Relevant Pages

  • Re: Key attributes with list values was Re: What are the differences ...KEY
    ... Jane Harper is married. ... And a constraint that states that single people cannot become divorced. ... database, or users, for that matter, to distinguish between them. ... That's the whole point of keys. ...
    (comp.databases.theory)
  • Re: Pin generation algorithm question
    ... the keys would be a big ... Suppose that we have a database that contains all valid numbers, ... load among several servers that all need access to this database. ... So the only real problem is which systems are accessing this crypto box. ...
    (sci.crypt)
  • Re: Database design, Keys and some other things
    ... >> Or 'the database has no opinion as what Donald Trump's e-mail address might ... some keys can be wrong or a data can ... Meaning is not related to just one number. ... > is concerned a VIN is not a surrogate key, ...
    (comp.databases.theory)
  • Re: Key attributes with list values was Re: What are the differences ...KEY
    ... database, or users, for that matter, to distinguish between them. ... That's the whole point of keys. ... But that is true of any constraint. ... keys can change, then either updates must be singular, that is, must affect ...
    (comp.databases.theory)
  • Re: Pin generation algorithm question
    ... > You have to secure a number of keys in this instance, ... > tokens in the database with a secret key cipher, or better a keyed hash, and ... Assume that an attacker can monitor requests and observe the ...
    (sci.crypt)