Sujet : Re: (1 Combination 2) = 0 -- Better explanation?
De : jbb (at) *nospam* notatt.com (Jeff Barnett)
Groupes : comp.lang.python sci.math sci.langDate : 16. Jul 2024, 00:20:54
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v747c8$t5ch$1@dont-email.me>
References : 1 2 3
User-Agent : Mozilla Thunderbird
On 7/15/2024 12:49 PM, HenHanna wrote:
On 7/14/2024 8:44 PM, Jeff Barnett wrote:
On 7/14/2024 2:57 PM, HenHanna wrote:
Python says: (1 Combination 2) = 0
Ok... It's Impossible (to do).
------- is there a Better explanation?
(5 Combination 0) = 1 <---- This is explained by Comb(5,0)=Comb(5,5)
in general:
Comb(N,r)=Comb(N,N-r)
_______________________________________
from math import comb
for i in range(6): print( comb(5,i) )
print( comb(1,2) )
Let combination of n things taken m at a time be represented by [n,m].
Then [n,m] = [n,n-m] as you correctly note above. Further, we have the
computational formula [n,m] = n!/(m!(n-m)!) where x! is simply x
factorial. So [1,2] = 1!/(2!((-1)!)), or 1/2 divided by (-1)!. However
factorial of a negative integer is, by convention, an infinite value
so [1.2] = 0.
THank you...
Bard.Google.com says that
Comb(1,2) is not defined
factorial(-1) is not defined
factorial(-2) is not defined
GammaFunction(-1) is not defined
GammaFunction(-2) is not defined
They are partially correct. However, one can say that 1/0 = oo is
defined (where oo is infinity). In particular. 1/oo = 0 certainly makes
sense and that's all we need to accept for the above deductions.
Something I forgot to say in my original above is why x! = oo when x is
a negative integer. I cure that omission now. We want to define the
factorial as 1! = 1 and n! = n*(n-1)! when n > 1. We would also like to
be able to pedal backwards, i.e.. derive (n-1)! from n! and n. This is
certainly straightforward when n > 0. However the cases for other
integer n is trickier. For example, from our recursion formula we have
0! = 0*(-1)! and we know that (by definition) 0! =1. Thus, 1 = 0*(-1)!
which only has the possible symbolic solutions (-1)! = oo or -oo. Now a
trivial induction argument will draw the same conclusion for all
negative integers.
The importance of this bit of sophistry is our desire to do symbolic
manipulations with various classes of formulas without having to
numerically separate out a lot of special cases. Look at the above
definition of combination. With the established conventions, we have 1)
[n,n] = 1 and this can't work unless 0! = 1; 2) [n.0] = 1 which says
that the only o element subset of n elements is the empty set; etc.
It is a goal of mathematicians to make their definitions work not only
for the obvious cases but where there is darkness in our knowledge that
might be trivially illuminated by formulas that allow straightforward
consistent treatment throughout.
-- Jeff Barnett