Perplexity of the following example This example is from Stanford's lecture about Language Models. A system has to recognise


*

*An operator ($P=\frac{1}{4}$)

*Sales ($P=\frac{1}{4}$)

*Technical Support ($P=\frac{1}{4}$)

*30000 Names ($P=\frac{1}{120,000}$)


The answer is given as 53. However, when I calculate it, it turns out to be around 56. This is how I did it: $$Perplexity \ = \ (4\times 4 \times 4 \times 120000)^{\frac {1}{4}}$$.
What am I doing wrong?
It's on page 34 here: https://web.stanford.edu/class/cs124/lec/languagemodeling.pdf
 A: I think the correct calculation should be
$$(4^{1/4} \times 4^{1/4} \times 4^{1/4}) \times \left((120000)^{1/120000} \right)^{30000}$$
which is the product over all $30003$ possible outcomes of $(1/p)^{p}$ where $p$ is the probability of that outcome. I get $52.6$.
A: First understand that what is the meaning of the perplexity formula
$Perplexity = P(w_1,w_2,...,w_N)^{\frac{-1}{N}}$
Where $N$ is the number of words in the testing corpus. Assume that you have developed a language model, where each word has some probability of occurring. The given problem specifically gives you three words and their probabilities. Plus it states that among $N$ there are 30,000 names. 
Now if you look at probabilities, you will see that probability of the word "Operator" is 1/4. As it is independent of context, it is safe to assume that whatever your language model outputs, 25% of the words are "Operator" only. Similarly, 25% are "Sales" and 25% are "Technical Support". Till now you know 75% of the words your model is going to output, remaining is 25%. 
Now, remember the question said that the model recognizes 30,000 names as well. These names can be fit into the remaining 25% of your testing set i.e. 25% of output = 30,000.Hence, total words in output = 4*30K = 120K = $N$
Therefore your model output will look something like this: $\{ ``Operator"\times30K,\ ``Sales"\times30K,\ ``Tech Support"\times30K,\ 30K\ names \}$
Since our probabilities are not dependent on the context, the order doesn't matter. 
Now if we go back to our Perplexity formula and put down the values, we get the following answer:
\begin{equation*}
Perplexity = \left( {P(Operator)}^{30K}\times{P(Sales)}^{30K}\times{P(TechSupport)}^{30K}\times{P(name)}^{30K} \right)^{\frac{-1}{120K}}
\end{equation*}
\begin{equation*}
 = \left( \frac{1}{4}^{30K}\times\frac{1}{4}^{30K}\times\frac{1}{4}^{30K}\times\frac{1}{120K}^{30K} \right)^{\frac{-1}{120K}} = 52.6
\end{equation*} 
