Connecting Tech Pros Worldwide Help | Site Map

How to compute Permutation of 4P3?

Newbie
 
Join Date: Jan 2008
Posts: 12
#1: Oct 9 '09
Let's say i create a String array that store 4 Alphabets {"A","B","C","D"}
How can i get the result if i need permutation of 4P3 and 4P2?

I had refer to many examples from the internet, but those examples cannot compute n selection from m elements. They only able to computer permutation of m elements without selection e.g. 4P4.

I need help in how to create an algorithm that can perform permutation of n selection from m elements.

Any help will be appreciated.

Thanks
Ash
JosAH's Avatar
Expert
 
Join Date: Mar 2007
Posts: 10,611
#2: Oct 9 '09

re: How to compute Permutation of 4P3?


The sequence nCm can be easily generated; for every element in nCm generate all its permutations mPm (which is also easy).

kind regards,

Jos
Newbie
 
Join Date: Aug 2009
Posts: 15
#3: Oct 9 '09

re: How to compute Permutation of 4P3?


I think Random class can help you alot in this regard.......Post more what you intend to do ......
Reply


Similar Java bytes