Combinations and Permutations Script

Discussion in 'PHP' started by jakomo, Nov 5, 2008.

  1. #1
    Hello friends!

    Maybe someone can help me, I'm looking for a function like this:

    http://www.mathsisfun.com/combinatorics/combinations-permutations-calculator.html
    Code (markup):
    I'm looking for a function where I can send two values (n and r) and the function give me the list of possibilities.

    Example:
    n: 4
    r: 2

    Possibilities Values: {1,2} {1,3} {1,4} {2,1} {2,3} {2,4} {3,1} {3,2} {3,4} {4,1} {4,2} {4,3}

    Thanks,
    Jakomo
     
    jakomo, Nov 5, 2008 IP
  2. jakomo

    jakomo Well-Known Member

    Messages:
    4,262
    Likes Received:
    82
    Best Answers:
    0
    Trophy Points:
    138
    #2
    Done.
    Please close this post :)

    Thanks,
    Jakomo
     
    jakomo, Nov 5, 2008 IP