R.E. Boss wrote:
> If the subsets are differently grouped, more efficient solutions are
> possible:
>
>    (i. <@comb"0 ])5
> ++-+---+-----+-------+
> ||0|0 1|0 1 2|0 1 2 3|
> ||1|0 2|0 1 3|0 1 2 4|
> ||2|0 3|0 1 4|0 1 3 4|
> ||3|0 4|0 2 3|0 2 3 4|
> ||4|1 2|0 2 4|1 2 3 4|
> || |1 3|0 3 4|       |
> || |1 4|1 2 3|       |
> || |2 3|1 2 4|       |
> || |2 4|1 3 4|       |
> || |3 4|2 3 4|       |
> ++-+---+-----+-------+
>
>    ts 'ps2 i.15'
> 0.051891392 4280704
>    ts'(i. <@comb"0 ])15'
> 0.0078416183 1611136
>
>    ts 'ps2 i.20'
> 2.238679 1.5356698e8
>    ts'(i. <@comb"0 ])20'
> 0.40906997 62709248
To be honest to you all this was the kind of alternative
I was asking (wrongly typed as challenging) for.


Thanks

@@i=arie

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

Reply via email to