[Math] Problem about eight different books randomly put on shelf.

combinatoricsprobabilityproof-verification

The problem sounds like this (My translation from Russian):

Eight different books were put on a shelf in random order. Calculate
probability that two specific books were put near each other.

My answer: Let's divide the space on the shelf into eight slots. Let's also name our two books, "A" and "B" respectively.
We have two sets of combinations – in the first set of combinations we have AB (i.e. A goes first). For example, A is put into the first slot and B is put into the second slot. Next example, A is put into the second slot and B is put into the third slot. And so on. There are 7 such AB combinations in total. By the same logic there are also 7 BA combinations. Obviously there is no overlap between said combinations, thus we can sum them up and get 14 combinations in total where books A and B are put side by side.

As for number of total combinations of books on the bookshelf, it's equal to "n!", where n is equal to 8. Why? Because in order to calculate combinations when repetitions are forbidden and order is important we use this formula:

enter image description here

n means total number of items and r means number of selected items.
But because in our case n=r we get (n-r)!=0!=1. Consequently, the formula is turned into "n!".

This all means that the probability of A and B being beside each other is 14/8!

What my textbook says: My textbook has different opinion. Namely, for some strange reasons it thinks that the probability is (7*2!*6!)/8!

UPDATE:

I understand my mistake now. I forgot that while A and B can stand still in their slots we can get additional combinations by making other books to change their slots. Thus each case with positions of A and B is in fact set of combinations. How many combinations in each set? It's "6!", because we decreased number of total and selected books by ignoring books A and B. We multipy it by 14 and get 6!*14=6!*2*7=6!*2!*7

Now I'm with agreement with my textbook.

Best Answer

The answer is (7!.2!.)/8!

Let me clear, first consider the two book as one, (plus) the other 6 books, so we have 7 books which can put the shelf 7! different ways. Now there are two points the first one the two books now together which we want. The second point is the two books can change their places, it means 2! different ways. So we multiply them. We need divede them all possible ways. The all possible way is 8!

Related Question