Error using nchoosek (line 48)
K must be an integer between 0 and N.
>> nchoosek ([4 5], 8)
ans =
Empty matrix: 0-by-8
-----------------------------------------------------------------
I find this behaviour of Matlab rather unfortunate. Actually, I would
have defined the output to be 0 and [0 0].
Having nchoosek (n, k) be 0 when k > n is a very useful convention
that make lots of combinatorial formulas easier to write (and prove).
This is for instance the behaviour of R:
-----------------------------------------------------------------
> choose (5, 8)
[1] 0
> choose (c(4, 5), 8)
[1] 0 0
-----------------------------------------------------------------
and Python + SciPy:
-----------------------------------------------------------------
>>> from scipy.special import binom
>>> binom(5, 8)
0.0
>>> binom((4, 5), 8)
array([ 0., 0.])
-----------------------------------------------------------------
@++
Julien