Question: Select remove in partitition

Hi

How can I remove a subset containing a number from a partition?

eg S := [seq(2..5)]

P:=combinat:-setpartition(S, 2);

[[[2, 3], [4, 5]], [[2, 4], [3, 5]], [[2, 5], [3, 4]]]

I want to remove any partition involving 5

leaving

[[[2, 3]], [[2, 4]], [[3, 4]]]

i tried

remove(has,P,5)

 

 

Please Wait...