You are not logged in. Your edit will be placed in a queue until it is peer reviewed.
We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.
Required fields*
- $\begingroup$ what do you mean "dyadic"? it works when some symbols are more common than others and the more common symbols are given "abbreviations". this is true of human languages. yes a simple algorithm is to try the encoding on different width strings & see which is optimal. it depends on the data of course. $\endgroup$vzn– vzn2014-06-01 03:42:58 +00:00Commented Jun 1, 2014 at 3:42
- $\begingroup$ @vzn A dyadic distribution is one for which the frequencies of the symbols are 2^-i for i between 1 and n, and another symbol with frequency 2^-n exists as well. This is the optimal case for Huffman encoding since the encoding tree is maximally skewed. Regarding your brute force solution, this certainly works but isn't very satisfying. $\endgroup$VF1– VF12014-06-01 04:14:02 +00:00Commented Jun 1, 2014 at 4:14
- $\begingroup$ disagree that optimal huffman encoding is for dyadic frequencies (not sure where that assertion comes from, it would be better if you cite something for that). optimal encoding for all compression algorithms is when there is huge redundancy. afaict/afaik huffman encoding is generally applied to language text where there are natural coding "widths" (character sizes) and other applications are not very common. also not having to determine optimal width & instead assuming it is a "feature" not a "bug" of this compression method. Lempel-Ziv is used more for variable coding widths. try that one! $\endgroup$vzn– vzn2014-06-01 18:11:52 +00:00Commented Jun 1, 2014 at 18:11
- $\begingroup$ @vzn Wiki page, look under "main properties". It's pretty clear a dyadic leads to the most compression since then the codes are spread out entirely throughout the Huffman trie, weighted to the top. Not sure how LZW is relevant to my question at all, though. I'm not asking this because I have a file to compress, I'm investigating this particular compression algorithm. $\endgroup$VF1– VF12014-06-01 20:48:02 +00:00Commented Jun 1, 2014 at 20:48
- $\begingroup$ You ask if there is an algorithm to find the optimal word width, and the answer is trivially yes: just try all possibilities. If that is not a suitable answer, then you haven't posed your question carefully enough: you must have some additional requirements you didn't list in the question -- what are they, and what is the motivation for them? $\endgroup$D.W.– D.W. ♦2014-06-02 06:19:49 +00:00Commented Jun 2, 2014 at 6:19
Add a comment |
How to Edit
- Correct minor typos or mistakes
- Clarify meaning without changing it
- Add related resources or links
- Always respect the author’s intent
- Don’t use edits to reply to the author
How to Format
- create code fences with backticks ` or tildes ~ ```
like so
``` - add language identifier to highlight code ```python
def function(foo):
print(foo)
``` - put returns between paragraphs
- for linebreak add 2 spaces at end
- _italic_ or **bold**
- indent code by 4 spaces
- backtick escapes
`like _so_` - quote by placing > at start of line
- to make links (use https whenever possible) <https://example.com>[example](https://example.com)<a href="https://example.com">example</a>
- MathJax equations
$\sin^2 \theta$
How to Tag
A tag is a keyword or label that categorizes your question with other, similar questions. Choose one or more (up to 5) tags that will help answerers to find and interpret your question.
- complete the sentence: my question is about...
- use tags that describe things or concepts that are essential, not incidental to your question
- favor using existing popular tags
- read the descriptions that appear below the tag
If your question is primarily about a topic for which you can't find a tag:
- combine multiple words into single-words with hyphens (e.g. complexity-theory), up to a maximum of 35 characters
- creating new tags is a privilege; if you can't yet create a tag you need, then post this question without it, then ask the community to create it for you