Question to calculating probability The question:
79% of the drivers in a city always fasten their seatbelt when driving, and everyday some drivers receive a ticket(for various reasons...). If a driver has fastened their seatbelt there is a chance of 7% that the driver receives a ticket. If a driver does not fasten their seatbelt there is a 22% chance that he will receive a ticket. 
If a driver receives a ticket what is the probability that he had fastened his seatbelt?
My assumption is that 7/29 of the people who receive a ticket had fastened their seatbelt and 22/29 did not. So I just calculated (7/29) * (0,79) + (22/29) * (0,21) and I got 0.35 but that seems to be wrong.
 A: You can't assume $\frac{7}{29}$ of people who receive a ticket fastened their seatbelt. Consider an extreme case, where the percentage of people who fasten their seatbelt is much higher than $79\%$ -- suppose it is $100\%$. Then clearly $100\%$ of people who receive a ticket fastened their seatbelt. If $0\%$ of people fasten their seatbelt, then $0\%$ who receive a ticket fastened their seatbelt. If the percentage who fasten is somewhere in between -- e.g., $79\%$ -- then the percentage who fastened given that they received a ticket is somewhere in between, but we can't just say it's $\frac{7}{29}$.
Are you familiar with Bayes' Theorem? That's probably the best way to approach this problem.
A: Let $S$ and $T$ be the events "seatbelt fasten" and "receive ticket" respectively.


*

*$P(S) = 0.79$

*$P(T \mid S) = 0.07$

*$P(T \mid S^C) = 0.22$


Use Bayes' formula to find $P(S \mid T)$.
\begin{align}
P(S \mid T) &= \frac{P(S \cap T)}{P(T)} \\
&= \frac{P(T \mid S) P(S)}{P(T \mid S) P(S)+P(T \mid S^C) P(S^C)} \\
&= \frac{0.07 \cdot 0.79}{0.07 \cdot 0.79 + 0.22 \cdot (1 - 0.79)} \\
&= \frac{79}{145}
\end{align}
If a driver receives a ticket what is the probability that he had fastened his seatbelt is $79/145$.
