Daniel,
Thank you for your reply but I think it too is not correct and I' m not sure why. See below for a comparision of the two solution methods. Am I mis-interpreting something here ?
Also, I agree that Eq.(3) is undersimplified. Perhaps the author intentionally left it in that form to help show how this problem can be solved manually (pencil & paper).
equation3 = (r1*r4*r6*r7) + (r1*r3*r6*r7) - (r1*r3*r4*r6*r7) + (r1*r2*r3*r4*
r5*r6*r7) + (r1*r3*r4*r5*r6*r7) - (r1*r2*r3*r4*r5*r6*r7) - (r1*r2*r3*r5*
r6*r7) - (r1*r3*r5*r6*r7) + (r1*r2*r3*r5*r6*r7) - (r1*r2*r4*r5*r6*
r7) - (r1*r3*r4*r5*r6*r7) + (r1*r2*r3*r4*r5*r6*r7) + (r1*r2*r5*r7) + (r1*
r3*r5*r7) - (r1*r2*r3*r5*r7) (* Eq.(3) ReliabilityEdge volume 1, Issue 1 *)
r1 r2 r5 r7 + r1 r3 r5 r7 - r1 r2 r3 r5 r7 + r1 r3 r6 r7 + r1 r4 r6 r7 -
r1 r3 r4 r6 r7 - r1 r3 r5 r6 r7 - r1 r2 r4 r5 r6 r7 + r1 r2 r3 r4 r5 r6 r7
Original Problem
path1 = And[c1, c2, c5, c7];
path2 = And[c1, c3, c5, c7];
path3 = And[c1, c3, c6, c7];
path4 = And[c1, c4, c6, c7];
bexpr = Or[path1, path2, path3, path4]
(c1 && c2 && c5 && c7) || (c1 && c3 && c5 && c7) || (c1 && c3 && c6 &&
c7) || (c1 && c4 && c6 && c7)
Ilian' s Solution (1)
dists = Table[{ToExpression["c" ~~ ToString[i]],
BernoulliDistribution[ToExpression["r" ~~ ToString[i]]]}, {i, 7}]
{{c1, BernoulliDistribution[r1]}, {c2, BernoulliDistribution[r2]}, {c3,
BernoulliDistribution[r3]}, {c4, BernoulliDistribution[r4]}, {c5,
BernoulliDistribution[r5]}, {c6, BernoulliDistribution[r6]}, {c7,
BernoulliDistribution[r7]}}
survivalfunction1 = Expand[PDF[ReliabilityDistribution[bexpr, dists], 1]]
r1 r2 r5 r7 + r1 r3 r5 r7 - r1 r2 r3 r5 r7 + r1 r3 r6 r7 + r1 r4 r6 r7 -
r1 r3 r4 r6 r7 - r1 r3 r5 r6 r7 - r1 r2 r4 r5 r6 r7 + r1 r2 r3 r4 r5 r6 r7
Simplify[survivalfunction1/
equation3] (* This show that the results are equivalent *)
1
Daniel' s Solution (2)
bexpr2 = BooleanConvert[bexpr, "ANF"]
(c1 && c2 && c5 && c7) [Xor] (c1 && c3 && c5 && c7) [Xor] (c1 && c3 && c6 &&
c7) [Xor] (c1 && c4 && c6 && c7) [Xor] (c1 && c2 && c3 && c5 &&
c7) [Xor] (c1 && c3 && c4 && c6 && c7) [Xor] (c1 && c3 && c5 && c6 &&
c7) [Xor] (c1 && c2 && c4 && c5 && c6 && c7) [Xor] (c1 && c2 && c3 &&
c4 && c5 && c6 && c7)
survivalfunction2temp = bexpr2 /. {And -> Times, Xor -> Plus}
c1 c2 c5 c7 + c1 c3 c5 c7 + c1 c2 c3 c5 c7 + c1 c3 c6 c7 + c1 c4 c6 c7 +
c1 c3 c4 c6 c7 + c1 c3 c5 c6 c7 + c1 c2 c4 c5 c6 c7 + c1 c2 c3 c4 c5 c6 c7
survivalfunction2stringtemp = ToString[survivalfunction2temp]
"c1 c2 c5 c7 + c1 c3 c5 c7 + c1 c2 c3 c5 c7 + c1 c3 c6 c7 + c1 c4 c6 c7 + c1
c3 c4 c6 c7 + c1 c3 c5 c6 c7 + c1 c2 c4 c5 c6 c7 + c1 c2 c3 c4 c5 c6 c7"
survivalfunction2string =
StringReplace[survivalfunction2stringtemp, "c" -> "r"]
"r1 r2 r5 r7 + r1 r3 r5 r7 + r1 r2 r3 r5 r7 + r1 r3 r6 r7 + r1 r4 r6 r7 + r1
r3 r4 r6 r7 + r1 r3 r5 r6 r7 + r1 r2 r4 r5 r6 r7 + r1 r2 r3 r4 r5 r6 r7"
survivalfunction2 = ToExpression[survivalfunction2string]
r1 r2 r5 r7 + r1 r3 r5 r7 + r1 r2 r3 r5 r7 + r1 r3 r6 r7 + r1 r4 r6 r7 +
r1 r3 r4 r6 r7 + r1 r3 r5 r6 r7 + r1 r2 r4 r5 r6 r7 + r1 r2 r3 r4 r5 r6 r7
Simplify[survivalfunction2/
equation3](* This show that the results are not equivalent *)
(r4 r6 + r2 (1 + r3) r5 (1 + r4 r6) + r3 (r5 + r6 + r4 r6 + r5 r6))/(
r4 r6 + r2 (-1 + r3) r5 (-1 + r4 r6) + r3 (r5 + r6 - r4 r6 - r5 r6))
Let' s do a quick numerical sanity check.
r1 = r2 = r3 = r4 = r5 = r6 = r7 = 1;
survivalfunction1 (* This is the correct numerical value *)
1
survivalfunction2 (* This is numerically not possible, must be less than or
equal to one *)
9
Upon examination of survivalfunction2 I notice there are no negative signs in the algebra . . . not sure why. Also, I apologize here if everything is not formatted with all proper formatting, I'm still unfamiliar with much at StackExchange.