468,504 Members | 2,003 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,504 developers. It's quick & easy.

Help on permutation and combination.

1
Need coding for a program where given positive integers n and r, to find the number of r-permutations when repetition is allowed and r-combinations when repetition is allowed of the ser with n-element. the program should accept user's input and list down the r-permutations and r-combinations in lexicographic order.
...really desperate for help..thanks!
Oct 16 '06 #1
1 4263
D_C
293 100+
Some formulas may help.

nPr or P(n,r) = n! / (n-r)!

nCr or C(n,r) = n! / r!(n-r)!

In other words, (nCr * r!) = nPr.
Oct 17 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

20 posts views Thread by drs | last post: by
10 posts views Thread by Talin | last post: by
2 posts views Thread by lucotuslim | last post: by
1 post views Thread by user | last post: by
27 posts views Thread by onkar | last post: by
20 posts views Thread by sophia | last post: by
reply views Thread by viza | last post: by
reply views Thread by NPC403 | last post: by
3 posts views Thread by gieforce | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.