Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
By inversely proportional, I meant that the number of questions asked to identify an animal (Q) multiplied by how many times the animal is chosen (C) should be constant. If a goat appears a hundred times more often than a unicorn then it should take a hundred times more questions to identify the unicorn than the goat.

In roboticus' example, which you seem to be endorsing, this is the tree produced:

Q ___________________/ \___________________ / \ Q __________________Q / \ / \ Q fish Q _________Q / \ / \ / +\ __________Q cow dog cat Q + Q / \ / \ +/ \ Q Q Q wolf sheep + horse / \ / \ / \ walrus badger seal Q________________ wolverine frog / \ Q Q / \ / \ Q hampster ocolot Q / \ / \ pegasus Q gerbil platypus / \ axolotl unicorn

The fish with a frequency of 150 requires 2 questions; the unicorn with a frequency of 1, required 9. And it puts walrus(15), badger(17), seal(18), wolverine(22) & frog(28) at the same level.

So the inverse proportionality is relative rather than mathematically absolute. It would require the insertion of 291 additional questions above the unicorn to achieve the math you describe, and in the process, throws away the "compressive" attribute that defines Huffman.

If non-compressive, relative inverse proportionality is sufficient, then my original reading of your question would be more accurate:

Q / \ fish Q / \ cat Q / \ dog Q / \ cow Q / \ horse Q / \ sheep Q / \ wolf Q / \ frog Q / \ wolverine Q / \ seal Q / \ badger Q / \ walrus Q / \ ocelot Q / \ hamster Q / \ gerbil Q / \ platypus Q / \ unicorn Q / \ pegasus axolotl

Which brings me back to the idea that what roboticus' use of Huffman does, is minimise the depth of the tree.

But if that were the goal, then its maximum depth of 9 is 3 more than is required:

__________Q__________ / \ fish ____________________Q______________________ / \ Q _________________________Q_________________ +__________ / \ / + \ cat dog _________Q__________ __ +___________Q_______________ / \ / + \ ____Q____ _____Q______ _____Q___ +___ ______Q______ / \ / \ / + \ / \ Q Q Q Q Q + Q Q Q / \ / \ / \ / \ / \ + / \ / \ / \ cow horse sheep wolf frog wolverine seal badger walrus ocelot ham +ster gerbil platypus unicorn pegasus axolotl

All of which I guess means, that I have no idea what you set out to achieve :(


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

In reply to Re^5: Challenge: Optimal Animals/Pangolins Strategy by BrowserUk
in thread Challenge: Optimal Animals/Pangolins Strategy by Limbic~Region

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2024-04-19 22:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found