In a line up of 10 soldiers, what is the maximum number of soldiers that can be picked in order of either ascending or descending heights? In a line up of 10 soldiers, what is the maximum number of soldiers that can be picked in order of either ascending or descending heights? Assume that no two soldiers have the same height. Soldiers can be picked from anywhere in the line, but their order of standing cannot be changed.
In other words, we want to find the maximum number k such that, for any permutation of 10 elements, we can always either find an increasing subsequence of length k, or a decreasing subsequence of length k.
 A: This is not an answer, but may help others finding one
Assuming you meant the maximum number of soldiers, since this is the intresting case
Lets prove first that in 5 natural number in fixed order you can always find 3 in increasing or 3 in decreasing order. To do this, just try to costruct a sequence with $\{1,2,3,4,5\}$ which contraddicts it.
$5$ and $4$ need to placed somewhere. If between them there are 2 number or more, we have $5ab4$. This lead to a sequence of 3 elements if $a<b$ or $b < a$. So we need to take one or no elements between $5$ and $4$.
In the first case, consider the highest number not used yet, $c$. It cannot be on the right of $4$, and cannot be such that there are two numbers between $c$ and $4$. So we must have $c5a4$. Moreover, $c > a$, so $c=3$.
Finally we need to place $b < 3$. Placing it on the left or on the right of the sequence lead to an easy contraddiction
In the second case, where we $54$ we need to place $1,2,3$, which can only be placed on the left (otherwise $5,4,a$ will be a sequence of three ordered elements).
As before, we finally observe that in the case $3ab54$ we have a contraddiction as in the beginning, and in both $a3b54$ and $ab354$ we have a contraddiction, since $a<3<5$.
