As you say 50 will always be the highest values but I would hazard a guess he means which numbers turn up most frequently.
2010/4/25 Raul Miller <[email protected]>: > 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 > -- Björn Helgason, Verkfræðingur Fornustekkum II 781 Hornafirði, t-póst: [email protected] gsm: +3546985532 sími: +3544781286 http://groups.google.com/group/J-Programming Tæknikunnátta höndlar hið flókna, sköpunargáfa er meistari einfaldleikans góður kennari getur stigið á tær án þess að glansinn fari af skónum /|_ .-----------------------------------. ,' .\ / | Með léttri lund verður | ,--' _,' | Dagurinn í dag | / / | Enn betri en gærdagurinn | ( -. | `-----------------------------------' | ) | (\_ _/) (`-. '--.) (='.'=) ♖♘♗♕♔♙ `. )----' (")_(") ☃☠ ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
