lchoose function in R

2k Views Asked by At

My understanding of lchoose function in R is simply lchoose(a,b) = log(choose(a,b)). However, I found that:

 temp <- 7.9999993
 k <- 8
 choose(temp,k)
 [1] 0
 lchoose(temp,k)
 [1] 0
 log(choose(temp,k))
 [1] -Inf

So lchoose is not log of the choose function output. Why is this happening?

1

There are 1 best solutions below

5
On BEST ANSWER

In the discrete case (i.e discrete n), choose(n,k) computes the number of distinct k-element subsets from a set of n elements, so if k > n, then you are counting subsets of a set which have more elements that the corresponding set. Since there are no such subsets, then the answer is zero.

In general, for an n which is a real number, the function can still be computed, but however, the function still has to have the same meaning over discrete values, so for k>n the function has a value of zero. If you look at the definition of the binomial function with real n (see here) you'll see that the answer will be zero, but I tried to explain it, hopefully, in an intuitive manner.