I wish to compute the probability of having a log(n) length consecutive monotone subsequence in a random permutation of {1,...,n} (log with base 2).
I'm trying to show it's $\leq1/n$, does it make sense?
I wish to compute the probability of having a log(n) length consecutive monotone subsequence in a random permutation of {1,...,n} (log with base 2).
I'm trying to show it's $\leq1/n$, does it make sense?
As Michael noted in a comment, the expected number of consecutive monotonic subsequences of length $m$ in a permutation of length $n$ is $2(n-m+1)/m!$. The factor $2$ is for the options "decreasing" and "increasing", $n-m+1$ counts the number of positions in which the subsequence can occur, and $1/m!$ is the probability for a given subsequence to be in increasing order. The probability of having at least one such subsequence is lower than this expected value.
Since $\log n$ usually isn't an integer, your question doesn't make sense when taken literally, so I'll assume that you're interested in the asymptotic behaviour. With Stirling's approximation,
$$ (\log_2 n)!\approx\sqrt{2\pi\log_2 n}\left(\frac{\log_2 n}{\mathrm e}\right)^{\log_2 n}=\sqrt{2\pi\log_2 n}\,n^{\log_2\log_2 n-1/\log2}\;, $$
so $2(n-\log n+1)/(\log n)!$ will eventually be less than $\frac1n$ for sufficiently large $n$. We can plot the functions to find that $2(n-\log_2n+1)/(\log_2n)!=\frac1n$ around $n=676$, and indeed simulations show that the probability is greater than $\frac1n$ for $n=2^9=512$ but less than $\frac1n$ for $n=2^{10}=1024$. (Here's the code.)