Maybe somebody has a better indexing recipe but this gets the job done: $wh=:3 comb 9
84 3 xyz=: 1 1 1 0 ; 1 1 1 1 0 ; 1 1 1 1 1 84 20$ ; xyz ((<"1)(i.84)(;"0 1)wh) } 84 9$<0 1 1 1 0 1 1 1 1 0 1 1 1 1 1 0 0 0 0 0 0 1 1 1 0 1 1 1 1 0 0 1 1 1 1 1 0 0 0 0 0 1 1 1 0 1 1 1 1 0 0 0 1 1 1 1 1 0 0 0 0 : : 0 0 0 0 0 1 1 1 0 1 1 1 1 0 0 1 1 1 1 1 0 0 0 0 0 1 1 1 0 0 1 1 1 1 0 1 1 1 1 1 0 0 0 0 0 0 1 1 1 0 1 1 1 1 0 1 1 1 1 1 On Fri, Jan 5, 2018 at 8:02 PM, Henry Rich <[email protected]> wrote: > try. itself takes no more time than executing a short sentence like 2 + 3. > > For placement of 111 1111 11111, find all the ways to rearrange 000000xxx, > and for each one, replace the first x with 1110, the second with 11110, the > third with 11111. > > To find all the ways to rearrange 000000xxx, find all the combinations of > (i.9) taken 3 at a time and install an x in the positions indicated. > > To find the combinations of i.9 taken 3 at a time, use R. E. Boss's > method, see Combinations in the wiki. > > Henry Rich ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
