A random variable $X$ has a distribution given by $P(X=i)=\pi_i$ For $i=1,2,...,p$ where $\sum_{i=1}^p n_i=1$. In a sample size $n$ the frequency of outcome $i$ is $n_i$ where $n_i\geq 0$ and $\sum_{i=1}^p n_i=n$. How do you find the maximum likelihood estimators of the $\pi_i$?
So so far I have tried this: $L(\pi_1,...,\pi_p;x_1,...,x_n)=\prod_{i=1}^p \prod_{k=1}^{n_i}P(X_k=i)=\prod_{i=1}^p \prod_{k=1}^{n_i}\pi_i=\prod_{i=1}^p \pi_i^{n_i}$
$\Rightarrow l(\pi_1,...,\pi_p;x_1,...,x_n)= \sum_{i=1}^p n_i \operatorname{log}\pi_i$ Then I say that we need for $j=1,...,p$ $\frac{\partial l}{\partial \pi_j}=\frac{n_j}{\pi_j}+\sum_{i=1}_{i\neq j}^p \operatorname{log}\pi_i=0$
Here I get stuck. Any help would be greatly appreciated