Problem

Source: 2022 Bulgarian Spring Math Competition, Problem 8.4

Tags: combinatorics, Permutations with restrictions



Let $p = (a_{1}, a_{2}, \ldots , a_{12})$ be a permutation of $1, 2, \ldots, 12$. We will denote \[S_{p} = |a_{1}-a_{2}|+|a_{2}-a_{3}|+\ldots+|a_{11}-a_{12}|\]We'll call $p$ $\textit{optimistic}$ if $a_{i} > \min(a_{i-1}, a_{i+1})$ $\forall i = 2, \ldots, 11$. $a)$ What is the maximum possible value of $S_{p}$. How many permutations $p$ achieve this maximum?$\newline$ $b)$ What is the number of $\textit{optimistic}$ permtations $p$? $c)$ What is the maximum possible value of $S_{p}$ for an $\textit{optimistic}$ $p$? How many $\textit{optimistic}$ permutations $p$ achieve this maximum?