Tue 18 Mar 2014 03:56:02 AM UTC, original submission:
If we have a vector `v' of length `n=length(v)', then the following inconsistency is observed
size(nchoosek(v, 0 ),1) != nchoosek(length(v), 0 )
size(nchoosek(v, 1 ),1) == nchoosek(length(v), 1 )
size(nchoosek(v, 2 ),1) == nchoosek(length(v), 2 )
...
size(nchoosek(v, N ),1) == nchoosek(length(v), N )
that is, for all values of K, the equality `size(nchoosek(v, K ),1) == nchoosek(length(v), K )' is valid, except for K==0.
This is taken from the nchoosek's help:
The resulting C has size `[nchoosek (length (N), K), K]'.
For the case K==0, the help is wrong; however, what really should be changed is the result of the function, not the help.
|