CS 454 Theory of Computation Sonoma State University, Fall 2011 Instructor: B. (Ravi) Ravikumar Office: 116 I Darwin Hall Original slides by Vahid and.

Slides:



Advertisements
Similar presentations
More Set Definitions and Proofs 1.6, 1.7. Ordered n-tuple The ordered n-tuple (a1,a2,…an) is the ordered collection that has a1 as its first element,
Advertisements

Copyright © Cengage Learning. All rights reserved.
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
(CSC 102) Discrete Structures Lecture 14.
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Elementary Number Theory and Methods of Proof
The Engineering Design of Systems: Models and Methods
Discrete Mathematics Lecture 4 Harper Langston New York University.
CS5371 Theory of Computation
CS5371 Theory of Computation Lecture 1: Mathematics Review I (Basic Terminology)
Costas Busch - RPI1 Mathematical Preliminaries. Costas Busch - RPI2 Mathematical Preliminaries Sets Functions Relations Graphs Proof Techniques.
CS 454 Theory of Computation Sonoma State University, Fall 2011 Instructor: B. (Ravi) Ravikumar Office: 116 I Darwin Hall Original slides by Vahid and.
Courtesy Costas Busch - RPI1 Mathematical Preliminaries.
Theoretical Computer Science COMP 335 Fall 2004
Chapter 4: A Universal Program 1. Coding programs Example : For our programs P we have variables that are arranged in a certain order: Y 1 X 1 Z 1 X 2.
Set theory Sets: Powerful tool in computer science to solve real world problems. A set is a collection of distinct objects called elements. Traditionally,
Methods of Proof & Proof Strategies
 2004 SDU Introduction to the Theory of Computation My name: 冯好娣 My office: 计算中心 430
CS355 - Theory of Computation Lecture 2: Mathematical Preliminaries.
Induction and recursion
Introduction Chapter 0. Three Central Areas 1.Automata 2.Computability 3.Complexity.
1 Introduction to Abstract Mathematics Chapter 4: Sequences and Mathematical Induction Instructor: Hayk Melikya 4.1- Sequences. 4.2,
MATH 224 – Discrete Mathematics
Methods of Proof. This Lecture Now we have learnt the basics in logic. We are going to apply the logical rules in proving mathematical theorems. Direct.
INTRODUCTION TO THE THEORY OF COMPUTATION INTRODUCTION MICHAEL SIPSER, SECOND EDITION 1.
Section 2.4. Section Summary Sequences. Examples: Geometric Progression, Arithmetic Progression Recurrence Relations Example: Fibonacci Sequence Summations.
1 Strings and Languages. 2 Review Sets and sequences Functions and relations Graphs Boolean logic:      Proof techniques: – Construction, Contradiction,
Chapter 3 – Set Theory  .
Introduction to CS Theory Lecture 3 – Regular Languages Piotr Faliszewski
10/17/2015 Prepared by Dr.Saad Alabbad1 CS100 : Discrete Structures Proof Techniques(1) Dr.Saad Alabbad Department of Computer Science
Methods of Proof Lecture 3: Sep 9. This Lecture Now we have learnt the basics in logic. We are going to apply the logical rules in proving mathematical.
CSCI 2670 Introduction to Theory of Computing Instructor: Shelby Funk.
Mathematical Preliminaries. Sets Functions Relations Graphs Proof Techniques.
CS 103 Discrete Structures Lecture 10 Basic Structures: Sets (1)
Fall 2005Costas Busch - RPI1 Mathematical Preliminaries.
Prof. Busch - LSU1 Mathematical Preliminaries. Prof. Busch - LSU2 Mathematical Preliminaries Sets Functions Relations Graphs Proof Techniques.
Basic Structures: Sets, Functions, Sequences, and Sums CSC-2259 Discrete Structures Konstantin Busch - LSU1.
Language: Set of Strings
CompSci 102 Discrete Math for Computer Science
Theory of Computation, Feodor F. Dragan, Kent State University 1 TheoryofComputation Spring, 2015 (Feodor F. Dragan) Department of Computer Science Kent.
Copyright © Cengage Learning. All rights reserved.
Naïve Set Theory. Basic Definitions Naïve set theory is the non-axiomatic treatment of set theory. In the axiomatic treatment, which we will only allude.
ICS 253: Discrete Structures I Induction and Recursion King Fahd University of Petroleum & Minerals Information & Computer Science Department.
Mathematical Preliminaries
Sets Goal: Introduce the basic terminology of set theory.
CSE 311 Foundations of Computing I Lecture 9 Proofs and Set Theory Autumn 2012 CSE
CS 103 Discrete Structures Lecture 13 Induction and Recursion (1)
Basic Structures: Sets, Functions, Sequences, and Sums.
Foundations of Discrete Mathematics Chapters 5 By Dr. Dalia M. Gil, Ph.D.
Sets Definition: A set is an unordered collection of objects, called elements or members of the set. A set is said to contain its elements. We write a.
Based on slides by Patrice Belleville and Steve Wolfman CPSC 121: Models of Computation Unit 11: Sets.
Classifications LanguageGrammarAutomaton Regular, right- linear Right-linear, left-linear DFA, NFA Context-free PDA Context- sensitive LBA Recursively.
Based on slides by Patrice Belleville and Steve Wolfman CPSC 121: Models of Computation Unit 11: Sets.
1 Mathematical Preliminaries. 2 Sets Functions Relations Graphs Proof Techniques.
CSE 311: Foundations of Computing Fall 2013 Lecture 8: Proofs and Set theory.
Module #3 - Sets 3/2/2016(c) , Michael P. Frank 2. Sets and Set Operations.
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen Department of Computer Science University of Texas-Pan American.
Section 1.7. Definitions A theorem is a statement that can be shown to be true using: definitions other theorems axioms (statements which are given as.
Methods of Proof Lecture 4: Sep 20 (chapter 3 of the book, except 3.5 and 3.8)
Chapter 2 1. Chapter Summary Sets (This Slide) The Language of Sets - Sec 2.1 – Lecture 8 Set Operations and Set Identities - Sec 2.2 – Lecture 9 Functions.
Notions & Notations - 1ICOM 4075 (Fall 2010) UPRM Department of Electrical and Computer Engineering University of Puerto Rico at Mayagüez Fall 2010 ICOM.
Section 1.7. Section Summary Mathematical Proofs Forms of Theorems Direct Proofs Indirect Proofs Proof of the Contrapositive Proof by Contradiction.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
Chapter 2 Sets and Functions.
The Language of Sets If S is a set, then
Taibah University College of Computer Science & Engineering Course Title: Discrete Mathematics Code: CS 103 Chapter 2 Sets Slides are adopted from “Discrete.
Computer Science Department
Induction and recursion
Mathematical Preliminaries
Logic Logic is a discipline that studies the principles and methods used to construct valid arguments. An argument is a related sequence of statements.
Presentation transcript:

CS 454 Theory of Computation Sonoma State University, Fall 2011 Instructor: B. (Ravi) Ravikumar Office: 116 I Darwin Hall Original slides by Vahid and Givargis, Mani Srivastava and others Extensive editing by Ravikumar

Lecture 2 Goals: chapter 0 (45 minutes) Quiz 1 (10 minutes) Chapter 1 (rest of the class)

Chapter 0 Sets Set operations and set relations union, intersection, complement member, subset, equality Venn diagrams Problem: Show that (A U B) C = (A C)U (B C) Proof: Let x be in LHS set. Then, x is in both A U B and is in C. i.e., x is A and C, or x is in B and C. I.e., x is in A C or in B C. This means, x is in (A C)U (B C). Converse is similar.

Sequences and tuples A sequence is a list of objects where order is important. Thus, is a sequence that is different than. A finite sequence of length k is called a k-tuple. Thus, the above sequence is a 4-tuple. Power-set of a set A is the set of all its subsets. Ex: A = {1, 2} P(A) = {{1}, {2}, {1,2},  }

Cartesian product A X B = { | i is in A and j is in B } Example: A = {a, b, c}, B = { 1, 2} What is A X B?

Cartesian product A X B = { | i is in A and j is in B } Example: A = {a, b, c}, B = { 1, 2} What is A X B? A x B = {,,,,, } A X A X … X A is often denoted by A k.

Relations A relation on a set A is a subset of A X A. Example 1: A = { 1, 2, …, 10}, relation R is defined as: (a, b) is in R if a – b = 3. R = { (4, 1), (5, 2), (6, 3), (7, 4), (8, 5), (9, 6), (10, 7)} Example 2: Children’s game of Rock-Paper-Scissors. Relation could be “beats”. B = { (scissors, paper), (paper, rock), (rock, scissors)}

Functions A function (from A to B) is a relation R in which for every i, there is a unique j such that is in R. onto: for any y in B, there is at least one x in A such that is in R. one-one: for any y in B, there is at most one x in A such that is in R. bijective: for any y in B, there is exactly one x in A such that is in R.

Some special relations equivalence relation partial-order relation Graphs: Definition Example Strings and languages Boolean logic quantifiers Summary of mathematical terms

Definitions, theorems and proofs Definitions: A definition is the way to describe an object in a way that its characteristics are completely captured in the description. Assertions: Mathematical statement expresses some property of a set of defined objects. Assertions may or may not be true. Proof: is a convincing logical argument that a statement is true. The proofs are required to follow rigid rules and are not allowed any room for uncertainties or ambiguities. Theorem: is a proven assertion of some importance.

Rules for carrying out proof Usually assertions are compound statements that are connected using Boolean connectives and quantifiers. You can use theorems of Boolean logic in the proof. Direct proof: For example, if the assertion is P or Q, you can show it as follows: Suppose P is not true. Then, Q must be true. Similarly, to show P  Q, you assume P is true. From this, show Q is true. To show that P Q, you should show P  Q and Q  P.

Example: Every positive integer is either a prime, or is a product of two integers both of which are strictly smaller than itself. Is this a definition? Is it an assertion?

Example: Every positive integer is either a prime, or is a product of two integers both of which are strictly smaller than itself. It is an assertion. Is it a true assertion?

Example: Every positive integer is either a prime, or is a product of two integers both of which are strictly smaller than itself. Yes, it is a true assertion. How to prove this assertion?

Example: Every positive integer is either a prime, or is a product of two integers both of which are strictly smaller than itself. Yes, it is a true assertion. How to prove this assertion? This requires knowing the definition of a prime number. Prime number: A number x is prime if it has exactly two divisors, namely 1 and x.

Most of the theorems assert properties of a collection of objects. If the collection is finite, usually it is easy: you can show it for every member one by one. Need for proof really arises when the assertion is of the form : “Every object in a set X has some property Y.” where X is an infinite set. Now you can’t prove it one by one! Proof techniques: (not an exhaustive list!) proof by construction proof by contradiction proof by induction

Proof by construction: Definition: A k-regular graph is a graph in which every node has degree k. Theorem: For each even number n greater than 2, there exists a 3-regular graph with n nodes. Although the construction below shows the claim for n = 14, it can be readily generalized.

Proof by contradiction To show P  Q, assume Q is not true, then show that P is false, which contradicts the hypothesis that P is true. Theorem: is not rational, i.e., it can’t be written as a ratio of two integers. A proof by contradiction is presented in page 22. Alternate proof: (This is not a proof by contradiction.) This proof is based on two lemmas. Lemma 1: A positive integer n is a perfect square if and only if it has an odd number of divisors. Lemma 2: If a positive odd integer n has d divisors, then 2n has 2d divisors.

Proof by induction Example 1: Formula for mortgage calculation. Page 24 of text. Example 2: Show that the set of all binary strings of length n can be arranged in a way that every adjacent string differs in exactly one bit position, and further the first and the last string also differ in exactly one position. For n = 2, one such is 00, 01, 11, 10.

Assertion: Every integer is a sum of squares of two integers. This is not true. To disprove it, it is enough to find one integer (counter- example) that can’t be written as sum of two squares. Consider 3. Suppose x 2 + y 2 = 3 for some integers x and y. This means, x 2 is either 0, 1 or 2. (Why not any other number?) Case 1: x 2 is 0. Thus y 2 is 3. But there is no integer y such that y 2 = 3. (How can we show this?) Case 2: x 2 is 1. Thus y 2 is 2. But from previous slide, we know that there is no integer y such that y 2 = 2. Case 3: x 2 is 2. But from previous slide, we know that there is no integer x such that x 2 = 2. End of proof.