# Huffman Coding vs Arithmetic Coding

Are there conditions under which given text $$T$$ that huffman code and arithmetic code will produce the exact encoding of $$T$$?

• Of course. I assume it’s homework, so I’ll just say it’s really easy to show. – gnasher729 Jan 28 '19 at 20:24
• This is for preparation for the exam.A friend told me that the exact opposite. Meaning that there are no conditions since Huffman is based on frequencies and the arithmetic takes the frequencies and uses them to find an interval. So if you say it's true what is the reason for that? – Kate Jan 28 '19 at 21:03
• That's an argument why they are usually different. Figure out why arithmetic coding is usually more efficient. Then figure out in which situations is is not more efficient, but exactly as efficient as Huffman. And there you get your conditions. – gnasher729 Jan 28 '19 at 21:30