Find the probability the sum of two dices equal to 4 
A random number $N$ of dices is thrown. Let $A_i$ be the event that $N=i$, and assume $\mathbb{P}(A_i)=2^{-i}$. The sum of the score is $S$. Find the probability that $N=2$ given $S=4$.

To do this problem, I use conditional probability. I have 
$$\begin{align}\mathbb{P}(N=2\vert S=4)&=\frac{\mathbb{P}(\{N=2\}\cap\{S=4\})}{\mathbb{P}(S=4)}\\&=\frac{\mathbb{P}(S=4\vert N=2)\mathbb{P}(N=2)}{\mathbb{P}(S=4)}\end{align}$$
The problem I is I don't know how to calculate $\mathbb{P}(S=4\vert N=2)$. If I draw a probability tree, I start from $N=2$ which has probability $1/4$, then I have elements $(1,3),(3,1),(2,2)$. This is where I get stuck.

To find $\Bbb P(N=2|S=4)$ using the law of total probability we need to find $\Bbb P(N=k\cap S=4)$ for $k=1,2,3,4$. (We need not consider $k>4$ because the sum of five or more dice is always greater than 4.)


*

*$\Bbb P(N=1)=\frac12$ and out of six ways to roll a die only one way results in a 4, so $\Bbb P(N=1\cap S=4)=\frac12×\frac16=\frac1{12}$.

*$\Bbb P(N=2)=\frac14$ and you have already calculated that only three rolls of the 36 possible with two dice sum to 4, so $\Bbb P(N=2\cap S=4)=\frac14×\frac1{12}=\frac1{48}$.

*$\Bbb P(N=3)=\frac18$. Out of $6^3$ possible rolls of three dice, only three (112, 121, 211) sum to 4. $\Bbb P(N=3\cap S=4)=\frac18×\frac3{216}=\frac1{576}$.

*$\Bbb P(N=4)=\frac1{16}$, but only one roll out of $6^4$ sums to 4: 1111. Thus $\Bbb P(N=4\cap S=4)=\frac1{16}×\frac1{1296}=\frac1{20736}$.


The law of total probability then states that
$$\Bbb P(N=2|S=4)=\frac{\frac1{48}}{\frac1{12}+\frac1{48}+\frac1{576}+\frac1{20736}}=\frac{432}{2197}$$
