Presentation is loading. Please wait.

Presentation is loading. Please wait.

Set Theory A B C.

Similar presentations


Presentation on theme: "Set Theory A B C."— Presentation transcript:

1 Set Theory A B C

2 Classification problems
aim to identify the characteristics that indicate the group to which each case belongs. This pattern can be used both to understand the existing data and to predict how new instances will behave.

3 Motivation Gender classification of a person based on only a frontal-view image is something we can do very easily. The k-means algorithm attempts to divide the data based solely on the natural separation of the data.  It does not use any information with respect to the gender of each person to perform the classification. 

4 Sets Informally: A set is a collection of objects, with the collection treated as a single object. Examples: Z ={x|x is integer number} Z consists of all integers: …….-2,-1,0,1,2,……. Q = { x| x is rational number} Q consists of numbers can be written a/b, empty set, 

5 Defining Sets Sets can be defined directly: e.g. {1,2,4,8,16,32,…},
{BIT1113 , BIT1073,…………} { 1 , 3 , 5, ……….., 21 } Roster notation Order, number of occurence are not important. e.g. {A,B,C} = {C,B,A} = {A,A,B,C,B} A set can be an element of another set. {1,{2},{3,{4}}}

6 Defining Sets by Predicates
Set-builder is used when the roster method is cumbersome or impossible The set of elements, x, in A such that P(x) is true.

7  Membership { 7, “Ahmad”, /2 , T } x is an element of A x is in A
Examples: /2  {7, “Ahmad”, /2, T } /3  {7, “Ahmad”, /2, T } 14/2  {7, “Ahmad”, /2, T } 7  2/3  

8 Containment / Subset improper subset A is a subset of B
A is contained in B A subset might contain every element of the original set A . Examples: R, {3}{5,7,3}   every set, A  A

9 Containment / Subset Example:
A proper subset is a subset which is not the same as the original set itself. In this case, there is an element of B which is not an element. implies , Example: Let A ={1,2,3,4,5}, B={1,2,3,4,5,6,7} and C={1,2,3,4,5} Thus, A B , C B, and A C

10 exercise List the elements of the following sets.
{x | x is a real number such that x2 = 1} {x| x is an integer such that x2 - 3 = 0} Use a property to give a description of each of the following sets. { a , e , i , o , u } { 2 , 4 , 6 , 8 , 10 }

11 exercise 1. Suppose that A={2,4,6}, B={2,6} and C={4,6}.
Determine which of these sets are subset of which other of these sets. 2. Determine whether each of the following pairs of sets are equal. a. {1,3,5} and {5,1,3} b. {{1}} and {1,{1}}.

12 Basic Operations on Sets
union: intersection: difference: complement:

13 Venn diagrams A Venn diagram is a representation of sets by sets of points in the plane. In the diagram shown in the following page, the universal set U is represented by the interior of a rectangle, and the other sets are represented by disks lying inside the rectangle.

14 U U U A B B A A B Figure 1 Figure 2 Figure 3 Figure 1 represents A  B and A  B. Figure 2 shows that A and B are disjoint. Figure 3 shows that A and B are not disjoint.

15 Partitions of Sets Two sets are disjoint if their intersection is empty. A collection of nonempty sets {A1, A2, …, An} is a partition of a set A if and only if A1, A2, …, An are mutually disjoint. exercise

16 Union  The union of two sets A and B, denoted by A  B, is the set of all elements which belong to A or B or both i.e. A  B = {x : x  A or x  B} Figure 4 A  B is shaded.

17 The intersection of two sets A and B, denoted by
A  B, is the set of elements common to both A and B, i.e. A  B = {x : x  A and x  B} U A B Figure A  B is shaded. Note : If A  B =  then A and B are disjoint.

18 Example Let A = { a, b, c, d, e }, B = { c, d, e, f, g } and C = { a, e, i, o, u }. then A  B = { c, d, e } B  C = { e } C  A = { a, e }

19 Complement The complement of a set A, denoted by , is the set of elements which do not belong to A. It is the same as the difference of the universal set U and A i.e. Figure is shaded.

20 Example Let the universal set U be the set containing letters of the English alphabet and A = { a, b, c, x, y, z }. then = { d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w }

21 Difference \ The difference of set A and B, denoted by A \ B is the set of elements which belong to A but not to B, i.e. A \ B = {x : x  A , x  B}. A\B is also called the complement of B with respect to A. Figure 6 A \ B is shaded.

22 Example Let S = { a, b, c, d } and T = { c, d, e, f }, then S \ T = { a, b } T \ S = { e, f }

23 Application of Venn diagrams in counting
Example In a class of 50 college students, 30 study Pascal, 25 study C and 10 study both computer languages. How many students do not study computer language ?

24 No. of students who do not study computer language is
Pascal C 10 20 15

25 Exercise In a survey of 160 passengers, an airline found that 48 preferred wine with their meals, 78 preferred mixed drinks, and 66 preferred ice tea. In addition, 12 enjoyed wine and mixed drinks, 18 enjoyed mixed drinks and ice tea, and 16 enjoyed ice tea and wine, and 4 passengers enjoyed them all. a) How many passengers want only iced tea with their meals? b) How many passengers do not like any of them?

26 Algebra of sets Sets, under the operations of union, intersection and complement, satisfy the laws listed in the following table. We can use these laws of algebra of sets to simplify complicated set expressions.

27 Set Identities

28 Algebra of sets The following identities can be verified by drawing Venn diagrams.

29 Example Use Venn diagrams to represent the following set expressions. (a) A B A B C C A B C

30 (b) A B C

31 Exercise: Use Venn diagrams to represent the following set expressions.

32 Power Sets power set:

33 Russell’s Paradox In a town lives a barber who shaves exactly those who do not shave themselves. The question is whether the barber shaves himself. Answer : The barber shaves himself if and only if he does not shave himself!

34 a) No. of passengers = 36 No. of passengers = 160 – 24 – 52 – 36 – 12 – 8 – 14 – 4 = 10

35 Halting Problem We want a program H that given any program P and input I: H(P,I) returns “halt” if P will terminate given input I; H(P,I) returns “loop forever” if P will not terminate given input I. No such program can terminate in a finite number of steps!

36 Ordered n-tuples The notation (a1, …,an) is called an ordered n-tuples. (a1, …,an) and (b1, …,bn) are equal if and only if a1 = b1, a2 = b2 , …., an=bn. Given n sets A1, A2, ….. An , the Cartesian product of these sets is the set A1xA2x…..x An ={(a1,…,an) : a1 A1,a2 A2 , ….,an An }

37 exercise Let A={x,y}, B={1,2,3}, and C={a,b}. Find a. A x B x C
b. (A x B ) x C

38 Properties of sets The following exercise shows that the operation is reflexive and transitive, concepts that will be discussed in this section.

39 example Suppose that A,B,C are sets such that
A B and B C. Show that A C. c. Show that A A

40 example Suppose that A,B,C are sets such that
A B and B C. Show that A C. Solution: We need to show that every element of A is an element C. Let x A. since A B then x B. But B C, so that x C.

41 example Show that A A. Solution: The proposition
if x A , then x A is always true. Thus A A

42 Theorem Let A and B be two sets. Then
A n B A and A n B B is similar argument. Proof: If x A n B then x A and x B. This still imply that x A. Hence, A n B A

43 Theorem Let A and B be two sets. Then
A B U A and B A U B is similar argument. Proof: If x A then x A U B is always true. Hence, A A U B. More theorem


Download ppt "Set Theory A B C."

Similar presentations


Ads by Google