C
Cousin Stanley
| Many thanks for your input/explanation.
|
John ....
You're welcome ....
For convenience, a brief summary ....
An N element set has a total of ( 2 ** N ) subset combinations ....
c = ( n! / t! * ( n - t )! ) # combiniations of n things
# taken t at a time
p = ( n! / ( n - t )! ) # permutations of n things
# taken t at a time
Run the factorial program a few times
with different set sizes and check
the results to get a feel for the numbers ....
python factorial.py 3
python factorial.py 4
python factorial.py 5
...
python factorial.py 12
http://fastq.com/~sckitching/Python/factorial.py
[ 2.6 KB ]
The program shows the number of combinations
and permutations for each set size and their totals ...
combin( n , t ) .... c
permut( n , t ) .... p
|
John ....
You're welcome ....
For convenience, a brief summary ....
An N element set has a total of ( 2 ** N ) subset combinations ....
c = ( n! / t! * ( n - t )! ) # combiniations of n things
# taken t at a time
p = ( n! / ( n - t )! ) # permutations of n things
# taken t at a time
Run the factorial program a few times
with different set sizes and check
the results to get a feel for the numbers ....
python factorial.py 3
python factorial.py 4
python factorial.py 5
...
python factorial.py 12
http://fastq.com/~sckitching/Python/factorial.py
[ 2.6 KB ]
The program shows the number of combinations
and permutations for each set size and their totals ...
combin( n , t ) .... c
permut( n , t ) .... p