On Feb 20, 12:56 am, Fibonacci Code <angli...@gmail.com> wrote:
On Feb 20, 12:23 am, biject <davvid_a_sc...@email.com> wrote:
On Feb 19, 8:57 am, biject <davvid_a_sc...@email.com> wrote:
On Feb 19, 5:55 am, Fibonacci Code <angli...@gmail.com> wrote:
Hi All,
Is there anyway to represent a binary string to unary
representation, with the samesize as the orignal string ?
FYI, unary coding
1 0
2 10
3 110
4 1110
5 11110
......
If I had a binary string of 111100001010011
Unary representation is 111011100001010
But if I had binary string of 000011110101100 (Inverse of
111100001010011)
Unary representation is 111011100001010
Hence both of the string 111100001010011 and 000011110101100 were
map to 111011100001010
then I will need extra one bit to say if it start with 1 or start with
0.
that will be one bit extra from the original string.
Is there any other way to represent a binary string to unary
representation yet maintain the size ?
Please advise.
Many thanks.
Ray
yes there is you just think of the leading bit as the continuation bit
and every time a
change you chane exmple::
111100001010011 starting string
111101110000101 my way
111011100001010 your way Notive if shifted one bit only ends different
000011110101100 strting string
000010001111010 my way Notice opposite of my way above
111011100001010 your way Notive if shited one bit every bit exactly
opposite excpet ends
This is actually a simple two state mtf where first state seen is zero
which is how I write
MTFQ which is exactly like Marks MTF except zero is first character
seen and so on.You
could all do the sitcgky verion of MTF in binary a simalar way
David A. Scott
--
My Crypto
codehttp://bijective.dogma.net/crypto/scott19u.ziphttp://www.jim.com/jame...
My Compression
codehttp://bijective.dogma.net/
**TO EMAIL ME drop the roman "five" **
Disclaimer:I am in no way responsible for any of the statements
made in the above text. For all I know I might be drugged.
As a famous person once said "any cryptograhic
system is only as strong as its weakest link"
The method I gave above was bijective. However most people here
don't like bijective compression so
here is a non bijective way. Suppose you writing a compression scheme
where you know that
there will alwasy be more zeroes than ones in the files you care
about. If that the case
just use your original methd. At the end when you undo the conversion
you could change by inverting
every bit to its opposite.
if you used such a method
111011100001010 woud convert on reverse to
000011110101100
and the other string would not be a result of your compression since
you
only want strings with more zeros than ones. Hay I don't like this
method
I prefer the first but I see in the standard BWT the goal for many
programers
is to increase the run of zeroes so it might appeal to them and its
not bijective.
Again I would not to this so you might!
David A. Scott
--
My Crypto
codehttp://bijective.dogma.net/crypto/scott19u.ziphttp://www.jim.com/jame...
My Compression
codehttp://bijective.dogma.net/
**TO EMAIL ME drop the roman "five" **
Disclaimer:I am in no way responsible for any of the statements
made in the above text. For all I know I might be drugged.
As a famous person once said "any cryptograhic
system is only as strong as its weakest link"- Hide quoted text -
- Show quoted text -
Woah,
Really thanks a lot, I never think about that. by
the way you are encoding from the right to left ?
I will do a more detail study on this encoding.
Regards,
Ray- Hide quoted text -
- Show quoted text -
Hi David,
There is one more question,
---Quote---
111100001010011 starting string
111101110000101 my way
111011100001010 your way Notive if shifted one bit only ends
different
000011110101100 strting string
000010001111010 my way Notice opposite of my way above
111011100001010 your way Notive if shited one bit every bit exactly
---Quote---
If there is a string 11110000101001 (111100001010011 remove trailing
1) according to your way
should I put 1 or put 0 at the first bit ? to my understand, we should
put 0 as next bit is changed.
but if we put 0, how can we know it is start with 1 ?
Please advise.
Ray