Amy took for a picnic: cherries, nectarines, sandwich, beer, wine, cucumber, milk and cake. He wants to determine the order in which they are consumed. How many possibilities there are, if you know:
1) beer and wine must not be drunk immediately after each other
2) Cucumber and milk should not occur immediately after each other?
What is the best way to solve such problems?
How many ways can we arrange food so that beer and wine will be adjacent in the consumption order? Treat beer+wine as one entity, since they must be consumed one right after the other. Then we have $7$ objects to put into a consumption order (cherries, nectarines, sandwich, beer+wine, cucumber, milk, cake). There are $7!$ ways to do this, given a specific ordering of beer+wine. There are $2$ possible orderings of beer+wine (beer->wine or wine-> beer). So there are $2\cdot 7!$ ways to eat beer and wine right after each other. Similarly, there are $2\cdot 7!$ ways to eat cucumber and milk right after each other!
So if you are only considering each restriction alone, then the number of allowed possibilities is the same for both: $8!-2\cdot7!$. If you want to enforce both restrictions simultaneously, read on!
To find out the number of ways that we can eat beer+wine together OR cucumber+milk together, we can try to add these two counts to get $4\cdot 7!$. But notice that we double-counted the number of ways to eat beer+wine together AND cucumber+milk together! The number of ways to do this is $4\cdot 6!$ (can you see why?). So the real number of ways to eat beer+wine together OR cucumber+milk together is $4(7!-6!)$. Since every other way of eating food has neither beer+wine together nor cucumber+milk together, we know that the number of allowed possibilities is: $$8!-4(7!-6!) = 8!-24\cdot 6!$$