This is a classical problem of conditional probabilities.
Let's name the events...
$F$: device is faulty
$\overset{-}{F}$: device is not faulty
$D$: device is shown by the test to be faulty
$\overset{-}{D}$: device is shown by the test not to be faulty
notice that events $F$, $\overset{-}{F}$ and $D$, $\overset{-}{D}$ are complementary. Therefore...
$P(F)+P(\overset{-}{F})=1$
$P(D)+P(\overset{-}{D})=1$
What we know?
$P(F)=\frac{8}{1000}$
$P(D|F)=\frac{98}{100}$
$P(D|\overset{-}{F})=\frac{5}{100}$
Also...
$P(\overset{-}{F})=1-P(F)=1-\frac{8}{1000}=\frac{992}{1000}$
To solve the problem will need to calculate the probabilities of events $D$ and $\overset{-}{D}$.
$P(D)=P(D∩F)+P(D∩\overset{-}{F})=P(F)\times P(D|F)+P(\overset{-}{F})\times P(D|\overset{-}{F})$
$=\frac{8}{1000}\times \frac{98}{100}+\frac{992}{1000}\times \frac{5}{100}=\frac{5744}{10^5}$
$P(\overset{-}{D})=1-P(D)=1-\frac{5744}{10^5}=\frac{94256}{10^5}$
The questions...
(a)
The chance that a device which is shown by the test to be faulty, is in fact faulty
$=P(F|D)=\frac{P(F∩D)}{P(D)}=\frac{P(D|F)\times P(F)}{P(D)}=\frac{\frac{98}{100}\times \frac{8}{1000}}{\frac{5744}{10^5}}=\frac{98\times8}{5744}=\frac{784}{5744}\approx13.65\%$
(b)
the chance that a device which is shown by the test not to be faulty, is in fact faulty
$=P(F|\overset{-}{D})=\frac{P(F∩\overset{-}{D})}{P(\overset{-}{D})}=\frac{P(\overset{-}{D}|F)\times P(F)}{P(\overset{-}{D})}=\frac{(1-P(D|F))\times P(F)}{P(\overset{-}{D})}\\
=\frac{(1-\frac{98}{100})\times \frac{8}{1000}}{\frac{94256}{10^5}}=\frac{\frac{2}{100}\times \frac{8}{1000}}{\frac{94256}{10^5}}=\frac{16}{94256}\approx0.017\%$
In a batch of 1,000,000 devices, how many faulty devices can be expected to pass through this screening test?
This is the probability a device is faulty and the device passes the test multiplied by 1,000,000
$P(F∩\overset{-}{D})\times10^6=P(\overset{-}{D}|F)\times P(F)\times10^6=(1-P(D|F))\times P(F)\times10^6$
$=(1-\frac{98}{100})\times\frac{8}{1000}\times10^6=\frac{2}{100}\times\frac{8}{1000}\times10^6=16\times10=160$