Newsgroups: comp.lang.apl
Path: watmath!watserv2.uwaterloo.ca!torn!utcsri!geac!itcyyz!yrloc!rbe
From: rbe@yrloc.ipsa.reuter.COM (Robert Bernecky)
Subject: Re: Cup of coffee?
Message-ID: <1993Feb8.152439.26726@yrloc.ipsa.reuter.COM>
Reply-To: rbe@yrloc.ipsa.reuter.COM (Robert Bernecky)
Organization: Snake Island Research Inc, Toronto
References: <C1yLz0.8ts@watserv1.uwaterloo.ca>
Date: Mon, 8 Feb 93 15:24:39 GMT

In article <C1yLz0.8ts@watserv1.uwaterloo.ca> "Jack Rudd" <JACKRUDD@BLDFVM1.VNET.IBM.COM> writes:
>In a previous append today Mike Kent suggested going for coffee
>while waiting for 15000 ? 15000 .   But it took only 110 milliseconds
>of computation time on my RISC/6000 mod 530H.
>

There are smart and dumb implementations of deal. Some systems actually
use both, depending on available space. Others are merely dumb.
A third are merely smart. Doug Forkes and I worked out a mostly
smart one some time ago. If I can remember what we did, I'll 
post a model of it.

The dumb one basically picks a random number in the range, then 
serially examines every number it's generated thus far in the result to
see if this it has already picked this one. If so, it picks another
number, searches for it, ...   
If it's not in the result, it appends it, checks for completion, and
keeps going if not done.

Such a dumb algorithm is at least n^2 in complexity. I remember
running into this first on a 360/50 with 48k workspaces, where
a suitably crafted roll would have taken several decades to complete.
I think the system crashed before it was done...
Bob


Robert Bernecky      rbe@yrloc.ipsa.reuter.com  bernecky@itrchq.itrc.on.ca 
Snake Island Research Inc  (416) 368-6944   FAX: (416) 360-4694 
18 Fifth Street, Ward's Island
Toronto, Ontario M5J 2B9 
Canada
