Download Basic Structures - Discrete Mathematics - Lecture Slides and more Slides Discrete Mathematics in PDF only on Docsity!
CSE115/ENGR160 Discrete Mathematics 02/09/
2. 1 Basic structures
- Sets
- Functions
- Sequences
- Sums
Notation
- The set of all vowels in the English alphabet can be written as V={a, e, i, o, u}
- The set of odd positive integers less than 10 can be expressed by O={1, 3, 5, 7, 9}
- Nothing prevents a set from having seemingly unrelated elements, {a, 2, Fred, New Jersey}
- The set of positive integers<100: {1,2,3,โฆ, 99}
4
a โ A : a isan elemnetof theset A. a โ A : otherwise
Notation
- Set builder : characterize the elements by stating the property or properties
- The set O of all odd positive integers < 10:
O={x|x is an odd positive integer < 10} or specify as
- The set of positive rational numbers
5
O = { x โ Z +^ | x isoddand x < 10 }
Q + ={ x โ R | x = p / q forsomepositiveintegers p and q }
Sets and operations
- A datatype or type is the name of a set,
- Together with a set of operations that can be performed on objects from that set
- Boolean : the name of the set {0,1} together with operations on one or more elements of this set such as AND, OR, and NOT
Sets
- Two sets are equal if and only if they have the same elements
- That is if A and B are sets, then A and B are equal if and only if. We write A=B if A and B are equal sets
- The sets {1, 3, 5} and {3, 5, 1} are equal
- The sets {1, 3, 3, 3, 5, 5, 5, 5} is the same as {1, 3, 5} because the have the same elements
8
โ x ( x โ A โ x โ B )
Empty set and singleton
- Empty ( null ) set: denoted by {} or ร
- The set of positive integers that are greater than their squares is the null set
- Singleton : A set with one element
- A common mistake is to confuse ร with {ร}
Subset
- The set A is a subset of B if and only if every element of A is also an element of B
- Denote by AโB
- We see AโB if and only if
11
โ x ( x โ A โ x โ B )
Proper subset
- A is a proper subset of B: Emphasize that A is a subset of B but that Aโ B, and write it as AโB
- One way to show that two sets have the same elements is to show that each set is a subset of the other, i.e., if AโB and BโA, then A=B
13
โ x ( x โ A โ x โ B )โงโ x ( x โ B โง x โ A )
โ x ( x โ A โ x โ B )
Sets have other sets as members
- A={โ
, {a}, {b}, {a,b}}
- B={x|x is a subset of the set {a, b}}
- Note that A=B and {a}โA but aโA
- Sets are used extensively in computing problem
Infinite set and power set
- A set is said to be infinite if it is not finite
- The set of positive integers is infinite
- Given a set S, the power set of S is the set of all subsets of the set S. The power set of S is denoted by P(S)
- The power set of {0,1,2}
- P({0,1,2})={โ
,{0},{1},{2},{0,1},{1,2},{0,2},{0,1,2}}
- Note the empty set and set itself are members of this set of subsets
Example
- What is the power set of the empty set?
- The set {โ
} has exactly two subsets, i.e., โ
, and the set {โ
}. Thus P({โ
})={โ
,{โ
}}
- If a set has n elements, then its power set has 2n^ elements
Ordered pairs
- 2-tupels are called ordered pairs
- (a, b) and (c, d) are equal if and only if a=c and b=d
- Note that (a, b) and (b, a) are not equal unless a=b
Cartesian product
- The Cartesian product of sets A and B, denoted by A x B, is the set of all ordered pairs (a,b), where a โ A and b โ B
- A: students of UC Merced, B: all courses offered at UC Merced
- A x B consists of all ordered pairs of (a, b), i.e., all possible enrollments of students at UC Merced 20
A ร B ={( a , b )| a โ A โง b โ B }