Given a sequence of numbers, its head length is the largest integer m for which the first m terms are nondecreasing. For instance, the head length of [1, 1, 2, 4, 3] is 4. Thus, we can compute the average head length for any set of sequences. For example, we can evaluate the head lengths for all six permutations of the sequence [1, 2, 3]:
Let n be a positive integer.
- [2, 1, 3], [3, 1, 2], and [3, 2, 1] each have head length 1,
- [1, 3, 2] and [2, 3, 1] have head length 2, and
- [1, 2, 3] has head length 3.
Let n be a positive integer.
- Consider all the permutations of [1, 2, …, n].
- What fraction of them has head length 1?
- What fraction of them has head length k, for k < n?
- What is the average head length of a permutation of [1, 2, …, n]?
- What is the average head length of a permutation of [1, 1, 2, 3, …, n]?
- What is the average head length of a sequence of length n consisting of the numbers {1, 2, 3, 4}?