Code Generation from Tag
If binary tag is .t1t2t3... = (r-l)/2 in [l,r) then we want to choose k to form the code t1t2...tk.
Short code:
- choose k to be as small as possible so that l < .t1t2...tk000... < r.
Guaranteed code:
- choose
- l < .t1t2...tkb1b2b3... < r for any bits b1b2b3...
- for fixed length strings provides a good prefix code.
- example: [.000000000..., .000010010...), tag = .000001001...Short code: 0Guaranteed code: 000001