AEight 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: