On Fri, Mar 20, 2009 at 01:18:00PM -0400, Stavros Macrakis wrote:
> Yes, this is a bug, set_partitions is not returning correctly
> simplified sets -- could you please report it?
>
done
> In the meantime, as a workaround, you can simplify the results of
> set_partitions correctly by calling resimplify:
>
> resimplify(expr):=expand(expr,1,1)$
>
> is(listify(resimplify(set_partitions({1,2,3,4},3)))[3] = {{1},{3},{2,4}});
> => true
>
> -s
>
thanks
Oliver
>
>
> On Fri, Mar 20, 2009 at 12:48 PM, Oliver Kullmann
> <O.Kullmann at swansea.ac.uk> wrote:
> > Hello,
> >
> > Using Maxima 5.17.1 with Ecl 8.12.0 I get
> > the following bizarre behaviour:
> >
> > (%i1) listify(set_partitions({1,2,3,4},3));
> > (%o1) [{{1},{2},{3,4}},{{1},{2,3},{4}},{{1},{3},{2,4}},{{1,2},{3},{4}},{{1,3},{2},{4}},
> > ? ? ? {{1,4},{2},{3}}]
> > (%i2) listify(set_partitions({1,2,3,4},3))[3];
> > (%o2) {{1},{3},{2,4}}
> > (%i3) is(listify(set_partitions({1,2,3,4},3))[3] = {{1},{3},{2,4}});
> > (%o3) false
> >
> > There is clearly a bug here. It seems to me that the villain is set_partitions
> > which doesn't seem to produce "good sets".
> >
> > Oliver
> >
> > P.S. It's not just the equality test not working, but e.g.
> > (%i4) intersection(listify(set_partitions({1,2,3,4},3))[3], {{2},{2,1},{2,3},{2,4}});
> > (%o4) {}
> > (%i5) intersection({{1},{3},{2,4}}, {{2},{2,1},{2,3},{2,4}});
> > (%o5) {{2,4}}
> >