0

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?

Perm
  • 5
  • 1
    Is that consecutive, or selected from the whole sequence? In the sequence 1,4,2,5,3, are you allowed the subsequence 1,2,3? Is it log2, or natural log, or log10? – Empy2 Jan 31 '15 at 16:31
  • consecutive sequence, log2. – Perm Jan 31 '15 at 16:56
  • 1
    The average number of those subsequences would be $2(n-\log(n)+1)/\log(n)!$, but the probability would be smaller than that. – Empy2 Jan 31 '15 at 17:02

1 Answers1

1

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.)

joriki
  • 238,052