Re: Logics and probability
- To: mathgroup at smc.vnet.net
- Subject: [mg78556] Re: Logics and probability
- From: "Dr. Wolfgang Hintze" <weh at snafu.de>
- Date: Wed, 4 Jul 2007 05:34:17 -0400 (EDT)
- References: <f6an5k$i4o$1@smc.vnet.net>
- Reply-to: "Dr. Wolfgang Hintze" <weh at snafu.de>
Thanks for your hints. A few hour later I found this solution by myself P[(A_) || (B_)] := P[LogicalExpand[A]] + P[LogicalExpand[B]] - P[LogicalExpand[A && B]] P[(X_) && (Y_)] := p[X]*P[Y] P[A_] := p[A] Example: weg1 = 1 && 2 weg2 = 3 && 5 && 2 weg3 = 1 && 5 && 4 weg4 = 3 && 4 w = weg1 || weg2 || weg3 || weg4; v = P[w] p[1]*p[2] + p[3]*p[4] - p[1]*p[2]*p[3]*p[4] + p[2]*p[3]*p[5] - p[1]*p[2]*p[3]*p[5] + p[1]*p[4]*p[5] - p[1]*p[2]*p[4]*p[5] - p[1]*p[3]*p[4]*p[5] - p[2]*p[3]*p[4]*p[5] + 2*p[1]*p[2]*p[3]*p[4]*p[5] u = v /. Table[p[i] -> p, {i, 1, 5}] 2*p^2 + 2*p^3 - 5*p^4 + 2*p^5 Regards, Wolfgang "Dr. Wolfgang Hintze" <weh at snafu.de> schrieb im Newsbeitrag news:f6an5k$i4o$1 at smc.vnet.net... > 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 > > >