Artificial intelligent assistant

What is the probability that a randomly selected patient, who was diagnosed positive, in one actually have cancer? Suppose a clinical test was applied to detect cancer. The test has the property that $90\%$ of the cases that suffered cancer they were positive, while $5\%$ of the cases that did not have cancer were diagnosed as positive. Assuming that $1\%$ of patients in a hospital have cancer What is the probability that a randomly selected patient, who was diagnosed positive, in one actually have cancer? My try: I believe that the two events of the total are the people who has cancer($90\%$ positive and 10% negative) and people who doesn't ($95\%$ negative and $5\%$ positive). I Also know that the events of having cancer and the diagnosed are independent. I don't know how to pursue.

Lets consider there were $1000$ people who took the cancer test. Out of which $1$%$ \to 10$ actually had cancer. According to the data - the test was $+ve$ for $90$% of the cancerred patients i.e the test was positive for $9$ and $-ve$ for $1$ who actually had cancer.

Also we know $10$ people had cancer and $990$ didn't so, $5$% of this 990 were detected $+ve$ having cancer i.e $49.5$ were detected $+ve$ and remaining $990-49.5$ were $-ve$.

We have collected the statistics now - we need to find probability of actually cancerred patients given they were diagnosed $+vely$. Let $A$=Patient having Cancer & $B$ = They were diagnosed $+vely \therefore$ $P(A/B) = P(A$$\cap$$B)/P(B)$.

$P(A$$\cap$$B)$ = (Count of people who actually had cancer and were diagnosed $+vely \to 9$)/(Total count $\to 1000$.)

$P(B)$ = (Count who was diagnosed $+vely \to 9+49.5$)/(total count $\to 1000$).

Substituting the values we get $P(A/B) = P(A$$\cap$$B)/P(B)$ = $$9/(9+49.5) = 0.153$$

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy a309cc2ae00163b1be4b4301983e90a4