Professional Documents
Culture Documents
Chris Budd
How to tell the truth
a,b,c are 0 or 1
x = 22a + 2b + c
0 000
1 001
2 010
3 011
4 100
5 101
6 110
7 111
1, 0 are called bits of information
All information in a computer is made up of bits
On his fingers!
eg. 10110 = 16 + 4 + 2 = 22
11001 = 16 + 8 + 1 = 25
How to catch a liar.
Q1 Is it 4,5,6,7?
Q2 Is it 2,3,6,7?
Q3 Is it 1,3,5,7?
Q4 Is it 1,2,4,7?
Can we detect it
…. And …
Correct it
Answer the following questions .. You can
either tell the truth or lie at most once
1 001 110
2 010 011
3 011 101
4 100 101
5 101 011
Hamming Distance:
Take two binary numbers. How many
digits do we have to change to turn one
into the other?
110110
110110
1
1
110111 2 100110
3
3
110000
Making an error changes the original binary number by one
Hamming distance
110111
010110 110100
110110
100110 110010
111110
Idea: Choose a code of binary numbers 3 Hamming distances apart
Any error is then always closer to the original number than to any other number
0 000 000
1 001 110
All are a Hamming distance of 3
2 010 011 apart
3 011 101
4 100 101
5 101 011
Used to store the numbers 0,1,2,3,4,5,6,7 in such a way that any errors