Finding probability of books I'm trying to find the probability of books in certain situations.
Suppose you have $40$ different books ($20$ math books, $15$ history books, and $5$ geography books).
a) You pick two books at random, one at a time. What is the probability that the two books are from different disciplines?
I think I was able to get the answer for the first part:
$$1-\frac{20⋅19+15⋅14+5⋅4}{40⋅39}.$$
b) You pick $5$ books at random, with replacement, one at a time. What is the probability that you’ve picked books from at most two disciplines?
I am not sure to find the probability for this. How to set it up?

There are $40^5$ equally likely sequences of $5$ books. We find the number of good sequences, that is, sequences that have at most two disciplines. We will use the Principle of Inclusion/Exclusion. 
There are $35^5$ good sequences that contain math and/or history, $25^5$ that contain math and/or history, and $20^5$ that contain history and/or geography. 
If we add these three numbers together, we will have double-counted the math-only sequences, also the history-only, also the geography-only.
Thus the number of good sequences is $35^5+25^5+20^5-20^5-15^5-5^5$. Divide by $40^5$. To make the arithmetic easy, note that each term is divisible by $5^5$. 
