Combinations with repetitions: Difference between revisions

→‎J Alternate implementation: verb now defined in stats addon
(Add Factor)
(→‎J Alternate implementation: verb now defined in stats addon)
Line 1,845:
 
<syntaxhighlight lang="j">require 'stats'
rcomb=: (combrcombrep #) { ]</syntaxhighlight>
combr=: i.@[ -"1~ [ comb + - 1:
rcomb=: (combr #) { ]</syntaxhighlight>
 
<code>rcomb</code> functions identically, and <code>combrcombrep</code> calculates indices:
 
<syntaxhighlight lang="j"> 2 combrcombrep 3
0 0
0 1
892

edits