Re: Mapping rationals to binary strings while preserving order
- From: Herbert Glarner <herbert.glarner@xxxxxxxxxx>
- Date: Wed, 12 Jul 2006 23:22:29 +0200
You obviously are willing to deal with different bit lengths, i.e. treat the mapped representation as a bitstream. Depending on how you plan to store them, you might run into a practical problem there. Consider you see a bitstream like 01011. How do you interpret it? It is ambigeous and may signify the two fractions 01;011 or the only fraction 01011 or even the three "fractions" 0;1;011 etc.
If you right-pad the missing bits with 0es so that all numbers are of same length, the numbers are not ambigeous anymore, but then there is no point in searching for shorter string representations, because it is determined alone by the range of your fractions (if there is any, that is). If it is a requirement to represent all possible fractions, then you will have a large number of bits pretty soon. After all, the initial bit is 0 for a fraction < 1, and in e.g. 15 bits you can only represent 2^15=32k different fractions.
Thus, the additional information needed before thinking about such a representation is: Is your input finite? If so, what is the resolution you have in mind? Is the max. denominator 9 as per your example?
Regards
//Herbert
--
http://herbert.wikispaces.com
.
- Follow-Ups:
- Re: Mapping rationals to binary strings while preserving order
- From: Janez Brank
- Re: Mapping rationals to binary strings while preserving order
- From: neleai
- Re: Mapping rationals to binary strings while preserving order
- References:
- Mapping rationals to binary strings while preserving order
- From: Janez Brank
- Mapping rationals to binary strings while preserving order
- Prev by Date: Re: Mapping rationals to binary strings while preserving order
- Next by Date: Re: Two-dimensional pattern matching/compression
- Previous by thread: Re: Mapping rationals to binary strings while preserving order
- Next by thread: Re: Mapping rationals to binary strings while preserving order
- Index(es):
Relevant Pages
|