# A shelf has $6$ Math books and $4$ Physics books. What is the probability that $3$ math books are always together?

All outcomes are equally likely.

My first thought: $P$=$6\choose 3 $$3!8!/10!. But I am obviously over counting as Probablity P> 1. • Use inclusion/exclusion principle in order to count the number of desired arrangements, then divide the result by the total number of arrangements. Jan 23, 2017 at 19:44 • But in general, I believe that it is a rather difficult problem, because 6 math books can form 2 separate groups of 3. I'd "call" for the help of either one of: lulu, true blue anil, N. F. Taussig, drhab (there are a few more, but I don't have them in memory at the moment). Jan 23, 2017 at 20:28 • We need to subtract the number of the cases for which there are 2 ajacent sets of 3 Math books i.e. 5\choose 2$$3!3!5!$. Is there something else? Because this number is way too small. Jan 23, 2017 at 21:08
• What do you mean by "always"? How often are the books rearranged?
– bof
Jan 24, 2017 at 0:44

The question is a bit vague, I take it that at least $3$ Math books must be together. We shall solve it using the complement.

Imagine the $4$ Physics to be dividers with $5$ spaces where Math books can be placed:

$- P - P - P - P -$

Using stars and bars with inclusion-exclusion to ensure that $<3$ books are in any space,

number of patterns = $\binom{10}{4} - \binom51\binom74 +\binom52\binom44 = 45$

Thus total "bad" permutations = $45\cdot6!4!$

and $Pr = 1 - \dfrac{45\cdot6!4!}{10!} = \dfrac{11}{14}$

Altenative count of number of patterns

If you don't want to get into stars and bars and PIE, here is a basic way:

$2 | 2 | 2 | 0 | 0 : \frac{5!}{3!2!} = 10$

$2 | 2 | 1 | 1 | 0 : \frac{5!}{2!2!} = 30$

$2 | 1 | 1 | 1 | 1 : \frac {5!}{4!} = 5, \;so\; 45$ total patterns

(I'm assuming that you care about the order the books are placed it, Ie switching two books around gives a different configuration). As always, these things are about making sure we count in the right way. The number of possible configuration is determined by where we place the 6 math books. Each book gets a position from 1 to 10. So a configuration is the same as a 6-tuple of numbers between 1 and 10 with different entries, yielding $\frac{10!}{4!}$ configurations. If we wish for 3 math books to be in consecutive spots, we can assume we actually went ahead picked three books and put those in spots of the form $i,i+1,i+2$ for some $i$ ranging from 1 to 7, meaning that the remaining 3 books can be assigned a spot from one of 7 vacancies, yielding $\frac{7!}{4!}$ (Im assuming having more than three books side by side is ok. For each choice of 3 out of 6 books (there's $\binom{3}{6}$ of those) and each choice of $i$ (there's 7 choices of $i$) we thus have $\frac{7!}{4!}$ configurations. so that the number of valid configurations becomes $7\cdot \binom{3}{6}\cdot \frac{7!}{4!}$. The answer is now $\frac{7\binom{3}{6}\frac{7!}{4!}}{\frac{10!}{4!}}$

• You're right, there was a typo in the last sentence. I fixed it Jan 24, 2017 at 14:52

[M M M][M][P][M][P][P][P][M]

Possible arrangements of 3-M = 3!

Possible arrangements of all books with the 3-M counted as 1 = 8!

Possible arrangements of all books = 10!

P = 3!8!/10! = 1/15