Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "DISCRETE COMPUTATIONAL STRUCTURES CSE 2353 Fall 2010 Most slides modified from Discrete Mathematical Structures: Theory and Applications by D.S. Malik."— Presentation transcript:

1 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

2 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

3 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

4 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

5 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

6 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.

7 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

8 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?

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

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

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

12 CSE 2353 sp10 12 Mathematical Induction

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

14 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

15 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.

16 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

17 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

18 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

19 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

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

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

22 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

23 CSE 2353 sp10 23 Relation Arrow Diagram

24 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

25 CSE 2353 sp10 25 Relation Directed Graph

26 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

27 CSE 2353 sp10 27 Inverse of Relations

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

29 CSE 2353 sp10 29 Composition of Relations

30 CSE 2353 sp10 30 Properties of Relations

31 CSE 2353 sp10 31 Relations

32 CSE 2353 sp10 32 Relations

33 CSE 2353 sp10 33 Equivalence Classes

34 CSE 2353 sp10 34 Partially Ordered Sets

35 CSE 2353 sp10 35 Partially Ordered Sets

36 CSE 2353 sp10 36 Partially Ordered Sets

37 CSE 2353 sp10 37 Partially Ordered Sets

38 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.

39 CSE 2353 sp10 39 Partially Ordered Sets

40 CSE 2353 sp10 40 Digraph vs. Hasse Diagram

41 CSE 2353 sp10 41 Minimal and Maximal Elements

42 CSE 2353 sp10 42 Partially Ordered Sets

43 CSE 2353 sp10 43 Partially Ordered Sets

44 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

45 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

46 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

47 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)

48 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.

49 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

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

51 CSE 2353 sp10 51 Functions

52 CSE 2353 sp10 52 Functions

53 CSE 2353 sp10 53 Functions

54 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.

55 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

56 CSE 2353 sp10 56 Functions

57 CSE 2353 sp10 57 Functions

58 CSE 2353 sp10 58 Functions

59 CSE 2353 sp10 59 Special Functions and Cardinality of a Set

60 CSE 2353 sp10 60 Special Functions and Cardinality of a Set

61 CSE 2353 sp10 61 Special Functions and Cardinality of a Set

62 CSE 2353 sp10 62 Special Functions and Cardinality of a Set

63 CSE 2353 sp10 63 Special Functions and Cardinality of a Set

64 CSE 2353 sp10 64 Special Functions and Cardinality of a Set

65 CSE 2353 sp10 65 Mathematical Systems


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

Similar presentations


Ads by Google