[Jprogramming] Random Numbers with interation
Bo Jacoby
bojacoby at yahoo.dk
Mon Apr 26 07:44:40 HKT 2010
What does the word 'interation' mean? 'iteration' or 'interaction' ?
--- Den man 26/4/10 skrev Roger Hui <rhui000 at shaw.ca>:
> Fra: Roger Hui <rhui000 at shaw.ca>
> Emne: Re: [Jprogramming] Random Numbers with interation
> Til: "Programming forum" <programming at jsoftware.com>
> Dato: mandag 26. april 2010 00.29
> There are other situations where the
> expression I suggested
> is much more economical than the one you used. For
> example:
>
> ts=: 6!:2 , 7!:2@]
>
> 10 ts '1e6 ?@$ 2'
> 0.0029846 1.04934e6
> 10 ts '?1e6 $ 2'
> 0.0132888 5.24352e6
>
> i.e. factor of 4 in time, factor of 5 in space.
>
>
>
> ----- Original Message -----
> From: Don Guinn <donguinn at gmail.com>
> Date: Sunday, April 25, 2010 7:53
> Subject: Re: [Jprogramming] Random Numbers with interation
> To: Programming forum <programming at jsoftware.com>
>
> > True. There is a lot that could be done to make it
> faster. But
> > it was so
> > much faster I didn't bother. And as you say, if you
> can't half
> > the time,
> > it's not worth doing. But I did try it. Looks like
> maybe 20% faster
> >
> > On Sun, Apr 25, 2010 at 9:18 AM, Roger Hui <rhui000 at shaw.ca>
> wrote:
> >
> > > Slightly more economical to do 1e6?@#50 or
> 1e6?@$50
> > > instead of ?1e6#50 .
> > >
> > >
> > >
> > > ----- Original Message -----
> > > From: Don Guinn <donguinn at gmail.com>
> > > Date: Sunday, April 25, 2010 5:57
> > > Subject: Re: [Jprogramming] Random Numbers with
> interation
> > > To: Programming forum <programming at jsoftware.com>
> > >
> > > > How about 0.07 seconds.
> > > >
> > > > 6!:2
> '(1!:2&2)|."1]10{.\:~(>:~.z),.~
> > #/.~z=.?1e6#50'> > 15 20400
> > > > 8 20340
> > > > 46 20287
> > > > 13 20278
> > > > 33 20249
> > > > 39 20220
> > > > 18 20219
> > > > 29 20206
> > > > 25 20197
> > > > 9 20166
> > > > 0.0658392
> > > >
> > > > On Sun, Apr 25, 2010 at 7:36 AM, smandula
> > > > <smandula at idirect.com>
> wrote:
> > > >
> > > > >
> > > > > Thank you kindly for your reply.
> > > > > The statement of one million is an
> example, could be
> > > > 1,000 or 50,000
> > > > > iterations.
> > > > > The random numbers being tested could
> be 1 to 50, or 1 to 100
> > > > >
> > > > > I have a basic program whereby I enter
> the maximum iterations,
> > > > in the
> > > > > example 1,000,000
> > > > > and a time clock starts, and a counter
> starts counting up to
> > > > the required
> > > > > 1,000,000 intervals.
> > > > >
> > > > > Once, done the time duration shows, in
> my case 17 minutes, and
> > > > a list of 10
> > > > > highest occurrences
> > > > > for these random numbers. i.e.
> > > > > number 29 occurrences
> 204,984
> > > > > number 26 occurrences
> 204,855
> > > > > number 40 occurrences
> 204,732
> > > > > number 17 occurrences
> 204,629
> > > > > Number 1 occurrences
> 204,480
> > > > >
> > > > > I would appreciate any input from the
> forum, especially for
> > > > faster times
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
__________________________________________________
Bruger du Yahoo!?
Er du træt af spam? Yahoo!Mail har den bedste spambeskyttelse, der findes
http://dk.mail.yahoo.com
More information about the Programming
mailing list