Let $n$ be a positive integer. For a permutation $a_1, a_2, \dots, a_n$ of the numbers $1, 2, \dots, n$ we define

$$b_k = \min_{1 \leq i \leq k} a_i + \max_{1 \leq j \leq k} a_j$$

We say that the permutation $a_1, a_2, \dots, a_n$ is [i]guadiana[/i] if the sequence $b_1, b_2, \dots, b_n$ does not contain two consecutive equal terms. How many guadiana permutations exist?
**
   - We biject guadiana permutations with \(0-1\) sequences of length \(n-1\).
   - By the same argument as in the first solution, we must have either \(a_k = M_k\) or \(a_k = m_k\) for each \(k \geq 2\). Thus, we can assign to each guadiana permutation the \(0-1\) sequence \(x_1, x_2, \dots, x_{n-1}\) where \(x_i = 1\) if and only if \(a_{i+1} = M_{i+1}\).
   - We now reconstruct a guadiana permutation from its \(0-1\) sequence. Assume that there are exactly \(m\) zeroes in the sequence, so \(a_k = m_k\) for \(k \geq 2\) exactly \(m\) times.
   - Notice that if \(a_k = m_k\), then \(a_k < a_1\), so there exist at least \(m\) values in the permutation that are less than \(a_1\). Similarly, there are at least \(n-1-m\) values in the permutation that are greater than \(1\). This clearly implies that \(a_1 = m+1\).
   - Furthermore, the values less than \(a_1\) must form a decreasing subsequence in the permutation, as \(a_1 > a_i > a_j\) implies \(m_j = a_j < a_i = m_i\), and because \((m_i)\) is clearly a decreasing sequence, this implies \(j > i\). Similarly, the values greater than \(a_1\) must form an increasing subsequence. Because their positions are given by the \(0-1\) string, this allows us to reconstruct the permutation uniquely.
   - So the number of guadiana permutations is equal to the number of \(0-1\) sequences of length \(n-1\), which is clearly \(2^{n-1}\).

The final answer is \(\boxed{2^{n-1}}\)