Presentation is loading. Please wait.

Presentation is loading. Please wait.

Changing Base without Losing Space Yevgeniy DodisMihai P ă trașcuMikkel Thorup STOC10.

Similar presentations


Presentation on theme: "Changing Base without Losing Space Yevgeniy DodisMihai P ă trașcuMikkel Thorup STOC10."— Presentation transcript:

1 Changing Base without Losing Space Yevgeniy DodisMihai P ă trașcuMikkel Thorup STOC10

2 Changing Base Represent a vector A[1..n] {0,..,9} n (…on a binary computer) Support reading and writing A[i] SpaceTime Write a big number (10 n ) in binary nlog 2 10O(n) Store each digit with 4 bits 4nO(1) 0 1

3 Changing Base Represent a vector A[1..n] {0,..,9} n (…on a binary computer) Support reading and writing A[i] SpaceTime arithmetic codingnlog 2 10O(n) Huffman coding4nO(1) 0 1

4 Changing Base Represent a vector A[1..n] {0,..,9} n (…on a binary computer) Support reading and writing A[i] SpaceTime arithmetic codingnlog 2 10O(n) Huffman coding4nO(1) This papernlog 2 10O(1) 0 1

5 Prefix-Free Coding Represent A[1..n] {0,1} n, n by a prefix-free code Elias codes: Code lengthHow 2n append a bit after each A[i] (more? yes/no) n+2lg n at the beginning, write n by the code above n+lg n+2lglg n... n + lg n + … + O(lg * n)optimal length

6 Online Prefix-Free Coding write 0 write 1 write 0 close file prefix-free encoding Code lengthHow 2n append a bit after each A[i] (more? yes/no) n+2n a bit after each block of size n ^^^ Optimal? [Maurer, Sjödin] real time, low memory real time, low memory

7 Online Prefix-Free Coding write 0 write 1 write 0 close file prefix-free encoding Code lengthHow 2n append a bit after each A[i] (more? yes/no) n+2n a bit after each block of size n ^^^ Optimal? [Maurer, Sjödin] n + lg n + O(lglg n)This paper. O(1) time/symbol, O(lg n) memory O(1) time/symbol, O(lg n) memory

8 Why Prefix-Free Coding? message hash crypto secure Is this secure? Block 1Block 2..Block N hash … key

9 Why Prefix-Free Coding? message hash crypto secure Block 1Block 2..Block NPS: send money hash … key Prefix-free security

10 Prefix Free Changing Base Crypto: big blocks (b=128 bits or more) Let B=2 b BB..BEOF BB..B

11 Prefix Free Changing Base Crypto: big blocks (b=128 bits or more) Let B=2 b Entropy loss: nlog 2 (B+1) - nlog 2 B = nlog 2 (1+ 1 / B ) = O(n/B) So if B>>N, i.e. b>>log 2 n, negligible loss… BB..B BB BEOF B+1..B+1

12 The Algorithm in One Slide Block #123456… Input alphabetBBBBBB… With EOFB+1 … Split B B+3B-3 B+6B-6 B+9… RegroupB B+3 B-3 B+6 B-6 B+9 … MergeBBBBBB… Doing the math: Merge:(B+3i)(B-3i) < B 2 Split: (B-3i)(B+3i+3) > (B+1) 2 if B>4n 2

13 What have we learned? Block #123456… Input alphabetBBBBBB… With EOFB+1 … Split B B+3B-3 B+6B-6 B+9… RegroupB B+3 B-3 B+6 B-6 B+9 … MergeBBBBBB… I want to code something from alphabet X

14 What have we learned? Block #123456… Input alphabetBBBBBB… With EOFB+1 … Split B B+3B-3 B+6B-6 B+9… RegroupB B+3 B-3 B+6 B-6 B+9 … MergeBBBBBB… I want to code something from alphabet X Combine with some Y such that: X Y2 m

15 What have we learned? Block #123456… Input alphabetBBBBBB… With EOFB+1 … Split B B+3B-3 B+6B-6 B+9… RegroupB B+3 B-3 B+6 B-6 B+9 … MergeBBBBBB… I want to code something from alphabet X Combine with some Y such that: X Y2 m Take a large alphabet T and split into: TYZ

16 Information Carrier Codes 12..M Y = 2 M / X Z = T / Y entropy loss: O(1/Y) entropy loss: O(1/Y) entropy loss: O(1/Z) O(1 / T) loss X X T T what I want to encode information carrier

17 Storing a Vector Group 2 log 10 n digits |T|=n 2 waste O(1/n) bits per carrier code O(n) constants (Z 1, Z 2, …; M 1, M 2, …) O(lg n) constants using tree structure x0x0 x0x0 x1x1 x1x1 12..M1M1 z1z1 z1z1 x2x2 x2x2 12 M2M2 x3x3 x3x3 z2z2 z2z2 12 M3M3 z3z3 z3z3 …

18 The End Open Problem: locally decodable arithmetic codes for non-uniform distributions


Download ppt "Changing Base without Losing Space Yevgeniy DodisMihai P ă trașcuMikkel Thorup STOC10."

Similar presentations


Ads by Google