There are $10$ girls in a class, all with different heights. They want to form a queue so that no girl stands directly between two girls shorter than her. How many ways are there to form the queue?
Problem
Source:
Tags: combinatorics
20.09.2021 23:51
Note that if we have adjacent girls $i, j$ with heights $h_i < h_j$, then the girl to the right of $j$ should be taller than her, and so on. Similarly if we have $h_i > h_j$, then the girl to the left of $i$ should be taller than her, and so on. Consider the placement of the shortest girl $s$. By definition, girls adjacent to $s$ must be taller than her, hence all of the girls to the right of $s$ are in ascending order and all the girls to the left in descending order. If there are $k$ girls to the right of $s$, we have ${9 \choose k}$ possible combinations of those girls. They will be sorted in ascending order, and the rest of the girls in descending order to the left of $s$. $$\sum_{k = 0}^9{9 \choose k} = 2^9 = \boxed{512}$$
21.09.2021 08:58
Let $1, 2, 3, 4, 5 \dots 10$ be each girl and their heights corresponding. Then the person of "length" 10 must be first or last otherwise she would be between two shorter ones. There are two ways to do so (1st and 10th position). Thereafter, we recurse back to the same problem in which there are 9 girls $1, 2, 3, \dots 9$. So on and so forth, each step producing two ways. Hence, there are $2^9$ ways. Yay! I got the same answer as @polarity.