subset permutations

Steven D'Aprano steve at REMOVETHIScyber.com.au
Fri Dec 9 23:34:58 EST 2005


On Fri, 09 Dec 2005 16:03:46 +1100, Ben Finney wrote:

>> Do you want the result to be:
>> AB, AC, AD, BC, BD, CD
> 
> That is the complete set of combinations of the letters.
> 
>> Or, do you want AB,BA,AC,CA,AD,DA,BC,CB,BD,DB,CD,DB ?
> 
> That is the complete set of permutations of the letters.


Only if you are choosing without replacement. If you are choosing with
replacement, you also get AA, BB, CC, DD.

Unfortunately, there is ambiguity in the terms "permutation" and
"combination", not just between English common usage and mathematics, but
even in mathematics.



-- 
Steven.




More information about the Python-list mailing list