Question: how to remove the lists(sets) with all the same members?

Hi all. how can i detect and remove the lists with same members? for example in the code below, i want to remove duplicate of the lists with the same members, for example [1,1,5],[1,5,1],[5,1,1]. i want just one of these sets to remain and the others to be removed. it doesn't matter which. i want just one set with members 1,5,1 which their summation is 7. and the same thing for other lists. thanks in advance.
 

restart:with(combinat):with(Iterator):

MM:=composition(7, 3)

{[1, 1, 5], [1, 2, 4], [1, 3, 3], [1, 4, 2], [1, 5, 1], [2, 1, 4], [2, 2, 3], [2, 3, 2], [2, 4, 1], [3, 1, 3], [3, 2, 2], [3, 3, 1], [4, 1, 2], [4, 2, 1], [5, 1, 1]}

(1)

 


 

Download code.mw

Please Wait...