Trouble understanding sample spaces in Bayes Theorem I wanted to check my understanding of what's going on in the problem below, which employs Bayes' Theorem. 

I would like to understand what's going on with respect to the sample space $\Omega$. It seems like we can only apply rules like Bayes' Theorem when $H$ and $D$ are events "from" the same sample space $\Omega$. But aren't $H$ and $D$ fundamentally different things here, i.e. don't they belong to different sample spaces?
Couldn't one say that we have two sample spaces $\Omega_1$ and $\Omega_2$ where $\Omega_1 = \{D, \bar{D}\}$, i.e. the set containing outcomes test positive and test negative (denoted $\bar{D}$) and $\Omega_2 = \{H, \bar{H}\}$, i.e. the set containing outcomes disease and no disease?
Thus, how are events $H$ and $D$ from the same sample space?
Apologies if this question is overly rudimentary. I'm just so used to applying Bayes' Thereom without fully understanding it. Thanks for taking the time to read my question!
 A: With word problems like this, there are always literally infinitely many ways to formalize the written problem into a precise mathematical statement in terms of a sample space $\Omega$, a set of events, and a probability measure $P$.
The method you ultimately choose to translate a word problem into a mathematical model depends on what you're trying to do.
Here's one possible way, but it is by no means the only way or necessarily the best way.
Let the sample space $\Omega$ be the set of all people who have taken the test.
This is a natural choice because the word problem is considering people who have taken the test.
Each of these people either has the disease or doesn't, and each of this people either has a positive test or not.
With this definition, we have
$$
H = \{\text{person} \in \Omega : \text{person has the disease}\}
$$
and
$$
D = \{\text{person} \in \Omega : \text{person's test is positive}\}.
$$
Then you could proceed as in the example, knowing that $P(H) = 0.002$ (the proportion of the population with the disease), $P(D \mid H^c) = 0.01$ (the false positive rate), and $P(D^c \mid H) = 0.01$ (the false negative rate).
Another possibility is letting $\Omega$ be the set of all people, regardless of whether or not they have taken the test.
This sample space is a superset of the previous sample space.
With this formulation, the event $H$ would be stated identically, but $D$ would have to change to something like
$$
D = \{\text{person} \in \Omega : \text{person's test would be positive if they were to take the test}\}.
$$
This wording is necessary because probably not every person in $\Omega$ has taken the test.
Regardless of the formalization, you would still always end up with $H$ and $D$ being events in a common sample space $\Omega$, and you would always have $P(H) = 0.002$, $P(D \mid H^c) = 0.01$, and $P(D^c \mid H) = 0.01$ because of the specification of the problem.
As you get more familiar with probability, you will see that to approach word problems like this is it not always necessary to construct an explicit sample space.
You will be comfortable knowing that you could do it if you really needed to do it, but for the purpose of solving a problem like in the question, you don't need to know the full specification of the sample space.
A: The whole purpose of the sample space is that it must encompass all possible outcomes in the problem, so that every "event" in the problem is some subset of the sample space.  If the sample space does not do this, then it fails to meet the basic requirements of what it is supposed to do in the context of the problem.
Now, under your approach you posit that you could have two "sample spaces" that each describe a different aspect of the problem.  The proposed sets $\{ D, \bar{D} \}$ and $\{ H, \bar{H} \}$ are not actually sets of outcomes - they are classes of events.  If you want your problem to involve all these events then they would need to be subsets of outcomes on the same set (i.e., you would require $\Omega = D \cap \bar{D} = H \cap \bar{H}$).  You would then define the sigma-field of events induced by the set $\{ D, H \}$, and this would include all combinations of the two events of interest in your problem.
