Given if we know $P(S)$ and $P(C|S)$ and $P(D|S)$, how do you compute $E[C|D=d]$? One way that I thought of is to find the conditional probability of $P(C|D)$ by computing the joint probability $P(C,D,S)$ and marginalizing it over $S$. But, $P(D|S)$ is a binomial distribution with parameter $q$ and $S$. Finding the full joint probability distribution will be too complicated. Does anyone know an easier way to find $E[C|D=d]$? Thanks.
Note: I forgot to mention that C and D are independent given S
You have $$ P(C\cap S)=P(S)P(C|S), P(D\cap S)=P(S)P(D|S) $$ This information is not enough to let you compute $$ P(C\cap D), P(C|D) $$ because you lost information at $$ P(C\cap D\cap S^{c}) $$ and in principle you do not know what this is.