I am following this tutorial, where we derive common probability distributions based on a constraint and the entropy equation for a discrete random variable.
I am stuck on a step: it's labeled step 8 to 9 in the post.
We do as follows.
First, we define a constraint set.
We declare our entropy equation:
$ H(x) = - \sum_{i=a}^{b} p_i\log(p_i) \tag{5} $
We then set our constraint:
$\sum_{i=a}^{b} p_i = 1 \tag{6}$
Solving for the partial derivatives of the lagrangian we are left with:
$\mathcal{L}(p_a, \ldots, p_b, \lambda) = -\sum_{i=a}^{b} p_i\log(p_i) - \lambda(\sum_{i=a}^{b} p_i - 1) \tag{7}$
and
$\frac{\partial \mathcal{L}(p_a, \ldots, p_b, \lambda)}{\partial \lambda} = 0 - \sum_{i=a}^{b} p_i + 1 = 0 \tag{9}$
It then just skips ahead and says:
$$p_i = \frac{1}{b-a+1}, \\ \lambda = \lg(b-a+1) -1 \tag{10} $$
But, where does the first equation come from? How did we take the sum at point 9 and end up at the value for $p_i$.
The sum is over the support $[a, a + 1, b - 1, b]$. I'm just not seeing how summing the probbailities over that support ultimately solve for $p_i$.
Solving for $\frac{\partial L}{\partial p}=-log_2p-1-\lambda$ you get $p=2^{-1-\lambda}$. But the sum of the probabilities is 1 from the constraint, so $2^{-1-\lambda}n=1\implies pn=1\implies p=\frac{1}{n}$ where $n$ is the cardinality of the support. In your case $n=b-a+1$ (even though I don’t get the +1), but that’s just a specific case for your support.
You don’t care about the value of $\lambda$ as only the distribution of $p$ matters.