Foundations of Computer Science Spring Mathematical Preliminaries

Similar documents
Slides for Faculty Oxford University Press All rights reserved.

CHAPTER 8. Copyright Cengage Learning. All rights reserved.

HW Graph Theory SOLUTIONS (hbovik) - Q

Data Structure Lecture#10: Binary Trees (Chapter 5) U Kang Seoul National University

v V Question: How many edges are there in a graph with 10 vertices each of degree 6?

These notes present some properties of chordal graphs, a set of undirected graphs that are important for undirected graphical models.

Lecture 22 Tuesday, April 10

Figure 4.1: The evolution of a rooted tree.

Trees. Arash Rafiey. 20 October, 2015

CS521 \ Notes for the Final Exam

Recursion and Structural Induction

CSE 20 DISCRETE MATH WINTER

Treewidth and graph minors

Paths, Flowers and Vertex Cover

Graph Algorithms Using Depth First Search

Introduction to Automata Theory. BİL405 - Automata Theory and Formal Languages 1

Trees (Part 1, Theoretical) CSE 2320 Algorithms and Data Structures University of Texas at Arlington

THE EULER TOUR TECHNIQUE: EVALUATION OF TREE FUNCTIONS

Control Flow Graphs. (From Matthew S. Hetch. Flow Analysis of Computer Programs. North Holland ).

Trees. Q: Why study trees? A: Many advance ADTs are implemented using tree-based data structures.

Ambiguous Grammars and Compactification

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

Lecture 10: Strongly Connected Components, Biconnected Graphs

THE EULER TOUR TECHNIQUE: EVALUATION OF TREE FUNCTIONS

9.5 Equivalence Relations

Math 170- Graph Theory Notes

4 Basics of Trees. Petr Hliněný, FI MU Brno 1 FI: MA010: Trees and Forests

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

A Formalization of Transition P Systems

MATH 139 W12 Review 1 Checklist 1. Exam Checklist. 1. Introduction to Predicates and Quantified Statements (chapters ).

Directed Graph and Binary Trees

Advanced Set Representation Methods

The self-minor conjecture for infinite trees

Math 485, Graph Theory: Homework #3

Properties of red-black trees

Lecture 2 - Graph Theory Fundamentals - Reachability and Exploration 1

4&5 Binary Operations and Relations. The Integers. (part I)

Graph Algorithms. Chromatic Polynomials. Graph Algorithms

We will show that the height of a RB tree on n vertices is approximately 2*log n. In class I presented a simple structural proof of this claim:

Summary of Course Coverage

Algorithmic Aspects of Communication Networks

March 20/2003 Jayakanth Srinivasan,

Graphs and trees come up everywhere. We can view the internet as a graph (in many ways) Web search views web pages as a graph

Complexity Theory. Compiled By : Hari Prasad Pokhrel Page 1 of 20. ioenotes.edu.np

Math 776 Graph Theory Lecture Note 1 Basic concepts


Power Set of a set and Relations

An undirected graph is a tree if and only of there is a unique simple path between any 2 of its vertices.

DISCRETE MATHEMATICS

Search Trees. Undirected graph Directed graph Tree Binary search tree

Recursively Defined Functions

Constrained Types and their Expressiveness

Hamilton paths & circuits. Gray codes. Hamilton Circuits. Planar Graphs. Hamilton circuits. 10 Nov 2015

THREE LECTURES ON BASIC TOPOLOGY. 1. Basic notions.

Chapter 4. Relations & Graphs. 4.1 Relations. Exercises For each of the relations specified below:

GRAPH THEORY: AN INTRODUCTION

Discrete mathematics II. - Graphs

Logic and Discrete Mathematics. Section 2.5 Equivalence relations and partitions

CS 6783 (Applied Algorithms) Lecture 5

Reflection in the Chomsky Hierarchy

Crossing bridges. Crossing bridges Great Ideas in Theoretical Computer Science. Lecture 12: Graphs I: The Basics. Königsberg (Prussia)

CMSC th Lecture: Graph Theory: Trees.

Binary Relations McGraw-Hill Education

MAT 7003 : Mathematical Foundations. (for Software Engineering) J Paul Gibson, A207.

(2,4) Trees. 2/22/2006 (2,4) Trees 1

CSE 20 DISCRETE MATH. Fall

Lecture 1. 1 Notation

Graph Algorithms. Chapter 22. CPTR 430 Algorithms Graph Algorithms 1

1. Draw the state graphs for the finite automata which accept sets of strings composed of zeros and ones which:

Space vs Time, Cache vs Main Memory

Graph and Digraph Glossary

To illustrate what is intended the following are three write ups by students. Diagonalization

Lecture 2 : Counting X-trees

Algorithms and Data Structures

Lecture 5: Graphs. Rajat Mittal. IIT Kanpur

CHAPTER 10 GRAPHS AND TREES. Alessandro Artale UniBZ - artale/

1. Relations 2. Equivalence relations 3. Modular arithmetics. ! Think of relations as directed graphs! xry means there in an edge x!

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

Definition of Graphs and Trees. Representation of Trees.

A model of navigation history

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

Semantics via Syntax. f (4) = if define f (x) =2 x + 55.

Definition For vertices u, v V (G), the distance from u to v, denoted d(u, v), in G is the length of a shortest u, v-path. 1

arxiv: v1 [math.co] 28 Sep 2010

W4231: Analysis of Algorithms

Relations and Graphs

1 Leaffix Scan, Rootfix Scan, Tree Size, and Depth

Lecture 3: Graphs and flows

COL351: Analysis and Design of Algorithms (CSE, IITD, Semester-I ) Name: Entry number:

Trees. (Trees) Data Structures and Programming Spring / 28

Graph Theory CS/Math231 Discrete Mathematics Spring2015

Math 778S Spectral Graph Theory Handout #2: Basic graph theory

Trees. Truong Tuan Anh CSE-HCMUT

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

CSE 20 DISCRETE MATH. Winter

Introduction to Computers and Programming. Concept Question

Notes slides from before lecture. CSE 21, Winter 2017, Section A00. Lecture 10 Notes. Class URL:

(2,4) Trees Goodrich, Tamassia (2,4) Trees 1

Chapter 11: Graphs and Trees. March 23, 2008

Evolution Module. 6.1 Phylogenetic Trees. Bob Gardner and Lev Yampolski. Integrated Biology and Discrete Math (IBMS 1300)

Transcription:

Foundations of Computer Science Spring 2017 Equivalence Relation, Recursive Definition, and Mathematical Induction Mathematical Preliminaries Mohammad Ashiqur Rahman Department of Computer Science College of Engineering Tennessee Tech University

Equivalence Class R instead of R is an equivalence relation over A The equivalence class of an element x A is defined by R is the set [x] R = {y A x R y}. A Problem: P is the parity relation over N. x P y, iff x, y N have the same parity (even or odd). Prove that P is an equivalence. [0] P =? [1] P =? Are [0] P and [2] P are equal?

Lemma Over Equivalence Relation If R be an equivalence relation over A and x, y A, then either: [x] R = [y] R [x] R [y] R = Disjoint classes or sets Prove: Assume, [x] R [y] R. Then, prove [x] R = [y] R. By symmetry and transitivity, we will try to prove: [y] R [x] R First prove x R y: There is some element z such that z [x] R and z [y] R z [x] R and z [y] R, x R z and y R z y R z, by symmetry, z R y x R z and z R y, by transitivity, x R y

Lemma Over Equivalence Relation 2 If R be an equivalence relation over A and x, y A, then either [x] R = [y] R OR [x] R [y] R = Prove: Assume: [x] R [y] R Now prove [y] R [x] R : If u [y] R, then, y R u x R y and y R u, by transitivity, x R u Thus, u [x] R All elements in [y] R are also in [x] R : [y] R [x] R Similarly, [x] R [y] R Therefore, [x] R = [y] R If [x] R [y] R, then [x] R [y] R =

Theorem on Equivalence Class Let R be an equivalence relation over A. The equivalent classes of R partition A. Proof: The equivalence classes form a disjoint family of subsets of A. Let x A By reflexivity, x [x] R Each element of A is in one of the equivalence classes. Therefore, the union of equivalence classes is the entire set A.

Infinite Sets and Sets with infinite elements Formal language and automata theory Need technique(s) to define element of an infinite set N = {0, 1, 2, 3,...} How can a machine tell the next number or if a number is a natural number? Recursive definition Specifies a method for constructing the elements of the set Two components: A basis and a set of operations

The basis Recursive Definition of a Set A A finite set of elements that are explicitly designated as members of A Known element(s) A (finite) set of operation(s) To construct new elements of A from the previously defined elements The recursive step Define N, the set of natural numbers. Basis: 0 N Recursive step: If n N, then s(n) N s is the successor function: s(n) = n + 1 Closure: n N only if it can be obtained from 0 by a finite number of application of the operation s s(0), s(s(0)), s(s(s(0))),

Recursive Definition (More Example) Define the sum operation of two numbers m and n. Basis: Recursive step: Closure: Define the relation LT (less than). Basis: Recursive step: Closure:

Recursive Definition (More Example) 2 Define the sum operation of two numbers m and n. Basis: If n = 0, m + n = m Recursive step: m + s(n) = s (m + n) Closure: m + n = k, only if this can be obtained from m + 0 = m using finite number of application of the recursive step 3 + 2 = s(s(s(0))) + s(s(0)) = s(s(s(s(0))) + s(0)) = s(s(s(s(s(0))) + 0) Define the relation LT (less than). Basis: [0, 1] LT Recursive step: If [m, n] LT, then [m, s(n)] LT and [s(m), s(n)] LT Closure: [m, n] LT only if it can be obtained from [0, 1] by a finite.

Recursive Generation of X Recursive generation of X: X 0 = {x x is a basis element} X i + 1 = X i {x x can be generated by i + 1 operations} X = {x x X j for some j 0} X i X i + 1 X 1 X 2 X 0

Mathematical Induction Proof for the verification of hypothesized properties Establishing relationships between the elements of sets and operations on the sets Impossible to prove a property for each member of an infinite set Mathematical induction provides sufficient conditions to prove a property that holds for each element in a set. A recursively defined set Extend a property from the basis to the entire set. A recursive definition is applied to generate the relation LT. [i, j] LT and i < j Does every pair generated by this definition ensure i < j?

Let Principle of Mathematical Induction X be a set defined by recursion from the basis X 0 X 0, X 1, X 2,, X n, be the sequence of sets generated by the recursive process P be a property defined on the elements of X Does P hold for every element in X? If it can be shown that i. P holds for each element in X 0 ii. Whenever P holds for every element in X 0, X 1, X 2,, and X n, P also holds for every element in X n+1 Then, by the principle of mathematical induction, P holds for every element in X

Justification! Conditions (i) and (ii) are satisfied but P is not true for all elements in X! Let X j be the first set of its kinds for which P fails. j > 0 Condition (i): P is true for each element in X 0 P holds for all sets starting from X 0 to X j - 1 Recursive generation: X 0, X 1,, X j - 1 Condition (ii): P must hold for X j There is no first set for which P fails.

Steps of an Inductive Proof Three distinct steps: Property P holds for each element of the basis set. The statement of the inductive hypothesis P holds for each X 0, X 1, X 2,, and X n Inductive step: P can be extended for X n+1 Recursive definition of LT (Less Than) Basis: [0, 1] LT Recursive step: If [m, n] LT, then [m, s(n)] LT and [s(m), s(n)] LT Lt i + 1 = LT i {[m, s(n)], [s(m), s(n)]} Closure: [m, n] LT only if it can be obtained from [0, 1] by a finite. Does every ordered pair [i, j] generated by this definition satisfy the inequality, i < j?

Definition of LT: Correctness Proof The basis step: The inequality holds for all elements in the basis. X 0 = {[0, 1]} The inductive hypothesis: x < y, for all ordered pairs [x, y] LT n The inductive step: i < j for all ordered pairs [i, j] LT n + 1 Recursive step in the definition relates LT n + 1 with LT n Either [i, j] = [x, s(y)] or [i, j] = [s(x), s(y)] for some [x, y] LT n If [i, j] = [x, s(y)], then i = x < y < s(y) = j If [i, j] = [s(x), s(y)], then i = s(x) < s(y) = j

Arithmetic Series Basis: n = 0 Inductive hypothesis: Assume for k = 1, 2,, n Inductive step: Prove for k = n + 1,

Directed Graph G = (N, A): A mathematical structure (graph) consisting of a set N and a binary relation A on N N: Nodes or vertices A N N: Arcs or edges A: Adjacency relation [x, y] A In-degree vs. out-degree Path A sequence of nodes and/or arcs Null-path: zero length, path to itself a b d c

Directed Graph: (Ordered) Tree An acyclic directed graph Root: In-degree zero All other nodes with in-degree one T = (N, A, r), r is the root, r N Parent, child Leaf: out-degree zero Depth Ancestor, descendent Minimal common ancestor Subtree A binary tree A strictly binary tree x 1 x 2 x 3 x 4 x 5 x 6 x 9 x 10 x 11 x 7 x 8 x 12

A Strictly Binary Tree Recursive definition Basis: A directed graph T = ({r}, φ, r) is a binary tree Recursive step: If T 1 = (N 1, A 1, r 1 ) and T 2 = (N 2, A 2, r 2 ) are binary trees T 1 T 2 = φ r N 1 N 2 Then T = (N 1 N 2 r, A 1 A 2 {[r, r 1 ], [r, r 2 ]}, r) Closure: T is a strictly binary tree only if it can be obtained from the basis elements by a finite number of constructions given in the recursive step. Prove the following relation? # of arcs = 2 # of leaves 2

THANKS Source: - Chapter 1, Languages and Machines, Thomas Sudkamp