Help on permutation and combination.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Devung
    New Member
    • Oct 2006
    • 1

    Help on permutation and combination.

    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!
  • D_C
    Contributor
    • Jun 2006
    • 293

    #2
    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.

    Comment

    Working...