Beefy Boxes and Bandwidth Generously Provided by pair Networks RobOMonk
We don't bite newbies here... much
 
PerlMonks  

Re^4: Algorithm to convert combinations to bitstring (size)

by Limbic~Region (Chancellor)
on Oct 18, 2006 at 14:44 UTC ( [id://579172]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Re^3: Algorithm to convert combinations to bitstring (size)
in thread Algorithm to convert combinations to bitstring

tye,
Ok, I think what you are saying is count in base-N even though you don't need all the bits? If that's the case then yes, it may make things easier and the extra space shouldn't be that much more.

Cheers - L~R

  • Comment on Re^4: Algorithm to convert combinations to bitstring (size)

Replies are listed 'Best First'.
Re^5: Algorithm to convert combinations to bitstring (size)
by tye (Sage) on Oct 18, 2006 at 14:50 UTC

    That was my alternative (in an update) if K is small (or near N). That uses log2( N**K ) bits.

    But what I described above is using base 2. It uses only N bits no matter how large (or small) K is, and the translation doesn't depend on K either. It can describe any subset of your superset, not just subsets of size K.

    - tye        

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://579172]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.