# Computing a single probability out of a joint probability

Given the joint probability and the factored term:

$$P(S,T,G,F,B) = P(G|B,F) \cdot P(S|T,F) \cdot P(T|B) \cdot P(B) \cdot P(F)$$

I want to compute $P(S = s)$, thus I want to compute

$$\sum_{T,G,F,B} P(S = s, T,G,F,B)$$

Since I want to do the concrete calculation by hand, I would like to eliminate some terms in order to ease the process. Is there anything which could be done? I am thinking of making use of $$\sum_X P(X|Y) = 1$$

-
Are $S,T,G,F,B$ random variables? Then there is no such thing as $P(S,T,G,F,B)$, but perhaps you mean $P(S=s,T=t,G=g,F=f,B=b)$ (assuming these are all discrete). – Robert Israel May 21 '12 at 19:30
@RobertIsrael Exactly, sorry for my sloppy notation. – Mahoni May 21 '12 at 19:32

As per my comment, you are really saying $$P(S=s,T=t,G=g,F=f,B=b) = P(G=g|B=b,F=f)P(S=s|T=t,F=f)P(T=t|B=b)P(B=b)P(F=f)$$ for discrete random variables $S,T,G,F,B$.
Sum both sides over $g$ and this says $$P(S=s,T=t,F=f,B=b) = P(S=s|T=t,F=f)P(T=t|B=b)P(B=b)P(F=f)$$ Now $P(T=t) = \sum_b P(T=t|B=b) P(B=b)$, so calculate this for each $t$. Then summing over $b$, $$P(S=s,T=t,F=f) = P(S=s|T=t,F=f) P(T=t) P(F=f)$$ To calculate $P(S=s)$, you'll have to do a double sum of this over all $t$ and $f$.