# Why do I find no clear answer for the log term in Shannon's theorem? [duplicate]

The explanations about Shannon's theorem speed up all of a sudden when they should tell us why he introduced the log term. They usually range from 'it's useful' to 'it's because there are two choices, then log2 is suitable'. Am I right in thinking that what the log does is 'give a context' to the probability you are measuring the entropy of? If 0.125 was one of two outcomes it's different than if it was one out of ten. Hence, choosing different logs puts this specific option (0.125) in the right ballpark. Am I correct? And is there a more formal proof for this (maybe for the use of log in probability in general). thanks!

## marked as duplicate by leonbloy, Namaste, Claude Leibovici, Lord Shark the Unknown, LeucippusJul 16 '17 at 5:20

• Have you seen these previous questions? What is the role of the logarithm in Shannon's entropy?, Intuitive explanation of entropy? I don't know of any interpretation in terms of contexts or ballparks -- a probability of 0.125 contributes the same term $-0.125\log 0.125$ to the entropy no matter how many other outcomes there are -- so I don't think you are on the right track. – Rahul Jul 15 '17 at 17:37
Why are there squares in Pythagoras' theorem? Long and deep thinking led Shannon to this formula. The proof is in the pudding: You could, in the heuristic process, try other functions, like $\arctan$ or something, but only with the correct "Ansatz" you obtain the mighty theorem.