I have following problem \begin{eqnarray} &\min_{p,t}&\quad \sum_{i =1}^n \frac{a_i^2}{p_i} \\ &s.t.& \sum_{i =1}^n p_i = b \\ && 0 \leq p_i \leq 1\quad \forall i \end{eqnarray} $a_i$'s are given positive parameters and b is a positive number less than $n$. Its Hessian is $2*\text{diag}\left(\frac{a_i}{p_i^3}\right)$ thus this problem is convex, thus KKT conditions leads to the optimal solution, but I can't solve them. Here are KKT conditions
$$ L(p,y,\lambda_1, ..,\lambda_n, u_1,...,u_n) = \sum_{i =1}^n \frac{a_i^2}{p_i} - \sum_{i =1}^n \lambda_ip_i - \sum_{i =1}^n u_i(1-p_i) + y\left(\sum_{i =1}^n p_i - b\right)\\ u_i \geq 0 \\ u_i(1-p_i) = 0 \\ \lambda_ip_i = 0\\ 0 \leq p_i \leq 1 \\ -\sum_{i =1}^n \frac{a_i^2}{p_i^2} -\lambda_i + u_i + y = 0 \quad \forall i \\ \sum_{i =1}^n p_i = b. $$ Does anybody know, how to solve it?
Generalizing my comment, here is how you can find a solution to the KKT system.
W.L.O.G., let $a_1 \leq a_2 \leq \cdots \leq a_n$. Let $A_m := \sum_{i=1}^{m}{a_i}$, and $B_m := \frac{A_m}{a_m}$.
Find (the largest) $k \in \{1,\cdots,n\}$ such that $0 < b - (n-k) \leq B_k$ (note that $k$ is well-defined; under the condition proposed in my comment, we have $k = n$). Then $$p_i = \frac{a_i}{A_k} \left[b - (n-k)\right], \:\: i = 1,\cdots,k,$$ $$p_{k+1} = \cdots = p_n = 1,$$ $$\lambda_i = 0, \:\: \forall i,$$ $$u_1 = \cdots = u_k = 0,$$ and $u_{k+1},\cdots,u_n,y$ such that $$y = \left(\frac{A_k}{b - (n-k)}\right)^2$$ and $$u_j + y = a^2_j, \:\: j = k+1,\cdots,n,$$ solves the KKT system (note that the last system is not inconsistent with $u_i \geq 0$).