QED Q: Why is it called the triangle inequality? A: Analogue with euclidean distance in the plane: picture Defn: Minimum Distance of a code C:

Similar documents
MATH 54 - LECTURE 10

HW Graph Theory SOLUTIONS (hbovik) - Q

THREE LECTURES ON BASIC TOPOLOGY. 1. Basic notions.

Metric and metrizable spaces

CSC 310, Fall 2011 Solutions to Theory Assignment #1

Lecture 13. Types of error-free codes: Nonsingular, Uniquely-decodable and Prefix-free

Error-Correcting Codes

A metric space is a set S with a given distance (or metric) function d(x, y) which satisfies the conditions

γ(ɛ) (a, b) (a, d) (d, a) (a, b) (c, d) (d, d) (e, e) (e, a) (e, e) (a) Draw a picture of G.

Sets. De Morgan s laws. Mappings. Definition. Definition

Homework #5 Solutions Due: July 17, 2012 G = G = Find a standard form generator matrix for a code equivalent to C.

Cardinality Lectures

Topology Homework 3. Section Section 3.3. Samuel Otten

Point-Set Topology 1. TOPOLOGICAL SPACES AND CONTINUOUS FUNCTIONS

CSE101: Design and Analysis of Algorithms. Ragesh Jaiswal, CSE, UCSD

1 Variations of the Traveling Salesman Problem

Diagonalization. The cardinality of a finite set is easy to grasp: {1,3,4} = 3. But what about infinite sets?

Discrete mathematics , Fall Instructor: prof. János Pach

Lecture 6: Faces, Facets

CS 580: Algorithm Design and Analysis. Jeremiah Blocki Purdue University Spring 2018

= [ U 1 \ U 2 = B \ [ B \ B.

Lectures on Order and Topology

Theorem 2.9: nearest addition algorithm

1 Counting triangles and cliques

Limitations of Algorithmic Solvability In this Chapter we investigate the power of algorithms to solve problems Some can be solved algorithmically and

9.5 Equivalence Relations

Finite Math - J-term Homework. Section Inverse of a Square Matrix

OUTLINE. Paper Review First Paper The Zero-Error Side Information Problem and Chromatic Numbers, H. S. Witsenhausen Definitions:

Topology 550A Homework 3, Week 3 (Corrections: February 22, 2012)

THE GROWTH OF LIMITS OF VERTEX REPLACEMENT RULES

11. APPROXIMATION ALGORITHMS

Nearest Neighbor Classification

Approximation Algorithms

Notes on metric spaces and topology. Math 309: Topics in geometry. Dale Rolfsen. University of British Columbia

Ramsey s Theorem on Graphs

1KOd17RMoURxjn2 CSE 20 DISCRETE MATH Fall

EDAA40 At home exercises 1

However, this is not always true! For example, this fails if both A and B are closed and unbounded (find an example).

Functions 2/1/2017. Exercises. Exercises. Exercises. and the following mathematical appetizer is about. Functions. Functions

Propositional Logic. Andreas Klappenecker

COMPUTABILITY THEORY AND RECURSIVELY ENUMERABLE SETS

Shannon capacity and related problems in Information Theory and Ramsey Theory

Topology - I. Michael Shulman WOMP 2004

Functions. How is this definition written in symbolic logic notation?

CS473-Algorithms I. Lecture 13-A. Graphs. Cevdet Aykanat - Bilkent University Computer Engineering Department

Test 1, Spring 2013 ( Solutions): Provided by Jeff Collins and Anil Patel. 1. Axioms for a finite AFFINE plane of order n.

MATH 54 - LECTURE 4 DAN CRYTSER

THE PRINCIPLE OF INDUCTION. MARK FLANAGAN School of Electrical, Electronic and Communications Engineering University College Dublin

Comparing sizes of sets

Chapter Summary. Mathematical Induction Recursive Definitions Structural Induction Recursive Algorithms

Combinatorial Gems. Po-Shen Loh. June 2009

Part II. Graph Theory. Year

Cartesian Products of Graphs and Metric Spaces

Linear Block Codes. Allen B. MacKenzie Notes for February 4, 9, & 11, Some Definitions

Notes on point set topology, Fall 2010

PACKING DIGRAPHS WITH DIRECTED CLOSED TRAILS

MATH 271 Summer 2016 Assignment 4 solutions

Lecture 2 September 3

Discrete Mathematics for CS Spring 2008 David Wagner Note 13. An Introduction to Graphs

6. Finding Efficient Compressions; Huffman and Hu-Tucker

Simplicial Complexes: Second Lecture

Trees. 3. (Minimally Connected) G is connected and deleting any of its edges gives rise to a disconnected graph.

1 Metric spaces. d(x, x) = 0 for all x M, d(x, y) = d(y, x) for all x, y M,

11. APPROXIMATION ALGORITHMS

Lecture 1. 1 Notation

Graph theory - solutions to problem set 1

AtCoder World Tour Finals 2019

Fixed-Parameter Algorithms, IA166

2. Metric and Topological Spaces

Recursively Defined Functions

Edge Colorings of Complete Multipartite Graphs Forbidding Rainbow Cycles

The clique number of a random graph in (,1 2) Let ( ) # -subgraphs in = 2 =: ( ) We will be interested in s.t. ( )~1. To gain some intuition note ( )

UCSD ECE154C Handout #21 Prof. Young-Han Kim Thursday, June 8, Solutions to Practice Final Examination (Spring 2016)

CSC 373: Algorithm Design and Analysis Lecture 4

The clique number of a random graph in (,1 2) Let ( ) # -subgraphs in = 2 =: ( ) 2 ( ) ( )

CMPSCI611: The SUBSET-SUM Problem Lecture 18

CSE 20 DISCRETE MATH. Fall

A geometric non-existence proof of an extremal additive code

We show that the composite function h, h(x) = g(f(x)) is a reduction h: A m C.

Announcements. Problem Set 3 due Friday, October 21. Alternate Midterm Times. Drop by office hours! Ask questions at

Geometric data structures:

11. APPROXIMATION ALGORITHMS

Treewidth and graph minors

Counting. Andreas Klappenecker

February 24, :52 World Scientific Book - 9in x 6in soltys alg. Chapter 3. Greedy Algorithms

Interleaving Schemes on Circulant Graphs with Two Offsets

Data Compression - Seminar 4

Lecture 7: Asymmetric K-Center

The Chinese remainder theorem

Outline. CS38 Introduction to Algorithms. Approximation Algorithms. Optimization Problems. Set Cover. Set cover 5/29/2014. coping with intractibility

Move-to-front algorithm

Topic 10 Part 2 [474 marks]

Propositional Logic Formal Syntax and Semantics. Computability and Logic

MC 302 GRAPH THEORY 10/1/13 Solutions to HW #2 50 points + 6 XC points

1 Definition of Reduction

5.3 Recursive definitions and structural induction

Network flows and Menger s theorem

HW Graph Theory SOLUTIONS (hbovik)

MC302 GRAPH THEORY SOLUTIONS TO HOMEWORK #1 9/19/13 68 points + 6 extra credit points

Standard Boolean Forms

Transcription:

Lecture 3: Lecture notes posted online each week. Recall Defn Hamming distance: for words x = x 1... x n, y = y 1... y n of the same length over the same alphabet, d(x, y) = {1 i n : x i y i } i.e., d(x, y) is the number of of places at which x and y differ. Recall Proposition: d(x, y) is a metric, i,e., (0) d(x, y) 0 (1) d(x, y) = 0 iff x = y (2) d(x, y) = d(y, x) (3) d(x, z) d(x, y) + d(y, z) (triangle inequality) Proof: 0, 1 and 2 are obvious. (3) (there is a simple proof in the text). Alternatively d(x, y) can be written in terms of the distance function for words of length 1: n d(x, y) = d(x i, y i ) where i=1 d(x i, y i ) = 0 x i = y i 1 x i y i Prove (3) first for length n = 1: Case 1: If x = z, then LHS is 0 and so LHS RHS. Case 2: If x z, then LHS is 1 and either x y or y z. So, RHS is at least 1. So, LHS RHS. For general n: 1

By the case, n = 1, for each i, d(x i, z i ) d(x i, y i ) + d(y i, z i ). So, n n n n d(x, z) = d(x i, z i ) d(x i, y i )+d(y i, z i ) = d(x i, y i )+ d(y i, z i ) i=1 i=1 = d(x, y) + d(y, z) QED Q: Why is it called the triangle inequality? A: Analogue with euclidean distance in the plane: picture Defn: Minimum Distance of a code C: i=1 i=1 d(c) = min(d(c, c ) : c, c C, c c ) Notation: (n, M, d)-code: a code of length n, size M and minimum distance d The larger M is, the more distinct messages can be transmitted. The larger d(c) is, the more spread out are the codewords and so the more errors can be corrected. If we want to emphasize the alphabet size q, then we write (n, M, d) q. Examples: Recall the codes: 2-repetition code (n, M, d) = (2, 2, 2) C = {aa, bb} (n, M, d) = (2, 2, 2) 3-repetition code (n, M, d) = (3, 2, 3) n-repetition code (n, M, d) = (n, 2, n) C 1 : (2,4,1) C 2 : (3,4,2) 2

C 3 : (5,4,3) C 4 (the ternary 6-repetition code): (6, 3, 6) 3 For C 2 : For C 3 : 000 011 101 110 000 0 011 2 0 101 2 2 0 110 2 2 2 0 00000 01101 10110 11011 00000 0 01101 3 0 10110 3 4 0 11011 4 3 3 0 To assess the goodness of a code, you need to specify an encoder and a decoder (or decoding algorithm). The encoder is simply a one-to-one mapping from all words of some length k into the codewords. Defn Nearest-neighbor (minimum distance) decoder (NND): Given a code C and received word x find the codeword c C closest, in Hamming distance, to x. Decode x to c. If x is a codeword, then c = x. Otherwise, it does its best to find the transmitted codeword. Note: Recall that a decoder performs two functions: (i) given received word, finds the most likely transmitted codeword (ii) inverts the encoder 3

Here, we are ignoring (ii), since it is much easier than (i), and the concept of NND has only to do with the code, not the encoder. Two types of NND: Complete NND: If there is more than one closest codeword c, decode to an arbitrary such c. Incomplete NND : If there is more than one closest codeword, declare an error. Q: Why would you choose Incomplete? A: For very noisy channels, Complete may be too risky. We usually assume Incomplete. Example C 3 : Assume 11011 was transmitted. received # channel dist to decoded decoded word errors closest codeword word (Inc) word (Comp) 11011 0 0 11011 11011 11111 1 1 11011 11011 10111 2 1 10110 10110 11000 2 2? 00000 or 11011 Table showing the distance between received word (rows) and each codeword (colums). 00000 10110 01101 11011 11011 4 3 3 0 11111 5 2 2 1 10111 4 1 3 2 11000 2 3 3 2 4

Note: decoding succeeded when at most 1 channel error is made; this is related to d(c 3 ) = 3 as follows. Defn: Let v N (the natural numbers, 1, 2,... A code C is v-error-correcting if, using INND, the decoder corrects all occurrences of v or fewer errors in any codeword. Theorem 1.9(ii): A code C is v-error-correcting iff d(c) 2v + 1. Note: iff means if and only if. Defn: Hamming Ball: Let x F n and r N. B r (x) = {y F n : d(x, y) r}. Analogue with Euclidean ball. Proof of Theorem (If): We first claim that the Hamming balls of radius v centered at codewords of C are pairwise disjoint. Suppose not. If c, c C, c c and B v (c) B v (c ), there exists some x B v (c) B v (c ). Then d(c, c ) d(c, x) + d(x, c ) 2v. a contradiction Let c be transmitted codeword and x be received. Assume that at most v errors were made, i.e., d(c, x) v. Then x B v (c) and for any other c C, x B v (c ). Thus, c is the closest codeword to x and so NND will decode x to c. Only if: HW1. Equivalent statement: d(c) 2v + 1 iff v d(c) 1. 2 5

where r is the greatest integer less than or equal to r (e.g., 2.5 = 2. So, to correct 1 error, you need d(c) 3; to correct 2 errors you need d(c) 5. Examples: 3-repetition code is 1-error-correcting. C 3 is 1-error correcting. 5-repetition code is 2-error-correcting. Defn: Let u N. A code C is u-error-detecting if whenever at least one but at most u errors are made, the received word is not a codeword. Why is this called error-detecting? Theorem 1.9(i): A code C is u-error-detecting iff d(c) u + 1. Proof (If): if at most u errors are made, then the received word cannot be a codeword, and so the error can be detected. (Only If): HW1. Equivalent statement: d(c) u + 1 iff d(c) 1 u So, to detect 1 error, you need d(c) 2; to detect 2 errors you need d(c) 3. 6

Lecture 4: Recall: If d(c) 2v + 1, then C can correct up to v errors (using NND decoder). If d(c) u+1, then C can detect up to u errors (declares an error if received word is not a codeword and returns the received word if it is a codeword). Different decoding modes: Can use a code (i.e., a set of codewords) as either error-correcting or error detecting. Example: if d(c) = 3, then C can detect (up to) 2 errors OR correct (up to) 1 error. But it must decide what it wants to do in advance. Example: 3-repetition code (in this case, NND = majority vote): Assume 111 was transmitted: received # channel Correction Detection word errors mode mode 111 0 111 111 110 1 111? 100 2 000? 000 3 000 000 Note: if 2 errors are made in a codeword, then the detector will detect that there is an error, but it cannot in general say how many errors. Can do the same for C 3. Q: If d(c) = 3, does there exist a hybrid-decoder: if (exactly) 2 errors are made, decoder is guaranteed to detect; AND 7

if (exactly) 1 error is made, decoder is guaranteed to correct. A: No: Suppose 110 were received. If 111 were transmitted (so 1 error), then decoder must decode to 111. But if 000 were transmitted (so 2 errors), then decoder should declare an error. Thus, decoder must do two different things if 110 is received! Example: if d(c) = 4, then C can 1. (error detection) detect (up to) 3 errors OR 2. (error correction) correct (up to) 1 error OR 3. (hybrid decoder) simultaneously (guaranteed!) detect 2 errors and correct 1 error But it must decide what it wants to do in advance. Hybrid Decoder: Let x be received word and c be some nearest neighbour codeword. If d(x, c ) 1, decode to c (in this case, there can be only one such c ) If d(x, c ) 2, declare an error. Proof that this works: Let c be transmitted word, x received word, and c a nearest neighbour codeword to x. Case 1: 1 channel error. Then d(x, c) = 1 and so d(x, c ) 1. Thus, decoder decodes to c. And 8

Since d(c) = 4, c = c. d(c, c ) d(c, x) + d(x, c ) 2. So, decoder correctly corrects 1 error. Case 2: Then d(x, c) = 2. 2 channel errors. If d(x, c ) 1, then d(c, c ) d(c, x) + d(x, c ) 3. Since d(c) = 4, c = c. But impossible since d(x, c ) d(x, c). Thus, d(x, c ) 2, and decoder correctly detects an error. Can we do any better if d(c) = 4? No. Example: C = {0000, 1111} (4-repetition code). You cannot simultaneously guarantee: correction of 1 error and detection of 3 errors Suppose 0001 were received. 0000 could have been sent (in which case decoder should correct to 0000) 1111 could have been sent (in which case decoder should detect an error) Defns: 1. the weight w(x) of a binary word x is the number of 1 s it contains. 2. for binary words x, y, define x y := z where z i = x i y i and is mod-2 addition (or exclusive or). Useful fact: d(x, y) = w(x y) because x i y i iff x i y i = 1. Another useful fact: Let A and B be finite sets and f : A B be a function. 9

If f is 1-1 (i.e., whenever a, a A and a a, then f(a) f(a )), then A B. If f is onto (i.e., for all b B, there exists a A s.t. f(a) = b), then A B. If f is 1-1 and onto, then A = B. For fixed n and q, for an (n, M, d) q code, there is a trade-off (fight) between M and d. Defn: A q (n, d) is the largest M such that there is an (n, M, d) q code. For fixed n and q, as d increases, one would expect that A q (n, d) decreases. A major coding problem: determine A q (n, d). Clearly, A q (n, 1) = q n Proposition: A q (n, n) = q Proof: If C is code of length n, then d(c) = n iff all codewords differ in all positions. Thus, the map from C to F, defined by f(x 1 x 2... x n ) = x 1 is 1-1. Thus, A q (n, n) q. But the q-ary n-repetition code contains exactly q codewords. So, A q (n, n) = q. In HW1, you will find: A 2 (n, n 1) and A 2 (n, 2). Some other specific values (or ranges) of A q (n, d) are given in Table 2.4 in the text. But in general A q (n, d) is hard to find. In fact, it is Unsolved! Some more recent partial results will be posted on the website. 10