Session 11: Coding Theory II

Slides:



Advertisements
Similar presentations
Noise, Information Theory, and Entropy (cont.) CS414 – Spring 2007 By Karrie Karahalios, Roger Cheng, Brian Bailey.
Advertisements

Applied Algorithmics - week7
Michael Alves, Patrick Dugan, Robert Daniels, Carlos Vicuna
Computer Networking Error Control Coding
Huffman code and ID3 Prof. Sin-Min Lee Department of Computer Science.
COS 461 Fall 1997 COS 461: Networks and Distributed Computing u Prof. Ed Felten u u.
Greedy Algorithms Amihood Amir Bar-Ilan University.
Bounds on Code Length Theorem: Let l ∗ 1, l ∗ 2,..., l ∗ m be optimal codeword lengths for a source distribution p and a D-ary alphabet, and let L ∗ be.
Data Compressor---Huffman Encoding and Decoding. Huffman Encoding Compression Typically, in files and messages, Each character requires 1 byte or 8 bits.
Error-Correcting Codes
Day 2 Information theory ( 信息論 ) Civil engineering ( 土木工程 ) Cultural exchange.
Is ASCII the only way? For computers to do anything (besides sit on a desk and collect dust) they need two things: 1. PROGRAMS 2. DATA A program is a.
Computer Science 335 Data Compression.
Information Theory Eighteenth Meeting. A Communication Model Messages are produced by a source transmitted over a channel to the destination. encoded.
S. Mandayam/ ECOMMS/ECE Dept./Rowan University Electrical Communications Systems ECE Spring 2007 Shreekanth Mandayam ECE Department Rowan University.
Chapter 2 Error-Detecting Codes. Outline 2.1 Why Error-Detecting Codes? 2.2 Simple Parity Checks 2.3 Error-Detecting Codes 2.4 Independent Errors: White.
Chapter 2 Parity checks Simple codes Modular arithmetic.
Lecture 4 Source Coding and Compression Dr.-Ing. Khaled Shawky Hassan
7/2/2015Errors1 Transmission errors are a way of life. In the digital world an error means that a bit value is flipped. An error can be isolated to a single.
Fundamentals of Multimedia Chapter 7 Lossless Compression Algorithms Ze-Nian Li and Mark S. Drew 건국대학교 인터넷미디어공학부 임 창 훈.
Numbers in Codes GCNU 1025 Numbers Save the Day. Coding Converting information into another form of representation (codes) based on a specific rule Encoding:
Information Theory and Security
S. Mandayam/ ECOMMS/ECE Dept./Rowan University Electrical Communications Systems Spring 2005 Shreekanth Mandayam ECE Department Rowan University.
Spring 2015 Mathematics in Management Science Binary Linear Codes Two Examples.
Huffman Coding Vida Movahedi October Contents A simple example Definitions Huffman Coding Algorithm Image Compression.
Richard W. Hamming Learning to Learn The Art of Doing Science and Engineering Session 10: Coding Theory I Learning to Learn The Art of Doing Science and.
Channel Coding Part 1: Block Coding
It is physically impossible for any data recording or transmission medium to be 100% perfect 100% of the time over its entire expected useful life. As.
Huffman Codes Information coding: –Most info transmission machines (computer terminal, Voyager spacecraft) use a binary code. –Why? These electric signals.
Lecture 10: Error Control Coding I Chapter 8 – Coding and Error Control From: Wireless Communications and Networks by William Stallings, Prentice Hall,
Huffman Encoding Veronica Morales.
E RROR D ETECTION A ND C ORRECTION C ODES Error Detection Code (Parity bit) Error Correction Code ( Hamming Code)
Information Coding in noisy channel error protection:-- improve tolerance of errors error detection: --- indicate occurrence of errors. Source.
1 i206: Lecture 2: Computer Architecture, Binary Encodings, and Data Representation Marti Hearst Spring 2012.
Richard W. Hamming Learning to Learn The Art of Doing Science and Engineering Session 13: Information Theory ` Learning to Learn The Art of Doing Science.
Compression.  Compression ratio: how much is the size reduced?  Symmetric/asymmetric: time difference to compress, decompress?  Lossless; lossy: any.
1 Source Coding and Compression Dr.-Ing. Khaled Shawky Hassan Room: C3-222, ext: 1204, Lecture 5.
Linawati Electrical Engineering Department Udayana University
Prof. Amr Goneid, AUC1 Analysis & Design of Algorithms (CSCE 321) Prof. Amr Goneid Department of Computer Science, AUC Part 8. Greedy Algorithms.
Error Control Code. Widely used in many areas, like communications, DVD, data storage… In communications, because of noise, you can never be sure that.
Huffman coding Content 1 Encoding and decoding messages Fixed-length coding Variable-length coding 2 Huffman coding.
1 Rectangular Codes Triplication codes: m 1 m 2 m 3 m 1 m 1 m 1 m 2 m 2 m 2 m 3 m 3 m 3 Repeated 3 times At receiving end, a majority vote is taken.
Coding Theory. 2 Communication System Channel encoder Source encoder Modulator Demodulator Channel Voice Image Data CRC encoder Interleaver Deinterleaver.
ECE 4710: Lecture #2 1 Frequency  Communication systems often use atmosphere for transmission  “Wireless”  Time-varying Electro-Magnetic (EM) Wave 
Richard W. Hamming Learning to Learn The Art of Doing Science and Engineering Session 12: Error-Correcting Codes Learning to Learn The Art of Doing Science.
Abdullah Aldahami ( ) April 6,  Huffman Coding is a simple algorithm that generates a set of variable sized codes with the minimum average.
Computer Science Division
ERROR DETECTING AND CORRECTING CODES -BY R.W. HAMMING PRESENTED BY- BALAKRISHNA DHARMANA.
CS 111 – Sept. 13 Error detection Error correction Review/practice chapter 1 questions Commitment: –Please read sections 2.1 and 2.2.
CS654: Digital Image Analysis Lecture 34: Different Coding Techniques.
Timo O. Korhonen, HUT Communication Laboratory 1 Convolutional encoding u Convolutional codes are applied in applications that require good performance.
David Wetherall Professor of Computer Science & Engineering Introduction to Computer Networks Error Coding Overview (§3.2)
Turbo Codes. 2 A Need for Better Codes Designing a channel code is always a tradeoff between energy efficiency and bandwidth efficiency. Lower rate Codes.
Lecture 12 Huffman Algorithm. In computer science and information theory, a Huffman code is a particular type of optimal prefix code that is commonly.
1 Decision Trees Greg Grudic (Notes borrowed from Thomas G. Dietterich and Tom Mitchell) [Edited by J. Wiebe] Decision Trees.
ECE 101 An Introduction to Information Technology Information Coding.
Error Detecting and Error Correcting Codes
Lossless Compression-Statistical Model Lossless Compression One important to note about entropy is that, unlike the thermodynamic measure of entropy,
8 Coding Theory Discrete Mathematics: A Concept-based Approach.
Huffman Codes ASCII is a fixed length 7 bit code that uses the same number of bits to define each character regardless of how frequently it occurs. Huffman.
COMP261 Lecture 22 Data Compression 2.
Data Compression.
Information Theory Michael J. Watts
Electrical Communications Systems ECE Spring 2007
S Digital Communication Systems
Fundamentals of Data Representation
Error Detection and Correction
Error Detection and Correction
Electrical Communications Systems ECE
Presentation transcript:

Session 11: Coding Theory II April 20, 2017 Richard W. Hamming Learning to Learn The Art of Doing Science and Engineering Session 11: Coding Theory II These notes provide a synopsis of key points in Dr. Hamming’s lecture presentation and corresponding book chapter. Hamming on Hamming: Learning to Learn

Coding Theory II Overview April 20, 2017 Coding Theory II Overview Two types of Coding Source Encoding Channel Encoding How do we find the best source encoding? Huffman encoding How do we encode for a noisy channel? Error correcting codes Start with an introduction to the session. Hamming on Hamming: Learning to Learn

The Best Source Encoding April 20, 2017 The Best Source Encoding We know efficient codes are related to probabilities. Intuition leads to the solution: What is information? Is it like time, do we know what it is, but cannot explain it if asked? Prove this by exchanging any two lengths and the average code length decreases. Hamming on Hamming: Learning to Learn

Deriving Huffman Encoding April 20, 2017 Deriving Huffman Encoding Create the best encoding of symbols from their probabilities. Build encoding tree from bottom up. Merge 2 least frequent nodes, combine their probabilities, repeat. Assign 0,1 to final 2 symbols. Back down the tree, split symbols, assigning 0 or 1 appended to parent’s code. Symbols are leaf nodes. Less frequent symbols added sooner, at greater depth, longer code. Hamming on Hamming: Learning to Learn

Deriving Huffman Encoding Tree (Visual) p(s1)=0.4 p(s2)=0.2 10 1 p(s3)=0.2 110 11 p(s4)=0.1 p(s4 & s5 & s3)=0.4 1110 111 p(s4 & s5)=0.2 Combine probabilities, left to right Assign codes, right to left. p(s5)=0.1 1111

Optimality Huffman trees give optimal (most efficient) codes. April 20, 2017 Optimality Huffman trees give optimal (most efficient) codes. Do we necessarily want optimal? What characteristics do we want? Efficiency (average code length)? Efficiency and low variability? Start from an optimum and move one way or the other. Sometimes you can get a large change a desired characteristic but pay little in performance. follow gradient away in shallow direction, a flat hilltop Hamming on Hamming: Learning to Learn

Why Huffman? Write a program to do it. April 20, 2017 Why Huffman? Write a program to do it. Sending Huffman tree and encoded info saves channel or storage capacity. Best possible data compression. If anything can be gained by compression. With uniform distribution, thus block code, no compression possible. No compression possible when all bits are needed to describe data. Huffman reduces entropy of variable codes Hamming on Hamming: Learning to Learn

Channel Encoding What to do with noise? April 20, 2017 Channel Encoding What to do with noise? Error detection Extra parity bit catches only 1 error. Probability of 2 errors in a message of length n increases with n. In a longer message parity bit takes up less channel capacity. In a longer message 2nd error more likely. Depends on probability p of error in a single bit. White noise assumption makes p(x=#errors) a binomial distribution Hamming on Hamming: Learning to Learn

April 20, 2017 Errors Probability of 2,3,4, and higher errors depends mostly on np product. np near 1 makes errors highly likely. Very small np makes double, triple errors highly unlikely. Tradeoff between error and efficiency. Engineering judgment that requires a concrete case and a real n and p. White noise assumption makes p(x=#errors) a binomial distribution Hamming on Hamming: Learning to Learn

Error Handling What if an error occurs? Repeat the message On marginal errors repeat messages will be clear On systematic errors you will repeat error until you get a double error. Not a good strategy. Strategy depends on the nature of the errors you expect.

Detecting Human Error Encoding alphanumeric symbols. Humans make different types of errors than machines Changing one digit: 667 to 677 Exchanging digits: 67 to 76 Parity can’t cope with the two digit exchange error

Detecting Human Errors Weighted code Add 1 parity symbol to a message of length n-1 so the message checksum below is 0. xk is the value for the kth symbol of the message, 0 ≤ xk ≤ 36

Different Types of Codes ISBN is a weighted code with modulo 11. Even/odd parity bit is for white noise Weighted code is for human noise. But machine can easily check code for mistake Many types of codes not talked about. Know what the noise is to determine type of code. Design a code to meet the cope with your particular type of noise problem.

Creativity in Deriving Codes Learn principles, then solve your problem. Next lecture will tell how Hamming derived his codes. If you were in the same situation Huffman or Hamming were in, could you come up with the codes if you had to? Creativity is simple if you are prepared.

Parting Thoughts Many scientists wasted the second half of their lives elaborating a famous theory. Leave elaborations to others. Follows from Hamming’s earlier statement, that those who come up with great ideas often don’t understand their own ideas as well as do those who follow. Set great work aside, try to do something else.