Re: Help with Permutations
- From: quasi <quasi@xxxxxxxx>
- Date: Sat, 07 Jan 2006 04:36:45 -0500
On 6 Jan 2006 13:52:24 -0800, "barliow" <jack.c.barlow@xxxxxxxxx>
wrote:
>Hi all,
>
>I'm not mathematically fantastic so I hope this makes sense.
>
>I've written an algorithm to generate all permutations of words from a
>given alphabet.
>
>Alphabet:
>
>"abc"
>
>Gives permutations:
>
>a, b, c, ab, ac, ba, bc, ca, cb, abc, acb, bac, bca, cab, cba
>
>In order to keep track of the progress through the algorithm, I need to
>be able to calculate the total number of permutations in advance. I can
>do this using the following formula:
>
>Number of permutations of size k taken from n objects is:
>
> n!
>n_P_k = --------
> (n - k)!
>
>So I can calculate the total number of permutations off all lengths as:
>
>P = (3! / (3! - 1!)) + (3! / (3! - 2!)) + (3! / (3! - 3!)) = 15
>
>However, the algorithm is designed to eliminate repeated permutations
>that arise as a result of having repeated letters:
>
>Alphabet:
>
>"acc"
>
>Gives permutations:
>
>a, c, ac, ca, cc, acc, cac, cca
>
>This means that the formula above no longer works. I'm wondering if
>someone can provide a formula to calculate the total of number of
>permutations of *all* lengths that will be outputted in the following
>scenarios:
>
>"abc" (should = 15)
>
>"accd" (should = 34)
>
>"acccdde" (uncertain as to what the result should be)
1265
quasi
.
- References:
- Help with Permutations
- From: barliow
- Help with Permutations
- Prev by Date: Re: Open, connected but not path-connected
- Next by Date: Tutte The factorization of linear graphs
- Previous by thread: Re: Help with Permutations
- Next by thread: Re: Help with Permutations
- Index(es):
Relevant Pages
|