# Compute probability from joint/conditional probability

I am referring to this question: Computing conditional probability out of joint probability

I have seen there how to derive the general case of subset of a joint distribution (so to speak). I am not 100% sure if I can apply this to my case though.

I am given a table of probability values for $\mathbb{P}((y_1,y_2,y_3) \mid x)$ where $y_i \in {0,1} that defines the full probability distribution, given a x (vector of unknown values). Now I am supposed to derive$\mathbb{P}(y_i = 0 \mid x)\$. Can I apply the standard rules (as in the link above)? Is the following expression correct?

$$\mathbb{P}(y_1 = 0 \mid x) = \sum\limits_{i=0}^1 \sum\limits_{j=0}^1 \mathbb{P}(y_1 = 0, y_2=i, y_3=j \mid x)$$

$$\Bbb P(y_1=0) = \sum_{j\in\{0,1\}}\sum_{k\in\{0,1\}}\Bbb P(y_1=0, y_2=j, y_3=k)$$
$$\Bbb P(y_1=0\mid \vec x) = \sum_{j\in\{0,1\}}\sum_{k\in\{0,1\}}\Bbb P(y_1=0, y_2=j, y_3=k\mid \vec x)$$