Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • 1
    $\begingroup$ This is not very helpful, but I think it's more natural in this case to do Cases[Flatten[Apply[Outer[Intersection, ##, 1] &, input], 2], {__}] at the end. $\endgroup$ Commented Mar 23, 2016 at 21:50
  • 1
    $\begingroup$ As possibly another unhelpful comment: is it possible to generate the full equivalence relation at the beginning, before you've generated the individual ones? It seems like it would be better to combine the conditions used to generate the equivalence classes first before generating the lists themselves. That way you can get output without generating input first. (This is still good question and should be answered. I figured I'd toss this out there anyway.) $\endgroup$ Commented Mar 23, 2016 at 21:53
  • 1
    $\begingroup$ Actually, Cases[Apply[Outer[Intersection, ##, 1] &, input], {__}, {3}]. $\endgroup$ Commented Mar 23, 2016 at 21:56