Regarding assumptions in typical Bayes' theorem problems This is not a question about how to understand Bayes' theorem. I have read textbooks and materials carefully and I think I understand it well. This is a question about the assumptions used in typical Bayes' theorem problems.
For example, the diagnostic test problem is a typical Bayes' theorem problem, which usually goes like this:
"A patient gets tested for a disease which afflicts 1% of population. The test is advertised as 95% accurate (meaning: P(T|D) = 0.95 and P(Tc|Dc) = 0.95, where T is test result is positive and D is the patient has the disease). Please calculate P(D|T)."
From what I read it seems that the problem is not just an exercise for students, instead it is from real cases. That's what I don't understand. My question is if we can gather past data to get P(T|D), why can't we just gather past data to get P(D|T) directly?
 A: 
My question is if we can gather past data to get P(T|D), why can't we just gather past data to get P(D|T) directly?

In short
By not evaluating P(D|T) directly you make the experiments easier as you can vary the groups of D and Dc on which you perform the testing and gather the data. These groups do not need to be in the ratio 1:99
Easy experiment
The value of P(T|D) is often computed against some golden standard. For instance, you have some group of people with known D or Dc and you tabulate them
       D    Dc
T    950    50  1000        
Tc    50   950  1000
    1000  1000  2000

In this particular test we used data from, say, several hospitals which together have 1000 patients and they were compared with a group of 1000 healthy people.
So this is a simple way to determine P(T|D) and P(T|Dc).
Complex experiment
If you would like to determine P(D|T) directly then you would need to select patients and sick people in a ratio equal to the prevalance. So you could sample something like this:
     D      Dc
T   19      99    118        
Tc   1    1881   1882
    20    1980   2000

Then conclude that P(D|T) = 19/118 ≈ 0.16
But for such an experiment you will have only very few cases of D. So we better do the easier experiment for which the P(T|D) is more accurately determined.
Wrap up
You need a number of cases T given D in order to make good estimates. For this you need a sufficiently large group of D. But we would need 99 times more of the group Dc which would be a lot. Luckily we do not need to have so many Dc because we do not need to evaluate P(D|T) directly, as we have Bayes rule.
