Minimizing a specific function over n variables Experimenting with something related to probability theory I came across the following $n$-variable function
$$ f(p_1,\ldots,p_n) = \sum_{i=2}^{n-1} \left ( (1-p_i)(1-p_{i-1})^i (1-p_{i+1})^{n-i} + p_i {n \choose i} \right ) $$
where $p_1,\ldots,p_n \in [0,1].$
The natural thing is to use the inequality $(1-p_i)^t \leq e^{-p_i t}$ but I don't know what to do from there.
Since I am very rusty with such optimizations I would like to ask if someone could find a good lower bound for this function ? What is a good approximation of the minimum of $f$ and how to obtain it? 
If this is too hard, it would be nice to see if there is a set of values for $p_1,\ldots,p_n$ such that $f(p_1,\ldots,p_n)$ is sub-exponential? 
Thank you.
 A: Use the transformation $x_i=1-p_i$. The problem is then equivalent to minimizing
$$
T = \sum_{i=2}^{n-1} x_i x_{i-1}^i x_{i+1}^{n-i} - \left(\begin{array}{c} n \\ i\end{array}\right) x_i
$$
for $x_i\in[0,1]$.
(This target function differs by a constant from the original.)
If $n\le 2$, $T=0$.
If $n=3$, then $T=x_2 x_1^2 x_3 - 3 x_2$. This is minimized when $x_2=1$ and $x_1x_3=0$. Thus,
$$
\mbox{If $n=3$, then $p_2 = 0$ and either $p_1=1$ or $p_3=1$.} 
$$
Suppose $n\ge 4$. Take the derivative with respect to $x_i$:
\begin{eqnarray}
(1) \ \frac{\partial T}{\partial x_1} &=& 2 x_2 x_1 x_3^{n-2} \\
(2) \ \frac{\partial T}{\partial x_2} &=& 3 x_3 x_2^2 x_4^{n-3} + x_1^2 x_3^{n-2} - \left(\begin{array}{c}n \\ 2\end{array}\right)\\
(3)  \frac{\partial T}{\partial x_i} &=&  x_{i-1}^i x_{i+1}^{n-i} + (i+1) x_{i+1} x_i^i x_{i+2}^{n-i-1} + (n-i+1) x_{i-1} x_{i-2}^{i-1} x_i^{n-i} - \left(\begin{array}{c} n \\ i \end{array}\right) \ \ \ \mbox{ for } 2 < i < n-1\\
(4) \frac{\partial T}{\partial x_{n-1}} &=& x_{n-2}^{n-1} x_n + 2 x_{n-2} x_{n-3}^{n-2} x_{n-1} - n\\
(5) \frac{\partial T}{\partial x_n} &=& x_{n-1} x_{n-2}^{n-1}.
\end{eqnarray}
Equation $(3)$ is at most $n+3 - \left(\begin{array}{c} n\\ i\end{array}\right)$ whenever it is valid, i.e., when $n\ge 5$ and $3\le i\le n-2$. But this quantity is negative. We conclude that to minimize $T$,
$$
x_i=1 \mbox{ for } 3\le i\le n-2.
$$
Equations $(2)$ and $(4)$ are also negative, showing $x_2=x_{n-1}=1$ as well. Then equation $(5)$ reduces to $1$, so $x_n=0$. Finally, equation $(1)$ reduces to $2x_1$, so $x_1=0$ as well. Hence,
$$
\mbox{If $n\ge 4$, then $p_1=p_n=1$ and $p_i=0$ for other $i$.}
$$
Finally, compute the optimal (original) target function:
\begin{eqnarray}
n=3 &\mapsto& 0 \\
n\ge 4 &\mapsto& n-4.
\end{eqnarray}
