Click here to Skip to main content
15,903,033 members
Home / Discussions / Algorithms
   

Algorithms

 
AnswerRe: Hyper-geometry Pin
Slayer2-Oct-06 6:21
Slayer2-Oct-06 6:21 
QuestionA Permuation Question Pin
Mushtaque Nizamani19-Sep-06 1:39
Mushtaque Nizamani19-Sep-06 1:39 
AnswerRe: A Permuation Question Pin
Rob Graham19-Sep-06 2:40
Rob Graham19-Sep-06 2:40 
AnswerRe: A Permuation Question Pin
ejuanpp19-Sep-06 2:43
ejuanpp19-Sep-06 2:43 
GeneralRe: A Permuation Question Pin
Mushtaque Nizamani19-Sep-06 3:01
Mushtaque Nizamani19-Sep-06 3:01 
GeneralRe: A Permuation Question Pin
Rob Graham19-Sep-06 3:35
Rob Graham19-Sep-06 3:35 
GeneralRe: A Permuation Question Pin
Mushtaque Nizamani19-Sep-06 3:46
Mushtaque Nizamani19-Sep-06 3:46 
AnswerRe: A Permuation Question Pin
Sean Cundiff20-Sep-06 6:53
Sean Cundiff20-Sep-06 6:53 
No.

        n!
nPr = ------
      (n-r)!

         n!
nCr = ---------
      (n-r)!*r!


Permutations = a set of elements in which order matters.
Combination = a set of elemets in which order does not matter.

nPr = nCr * r!

Permutations = (elements of subset)*(# of ways to order subset)


Example
-------

SET = {a,b,c,d}

4P3 = 24:
{a,b,c},{a,c,b},{b,a,c},{b,c,a},{c,a,b},{c,b,a}
{a,b,d},{a,d,b},{b,a,d},{b,d,a},{d,a,b},{d,b,a}
{a,c,d},{a,d,c},{c,a,d},{c,d,a},{d,a,c},{d,c,a}
{b,c,d},{b,d,c},{c,b,d},{c,d,b},{d,b,c},{d,c,b}


4C3 = 4:
{a,b,c}
{a,b,d}
{a,c,d}
{b,c,d}

in this case r=3 => r!=6

4P3 = 4C3 * 3! = 4 * 6 = 24

Notice that each line under 4P3 is the number of permutations of the corresponding line under 4C3.



-Sean
----
Shag a Lizard

GeneralRe: A Permuation Question Pin
Mushtaque Nizamani20-Sep-06 7:32
Mushtaque Nizamani20-Sep-06 7:32 
QuestionAn Algorithm Design Challenge Pin
Roger Wright18-Sep-06 12:00
professionalRoger Wright18-Sep-06 12:00 
AnswerRe: An Algorithm Design Challenge Pin
Bassam Abdul-Baki18-Sep-06 13:35
professionalBassam Abdul-Baki18-Sep-06 13:35 
GeneralRe: An Algorithm Design Challenge Pin
Roger Wright18-Sep-06 13:52
professionalRoger Wright18-Sep-06 13:52 
AnswerRe: An Algorithm Design Challenge Pin
Sean Cundiff18-Sep-06 16:05
Sean Cundiff18-Sep-06 16:05 
GeneralRe: An Algorithm Design Challenge Pin
Bassam Abdul-Baki18-Sep-06 16:12
professionalBassam Abdul-Baki18-Sep-06 16:12 
GeneralRe: An Algorithm Design Challenge Pin
Sean Cundiff18-Sep-06 16:46
Sean Cundiff18-Sep-06 16:46 
GeneralRe: An Algorithm Design Challenge Pin
Bassam Abdul-Baki18-Sep-06 16:49
professionalBassam Abdul-Baki18-Sep-06 16:49 
GeneralRe: An Algorithm Design Challenge Pin
Roger Wright18-Sep-06 17:26
professionalRoger Wright18-Sep-06 17:26 
GeneralRe: An Algorithm Design Challenge Pin
Kastellanos Nikos11-Oct-06 0:34
Kastellanos Nikos11-Oct-06 0:34 
AnswerRe: An Algorithm Design Challenge Pin
Rob Graham18-Sep-06 16:35
Rob Graham18-Sep-06 16:35 
GeneralRe: An Algorithm Design Challenge Pin
Roger Wright18-Sep-06 17:23
professionalRoger Wright18-Sep-06 17:23 
AnswerRe: An Algorithm Design Challenge Pin
ColinDavies29-Sep-06 12:19
ColinDavies29-Sep-06 12:19 
Questioncombination algorithm Pin
kebd14-Sep-06 11:53
kebd14-Sep-06 11:53 
AnswerRe: combination algorithm Pin
ejuanpp15-Sep-06 1:12
ejuanpp15-Sep-06 1:12 
GeneralRe: combination algorithm Pin
kebd15-Sep-06 8:29
kebd15-Sep-06 8:29 
Questiondfgfdg Pin
Gul zeb14-Sep-06 2:13
Gul zeb14-Sep-06 2:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.