Question 1191664
<font color=black size=3>
Let's consider a related problem: we have 3 books labeled S, M and L (for small medium and large) and we want to arrange them.


There are 3! = 3*2*1 = 6 ways to do this
If small goes first
SML
SLM
Or if medium goes first
MSL
MLS
Or if large goes first
LSM
LMS


Once we have a particular permutation of L,M,S set up, we'll then consider the sub-permutations for each block. 
The L block consists of 7 different large books we'll arrange together. There are 7! = 7*6*5*4*3*2*1 = 5040 ways to arrange just the large books.


For the M block, we have 5! = 5*4*3*2*1 = 120 ways to arrange those medium sized books.


The S block has 3! = 3*2*1 = 6 ways to arrange those books.


To summarize:<ul><li>There are 6 ways to arrange S, M, and L</li><li>There are 5040 ways to arrange the large books</li><li>There are 120 ways to arrange the medium sized books</li><li>There are 6 ways to arrange the small books</li></ul>We'll multiply these items out. Why multiplication? Well consider forming a table with 6 rows and 5040 columns (of course this is just a thought exercise and not something you actually have to draw out). There would be 6*5040 different inner cells to represent the number of permutations when considering just the first two items of the bullet list above. This is then extended to account for all the items above.


So we have 6*5040*120*6 = <font color=red>21,772,800</font> different ways to arrange the books such that the sizes stick together, and that order matters.


Answer: <font color=red>21,772,800</font>
This is a little under 21.8 million
</font>