Re: Logics and probability
- To: mathgroup at smc.vnet.net
- Subject: [mg78535] Re: Logics and probability
- From: dh <dh at metrohm.ch>
- Date: Tue, 3 Jul 2007 06:50:57 -0400 (EDT)
- References: <f6an5k$i4o$1@smc.vnet.net>
Hi Wolfgang, here is an "Ansatz" based on rules. I have not tested it thoroughly. I use prefix form and write "U" as un[] and "/\" as int[]. Here are the rules: P[un[a_ , b__]]:=P[a]+P[un[b]]-P[int[a,un[b]]]; P[int[a_ , b__]]:=P[a] P[int[b]]; P[int[a_]]:=P[a]; P[un[a_]]:=P[a]; if you now write: P[un[A,B]] you get: P[A]+P[B]-P[A] P[B] what is correct. Your second example: P[un[int[AB, BD] ,int[AB,BC,CB] , int[AC,BC,BD] ,int[AC,CD]]] gives: P[AB] P[BD]+P[AC] P[BC] P[BD]+P[AB] P[BC] P[CB]+P[AC] P[CD]-P[AC]^2 P[BC] P[BD] P[CD]-P[AB] P[BC] P[CB] (P[AC] P[BC] P[BD]+P[AC] P[CD]-P[AC]^2 P[BC] P[BD] P[CD])-P[AB] P[BD] (P[AC] P[BC] P[BD]+P[AB] P[BC] P[CB]+P[AC] P[CD]-P[AC]^2 P[BC] P[BD] P[CD]-P[AB] P[BC] P[CB] (P[AC] P[BC] P[BD]+P[AC] P[CD]-P[AC]^2 P[BC] P[BD] P[CD])) One would have to test the correctness of the rules and then rewrite them in infix form to make the calculus look it better. hope this helps, Daniel Dr. Wolfgang Hintze wrote: > Hello, > > this is really a very elementary question. > How can I treat the logics and numerics of probabilities? > > For example consider two events A and B. > > The probability of the event (A U B) is then > > w1 = P(A U B) = P(A) + P(B) - P(A/\B) > > Now let P(A) = P(B) = p and P(A/\B) = p^2 then > > w1 = p(2-p). > > When we have to deal with more complicated expressions like > > w2 = P((AB/\BD) U (AB/\BC/\CB) U (AC/\BC/\BD) U (AC/\CD)) > > where there are five events AB, BD, BC, CD, AC. > > How can Mathematica calculate the probability for me? > Some kind of "ProbabilityExpand" should reduce the expression > to a sum of probablities of pure AND-events (LogicExpand is not > appropriate). > > Thanks in advance > Wolfgang > > >