For what $p_1,\ldots,p_n$ is $P\left(\sum_{i=1}^n X_i = m\right) $ maximized? Suppose that I have $X_1,\ldots, X_n$ such that $X_i \sim \text{Bernoulli}(p_i)$, here we have that $X_i$ are independent but not neccessarily identically distributed. However, we have the constraint that $p_i>0.5$, let $m < 0.5 n$.
What is $p_1,\ldots, p_n$ such that
$$P\left(\sum_{i=1}^n X_i = m\right)  $$
is maximized? and how to show it?
 A: A partial solution.
Your probability $P=P(\sum X_i=m)$ is a multilinear polynomial in the $p_i$ and $1-p_i$: it is given by an expression of form $$P=\sum_{a}\prod_{i=1}^np_i^{a_i}q_i^{1-a_i}$$ where $q_i$ is shorthand for $1-p_i$, and where the summation extends over just those $a=(a_1,\ldots a_n)\in\{0,1\}^n$ for which $\sum a_i=m$.
Suppose the maximum  over the compact set $[1/2,1]^n$ is attained at $p$.  Since $P$ is linear (or rather, affine) in the variable $p_1$, the maximum is attained at an endpoint of the range of $p_1$, that is, if $p_1=1/2$ or $p_1=1$.  And so on for $p_2$, and the others.
Limited numerical experiments (with $n=3$ and $n=5$) seem to show the maximum is attained when all the $p_i=1/2$ and no $p_i=1$, but I don't see a clear reason just now.
A: This is the continuation of kimchi lover's answer.
From there, one can compute explicitly $P$. Assuming that $j$ of the $p_i$ are equal to $\frac{1}{2}$ and $n-j$ are equal to $1$, $P$ is the same as the probability that a sum of $j$ i.i.d Bernoullis with parameter $\frac{1}{2}$ is equal to $m-n+j$, namely
$$P=\binom{j}{m-n+j}2^{-j}.$$
We can treat this expression as a function of $j$ : we have
$$\frac{P(j+1)}{P(j)} =\frac{j+1}{2(m+j+1-n)}.$$
The condition $2m<n$ ensures that $\dfrac{P(j+1)}{P(j)}\geq 1$, so $P$ is nondecreasing and attains its maximum when $j=n$, i.e. when all the $p_i$'s are equal to $\frac{1}{2}$.
