Problem:
Five people of heights , and inches stand facing forwards in a line. How many orders are there for them to line up, if no person can stand immediately before or after someone who is exactly inch taller or exactly inch shorter than himself?
Problem:
Five people of heights , and inches stand facing forwards in a line. How many orders are there for them to line up, if no person can stand immediately before or after someone who is exactly inch taller or exactly inch shorter than himself?
Solution:
Answer:
Let the people be so that their heights are in that order, with the tallest and the shortest. We will do casework based on the position of .
- Case 1: is in the middle. Then, must be on one of the two ends, for two choices. This leaves only one choice for —the other end. Then, we know the positions of and since cannot neighbor and cannot neighbor . So we have options for this case.
- Case 2: is in the second or fourth spot. Then, we have two choices for the position of . Without loss of generality, let be in the second spot. Then, the first and third spots must be and , giving us two options. This fixes the positions of and , so we have a total of options for this case.
- Case 3: is in the first or last spot. Then, we have two choices for the position of . Without loss of generality, let it be in the first spot. Either or is in the second spot, giving us two choices. Without loss of generality, let it be . Then, if is in the third spot, the positions of and are fixed. If is in third spot, the positions of and are fixed, so we have a total of options for this case.
Hence, we have a total of possibilities.