Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Lecture 5 MATH1904 • Disjoint union If the sets A and B have no elements in common, we say that they are disjoint and we write A ∩ B = ∅. If A and B are disjoint sets, then |A ∪ B| = |A| + |B|. • The Addition Principle If one thing can be selected in a ways and another thing can be selected in b ways, then the number of different ways of selecting the first thing or the second thing is a + b. 1 • Union and intersection If the sets A and B are not disjoint, then we have: |A ∪ B| = |A| + |B| − |A ∩ B|. The reason is, in counting the sum |A| + |B|, we have counted the elements common to A and B twice and so we need to subtract |A ∩ B| from this sum to yield |A ∪ B|. • Cartesian Product In general, given sets A and B, their Cartesian product is the set A × B of all ordered pairs (x, y), where x is an element of A and y is an element of B. That is, A × B = { z | z = (x, y), x ∈ A and y ∈ B }. The size of A × B is |A| × |B|. This can be written |A × B| = |A| × |B|. 2 • The Multiplication Principle If one thing can be selected in a ways and another thing can be selected in b ways, then the number of different ways of selecting the first and the second thing is ab. This principle actually goes beyond the formula for |A × B| because the set from which the second choice is made could depend on the first choice. • Logic Notice that in the two principles given in this chapter, addition corresponds to exclusive or and multiplication corresponds to and then. 3 • Function Definition A function f : A → B is a subset of A × B with the property that for every element x ∈ A there is exactly one element y ∈ B such that (x, y) ∈ f . Actually, we’ve seen this before — the pairs (x, y) correspond to the arrows in the arrow diagram for f . 4 Theory of the Multiplication Principle The Multiplication Principle can be described in the language of set theory. What is perhaps surprising is that this apparently more general principle can be obtained from the Addition Principle. To see this, suppose that we have a set A and that for each element x ∈ A we have a set Bx which depends on x. We want to find the size of the set of ordered pairs X = { (x, y) | x ∈ A and y ∈ Bx }. Notice that the sets Bx can depend on x ∈ A and therefore X is generally not a Cartesian product (unless there is a set B such that Bx = B for all x ∈ A.) 5 On the other hand, for fixed x ∈ A, the ordered pairs (x, y), where y ∈ Bx form the Cartesian product {x} × Bx. Therefore X= [ ({x} × Bx) x∈A and furthermore, the sets {x} × Bx are disjoint. There is also a one-to-one correspondence between {x} × Bx and Bx in which (x, y) corresponds to y. Thus |{x} × Bx| = |Bx| and, from the Addition Principle, we have |X| = X |Bx|. x∈A In a great many of the examples that we deal with in this book the sets Bx turn out to have the same size, say b. When this happens, we can write |Bx| = b, for all x ∈ A. If |A| = a, then the formula becomes |X| = ab. In fact, this is just the Multiplication Principle. The special case when all the Bx are the same set corresponds to the formula for the size of a Cartesian product. 6