Calculating Conditional Probabilities and the Path where they come from

196 Views Asked by At

I have following Problem: Given is the Bayesian Graph of Picture 1. I want to calculate the probability that the goal is reached, which can be calculated as:

Since State 1 only requires either A or B to be satisfied (XOR) we calculate $P(goal) = P(A \cup B) * P(C) - P(A \cap B)* P(C) = 0.9*0.6 - 0.2*0.6 = 0.54 - 0.12 = 0.42$

Graph

So now we know that we will reach the goal with a probability of 42%. Now i want to calculate the success of reaching the goal for each path.
Meaning, that i want to know how many of these 42% come from A and how many come from B. This can be calculated as:
Path from A : $P(A \cap \neg B) * P(C) = 0.4* 0.5 * 0.6 = 0.12$
Path from B : $P(B \cap \neg A) * P(C) = 0.5 * 0.6 * 0.6 = 0.18$
Path from both: $P(B \cap A) * P(C)= 0.5 * 0.4 * 0.6 = 0.12 $

So we see that 0.12 come from A, 0.18 come from B and 0.12 come from both. Now we assume that the people always decide for the easier Path which means the people coming from both now decide to go over B, which results in 0.12 come from A and 0.30 come from B.

Now let's take a look at a quite more complex graph:

Graph2

First we have to calculate the Probability of reaching State 1 as:

$P(State 1) = P(D \cup E) - P(D \cap E) = 0.345 + 0.08 - 0.345*0.08 = 0.3974$
As a result $P(C) = 0.3974 * 0.08 = 0.0318$

So $P(State 2) = P(B \cup C) - P(B \cap C) = 0.0318 + 0.08 - 0.0318 * 0.08 = 0.109256$

$P(goal) = P(State 2) * P(A) = 0.109256 * 0.68 = 0.07429408$

Now i want to know again how many of these 7,4% come from B and C (= from D and from E). Same approach as before:
Path from B : $P(B \cap \neg C) * P(A) = 0.08 * 0.9682 * 0.68 = 0.05257 $
Path from C : $P(C \cap \neg B) * P(A) = 0.0318 * 0.92 * 0.68 = 0.01989$
Path from both: $P(B \cap C) * P(A)= 0.00173$

So we see that 0.05257 come from B, 0.01989 come from C and 0.00173 come from both. Now again, we assume that the people always decide for the easier Path which means the people coming from both now decide to go over B, which results in 0.01989 come from C and 0.0544 come from B.

Now we want to split the Path from C further into D and E. Therefore we take the same approach: Path from D : $P(D \cap \neg E) * P(C) = 0.345 * 0.92 * 0.08 = 0.025392$
Path from E : $P(E \cap \neg D) * P(C) = 0.08 * 0.655 * 0.08 = 0.004192$
Path from both: $P(D \cap E) * P(C)= 0.08 * 0.345 * 0.08 = 0.002208$

So we see that 0.025392 come from D, 0.004192 come from E and 0.002208 come from both. Now again, we assume that the people always decide for the easier Path which means the people coming from both now decide to go over D, which results in 0.004192 come from E and 0.0276 come from D.

My Problem:
(0.004192 from E) + (0.0276 come from D) = 0.031792 from C but we calculated 0.01989 come from C in the previous step. What am I doing wrong? Am i overseeing something? Should be something super simple, right?

Edit: Found My Mistake - Solution:
I did not consider the probability of reaching the goal but just how successful C actually is.
For calculating the correct path probability, I simply had to multiply my current solutions by 0.68, which is the probability of reaching the goal from C.
So the solution is:
Path from D : $P(D \cap \neg E) * P(C) = 0.345 * 0.92 * 0.08 * 0.68 = 0.025392 0.68 = 0.01726656 $
Path from E : $P(E \cap \neg D) * P(C) = 0.08 * 0.655 * 0.08 * 0.68 = 0.004192 * 0.68 = 0.00285056$
Path from both: $P(D \cap E) * P(C)= 0.08 * 0.345 * 0.08 * 0.68 = 0.002208 *0.68 = 0.00150144$

So we see that 0.01726656 come from D, 0.00285056 come from E and 0.00150144 come from both. Now again, we assume that the people always decide for the easier Path which means the people coming from both now decide to go over D, which results in 0.00285056 come from E and 0.018768 come from D.