Lecture 4 What are Codes? (Section 1.2)

Slides:



Advertisements
Similar presentations
Error Correcting Codes Stanley Ziewacz 22M:151 Spring 2009.
Advertisements

Algebraic Structures: Group Theory II
On the Hardness of Graph Isomorphism Jacobo Tor á n SIAM J. Comput. Vol 33, p , Presenter: Qingwu Yang April, 2006.
1 Undecidability Andreas Klappenecker [based on slides by Prof. Welch]
Lecture 3 Set Operations & Set Functions. Recap Set: unordered collection of objects Equal sets have the same elements Subset: elements in A are also.
CSE115/ENGR160 Discrete Mathematics 02/16/12 Ming-Hsuan Yang UC Merced 1.
Lecture 6: Greedy Algorithms I Shang-Hua Teng. Optimization Problems A problem that may have many feasible solutions. Each solution has a value In maximization.
Discrete Structures Chapter 5 Relations and Functions
Data Flow Analysis Compiler Design Nov. 8, 2005.
September 17, 2009Theory of Computation Lecture 4: Programs and Computable Functions III 1 Macros Now we want to use macros of the form: W  f(V 1, …,
1 Section 1.8 Functions. 2 Loose Definition Mapping of each element of one set onto some element of another set –each element of 1st set must map to something,
16.Greedy algorithms Hsu, Lih-Hsing. Computer Theory Lab. Chapter 16P An activity-selection problem Suppose we have a set S = {a 1, a 2,..., a.
DODAAC WEB MANAGEMENT SYSTEM
Section 1.2 Basics of Functions
Functions.
Section 1.8: Functions A function is a mapping from one set to another that satisfies certain properties. We will first introduce the notion of a mapping.
1.Definition of a function 2.Finding function values 3.Using the vertical line test.
Mathematics. Session Set, Relation & Function Session - 3.
February 12, 2015Applied Discrete Mathematics Week 2: Functions and Sequences 1Exercises Question 1: Given a set A = {x, y, z} and a set B = {1, 2, 3,
Fall 2002CMSC Discrete Structures1 … and the following mathematical appetizer is about… Functions.
10/26/20151 … and the following mathematical appetizer is about… Functions.
Basic Structures: Functions Muhammad Arief download dari
MAT 212 Brief Calculus Section 5.4 The Definite Integral.
Basic Structures: Sets, Functions, Sequences, and Sums.
Huffman Codes. Overview  Huffman codes: compressing data (savings of 20% to 90%)  Huffman’s greedy algorithm uses a table of the frequencies of occurrence.
Huffman encoding.
Discrete Mathematics Lecture # 19 Inverse of Functions.
1 Undecidability Andreas Klappenecker [based on slides by Prof. Welch]
Discrete Structures Li Tak Sing( 李德成 ) Lectures
1 Lecture 5 Functions. 2 Functions in real applications Curve of a bridge can be described by a function Converting Celsius to Fahrenheit.
Chapter 2 1. Chapter Summary Sets The Language of Sets - Sec 2.1 – Lecture 8 Set Operations and Set Identities - Sec 2.2 – Lecture 9 Functions and sequences.
FUNCTIONS.
Functions 7/7/2016COCS - Discrete Structures1. Functions A function f from a set A to a set B is an assignment of exactly one element of B to each element.
Functions Goals Introduce the concept of function
Theory Of Computer Science
Functions Defined on General Sets
Functions Section 2.3.
Chapter 16: Greedy Algorithms
CS100: Discrete structures
Andreas Klappenecker [based on slides by Prof. Welch]
Functions CS 202 Epp section 7.1.
Algorithms (2IL15) – Lecture 2
Lecture 6 Instantaneous Codes and Kraft’s Theorem (Section 1.4)
Advanced Algorithms Analysis and Design
CS 220: Discrete Structures and their Applications
Chapter 16: Greedy algorithms Ming-Te Chi
Digital Encodings.
Warm Up Given y = –x² – x + 2 and the x-value, find the y-value in each… 1. x = –3, y = ____ 2. x = 0, y = ____ 3. x = 1, y = ____ –4 – −3 2 –
Greedy Algorithms TOPICS Greedy Strategy Activity Selection
Data Compression Section 4.8 of [KT].
Data Structures and Algorithms (AT70. 02) Comp. Sc. and Inf. Mgmt
Relations and Functions
Ch 5 Functions Chapter 5: Functions
Copyright © Cengage Learning. All rights reserved.
Data Structure and Algorithms
Chapter 16: Greedy algorithms Ming-Te Chi
Discrete Mathematics CS 2610
5.1 Functions.
Functions Section 2.3.
Introduction to Graph Theory
Huffman Coding Greedy Algorithm
Theory of Computation Lecture 6: Primitive Recursive Functions I
Lecture 7 Information Sources; Average Codeword Length (Section 2.1)
Lecture 11 The Noiseless Coding Theorem (Section 3.4)
Lecture 17 Making New Codes from Old Codes (Section 4.6)
Lecture 3 Strings and Things (Section 1.1)
Lecture 15 The Minimum Distance of a Code (Section 4.4)
Analysis of Algorithms CS 477/677
Theory of Information Lecture 13
Lecture 18 The Main Coding Theory Problem (Section 4.7)
Presentation transcript:

Lecture 4 What are Codes? (Section 1.2) Theory of Information Lecture 4 Theory of Information Lecture 4 What are Codes? (Section 1.2)

Theory of Information Lecture 4 Definition of a Code Theory of Information Lecture 4 DEFINITION Let A={a1,…,ar} be set, which we call a code alphabet. An r-ary code over A is a set CA*. The elements of C are called codewords. The number r is called the radix of the code. 2-ary codes are said to be binary, 3-ary codes are said to be ternary. DEFINITION Let S={s1,…,sq} be set, which we call a source alphabet. Let C be a code. An encoding function is a bijective function f: SC, from S onto C. The pair (C,f) is said to be an encoding scheme for S.

Theory of Information Lecture 4 An Example of a Code Theory of Information Lecture 4 Source alphabet: S={_,a,b,…,z} Code alphabet: A={0,1,…,9} Code: C={00,01,…,26} Encoding function f: f(_)=00, f(a)=01, f(b)=02, f(c)=03, f(d)=04, f(e)=05, f(f)=06, f(g)=07, f(h)=08, f(i)=09, f(j)=10, f(k)=11, f(l)=12, f(m)=13, f(n)=14, f(o)=15, f(p)=16, f(q)=17, f(r)=18, f(s)=19, f(t)=20, f(u)=21, f(v)=22, f(w)=23, f(x)=24, f(y)=25, f(z)=26. Encode the message “I am here”: Read 1000 1210 1105 0020 0810 1900 0315 2118 1905

Theory of Information Lecture 4 An Example of a Code Theory of Information Lecture 4 Why did not we choose the following encoding function f: f(_)=0, f(a)=1, f(b)=2, f(c)=3, f(d)=4, f(e)=5, f(f)=6, f(g)=7, f(h)=8, f(i)=9, f(j)=10, f(k)=11, f(l)=12, f(m)=13, f(n)=14, f(o)=15, f(p)=16, f(q)=17, f(r)=18, f(s)=19, f(t)=20, f(u)=21, f(v)=22, f(w)=23, f(x)=24, f(y)=25, f(z)=26. The above code is variable length. The code from the previous slide is a fixed length code, or a block code. Its length is 2. ASCII (American Standard Code for Information Exchange) is a block code of length 8.

Variable versus Fixed Length codes Theory of Information Lecture 4 The code of slide 4 is a variable length code: not every codeword has the same length. The code of slide 3 is a fixed length code, or a block code. Its length is 2. ASCII (American Standard Code for Information Exchange) is a block code of length 8. Main advantage of fixed length codes: Main advantage of variable length codes:

Theory of Information Lecture 4 Homework Theory of Information Lecture 4 Exercises 1,2,3,4,5,6,7 of Section 1.2.