in reply to Challenge: Optimal Animals/Pangolins Strategy
Wouldn't that be a simple Huffman coding?
...roboticus
When your only tool is a hammer, all problems look like your thumb.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Challenge: Optimal Animals/Pangolins Strategy
by Limbic~Region (Chancellor) on May 02, 2013 at 17:31 UTC | |
Maybe - I am not sure. The idea that I am not able to explain has to do with compression. I understand Huffman coding which is where my idea came from. In my head it is different so if the example I came up with is equivalent to Huffman coding I have failed. Update: I am now pretty sure you are right. I still can't explain why what I am thinking about is different but this may help: In addition to coding for individual characters, I want to use any nodes that only have 1 leaf entry to code for character tuples. This is done AFTER the Huffman coding. Cheers - L~R | [reply] |
by roboticus (Chancellor) on May 02, 2013 at 23:58 UTC | |
Here's kind of what I was thinking. The Huffman tree keeps the most common animals (fish, dog, cat) at the top of the tree with few questions, and the unusual critters (unicorn, pegasus, axolotl) at the bottom of the tree. Is this something along the lines of what you're after?
Running it gives me:
So if I haven't screwed up, it looks like given the stated distributions and guesses, that you'd need 3.45 guesses on average. ...roboticus When your only tool is a hammer, all problems look like your thumb. | [reply] [d/l] [select] |
by Limbic~Region (Chancellor) on May 03, 2013 at 13:38 UTC | |
I don't think you screwed anything up - this is the standard 1 queue version of Huffman coding. It meets the stated goals of my objective. Let me try and give some more insight into this fuzzy idea I have. Huffman coding gives ideal compression when the symbol set it is coding for and the frequencies those symbols appear is known up front. Typically, those symbols are single characters and for my purposes that will be true. If the bit sequence '01101' is used but '01100' is empty/unused, I see that as an opportunity to fill in the tree with some unknown symbols. Since all the single character symbols are known and populated, I would plug these "holes" with symbols representing character tuples. I then realized that I should reduce the frequency of the single character symbols that were part of the newly inserted tuple because not all of them would be encoded. This could then generate a different looking tree with different holes to fill. Looks like an infinite recursion problem. I then thought - if I can come up with a strategy to populate a tree given a desired outcome, I could just jump to the answer. In my sleep deprived state, I thought the Animals problem I posted got me there but it really just got me back to the beginning. Cheers - L~R | [reply] |