Presentation is loading. Please wait.

Presentation is loading. Please wait.

Copyright © Cengage Learning. All rights reserved. 6 Sets and Counting.

Similar presentations


Presentation on theme: "Copyright © Cengage Learning. All rights reserved. 6 Sets and Counting."— Presentation transcript:

1 Copyright © Cengage Learning. All rights reserved. 6 Sets and Counting

2 Copyright © Cengage Learning. All rights reserved. 6.2 Cardinality

3 3 In this section, we begin to look at a deceptively simple idea: the size of a set, which we call its cardinality. Cardinality If A is a finite set, then its cardinality is n(A) = number of elements in A. Visualizing Cardinality

4 4 Cardinality Quick Example Let S = {a, b, c}. Then n(S) = 3. Counting the elements in a small, simple set is straightforward. To count the elements in a large, complicated set, we try to describe the set as built of simpler sets using the set operations. We then need to know how to calculate the number of elements in, for example, a union, based on the number of elements in the simpler sets whose union we are taking.

5 5 The Cardinality of a Union

6 6 How can we calculate n(A  B) if we know n(A) and n(B)? Our first guess might be that n(A  B) is n(A) + n(B). But consider a simple example. Let A = {a, b, c} and B = {b, c, d}. Then A  B = {a, b, c, d} so n(A  B) = 4, but n(A) + n(B) = = 6.

7 7 The Cardinality of a Union The calculation n(A) + n(B) gives the wrong answer because the elements b and c are counted twice, once for being in A and again for being in B. To correct for this overcounting, we need to subtract the number of elements that get counted twice, which is the number of elements that A and B have in common, or n(A  B) = 2 in this case. So, we get the right number for n(A  B) from the following calculation: n(A) + n(B) – n(A  B) = – 2 = 4.

8 8 The Cardinality of a Union This argument leads to the following general formula. Cardinality of a Union If A and B are finite sets, then n(A  B) = n(A) + n(B) – n(A  B). In particular, if A and B are disjoint (meaning that A  B = ∅ ), then n(A  B) = n(A) + n(B). (When A and B are disjoint we say that A  B is a disjoint union.)

9 9 The Cardinality of a Union Visualizing Cardinality of a Union Disjoint Sets Not Disjoint

10 10 The Cardinality of a Union Quick Example If A = {a, b, c, d} and B = {b, c, d, e, f }, then n(A  B) = n(A) + n(B) – n(A  B) = – 3 = 6. In fact, A  B = {a, b, c, d, e, f }.

11 11 Example 1 – Web Searches In October 2011, a search on Bing™ for “Lt. William Burrows” yielded 29 Web sites containing that phrase, and a search for “Romulan probe” yielded 17 sites. A search for sites containing both phrases yielded 4 Web sites. How many Web sites contained either “Lt. William Burrows,” “Romulan probe,” or both? Solution: Let A be the set of sites containing “Lt. William Burrows” and let B be the set of sites containing “Romulan probe.” We are told that n(A) = 29

12 12 Example 1 – Solution n(B) = 17 n(A  B) = 4. The formula for the cardinality of the union tells us that n(A  B) = n(A) + n(B) – n(A  B) = – 4 = 42. So, 42 sites in the Bing database contained one or both of the phrases “Lt. William Burrows” or “Romulan probe.” “Lt. William Burrows” AND “Romulan probe” cont’d

13 13 The Cardinality of a Union Cardinality of a Complement If S is a finite universal set and A is a subset of S, then n(A) = n(S) – n(A) and n(A) = n(S) – n(A).

14 14 The Cardinality of a Union Visualizing Cardinality of a Complement Quick Example If S = {a, b, c, d, e, f } and A = {a, b, c, d}, then n(A) = n(S) – n(A) = 6 – 4 = 2. In fact, A = {e, f }.

15 15 The Cardinality of a Union To determine the cardinality of a union of three or more sets, like n(A  B  C), we can think of A  B  C as a union of two sets, (A  B) and C, and then analyze each piece using the techniques we already have. Alternatively, there are formulas for the cardinalities of unions of any number of sets, but these formulas get more and more complicated as the number of sets grows. In many applications, we can use Venn diagrams instead.

16 16 The Cardinality of a Cartesian Product

17 17 The Cardinality of a Cartesian Product We’ve covered all the operations except Cartesian product. To find a formula for n(A  B), consider the following simple example: A = {H, T} B = {1, 2, 3, 4, 5, 6} so that A  B = {H1, H2, H3, H4, H5, H6, T1, T2, T3, T4, T5, T6}.

18 18 The Cardinality of a Cartesian Product The elements of A  B can be arranged in a table or spreadsheet with n(A) = 2 rows and n(B) = 6 elements in each row. In a region with 2 rows and 6 columns, there are 2  6 = 12 cells. So, n(A  B) = n(A)n(B) in this case.

19 19 The Cardinality of a Cartesian Product Cardinality of a Cartesian Product If A and B are finite sets, then n(A  B) = n(A)n(B). Quick Example If A = {a, b, c} and B = {x, y, z, w}, then n(A  B) = n(A)n(B) = 3  4 = 12.

20 20 Example 5 – Coin Tosses a. If we toss a coin twice and observe the sequence of heads and tails, how many possible outcomes are there? b. If we toss a coin three times, how many possible outcomes are there? c. If we toss a coin ten times, how many possible outcomes are there?

21 21 Example 5(a) – Solution Let A = {H, T} be the set of possible outcomes when a coin is tossed once. The set of outcomes when a coin is tossed twice is A  A, which has n(A  A) = n(A)n(A) = 2  2 = 4 possible outcomes.

22 22 Example 5(b) – Solution When a coin is tossed three times, we can think of the set of outcomes as the product of the set of outcomes for the first two tosses, which is A  A, and the set of outcomes for the third toss, which is just A. The set of outcomes for the three tosses is then (A  A)  A, which we usually write as A  A  A or A 3. The number of outcomes is n((A  A)  A) = n(A  A)n(A) = (2  2)  2 = 8. cont’d

23 23 Example 5(c) – Solution Considering the result of part (b), we can easily see that the set of outcomes here is A 10 = A  A ...  A (10 copies of A), or the set of ordered sequences of ten Hs and Ts. It’s also easy to see that n(A 10 ) = [n(A)] 10 = 2 10 = 1,024. cont’d


Download ppt "Copyright © Cengage Learning. All rights reserved. 6 Sets and Counting."

Similar presentations


Ads by Google