Jerry.Lewis at biogenidec.com
2008-Mar-26 04:10 UTC
[Rd] choose fails a fundamental property of binomial coefficients (PR#11035)
Full_Name: Jerry W. Lewis Version: 2.7.0 (2008-03-23 r44847) OS: Windows XP Professional Submission from: (NULL) (71.184.230.48) choose(n,k) = choose(n,n-k) is not satisfied if either 1. n is a negative integer with k a positive integer (due to automatically returning 0 for n-k<0) 2. n is not an integer with k a positive integer (due to rounding n-k to an integer, compounded by automatically returning 0 if n<0 which implies n-k<0) Both are easily fixed, as discussed in PR# 10766
maechler at stat.math.ethz.ch
2008-Mar-26 10:02 UTC
[Rd] choose fails a fundamental property of binomial coefficients (PR#11035)
>>>>> "JL" == Jerry Lewis <Jerry.Lewis at biogenidec.com> >>>>> on Wed, 26 Mar 2008 05:10:04 +0100 (CET) writes:JL> Full_Name: Jerry W. Lewis Version: 2.7.0 (2008-03-23 JL> r44847) OS: Windows XP Professional Submission from: JL> (NULL) (71.184.230.48) JL> choose(n,k) = choose(n,n-k) is not satisfied if either JL> 1. n is a negative integer with k a positive integer JL> (due to automatically returning 0 for n-k<0) JL> 2. n is not an integer with k a positive integer (due to JL> rounding n-k to an integer, compounded by automatically JL> returning 0 if n<0 which implies n-k<0) I think you have not really understood from help(choose) that we have choose(n,k) := n(n-1)...(n-k+1) / k! defined for non-negative integer k and arbitrary real n This definition has the very important property that it is used in the 'binomial theorem' and everything depending on that theorem, (1 + x) ^ \alpha = \sum_{k=0}^\infty choose(x,k) x^k which holds for all |x| < 1 for all \alpha \in \R ------- Your "fundamental" property does only hold when n is non-negative integer. Definitely no bug in R here! Martin Maechler, ETH Zurich
maechler at stat.math.ethz.ch
2008-Mar-26 11:10 UTC
[Rd] choose fails a fundamental property of binomial coefficients (PR#11035)
>>>>> "MM" == Martin Maechler <maechler at stat.math.ethz.ch> >>>>> on Wed, 26 Mar 2008 11:02:37 +0100 (CET) writes:>>>>> "JL" == Jerry Lewis <Jerry.Lewis at biogenidec.com> >>>>> on Wed, 26 Mar 2008 05:10:04 +0100 (CET) writes:JL> Full_Name: Jerry W. Lewis Version: 2.7.0 (2008-03-23 JL> r44847) OS: Windows XP Professional Submission from: JL> (NULL) (71.184.230.48) JL> choose(n,k) = choose(n,n-k) is not satisfied if either JL> 1. n is a negative integer with k a positive integer JL> (due to automatically returning 0 for n-k<0) JL> 2. n is not an integer with k a positive integer (due to JL> rounding n-k to an integer, compounded by automatically JL> returning 0 if n<0 which implies n-k<0) MM> I think you have not really understood from help(choose) MM> that we have MM> choose(n,k) := n(n-1)...(n-k+1) / k! MM> defined for non-negative integer k and arbitrary real n MM> This definition has the very important property that it is used MM> in the 'binomial theorem' and everything depending on that MM> theorem, MM> (1 + x) ^ \alpha = \sum_{k=0}^\infty choose(x,k) x^k Oops! "Of course", I meant 'choose(\alpha,k)' , not 'choose(x,k)' MM> which holds for all |x| < 1 for all \alpha \in \R MM> ------- MM> Your "fundamental" property does only hold when n is MM> non-negative integer. MM> Definitely no bug in R here! Martin Maechler, ETH Zurich