In how many different ways can 7 people sit in a row on a bench if two particular people, A and B, must sit next to each other?
Call the 7 seats (from left to right) seats 1, 2, 3, 4, 5, 6, 7.
A can sit in any of seats 1 through 6 with B sitting to his right. (Six different places.The other 5 persons have 5x4x3x2x1 different ways to arrange themselves for each of the six different places, for a total of 6x5x4x3x2x1 ways.)
Also, A can sit in any of seats 2 through 7 with B sitting to his left. (Six different places. Like the above, the other 5 persons have 5x4x3x2x1 different ways to arrange themselves for a total of 6x5x4x3x2x1 ways.)
This gives a total of 2 x 6x5x4x3x2x1 ways.