Permutation Algo Help

BlitzMax Forums/BlitzMax Beginners Area/Permutation Algo Help

Shortwind(Posted 2010) [#1]
Please help reboot my brain:

What is the formula for determining how many permutations are in a given set only using the elements found in said set where the length of the new group is to be equal to the number of elements in said given set?

An example follows:

Example #1

Given the set {A,B} there are only two ways these can combine: AB, BA

Given the set {A,A} there are still two ways, because these are considered different elements of the same set, even though they visually look the same, they are actually not: AA, AA

Given the set {A,B,C} there are only six: ABC, ACB, BAC, BCA, CAB, CBA

For some reason I can not remember the formula for finding this simple answer, can someone please help me jog my memory?

So, given a set of (X) elements how many (Y) permutations are there?

Thanks,
:D

[Edit]
P.S. LOL, I'm sure you can guess my next two questions if I can't figure them out on my own. :)

Last edited 2010


jankupila(Posted 2010) [#2]
If you have n different elements you have 1*2*3*4* ..n different permunations.

Last edited 2010

Last edited 2010


TaskMaster(Posted 2010) [#3]
It is called a factorial and is written like 5!.

5! = 5 * 4 * 3 * 2 * 1 = 120

Last edited 2010


Shortwind(Posted 2010) [#4]
:((( I'm am idiot!!!

That IS X! (X factorial)... Hmm, for some reason I thought that was something else dealing with combinations instead of permutations.

Thanks All.
:D

Last edited 2010


jankupila(Posted 2010) [#5]
I checked it, they are permutations but I think you can call them combinations as well.

Last edited 2010


Arabia(Posted 2010) [#6]
If I remember my Maths II course from 20 years ago (which I paid very little attention in), permutations and combinations are different.

I think as already pointed out, permutations are what you are looking at here, combinations are in any order.

i.e. (A,B) has one combination - A,B is the same as B,A

Permutations as you've already said are order specific.