octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: nchoosek


From: Julien Bect
Subject: Re: nchoosek
Date: Mon, 01 Sep 2014 08:28:18 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.0

Le 01/09/2014 07:51, Daniel J Sebald a écrit :
Julien, you mentioned commonly using nchoosek-like functions for k outside the range [0 N].  Can you give an example?

Assume for a while that binocdf does not exist. Then, you could write a simple replacement as follows :

   binopdf = @(k) (nchoosek (n, k) * (p ^ k) * (1 - p) ^ (n - k))

and it is valid for all non-negative k.

  And what if k is negative?  Error or 0?

For negative k I can see several options...

1) Error, because selecting a negative number of objects does not make sense (whatever the size of the set).

2) Zero, because it extends the validity of the above _expression_ to all integers.

3) Negative binomial coefficient (related to the negative binomial distribution and the binomial Taylor series)

I would keep the current choice (option 1) which makes more sense if you stick to the purely combinatorial interpretation of nchoosek.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]