Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

On this Kmett CRC article, why does ab = a0^n + 0^m b? What does this notation mean?

Tags:

math

haskell

crc

In Edward Kmett's article on CRCs it has the following derivation:

CRC(ab) =                               -- definition of CRC
crc(INIT,ab) + FINAL =                  -- linearity
crc(INIT,a0^n + 0^m b) + FINAL =        -- additive homomorphism
crc(INIT,a0^n) + crc(0,0^nb) + FINAL =  -- zero blindness 
crc(INIT,a0^n) + crc(0,b) + FINAL       -- definition of crc
crc(crc(INIT,a),0^n) + crc(0,b) + FINAL -- additive homomorphism
crc(crc(INIT,0^m)+crc(0,a),0^n) + crc(0,b) + FINAL

What in the world is a0^n and 0^m b? Are these powers, like a * pow(0, n)? If so, wouldn't 0^n = 0? Or XOR? Something else entirely? Is the space significant? I am not understanding why, for example:

ab = a0^n + 0^m b

and why 0^m b became 0^nb between the third and fourth lines?

like image 675
rityzmon Avatar asked Jul 13 '16 01:07

rityzmon


1 Answers

He's using a notation for bit strings. Here a and b are bit strings of length m and n respectively.

ab    =  a concatenated with b
0^n   =  the bit string of length n consisting of all 0s
a0^n  =  a concatenated with 0^n
0^m b = 0^m concatenated with b
a0^n + 0^m b  = sum of a0^n and 0^m b (same as the bitwise OR in this case)
              = a concatenated with b
like image 75
ErikR Avatar answered Nov 16 '22 18:11

ErikR