Re: [PEPr] Comment on Math::Math_Combinatorics

From: Date: Sat, 31 Mar 2007 05:14:44 +0000
Subject: Re: [PEPr] Comment on Math::Math_Combinatorics
References: 1 2 3 4 5 6  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-46121@lists.php.net to get a copy of this message
AFAIK repetition is a property of both combination or permutation. Combination is used when the order of the elements doesn't matters (like forming a team of 3 people from a set of 10 people, ABC = CBA) while permutation does (like generating a password, 123 != 321). It is not enough to know which one, combination or permutation, is the right one to solve your problem. You have to know if it is allowed or not to have repeated elements. So repetition is a "property" (or a subform) of both "tools". Permutation with repetition: Numeric password with 5 numbers: 10x10x10x10x10 = 100000 different passwords Permutation without repetition: Numeric password with 5 numbers: 10x9x8x7x6 = 30240 different passwords Combination with repetition: Subset of 2 people from a set of 3 people: C(2 3) * 2! = 6 (AA BB CC AB AC BC) Combination without repetition: Subset of 2 people from a set of 3 people: C(2 3) = 3 (AB AC BC) regards, Igor. On 3/30/07, David Sanders <dsanders@baselinesolutions.com.au> wrote:
I was thinking more of having repitition as an option. Wiki *said* the definition can be either with or without repitition for both combinations and permutations. (Now this is what I don't like about wiki: Someone has deleted the "Permutations without Repitition" sub-section without even providing a reason. See the history tab) However, there's a topic to think about - repetitions. The original definition of combination in mathematics implies that the elements have to be unique, i.e. the combinations of the set {A, A, B} are the same as these of {A, B}, of {A, A, A, A, B}, etc. Nevertheless, the term "combination with repetition" exists. I will try to take a look in my university courses on combinatorics during the weekend, because I'm uncertain what is the correct behaviour that has to be followed in the package. --
    David Sanders
    shangxiao
-- PEAR Development Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


« previous php.pear.dev (#46121) next »