# How to get the conditional probabilities from joint probability table?

I have a table of 3 binary variables whose joint probability is given.

a b c p(a,b,c)
0 0 0 0.192
0 0 1 0.144
0 1 0 0.048
0 1 1 0.216
1 0 0 0.192
1 0 1 0.064
1 1 0 0.048
1 1 1 0.096

I see that there is a joint probabilities formula for 3 variable

$$P(a,b,c) = P(c|a,b)P(a,b) = P(c|a,b)P(b|a)P(a)$$

But when I cross-validate it with the table value and the formula it's not exact. What's happening here I am not getting it. It's not the same formula I assume. But how do I get the conditional probabilities from this table? If I can get the form, I can build the DAG.

I can see some patterns like 0.192 and 0.048 is twice even though $$a$$ is changed. Then I thought maybe $$a$$ is independent of $$b$$ and $$c$$?

I also find this formula $$p(θ|X,α)=\frac{p(X|θ)p(θ|α)}{p(X|α)}$$

So, I tried with a=1, b=1, c=1,

$$P(c|a, b) * P(b|a) * P(a) = P(c|a, b) * \frac{P(b \cap a)}{P(a)} * P(a) = \frac{P(c\cap a \cap b)}{P(a\cap b)} * \frac{P(b \cap a)}{P(a)} * P(a) = \frac{1}{8}$$

• None of $a,b,c$ are independent of the others. Can you show use what you got when you tried $P(a,b,c) = P(c\mid a,b)P(a,b) = P(c\mid a,b)P(b\mid a)P(a)$ for some particular value of $a,b,c$? Sep 29, 2022 at 18:26
• The answer to the title question is "apply a definition of conditional probability." For instance, you can compute $P(b\mid a)=P(a\text{ and } b)/P(a)$ and read off the probabilities for any possible values of $(a,b)$ directly from the table.
– whuber
Sep 29, 2022 at 19:25
• @Henry I have added my approach. maybe it's the wrong approach. But the thing I am trying to do is to build that DAG from the formula or vice versa. I am trying to find out how that p(a, b, c) is generated. And also how did you find out none of a, b, or c is independent of each other? I also got the same observation. Just curious about your approach. Sep 29, 2022 at 20:38
• That does not show me your calculations. I would say $\frac23 \times \frac9{25}\times \frac25 = \frac{12}{125}$ not $\frac18$ Sep 30, 2022 at 1:06
• @Henry How did you get these values? Sep 30, 2022 at 5:44

First, It appears that you are mixing up the definition of conditional probability for events and for random variables.

The definition $$P(a,b,c)=P(c|a,b)P(a,b)=P(c|a,b)P(b|a)P(a)$$ is for events.

For random variables, the definition is :

$$P(A = a,B = b,C =c)=P(C = c|A = a,B = b)P(B = b,A = a)$$

where $$a,b,c$$ is the values that the random variables $$A$$, $$B$$, $$C$$ can assume (in this case, $$0$$ or $$1$$).

Now, if you want the conditional probability of $$C$$, given $$A$$ and $$B$$, you must obtain the probability $$P(B = b,A = a)$$.

Here is what you should do:

First, obtain $$P(B = b, A = a)$$ for all possible values of $$a$$ and $$b$$. For example, to obtain $$P(B = 0, A = 1)$$, just sum all probabilities where $$B = 0$$ and $$A = 1$$. Do the same for the other possible values of $$A$$ and $$B$$.

1. Now, you can calculate $$P(C = c|A = a,B = b) = \frac{P(A = a,B = b,C =c)}{P(B = b,A = a)}$$

you can follow the same reasoning for the other conditional probabilities.

A good exercise for learning is to obtain all possible combinations of conditional and unconditional probabilities for all variables.

• The definitions for random variables and events are the same, it's just a matter of notation. People sometimes do use notation shortcuts like using $P(a)$ meaning $P(A=a)$.
– Tim
Jun 8, 2023 at 5:51
• @Tim. Yes, I understand and agree. Maybe you could help me to rewrite the first sentences in a more precise way, I would appreciate it. A side note: In my understanding, the OP was confusing about the events definition, for this reason I introduced the random variables. Another possible approach it would be use the notation $a_0$ and $a_1$ to represent, respectively, the events $\{w \in \Omega: a=0\}$ and $\{w \in \Omega: a=1\}$. But I think this could lead to more confusion. Jun 8, 2023 at 13:11