160 likes | 334 Views
The Engineering Design of Systems: Models and Methods. Chapter 4 – Discrete Mathematics: Sets, Relations, and Functions. By Dr. Sartuk KARASOY Middle East Technical University skarasoy@metu.edu.tr. The viewgraphs are mainly courtesy of Dr. Dennis Buede. Sets: Writing Set Membership.
E N D
The Engineering Design of Systems: Models and Methods Chapter 4 – Discrete Mathematics: Sets, Relations, and Functions By Dr. Sartuk KARASOY Middle East Technical University skarasoy@metu.edu.tr The viewgraphs are mainly courtesy of Dr. Dennis Buede. Chapter 4 - Discrete Mathematics: Sets, Relations, and Functions
Sets: Writing Set Membership x A: x is an element of A x A or (x A): x is not an element of A Chapter 4 - Discrete Mathematics: Sets, Relations, and Functions
Sets: Describing Members of a Set 1) A is the set of elements, x, that satisfies the property (or predicate), p(x). A = { x | p(x) is true }, where p(x) is “well-defined”. 2) Complete enumeration is the listing of all of the members of the set. 3) Use the characteristic function of the set, . 4) Use recursive definition: A = { xi+1 = xi + 1, i = 0, 1, 2, 3; where x0 = 0 }. 5) Use one or more set operators such as union, intersection, and complement. Chapter 4 - Discrete Mathematics: Sets, Relations, and Functions
Sets: Special Sets U: the universal set or set of all possible members : the null set, a set with no elements. (Note and {} are not the same. has no elements, while {} has one.) We can write = { x U | x x }. Singleton set: a set with only one element. Finite set: a set with a finite number of distinct elements. Infinite set: a set with an infinite number of distinct elements. Subsets or Set Inclusion:If A and B are two sets, and if every element of A is an element of B, then A is a subset of B, AB. If A is a subset of B, and if B has at least one element that is not in A, then A is a proper subset of B, AB. Equality of Sets:If A and B are sets, and A and B have precisely the same elements, then A and B are equal, A = B. Chapter 4 - Discrete Mathematics: Sets, Relations, and Functions
Sets: Operations Absolute Complement Set Inclusion Relative Complement Set Intersection Chapter 4 - Discrete Mathematics: Sets, Relations, and Functions Figure 4.1-4
Sets: Partitions A partition on a set A is a collection P of disjoint subsets of A whose union is A. For a collection Bi (i = 1, 2, ..., n) to be a partition P of A: 1. BiA for i = 1, 2, …, n. 2. BiBj = for i j. 3. for any x A, x Bi for some i; (alternatively B1B2 … Bn ) Chapter 4 - Discrete Mathematics: Sets, Relations, and Functions Figure 4.5
Sets: Power Sets The power set of a set A is denoted, P (A). The power set is the set of all sets that are subsets of A. Mathematically, the power set is the family (or set) of sets such that XAXP(A), or P(A) = { X | XA }. Chapter 4 - Discrete Mathematics: Sets, Relations, and Functions
Relations: Ordered Pairs & Cartesian Products An ordered pair is (x, y) if x A, y B. A Cartesian Product, AB, is defined over two sets, A and B, such that AB = { (a, b) | a A and b B}. That is, the Cartesian Product of two sets is the set of all possible ordered pairs of those two sets. An ordered n-tuple is defined to be A1 A2 ... An = { (a1, a2,..., an) | ai Ai, i = 1,2, ... ,n }, where (a1, a2,..., an). Chapter 4 - Discrete Mathematics: Sets, Relations, and Functions
Relations: Unary and Binary A unary relation on a set A relates elements of A to itself and is a subset, R, of AA. R is usually described by a predicate that defines the relation. Examples are , = , > , “taller than”, and “older than”. If a1 and a2A, we write (a1, a2) R, which means that a1 R a2 or a1 “is related to” a2. A binary relation is a relation R that relates elements of A to elements of B and is a subset of AB. The domain of R, written as “dom R”, is defined as: dom R = { x | x A and (x, y) R for some y B }. The range of R, written as “ran R”, is defined as: ran R = { y | y B and (x, y) R for some x A }. Again (a1, b1) R a1 R b1. Chapter 4 - Discrete Mathematics: Sets, Relations, and Functions
Proving Implications An implication is an “If …, then …” statement, which is commonly written as “If p is true, then q is true” or “p q”. There are eight common methods for proving implications of this form. 1. Trivial proof: show that q is true independently of the truth of p. 2. Vacuous proof: by mathematical convention, whenever p is false, p q is true. The vacuous proof involves showing that p is false. This method is key to understanding the full implications of the properties of unary relations that are discussed below. 3. Direct proof: assume that p is true and use arguments based upon other known facts and logic to show that q must be true. 4. Indirect proof: use direct proof of the contrapositive of p q. The contrapositive of a true implication is known to be true; the contrapositive of p q is ~q ~p (or q is false implies p is false). Here we assume q is false and prove via logic and known facts that p must be false. 5. Contradiction-based proof: DeMorgan’s laws can be used to show that p q is equivalent to ~(p (~q)), that is, the statement “p is true and q is false” is false. Proof by contradiction starts by assuming that (p (~q)) is true and then proving, based on this assumption, that some known truth must be false. If the only weak link in the argument is the assumption of (p (~q)), then this assumption must be wrong. 6. Proof by cases: if p can be written in the form of p1 or p2 or … or pn (p1 p2 … pn), then p q can be proven by proving p1 q, p2 q, …, pn q as separate arguments. 7. Proof by elimination of cases is an extension of the method above: recall from the second method that p q is equivalent to [ (p q) (~p)], that is (p and q are true) or (p is false). Now p can be partitioned into a set of cases as done in 6 and attacked one at a time. 8. Conditional proof: if we are to prove p (q r), we can prove the equivalent (p q) r. Chapter 4 - Discrete Mathematics: Sets, Relations, and Functions
Relations: Properties of Unary Relations (1) Reflexive: x R x for all x A, e.g., equality, , .. (2) Irreflexive: for all x A, e.g., greater than, is the father of. (3) Symmetric: If x R y, then y R x x, y A, e.g., equality, is spouse of. Note, if x y for all x and y in A, then the relation is symmetric by a vacuous proof. (4) Anti-symmetric: If x R y and y R x, then x = y x, y A, e.g., equality, , .. Note, if there is no situation in which “x R y and y R x” is true, then the relation is anti-symmetric by vacuous proof. (5) Asymmetric: If x R y, then y x x, y A, e.g., <, >. (6) Transitive: If x R y and y R z, then x R z x, y, z A, e.g., , , =, >. This property is the most difficult to grasp. If there is no situation in which “x R y and y R z”, then the relation is transitive by vacuous proof. (7) Intransitive: If for some x, y, z A, it is true that x R y, y R z, but x z, the relation is considered intransitive. Chapter 4 - Discrete Mathematics: Sets, Relations, and Functions
Relations: Partial Ordering & Equivalence Relations A relation R on A is a partial ordering if R is reflexive, anti-symmetric, and transitive. Examples of partial orderings are or on the real number line, or or on P(A). A relation R on a set A is an equivalence relation if R is reflexive, symmetric, and transitive. An example of an equivalence relation is equality. Chapter 4 - Discrete Mathematics: Sets, Relations, and Functions
Functions Let A and B be two non empty sets. We write a function, f, as f : AB and say that f maps every element of A (the domain) to one and only one element of B (the range). If (a, b) f, then element, b, is the image of element, a, under f. Note that a function can map elements of A onto itself, f : AA. A function, f, from A to B is a relation such that (a) dom f = A ( i) f is defined for each element of A, a A (ii) (a, b) where b B for each element of A, a A (b) if (a, b) f and (a, c) f, then b = c; that is, f is single-valued, or no element of A is related to two elements of B. A function is called one-to-one or injective if (a, b) f and (c, b) f implies a = c. That is, no two elements of A can be mapped into the same element of B by f. A function f : AB is onto or surjective if and only if ran f = B, that is, f is defined for every b B. If a function is both one-to-one and onto (or bijective), then the relation f -1 is single- valued and maps every element of B onto some element of A. f -1 is therefore a function, called the inverse function. Chapter 4 - Discrete Mathematics: Sets, Relations, and Functions
Functions: Composition Let R be a relation from A to B, and S be a relation from B to C. (a, c) is an element of the composition of R and S, (denoted RS or R S) if and only if there is an element b B such that a R b and b S c. That is, a and c must be linked together by b; a is mapped to b and b is mapped to c. (Note that some authors write the composition of R and S as SR so be careful.) The composition of functions is defined in the same way as the composition of relations is. Chapter 4 - Discrete Mathematics: Sets, Relations, and Functions