Expected number of uniformly random points in unit square is in convex position. If $n$ points are uniformly generated in a unit square, following famous Erdős–Szekeres theorem.
The probability of them be in convex position is ${\displaystyle \left({\binom {2n-2}{n-1}}/n!\right)^{2}}$.
My interest is to find the expected number of points be in convex position, and I am enumerating $i$ points in the convex position and add all the possible $i$s.
Here is what I did, $P(i) =  {\left({\binom {2i-2}{i-1}}/i!\right)^{2}}$, the probability of having $i$ points in convex position.
And the expected number of points be in convex position can be achieved via
$$
\sum_{i=1}^n {n \choose i} * P(i)
$$
And I was using WolframAlpha (here) to get an idea of this number, for some reason the expected number is bigger than n, which is impossible :(
Can someone help me where did I do wrong?
 A: You've computed the expected number of subsets of points in convex position. For example, when $n \le 3$ all $2^n-1$ nonempty subsets are in convex position, so the sum equals $2^n-1$.
Let $X$ be the maximum cardinality of all sets in convex position. By union bound on all sets of size $k$ we have:
$$
P(X \ge k) \le \binom{n}{k} \left(\frac{1}{k!}\binom{2k-2}{k-1}\right)^2
$$
So we get an upper bound on the expectation of $X$:
$$
\begin{aligned}
E(X) &= \sum_{k=1}^n P(X \ge k) \\
     &\le \sum_{k=1}^n \min\left(1, \binom{n}{k} \left(\frac{1}{k!}\binom{2k-2}{k-1}\right)^2 \right)
\end{aligned}
$$
Getting a lower bound is more complicated, I think this upper bound should be reasonably tight. Why? Most of the sum on the right hand side comes from the terms which equal $1$, the terms less than $1$ decay rapidly. The expected number of sets of size $k$ in convex position equals $\binom{n}{k} \left(\frac{1}{k!}\binom{2k-2}{k-1}\right)^2$, so when this quantity is much bigger than 1, it's a reasonable to guess that $X$ will be bigger than $k$ with high probability.
