A={1, 2, 3, 4, 5}
Permutations[A, {3}]
I need to print all permutations where the first number is bigger than the second and the second number is bigger than the third:
lets say (5,4,3), ...(5,3,1), ...(4,2,1)...(3,2,1). it needs to be done with A={1, 2, 3, 4, 5}
Answer
Select[Permutations[A, {3}], Greater @@ # &]
Comments
Post a Comment