DISCRETE COMPUTATIONAL STRUCTURES CSE 2353 Fall 2010 Most slides modified from Discrete Mathematical Structures: Theory and Applications by D.S. Malik.

Slides:



Advertisements
Similar presentations
Discrete Math Methods of proof 1.
Advertisements

Discrete Mathematics I Lectures Chapter 6
Copyright © Cengage Learning. All rights reserved. CHAPTER 5 SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION.
The Engineering Design of Systems: Models and Methods
Induction and recursion
Induction Sections 4.1 and 4.2 of Rosen Fall 2010
Proof Must Have Statement of what is to be proven.
EE1J2 - Slide 1 EE1J2 – Discrete Maths Lecture 12 Number theory Mathematical induction Proof by induction Examples.
Chapter 12 Information Systems. 2 Chapter Goals Define the role of general information systems Explain how spreadsheets are organized Create spreadsheets.
Relations Chapter 9.
C OURSE : D ISCRETE STRUCTURE CODE : ICS 252 Lecturer: Shamiel Hashim 1 lecturer:Shamiel Hashim second semester Prepared by: amani Omer.
Methods of Proof & Proof Strategies
Course Outline Book: Discrete Mathematics by K. P. Bogart Topics:
Induction and recursion
Discrete Mathematics, 1st Edition Kevin Ferland
Discrete Mathematics, Part II CSE 2353 Fall 2007 Margaret H. Dunham Department of Computer Science and Engineering Southern Methodist University Some slides.
Chapter 9 Designing Databases Modern Systems Analysis and Design Sixth Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich.
Information Systems: Databases Define the role of general information systems Describe the elements of a database management system (DBMS) Describe the.
Chapter 9. Chapter Summary Relations and Their Properties Representing Relations Equivalence Relations Partial Orderings.
Chapter 9. Chapter Summary Relations and Their Properties n-ary Relations and Their Applications (not currently included in overheads) Representing Relations.
Methods of Proofs PREDICATE LOGIC The “Quantifiers” and are known as predicate quantifiers. " means for all and means there exists. Example 1: If we.
10/17/2015 Prepared by Dr.Saad Alabbad1 CS100 : Discrete Structures Proof Techniques(1) Dr.Saad Alabbad Department of Computer Science
1 Sections 1.5 & 3.1 Methods of Proof / Proof Strategy.
Chapter 9. Section 9.1 Binary Relations Definition: A binary relation R from a set A to a set B is a subset R ⊆ A × B. Example: Let A = { 0, 1,2 } and.
DISCRETE COMPUTATIONAL STRUCTURES CSE 2353 Fall 2011 Most slides modified from Discrete Mathematical Structures: Theory and Applications.
DISCRETE COMPUTATIONAL STRUCTURES
Discrete Mathematics Relation.
CompSci 102 Discrete Math for Computer Science
DISCRETE COMPUTATIONAL STRUCTURES CSE 2353 Fall 2005.
Relations and their Properties
Discrete Structures & Algorithms More on Methods of Proof / Mathematical Induction EECE 320 — UBC.
Mathematical Preliminaries
CompSci 102 Discrete Math for Computer Science March 1, 2012 Prof. Rodger Slides modified from Rosen.
Methods of Proof Dr. Yasir Ali. Proof A (logical) proof of a statement is a finite sequence of statements (called the steps of the proof) leading from.
CS 103 Discrete Structures Lecture 13 Induction and Recursion (1)
Foundations of Discrete Mathematics Chapters 5 By Dr. Dalia M. Gil, Ph.D.
DISCRETE COMPUTATIONAL STRUCTURES
Chapter 9. Chapter Summary Relations and Their Properties n-ary Relations and Their Applications (not currently included in overheads) Representing Relations.
Chapter Relations and Their Properties
DISCRETE COMPUTATIONAL STRUCTURES CSE 2353 Material for Second Test Spring 2006.
Mathematical Induction Section 5.1. Climbing an Infinite Ladder Suppose we have an infinite ladder: 1.We can reach the first rung of the ladder. 2.If.
Discrete Mathematics, Part IIIb CSE 2353 Fall 2007 Margaret H. Dunham Department of Computer Science and Engineering Southern Methodist University Some.
Mathematical Induction
CS104:Discrete Structures Chapter 2: Proof Techniques.
CSE 311: Foundations of Computing Fall 2013 Lecture 8: Proofs and Set theory.
DISCRETE COMPUTATIONAL STRUCTURES CS Fall 2005.
CompSci 102 Discrete Math for Computer Science March 13, 2012 Prof. Rodger Slides modified from Rosen.
Chapter 5. Section 5.1 Climbing an Infinite Ladder Suppose we have an infinite ladder: 1.We can reach the first rung of the ladder. 2.If we can reach.
Discrete Mathematical Structures: Theory and Applications 1 Logic: Learning Objectives  Learn about statements (propositions)  Learn how to use logical.
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.
DISCRETE COMPUTATIONAL STRUCTURES CSE 2353 Fall 2011 Most slides modified from Discrete Mathematical Structures: Theory and Applications.
DISCRETE COMPUTATIONAL STRUCTURES CSE 2353 Spring 2009 Most slides modified from Discrete Mathematical Structures: Theory and Applications.
Introduction to Set Theory (§1.6) A set is a new type of structure, representing an unordered collection (group, plurality) of zero or more distinct (different)
DISCRETE COMPUTATIONAL STRUCTURES CSE 2353 Fall 2010 Most slides modified from Discrete Mathematical Structures: Theory and Applications by D.S. Malik.
Chapter 5 1. Chapter Summary  Mathematical Induction  Strong Induction  Recursive Definitions  Structural Induction  Recursive Algorithms.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
Proof And Strategies Chapter 2. Lecturer: Amani Mahajoub Omer Department of Computer Science and Software Engineering Discrete Structures Definition Discrete.
Discrete Mathematics Margaret H. Dunham
Learn about relations and their basic properties
Advanced Algorithms Analysis and Design
Induction and recursion
DISCRETE COMPUTATIONAL STRUCTURES
Methods of Proof A mathematical theorem is usually of the form pq
DISCRETE COMPUTATIONAL STRUCTURES
Induction and recursion
DISCRETE COMPUTATIONAL STRUCTURES
Elementary Number Theory & Proofs
DISCRETE COMPUTATIONAL STRUCTURES
Mathematical Induction
Presentation transcript:

DISCRETE COMPUTATIONAL STRUCTURES CSE 2353 Fall 2010 Most slides modified from Discrete Mathematical Structures: Theory and Applications by D.S. Malik and M.K. Sen

CSE 2353 OUTLINE PART I 1.Sets 2.Logic PART II 3.Proof Techniques 4.Relations 5.Functions PART III 6.Number Theory 7.Boolean Algebra

CSE 2353 OUTLINE PART I 1.Sets 2.Logic PART II 3.Proof Techniques 4.Relations 5.Functions PART III 6.Number Theory 7.Boolean Algebra

CSE 2353 sp10 4 Proof Techniques  Direct Proof or Proof by Direct Method  Proof of those theorems that can be expressed in the form ∀x (P(x) → Q(x)), D is the domain of discourse  Select a particular, but arbitrarily chosen, member a of the domain D  Show that the statement P(a) → Q(a) is true. (Assume that P(a) is true  Show that Q(a) is true  By the rule of Universal Generalization (UG), ∀x (P(x) → Q(x)) is true

CSE 2353 sp10 5 Proof Techniques  Indirect Proof  The implication p → q is equivalent to the implication (∼q → ∼p)  Therefore, in order to show that p → q is true, one can also show that the implication (∼q → ∼p) is true  To show that (∼q → ∼p) is true, assume that the negation of q is true and prove that the negation of p is true

CSE 2353 sp10 6 Proof Techniques  Proof by Contradiction  Assume that the conclusion is not true and then arrive at a contradiction  Example: Prove that there are infinitely many prime numbers  Proof:  Assume there are not infinitely many prime numbers, therefore they are listable, i.e. p 1,p 2,…,p n  Consider the number q = p 1 p 2 …p n +1. q is not divisible by any of the listed primes  Therefore, q is a prime. However, it was not listed.  Contradiction! Therefore, there are infinitely many primes.

CSE 2353 sp10 7 Proof Techniques  Proof of Biimplications  To prove a theorem of the form ∀ x (P(x) ↔ Q(x )), where D is the domain of the discourse, consider an arbitrary but fixed element a from D. For this a, prove that the biimplication P(a) ↔ Q(a) is true  The biimplication p ↔ q is equivalent to (p → q) ∧ (q → p)  Prove that the implications p → q and q → p are true  Assume that p is true and show that q is true  Assume that q is true and show that p is true

CSE 2353 sp10 8 Proof Techniques  Proof of Equivalent Statements  Consider the theorem that says that statements p,q and r are equivalent  Show that p → q, q → r and r → p  Assume p and prove q. Then assume q and prove r Finally, assume r and prove p  What other methods are possible?

CSE 2353 sp10 9 Other Proof Techniques  Vacuous  Trivial  Contrapositive  Counter Example  Divide into Cases  Constructive

CSE 2353 sp10 10 Proof Basics You can not prove by example

CSE 2353 sp10 11 Proofs in Computer Science  Proof of program correctness  Proofs are used to verify approaches

CSE 2353 sp10 12 Mathematical Induction

CSE 2353 sp10 13 Mathematical Induction  Proof of a mathematical statement by the principle of mathematical induction consists of three steps:

CSE 2353 sp10 14 Mathematical Induction  Assume that when a domino is knocked over, the next domino is knocked over by it  Show that if the first domino is knocked over, then all the dominoes will be knocked over

CSE 2353 sp10 15 Mathematical Induction  Let P(n) denote the statement that then n th domino is knocked over  Show that P(1) is true  Assume some P(k) is true, i.e. the k th domino is knocked over for some  Prove that P(k+1) is true, i.e.

CSE 2353 sp10 16 Mathematical Induction  Assume that when a staircase is climbed, the next staircase is also climbed  Show that if the first staircase is climbed then all staircases can be climbed  Let P(n) denote the statement that then n th staircase is climbed  It is given that the first staircase is climbed, so P(1) is true

CSE 2353 sp10 17 Mathematical Induction  Suppose some P(k) is true, i.e. the k th staircase is climbed for some  By the assumption, because the k th staircase was climbed, the k+1 st staircase was climbed  Therefore, P(k) is true, so

CSE 2353 OUTLINE PART I 1.Sets 2.Logic PART II 3.Proof Techniques 4.Relations 5.Functions PART III 6.Number Theory 7.Boolean Algebra

CSE 2353 sp10 19 Learning Objectives  Learn about relations and their basic properties  Explore equivalence relations  Become aware of closures  Learn about posets  Explore how relations are used in the design of relational databases

CSE 2353 sp10 20 Relations  Relations are a natural way to associate objects of various sets

CSE 2353 sp10 21 Relations  R can be described in  Roster form  Set-builder form

CSE 2353 sp10 22 Relations  Arrow Diagram  Write the elements of A in one column  Write the elements B in another column  Draw an arrow from an element, a, of A to an element, b, of B, if (a,b)  R  Here, A = {2,3,5} and B = {7,10,12,30} and R from A into B is defined as follows: For all a  A and b  B, a R b if and only if a divides b  The symbol → (called an arrow) represents the relation R

CSE 2353 sp10 23 Relation Arrow Diagram

CSE 2353 sp10 24 Relations  Directed Graph  Let R be a relation on a finite set A  Describe R pictorially as follows:  For each element of A, draw a small or big dot and label the dot by the corresponding element of A  Draw an arrow from a dot labeled a, to another dot labeled, b, if a R b.  Resulting pictorial representation of R is called the directed graph representation of the relation R

CSE 2353 sp10 25 Relation Directed Graph

CSE 2353 sp10 26 Relations  Let A = {1, 2, 3, 4} and B = {p, q, r}. Let R = {(1, q), (2, r ), (3, q), (4, p)}. Then R −1 = {(q, 1), (r, 2), (q, 3), (p, 4)}  To find R −1, just reverse the directions of the arrows

CSE 2353 sp10 27 Inverse of Relations

CSE 2353 sp10 28 Relations  Constructing New Relations from Existing Relations

CSE 2353 sp10 29 Composition of Relations

CSE 2353 sp10 30 Properties of Relations

CSE 2353 sp10 31 Relations

CSE 2353 sp10 32 Relations

CSE 2353 sp10 33 Equivalence Classes

CSE 2353 sp10 34 Partially Ordered Sets

CSE 2353 sp10 35 Partially Ordered Sets

CSE 2353 sp10 36 Partially Ordered Sets

CSE 2353 sp10 37 Partially Ordered Sets

CSE 2353 sp10 38 Partially Ordered Sets  Let S = {1, 2, 3}. Then P(S) = { , {1}, {2}, {3}, {1, 2}, {2, 3}, {1, 3}, S}  Now (P(S),≤) is a poset, where ≤ denotes the set inclusion relation.

CSE 2353 sp10 39 Partially Ordered Sets

CSE 2353 sp10 40 Digraph vs. Hasse Diagram

CSE 2353 sp10 41 Minimal and Maximal Elements

CSE 2353 sp10 42 Partially Ordered Sets

CSE 2353 sp10 43 Partially Ordered Sets

CSE 2353 sp10 44 Application: Relational Database  A database is a shared and integrated computer structure that stores  End-user data; i.e., raw facts that are of interest to the end user;  Metadata, i.e., data about data through which data are integrated  A database can be thought of as a well-organized electronic file cabinet whose contents are managed by software known as a database management system; that is, a collection of programs to manage the data and control the accessibility of the data

CSE 2353 sp10 45 Application: Relational Database  In a relational database system, tables are considered as relations  A table is an n-ary relation, where n is the number of columns in the tables  The headings of the columns of a table are called attributes, or fields, and each row is called a record  The domain of a field is the set of all (possible) elements in that column

CSE 2353 sp10 46 Application: Relational Database  Each entry in the ID column uniquely identifies the row containing that ID  Such a field is called a primary key  Sometimes, a primary key may consist of more than one field

CSE 2353 sp10 47 Application: Relational Database  Structured Query Language (SQL)  Information from a database is retrieved via a query, which is a request to the database for some information  A relational database management system provides a standard language, called structured query language (SQL)

CSE 2353 sp10 48 Application: Relational Database  Structured Query Language (SQL)  An SQL contains commands to create tables, insert data into tables, update tables, delete tables, etc.  Once the tables are created, commands can be used to manipulate data into those tables.  The most commonly used command for this purpose is the select command. The select command allows the user to do the following:  Specify what information is to be retrieved and from which tables.  Specify conditions to retrieve the data in a specific form.  Specify how the retrieved data are to be displayed.

CSE 2353 OUTLINE PART I 1.Sets 2.Logic PART II 3.Proof Techniques 4.Relations 5.Functions PART III 6.Number Theory 7.Boolean Algebra

CSE 2353 sp10 50 Learning Objectives  Learn about functions  Explore various properties of functions  Learn about binary operations

CSE 2353 sp10 51 Functions

CSE 2353 sp10 52 Functions

CSE 2353 sp10 53 Functions

CSE 2353 sp10 54 Functions  Every function is a relation  Therefore, functions on finite sets can be described by arrow diagrams. In the case of functions, the arrow diagram may be drawn slightly differently.  If f : A → B is a function from a finite set A into a finite set B, then in the arrow diagram, the elements of A are enclosed in ellipses rather than individual boxes.

CSE 2353 sp10 55 Functions  To determine from its arrow diagram whether a relation f from a set A into a set B is a function, two things are checked: 1)Check to see if there is an arrow from each element of A to an element of B  This would ensure that the domain of f is the set A, i.e., D(f) = A 2)Check to see that there is only one arrow from each element of A to an element of B  This would ensure that f is well defined

CSE 2353 sp10 56 Functions

CSE 2353 sp10 57 Functions

CSE 2353 sp10 58 Functions

CSE 2353 sp10 59 Special Functions and Cardinality of a Set

CSE 2353 sp10 60 Special Functions and Cardinality of a Set

CSE 2353 sp10 61 Special Functions and Cardinality of a Set

CSE 2353 sp10 62 Special Functions and Cardinality of a Set

CSE 2353 sp10 63 Special Functions and Cardinality of a Set

CSE 2353 sp10 64 Special Functions and Cardinality of a Set

CSE 2353 sp10 65 Mathematical Systems