Derive Probabilities from Bayesian Network I have given the following Bayesian network.

I already know the fundamentals, for example, pairwise dependencies and how to calculate the total joint probability:
$$P(M,B,S,C,H) = P(M)\cdot P(S|M)\cdot P(B|M)\cdot P(C|S,B)\cdot P(H|B)$$
But now I want to calculate $P(M|S,C,H)$. I can easily apply Bayes Theorem to get:
$$P(M|S,C,H) = \frac{P(M,S,C,H)}{P(S,C,H)}$$
But I do not know how to calculate $P(M,S,C,H)$ and $P(S,C,H)$. I tried to solve it and got $P(M|S,C,H) = 0.5$. I strongly doubt that my calculations are correct because from sampling from the network with $1.000.000$ I got a relative frequency of about $0.2$.
EDIT: The sampling was performed incorrectly. It just proved that $P(M=1) = 0.2$. When performed correctly, it can be shown that the correct solution can be approximated with the sampled data from the network.

Your formulae are correct. Furthermore:
$$
\begin{align}
P(M, S, C, H) &= \sum_{B} P(M, B, S, C, H)\\
P(S, C, H) &= \sum_{B, M} P(M, B, S, C, H),
\end{align}
$$
are just the marginalizations. And you already have the formula for $P(M, B, S, C, H)$.
