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.
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)
Sysop: | Tetrazocine |
---|---|
Location: | Melbourne, VIC, Australia |
Users: | 4 |
Nodes: | 8 (0 / 8) |
Uptime: | 215:03:46 |
Calls: | 73 |
Calls today: | 1 |
Files: | 21,500 |
Messages: | 73,905 |