Thanks.

I am computing something like

Prob(A + B) = Prob(A) + Prob(B) - Prob(A*B)

for a complicated discrete distribution where '+' means union and '*'
means intersection. This is simple enough for a small number of sets,
but there might be millions of sets and the above formula gets more
complex since the sets are not disjoint.

For instance,

Prob(A + B + B) = Prob(A) + Prob(B)+ Prob(C) - Prob(A*B) - Prob(A*C) -
Prob(B*C) + Prob(A*B*C)

The Prob(A*B*C) terms are themselves complicated to generate.

Any ideas?



On Jan 18, 8:39 am, "Ondrej Certik" <[email protected]> wrote:
> Hi Reckoner,
>
> On Sat, Jan 17, 2009 at 12:51 PM, Reckoner <[email protected]> wrote:
>
> > I know python has a set() object, but I'm wondering if sympy has set
> > algebra built into it (e.g. union, intersection) for symbolic objects.
> > Note that I'm interested in manipulating the sets themselves and not
> > necessarily what's in those sets.
>
> > I hope that made some sense.
>
> As far as I know, you can only use python set() so far (it works well
> with sympy though). Do you have some examples what you'd like to do
> symbolically? Maybe it's easy to implement.
>
> Ondrej
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/sympy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to