2

I want to write the length of the word w which has the following form:

  • w=a^nb^mc^pd^q

with n,m,p,q >=2 after using the Run-Length-Compression. Also if w = a^2b^3c^4d^5 I can write w with the Run-Length-Compression as a0b1c00d01. The first binary number is dropped since the number 2(10),3(11),4(100),5(101) in binary representation all starts with 1 so we get a10b11c100d101 ==> a0b1c00d01.

Now I want to write the length of the result if

w  =a^nb^mc^pd^q
   = a |binary(n)|-1 b |binary(m)|-1 c |binary(p)|-1 d |binary(q)|-1
   =   |binary(n)| |binary(m)||binary(p)||binary(q)| -4 +4
   =   |binary(n)| |binary(m)||binary(p)||binary(q)|

My question is there anyway to simplify the result by writing the binary(n)... as sum or something similar ?

Spektre
  • 49,595
  • 11
  • 110
  • 380
Mr Asker
  • 2,300
  • 11
  • 31
  • 56
  • Shall it be possible to unanimously expand the compressed word to the original? How would you do that? You seem to intend to use pairs (literal character, length). Assuming it possible to know where (the encoding of) "one literal character ends": how do you know where the encoding of the length ends, where the next pair may begin? (Think about length 1.) (`The first binary number is droped since …` make that _The first_ binary digit _may be dropped …_ (or even _bit_). (Regarding your terminal question, I think it possible to give asymptotic upper and lower bounds.) – greybeard Nov 30 '15 at 06:17
  • If in `a^nb^mc^pd^q`, `a, b, c` and `d` are literal symbols rather than place-holders, you can omit them. Encoding the counts (-1 because `>=2`) in a unary number system using `0` as a terminator: `10110111011110`. – greybeard Nov 30 '15 at 09:56

0 Answers0