Presentation is loading. Please wait.

Presentation is loading. Please wait.

Mathematical Background

Similar presentations


Presentation on theme: "Mathematical Background"— Presentation transcript:

1 Mathematical Background
Sets Cardinality Relations Cartesian Products Functions Properties of Functions CSE 373, Copyright S. Tanimoto, Mathematical Background -

2 CSE 373, Copyright S. Tanimoto, 2001 Mathematical Background -
Sets A set is a collection of distinct objects. (An object is some identifiable person, place, thing, or idea). The objects are usually represented by symbols. The set consisting of Al Gore and George W. Bush: { Al Gore, George W. Bush} CSE 373, Copyright S. Tanimoto, Mathematical Background -

3 CSE 373, Copyright S. Tanimoto, 2001 Mathematical Background -
Sets (Continued) The set consisting of the first 5 primes: { 2, 3, 5, 7, 11} The set consisting of all strings made up of only a and b. { “”, “a”, “b”, “aa”, “ab”, “ba”, “bb”, } (or, without the use of quotes...) { λ, a, b, aa, ab, ba, bb, } CSE 373, Copyright S. Tanimoto, Mathematical Background -

4 CSE 373, Copyright S. Tanimoto, 2001 Mathematical Background -
Sets (continued) The objects that make up a set are called its elements or members. If an object e is an elements of a set S, then we write e  S The empty set { } contains zero elements. A set may contain other sets as members: { {a}, {b}, {a, b} } contains three (top-level) elements. { { } } contains one element. CSE 373, Copyright S. Tanimoto, Mathematical Background -

5 CSE 373, Copyright S. Tanimoto, 2001 Mathematical Background -
Cardinality A set may be finite or infinite. The cardinality of a finite set is the number of (top-level) elements it contains. Card( { a, b, c } ) = 3 We sometimes use vertical bars: | { a, b, c } | = 3 CSE 373, Copyright S. Tanimoto, Mathematical Background -

6 CSE 373, Copyright S. Tanimoto, 2001 Mathematical Background -
Binary Relations Suppose S is a set. Let a  S and b  S. Then (a, b) is an ordered pair of elements of S. The set of all ordered pairs over S is: { (x, y) | x  S, y  S } = the set of all ordered pairs (x, y) such that x is in S and y is in S. Any set of ordered pairs over S is called a binary relation on S. CSE 373, Copyright S. Tanimoto, Mathematical Background -

7 Binary Relations (cont)
Examples: Let S = { a, b, c } B1 = { (a, b), (c, b), (c, c) } is a binary relation on S. B2 = { (a, a), (b, b), (c, c) } is a binary relation on S. It happens to be reflexive. B3 = { } is a binary relation on S. It happens to be empty. CSE 373, Copyright S. Tanimoto, Mathematical Background -

8 Binary Relations (reflexivity)
A binary relation on S is reflexive provided that for every element in S, the pair of that element with itself is a pair in S. S = { a, b, c } R4 = { (a, a), (a, b), (b, b), (b, c), (c, c) } is reflexive. R5 = { (a, a), (a, b), (b, b) } is not reflexive, because c  S but (c, c) R5. CSE 373, Copyright S. Tanimoto, Mathematical Background -

9 Binary Relations (symmetry)
A binary relation R on S is symmetric provided that any pair that occurs in R also occurs “reversed” in R. S = { a, b, c } R6 = { (a, b), (b, a), (c, c) } is symmetric. { } is symmetric. R7 = { (a, b), (b, b), (c, c) } is not symmetric, because (a, b)  R7 but (b, a) R7. CSE 373, Copyright S. Tanimoto, Mathematical Background -

10 Binary Relations (transitivity)
A binary relation B on S is transitive provided that whenever there is a two-element “chain” in B there is also the corresponding “shortcut” in B. B is transitive iff (x  S,  y  S,  z  S) (x, y)  B and (y, z)  B  (x, z)  B) R8 = { (a, b), (a, c), (b, c), (c, c) } is transitive. R9 = { (a, b), (b, a)} is not transitive, because (a, b) and (b, a) form a chain, but (a, a), the shortcut, is not present. CSE 373, Copyright S. Tanimoto, Mathematical Background -

11 CSE 373, Copyright S. Tanimoto, 2001 Mathematical Background -
Cartesian Products Let S1 and S2 be sets. Then the cartesian product S1 X S2 is the set of all ordered pairs in which the first element is a member of S1 and the second element is a member of S2. Example: Let A = { a, b, c }, Let B = { 1, 2 } then A X B = { (a, 1), (a, 2), (b, 1), (b, 2), (c, 1), (c, 2) } CSE 373, Copyright S. Tanimoto, Mathematical Background -

12 Cartesian Products (n-way)
The n-way cartesian product S1 X S2 X ... X Sn is the set of all ordered n-tuples in which the ith element is an element of Si. S1 X S2 X ... X Sn = { (s1, s2, ..., sn ) | s1S1, s2S2, ..., s2S2 } CSE 373, Copyright S. Tanimoto, Mathematical Background -

13 CSE 373, Copyright S. Tanimoto, 2001 Mathematical Background -
Functions Let S1 and S2 be sets. Let f be a subset of S1 X S2. (f is a binary relation on S1 and S2) If for each x in S1 there is precisely one y in S2 such that (x, y)  f, then f is a function from S1 to S2. We also say f is a function on S1. S1 is called the domain of f and S2 is called the range of f. CSE 373, Copyright S. Tanimoto, Mathematical Background -

14 CSE 373, Copyright S. Tanimoto, 2001 Mathematical Background -
Functions (Examples) Let S1 = { a, b, c} and S2 = { 1, 2}. Let f1 = { (a, 1), (b, 1), (c, 2) } f1 is a function on S1. Let f2 = { (a, 1), (b, 1), (b, 2), (c, 1) } f2 is not a function. Let f3 = { (a, 1), (b, 2)} f3 is not a function on S1. But it is a partial function on S1. It’s actually a function on { a, b }. CSE 373, Copyright S. Tanimoto, Mathematical Background -

15 Properties of Functions
Let f be a function from S1 to S2. If every element of S2 appears as the second element of some ordered pair in f, then f is said to be “onto”. (It’s also said to be a surjection.) With S1 = { a, b, c} and S2 = { 1, 2}. and f1 = { (a, 1), (b, 1), (c, 2) }, f1 is onto. Let f4 = { (a, 1), (b, 1), (c, 1) } with the same domain and range. f4 is not onto. CSE 373, Copyright S. Tanimoto, Mathematical Background -

16 Properties of Functions (cont)
Let f be a function from S1 to S2. If no two elements of S1 are paired with the same element of S2 then f is said to be “one-to-one”. (It’s also said to be a injection.) With S1 = { a, b, c} and S2 = { 1, 2}. and f1 = { (a, 1), (b, 1), (c, 2) }, f1 is not one-to-one, since a and b are both paired with 1. Let f5 = { (a, 1), (b, 2)} with domain { a, b}. f5 is one-to-one. CSE 373, Copyright S. Tanimoto, Mathematical Background -

17 Properties of Functions
Let S1 = { a, b, c} and S2 = { 1, 2}. Let f1 = { (a, 1), (b, 1), (c, 2) } f1 is a function on S1. Let f2 = { (a, 1), (b, 1), (b, 2), (c, 1) } f2 is not a function. Let f3 = { (a, 1), (b, 2)} f3 is not a function on S1. But it is a partial function on S1. It’s actually a function on { a, b }. CSE 373, Copyright S. Tanimoto, Mathematical Background -


Download ppt "Mathematical Background"

Similar presentations


Ads by Google