Stumped - How would I solve this probability question? This question was merely a fun online math problem to see how many people could solve it, but I haven't been able to since last week and it's beginning to drive me nuts. The question:
A man has $7$ math books, $4$ history books and $5$ fiction books. What are the number of ways he can arrange $3$ math books, $2$ history books and $3$ fiction books on a shelf?
Now initially, I looked at the problem thinking "this can't be that hard, the shelf can only contain $3$ math, $2$ history and $3$ fiction books right? I calculated the number of possible ways he could arrange those $8$ books on the shelf then realized it was a little more complicated than that.. Each book is different, so from the $7$ math books there's all the possible ways he could arrange those alone, then the ways he could arrange the $2$ of $4$ history books and the $3$ of $5$ fiction books..
So using the $nCr$ formula for combinations, I came up with:
\begin{align*}
7C3 & = 35\\  
4C2 & = 6\\  
5C3 & = 10  
\end{align*}
Then this is where I got stumped. Am I supposed to multiply them all together to get $2,100$ total combinations? (It told me this was incorrect) or do I start calculating further possibilities IE from the $35$ possible math book combinations, I can only have $3$ etc?
I did some other crazy calculations that made absolutely no sense so I probably won't share those. It's been a while since I've done any sort of probability so if someone could explain to me how this problem is solved I would greatly appreciate it!
 A: By saying we are "arranging" the books on a shelf, the order usually matters. So my calculations assume that the order of the books matters.
To do this, first we choose the math books, which can be done in ${7 \choose 3}$ ways. Then we choose the history books, which can be done in ${4 \choose 2}$ ways. Then we choose the fiction books, which can be done in ${5 \choose 3}$ ways.
Then we arrange the order of the $8$ books we chose. This can be done in $8!$ ways.
The number of each of those choices is independent of the other choices, so the total count is the product of all those counts. Therefore our total count is
$${7 \choose 3}\cdot {4 \choose 2}\cdot {5 \choose 3}\cdot 8!$$
$$=35\cdot 6\cdot 10\cdot 40320$$
$$=84,672,000$$
This seems like a large number, but remember that this is small compared to the number of ways of arranging all $16$ books on that shelf, namely
$$16!=20,922,789,888,000$$
A: The number of ways to choose the books is given by
$$ {7 \choose 3}   {4 \choose 2}  {5 \choose 3} $$
The way to arrange $8$ books in a row is given by ( assuming all the math/etc books are different)
$$8!$$
Thus the number of possible out comes is given by
$$  8 !\left( {7 \choose 3}   {4 \choose 2}  {5 \choose 3} \right ) $$
Where we read the ``choose" notation as
$$ { n \choose k }= \frac{ n!}{k! (n-k)!}$$
A: Hint: First compute how many possibilities you have of choosing 3 math books out of 7, 2 history books out of 4 and 3 fiction books out of 5. Now multiply by the number of ways you can place 8 books on a shelf. 
