Probability Question Possibly Using Counting A parking lot contains $100$ cars that all look quite nice from the outside. However, $K$ of these cars happen to be lemons. The number $K$ is known to lie in the range $\{0,1,\ldots,9\},$ with all values equally likely.
(a) We test drive $20$ distinct cars chosen at random, and to our pleasant surprise, none of them turns out to be a lemon. Given this knowledge, what is the probability that $K=0$?
(b) Repeat part (a) when the $20$ cars are chosen with replacement; that is, at each test drive,  each car is equally likely to be selected,  including those that were selected earlier.
I'm on part a, and I figure that I'm looking for $P(k=0\mid 20\text{ good})$, so I used Bayes Law $(P(20\text{ good}\mid k=0) P(k=0))/P(20\text{ good})$. Where I'm struggling is to find $P(20 \text{ good})$, which should be $\sum_{r=0}^9 P(20 \text{ good}\mid k=r)P(k=r).$ The probability of any $k=r$ is $1/10.$ I feel that $P(20 \text{ good}\mid k=r)$ should be $20/(100-r),$ but that doesn't work. 
I can't even think where to start for part b. Please help.
 A: Set up the hierarchical model:
$$ K \sim \operatorname{DiscreteUniform}(0, \ldots, 9).$$
Given a total of $K$ lemons in the lot, the conditional number of lemons $X$ obtained in a random sample of $m$ cars drawn from a total of $N$ cars without replacement is $$X \mid K \sim \operatorname{Hypergeometric}(N = 100, m = 20, K)$$ with probability mass function $$\Pr[X = x \mid K] = \frac{\binom{K}{x} \binom{N - K}{m - x}}{\binom{N}{m}}.$$
We wish to determine $$\Pr[K = 0 \mid X = 0].$$  By Bayes rule, $$\Pr[K = 0 \mid X = 0] = \frac{\Pr[X = 0 \mid K = 0]\Pr[K = 0]}{\Pr[X = 0]}.$$  We can easily calculate the numerator:  $$\Pr[X = 0 \mid K = 0] = 1, \quad \Pr[K = 0] = \frac{1}{10}.$$  The denominator is a bit more challenging:  by the law of total probability, $$\Pr[X = 0] = \sum_{k=0}^9 \Pr[X = 0 \mid K = k]\Pr[K = k] = \sum_{k=0}^9 \frac{\binom{k}{0} \binom{100 - k}{20 - 0}}{\binom{100}{20}} \cdot \frac{1}{10} = \frac{1}{10 \binom{100}{20}} \sum_{k=0}^9 \binom{100 - k}{20}.$$ Using a computer we get $$\Pr[X = 0] = \frac{350200342}{796388915},$$ and the desired conditional probability is $$\Pr[K = 0 \mid X = 0] = \frac{159277783}{700400684}.$$
I have left the second part of the question as an exercise.
A: $$
\Pr(\text{20 good} \mid k=r) = \frac{\dbinom{100-r}{20}}{\dbinom{100}{20}}
$$
The numerator is the number of ways to choose $20$ cars out of the $100-r$ good cars. The denominator is the number of ways to choose $20$ cars out of $100.$
That's when the $20$ cars are distinct.
On the other hand, if they're chosen independently of each other, then the probability of getting a good car each time is $(100-r)/100.$
Therefore the probability of getting a good one every time is
$$
\Pr(\text{20 good}\mid k=r) = \left( \frac{100-r}{100} \right)^{20}.
$$
