Let $E_1$ be the event that the person follows yoga and medication, $E_2$ be the event that the person took prescription drugs. Let E be the event that the person has a heart attack. We need to find the probability that the person followed yoga and medication given certain conditions.
$E_1$ and $E_2,$ are a set of mutually exclusive and exhaustive events, so we can use Bayes Theorem to caclulate the conditional probability $P\left(\large \frac{E_i}{E}\right ) = \Large \frac{P\left(\frac{E}{E_i}\right ). P(E_i)} {\sum_{i=1}^{n} (P\left(\frac{E}{E_i}\right ).P(E_i))}$
Let us first caculate $P \large(\frac{E}{E_i})$:
$P \large(\frac{E}{E_1}) =$ 40% (1 - 30%) = 28% = $\large\frac{28}{100}$
$P \large(\frac{E}{E_2}) =$ 40% (1 - 25%) = 30% = $\large\frac{30}{100}$
Also, $ P (E_1) = P (E_2) = \large\frac{1}{2}$
P (probability that the person who had heart attach followed meditation and yoga) = $P\left(\large \frac{E_1}{E}\right )$
$P\left(\large \frac{E_2}{E}\right ) = \Large \frac{P\left(\frac{E}{E_2}\right ). P(E_2)} {\sum_{i=1}^{4} (P\left(\frac{E}{E_i}\right ).P(E_i))}$,
\(=\large\;\frac{\frac{28}{100}\;\times\;\frac{1}{2}}{\large\frac{28}{100}\;\times\;\frac{1}{2}\;+\;\frac{30}{100}\;\times\;\frac{1}{2}}\)
$= \large\frac{\frac{28}{200}}{\frac{28}{200}+\frac{30}{200}} = \frac{28}{28+30} = \frac{14}{29}$