Given that there are 101 people of different heights standing in a line
Consider the number 101
It is of the form
n^2+1
10^2+1
By application of Ramsey theory, any sequence consisting of distinct numbers contains a subsequence of length n^2+1 that is either decreasing or increasing.
Here we have 101 with n =10
Since 101 people are having different heights, we must have 10+1 heights i.e. heights of 11 people either increasing or decreasing.
https://gateoverflow.in/129834/subsequence-theorem-from-rosen
kenneth rosen statent
Every sequence of n ^2 + 1 distinct real numbers contains a subsequence of length n + 1 that is either strictly increasing or strictly decreasing.