If I want p elements from a set q I can use p?q
But suppose I don't want equal weights attached to the elements of q?
That is if an element of q has a larger weight it is picked more frequently
than p?q provides. The choice is weighted by a separate vector w (sums to
1).
For just one element I can use
((+/ .<)[EMAIL PROTECTED]:)@(+/\)
but if I need more than one element my solution works (but you can't see
it, its that bad). A possible solution using things like vv"1 0 gets some
duplicates in the pick.
Ideas? (probably there is a trivial solution, I just haven't found it).
Ralph S
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm