For a fixed $\epsilon> 0$, one need to find a probability distribution $\bf{p}=(p_1,p_2,\ldots,p_n)$ and an optimal code (prefix-free) for this distribution such that the average length $L=\sum_{i=1}^{n} p_il_i$ is arbitrarily close to $H(\bf{p})$$+1$, i.e, $L< H+1-\epsilon$.
I tried assigning $p_2=p_3=\ldots=p_N=p,\ p_1= 1-(N-1)p$ and computed the entropy.But I am getting stuck in finding the optimal code length which is given by Huffman Code. Can any one help me with this ?