On Sat, Apr 24, 2010 at 5:47 PM, smandula <[email protected]> wrote:
> Could someone write this program.
> Using random numbers, with
> at least one million interations or more, using numbers 50 numbers,
> posting to that specific number of  this 50 group,upon
> each iteration. When finished, display the 10 highest values.

A million random numbers is easy to understand, but what kind of
random numbers do you want?  Do you want random floating numbers
between 0 and 1 or did that "50" mean you want integers in the range
1..50?

Also, what does "posting" and "group" mean here?

Anyways, here is a J expression to generate a million random numbers
in the range 1..50 and then give you the largest 10 of them:

   10{.\:~1+?1e6#50
50 50 50 50 50 50 50 50 50 50

Note that the answer will almost always be 10 copies of the number
50 because you will typically be generating something like 20000
copies of the number 50.

So I suspect that this was not what you meant, but it is not at
all clear what you do mean.

Or, as Brian suggested, if you could give us some numeric examples
that would help a lot.

Thank you,

-- 
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to