I'm reading "Everybody Lies" by Stephens-Davidowitz now and there's a short passage I'm struggling with proving.
Here is a simple thought experiment. Suppose that here are 1,000,000 people in a city and 1 mosque. Suppose, if someone does not search for "kill Muslims," there is only a 1 in 100,000,000 chance that he will attack a mosque. Suppose if someone does search for "kill Muslims," this chance rises sharply, to 1 in 10,000. Suppose Islamophobia has skyrocketed and searches for "kill Muslims" have risen from 100 to 1000. In this situation, math shows that the chances of a mosque being attacked has risen about fivefold, from about 2 percent to 10 percent. But the chances of an individual who search for "kill Muslims" actually attacking a mosque remains only 1 in 10,000.
So I get that we have:
$$P(attack | \neg search) = \frac{1}{1,000,000,000}$$ $$P(attack | search) = \frac{1}{10,000}$$
and we're looking for
$$P(attack)$$
and
$$P(search | attack)$$
How do we get there though?
Although $P(\text{attack}|\text{search})$ may be the same, we see more attacks because there are more searches.
To get your results you use Bayes' theorem which says $$P(\text{search}|\text{attack})=\frac{P(\text{attack}|\text{search})P(\text{search})}{P(\text{attack})}=\frac{P(\text{attack}|\text{search})P(\text{search})}{P(\text{attack}|\text{search})P(\text{search})+P(\text{attack}|\neg\text{search})P(\neg\text{search})}$$