# How to solve this question related to conditional probability?

So I am doing a biostats course on Stanford online, and I hit a snag. This is related to conditional probability would love it if anybody could explain the workings behind the process of the first image, which I assume is the basis for the second. The first image:: (sorry couldn't directly post it).

Anyways, here, the BC refers to the prevalence of breast cancer in a population. That probability tree basically means that .003 (.3%) has breast cancer (first event). The next branch is a conditional probability. The false-negative probability is .1 while the false positive rate is .89. I did calculate the two cases where the is a positive result, but couldn't understand the calculation in red. As much as I understand, it is the conditional probability of having breast cancer, given that a person is tested positive, but I cannot figure out how the workings come by (if that part in the red is from a formula, we haven't been taught that). Can anybody explain how that is achieved?

This is the second question in a quiz following the lecture.

I believe this question is based on that concept from the first picture, but I cannot understand it. It'd be great if anyone could clear that up for me. Thanks a lot :)

Quiz question: Let $$X=1$$ if exposed and $$X=0$$ if unexposed. Let $$Y=1$$ if pancreatic cancer and $$Y=0$$ if no cancer. Then:
\begin{align*} P(X=1|Y=1)=&\frac{P(Y=1|X=1)P(X=1)}{P(Y=1)}\\ =&\frac{P(Y=1|X=1)P(X=1)}{P(Y=1|X=1)P(X=1)+P(Y=1|X=0)P(X=0)}\\ &=\frac{0.0004\times 0.15}{0.0004\times 0.15+0.0001\times 0.85}\\ &=0.4138 \end{align*}