[Pmwiki-users] OT: timing and seconds

Patrick R. Michaud pmichaud
Thu Jun 17 07:44:01 CDT 2004


On Fri, Jun 18, 2004 at 12:19:28AM +1200, Robin wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> On Friday 18 June 2004 00:08, Patrick R. Michaud wrote:
> > Actually, I wasn't going to do it that way, but rather use the time
> > ($Now) that the page is first created as the unique ID.  Since PmWiki
> > doesn't (or won't) allow two pages to be created at the same time,
> > this number will always be unique.
>
> Heh, I remember spending some time a year or two ago debugging a program 
> written about 10 years ago that used that assumption (it would divide by zero 
> on faster computers, had a timed loop that became too fast so the time 
> difference became zero).

This is a totally off-topic "me-too" story.  :-)

In 1993 I served as an expert-witness in several court cases that involved
a similar timing problem.  The county's system for selecting trial jury
members was flawed--the programmers involved didn't know how to use
the language's built-in random number generators, so they decided to 
write their own.  In it they decided to compute the next number in
sequence based on the clock time, figuring that this was a constantly
changing value and so it would make things "random".

Of course, time in a computer is not a random quantity--in fact 
it's very linear and discrete.  What's worse, the programmers 
failed to recognize that in a system that was processing around 
100,000 records per hour, the clock time would remain exactly the 
same for about 27-28 records before changing (and then it would 
change only by a value of one).

The county (and lawyers) discovered they had a problem when they started
getting a fair number of jury pools where jurors knew each other because
they had previously served on juries together the previous year.  :-)  
Worse, it created a potential for bias in the jury pools, because
the system tended to pull jurors from localized sections of the database
(e.g., people who had similar last names).

The county's programming staff defended the old system for a while,
but gave up (and switched to an entirely new system) within a week 
after my testimony.  I made a nice pocket of money being an expert 
witness for lawyers who were appealing their verdicts based on 
jury bias.  :-)  The downside was that I suddenly started being 
regularly selected for jury duty, which hadn't ever happened before.

Pm



More information about the pmwiki-users mailing list