Introduction
Prosecutor's Fallacy is a fallacy or an error in statistical reasoning. It uncovers a loophole in the logical way of our thinking. It's a confusion between the two conditional probabilities  Probability of A given B and the probability of B given A. So let's understand this Prosecutor's Fallacy.
About Prosecutor's Fallacy
A crime is committed. The city where the crime is committed has a population of say 500000. DNA from the crime scene is discovered. This DNA leads to, say, ten suspects. One of them is brought to trial. Now we need to know whether they are innocent?
Therefore, now we need to solve the case, and for that, we need the followings:
 I  the event that the defendant is innocent.
 Ic  the event that the defendant is guilty.
 Ev  The event that the defendant matches the information collected at the crime scene.
The conditional probabilities are:
 P(EvI)  the probability that an innocent person matches the evidence.
 P(IEv)  the probability that the person who matches the description is innocent.
The argument made by the Prosecutor:
Any innocent random person will have a 1 in 100000 chance of matching the evidence. Thus, if a person has damning evidence, they must be guilty.
Thus, he has committed the Prosecutor's Fallacy by making the above statement.
Mathematically speaking,
P(EvI) : 1/100000
P(IEv) = P(EvI) = 1/100000
The above probability is incorrect, so we can't conclude that the person is guilty and must be punished. Therefore, we now need to calculate the correct value of P(IEv).
The solution to calculate the actual value of P(IEv) is to use Baye's Theorem.
P(IEv) = P(EvI) * P(I)/P(Ev).
Let's calculate the probability of P(IEv).
Assumptions to be made:
 The guilty person needs to be among the 500000 adults living in the area.
 That guilty person should match the evidence as well.
The probability that the person is innocent:
P(I) : 499,999 / 500000 = 0.999998
The probability that the person is not innocent:
P(Ic) : 1 / 500000 = 0.000002
The probability that the person who is guilty matches with the damning evidence:
P(EvIc) : 1 (100%)
Now using Bayeâ€™s Theorem

P(Ev) = P(EvI)*P(I) + P(EvIc)*P(Ic)
 =0.00001*0.999998 + 1*0.000002
 =0.000012

P(IEv) = P(EvI) * P(I)/P(Ev)
 =0.00001 * 0.999998/0.00012
 P(IcEv) = 1 â€“ P(IEv) = 0.16667
Thus we can see that there is â…™ chance that a person matching the damning evidence is guilty and â…š chance of them being innocent.
Thus there is a high chance that the person, despite matching the damning evidence, is innocent.