How to solve COVID test validity using the Bayes theorem? The following information is given:
The COVID tests are $70\%$ sensitive, i.e., ${\Bbb P} ( \text{Positive} \mid \text{COVID} ) = 0.7$ and $98\%$ specific, i.e. Pr(negative|no Covid)=0.98. We need to solve the probability of having covid when the test result is covid given that a)P(Covid)=0.5 b) P(Covid)=0.05.
Can someone help me with making the joint probability distribution table and explain how they got it?
The work I've done so far is:
P(Covid|Positive) = P(Covid) x P(Positive|Covid) / P(Positive)
P(Covid|Positive) = 0.5 x (0.7) / (0.7 + 0.02)
I know the marginal probability is wrong but I don't think I understood the question fully. So having a table would help me understand it better.
Thanks in advance.
 A: Your work so far looks good, but you're making a mistake in the denominator where you need to compute P(positive). I get:
$$\begin{align}
P(\text{positive}) &= P(\text{positive | Covid}) P(\text{Covid}) + P(\text{positive | no Covid})P(\text{no Covid}) \\
&= (0.7) (0.5) + (0.02) (0.5) \\
&= 0.36.
\end{align}$$
where the first line uses the Law of Total Probability. Another way to think about that line is: $P(\text{positive}) = P(\text{positive AND Covid}) + P(\text{positive AND no Covid})$.
Plugging that into your calculation, I get
$$\begin{align}
P(\text{Covid | positive}) &= \frac{P(\text{positive | Covid}) P(\text{Covid})}{P(\text{positive})} \\
&= \frac{(0.7)(0.5)}{0.36} \\
&= 0.97222
\end{align}$$
so in this scenario, $P(\text{Covid | positive})$ is very high! (Of course, things will look very different in the second scenario where you assume $P(\text{Covid}) = 0.05$...)

You asked about how to compute a joint probability distribution table. To do that, you should compute probabilities of combinations like this: $$P(\text{Covid AND negative}) = P(\text{negative | Covid}) P(\text{Covid}) = (0.3)(0.5)=0.15.$$
Then you could repeat that computation for other combinations of outcomes to build a full $2 \times 2$ table of probabilities.
A: It is often worth producing a table like this where for example $0.35=0.7\times 0.5$, i.e. you expect $35\%$ of people to have Covid and test positive for it. The rest is also simple multiplication (e.g. $0.49=0.98 \times 0.5$), subtraction ($0.01=0.50-0.49$) or addition ($0.36=0.35+0.01$), and the numbers all add up to $1$ as a check.
            Covid       No Covid    
positive    0.35        0.01        0.36
negative    0.15        0.49        0.64
            0.50        0.50        1.00    

and from the top row of positive tests, the conditional probability is $P(\text{Covid} \mid \text{Positive}) = \frac{0.35}{0.36} \approx 0.97$.
In the other case the table becomes
            Covid       No Covid    
positive    0.035       0.019       0.054
negative    0.015       0.931       0.946
            0.050       0.950       1.000   

and the conditional probability $P(\text{Covid} \mid \text{Positive}) = \frac{0.035}{0.054} \approx 0.65$.
