# How to bound the maximal consecutive length in a random subset of [n] as function of n?

Let $S$ be a random subset of $[n]=\{1,2,\ldots,n\}$ chosen uniformly from $[n]$'s subsets. How can I find a function $f(n)$ s.t. for any $\varepsilon \gt 0$,

$$\lim_{n \rightarrow \infty} P\left[(1- \varepsilon) f(n) \le \lambda (S) \le (1 + \varepsilon)f(n)\right]=1 ?$$

-
What is the purpose of these 2 links? –  Did Feb 12 '13 at 20:52
What did you try to solve this question? –  Did Feb 12 '13 at 20:52
@Did related material I found but didn't help me. may helps to other people. –  mati Feb 12 '13 at 20:54
What did you try to solve this question? –  Did Feb 12 '13 at 21:00

Here is the answer: $f(n)=\log_2n$. I hesitate to post a full proof, for the usual reasons.

-
I didn't find How can I bound it using one of this equlities: en.wikipedia.org/wiki/List_of_inequalities, tried Chernoff's inequality, and Markov's –  mati Feb 12 '13 at 21:31
Concerning the usual reasons: On MathOverflow, we're getting flags claiming that this user's questions come from a take-home exam that is in progress. –  Scott Carnahan Feb 13 '13 at 1:15
@ScottCarnahan Thanks for the information. This is not what I was referring to but confirms my hesitations. –  Did Feb 13 '13 at 6:00
And now the OP is seemingly covering their tracks. –  Did Feb 13 '13 at 6:06