APLX Help : Help on APL language : APL Primitives : ! Binomial
|
|
|
|
|
Two-argument form See also one-argument form Factorial or Gamma function In its two-argument form, with positive arguments, 2 ! 4 (Number of unique pairs from a population
6 of 4)
3 ! 20 (Number of groups of three from a
1140 population of 20)
2 ! 6 12 20 (Number of pairs from a population
15 66 190 of 6 12 20 respectively)
TABLE1 ← 2 3⍴⍳6
TABLE2 ← 2 3 ⍴ 3 6 9 12 15 18
TABLE1 ! TABLE2 (TABLE1 is table of group sizes, TABLE2
3 15 84 is table of populations)
495 3003 18564
Other cases, such as negative or non-integer arguments, are also catered for. The various results that can be obtained are: Left Right Right-Left Result
Argument Argument
+ve +ve +ve (!RIGHT)÷(!LEFT)×!RIGHT-LEFT
+ve +ve -ve 0
+ve -ve -ve (¯1*LEFT)×LEFT!LEFT-RIGHT+1
-ve +ve +ve 0
-ve -ve +ve (¯1*RIGHT-LEFT)×(|RIGHT+1)!(|LEFT+1)
-ve -ve -ve 0
|
|
APLX Help : Help on APL language : APL Primitives : ! Binomial
|
|
Copyright © 1996-2010 MicroAPL Ltd