Thanks to all for your suggestions. david alis wrote: > I wonder what led John to think of his solution > because it is curiously out of character for someone > who's been using J for such a long time.
I was working under a restriction I should have stated: you can't use dyadic ? . This led me to either accumulating values and checking for uniqueness, or making all selections at once using combination index. Roger Hui wrote: >> pick2"0 i.5 >> 2 32 40 45 48 1 >> 7 28 29 35 54 11 >> 1 26 31 41 55 3 >> 3 11 29 41 43 32 >> 12 20 24 27 41 9 > > John, how can it be random when the first > five numbers are always in order? ;-) Sorting lottery ticket numbers is often misunderstood. Students learn to use permutations when order matters and combinations when order does not matter. The NJ Pick-6 lottery uses 6 numbers from 1-49. The number of distinct tickets is 6!49, not (!49x)%(!43x), a common mistake. Best wishes, John ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
