Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 4 Introduction to Set Theory

Similar presentations


Presentation on theme: "Chapter 4 Introduction to Set Theory"— Presentation transcript:

1 Chapter 4 Introduction to Set Theory
Discrete Mathematics: A Concept-based Approach

2 Set theory is considered a prerequisite for many areas in mathematics such as abstract algebra, combinatorics, relations, topology, graphs, rings, vector spaces, discrete mathematics, fuzzy sets and the like. In computer science, the set terminology is frequently used. In programming language the variables to be used is declared to belong a particular set. Also the input and output in a programming process belongs to certain sets. When we test the software, we design the test cases, which form again the sets. One can view the program to be collection of functions in turn the use of set terminology is imminent. Discrete Mathematics: A Concept-based Approach

3 Common set notations and description
Z or I = {… -3, -2, -1, 0, 1, 2, 3, …} = the set of integers N = {1 ,2, 3, 4, …} = set of natural numbers Q = {a/b| a, b Z and b ≠ 0 } = set of rational R = set of real numbers C = set of complex numbers = { x + iy | x, y R and i= }. Discrete Mathematics: A Concept-based Approach

4 Continued The number of elements or members in a given set is called the cardinality or size of the set. The cardinality of a given set A is denoted as | A | or #(A). We talk about cardinality of finite sets. The sets are mapped onto the set of nonnegative integers, are termed as countable infinite sets. There is one-to-one correspondence between the member of set and integers or natural numbers. The count may never finish. It can be stated in other words as, a set is called countably infinite provided it has the same cardinality as the set of positive integers Z+. A set that is not countable is termed as uncountable or non-denumerable. Discrete Mathematics: A Concept-based Approach

5 by f(n) = (n/2) if n is even; = −(n − 1)/2 if n is odd.
Example 4.2. We know that the set Z of integers is countably infinite. Let us define f : N → Z by f(n) = (n/2) if n is even; = −(n − 1)/2 if n is odd. Then f is a bijection from N to Z. If there is no bijection between N and a set Z, then Z is called uncountable. Discrete Mathematics: A Concept-based Approach

6 Russell’s Paradox Because of logic being used for the definition of sets, a paradox called Russell’s Paradox is discovered by Bertrand Russell. Mere collection of objects does not form a set. If every collection forms a set, then it leads to paradox. Consider the statement “ S be a set of all subsets which are not members of themselves”. The question is “ Does ?”. There are two possibilities. (i ) and (ii) S ∉ S. Let : From the definition of the given set, S should not belong to S. Let S ∉ S : Again from the definition of the set, S should belong to S. This means that if S ∉ S then Discrete Mathematics: A Concept-based Approach

7 Power set: The set of all the subsets of a given set A is called the power set of A and denoted by P(A). For example, If A = Ø. P(A) is written as under. If A = Ø then P(A) = P(Ø) = { Ø }= {{ }} and the cardinality is 1. It is 20 If A = {1} then P(A) = { Ø, {1}} and the cardinality of P(A) is 2. It is 21 If A= {1,2} then P(A) = { Ø, {1}, {2}, {1,2}} and the cardinality is 4. It is 22 If A = {1,2,3} then P(A) = { Ø, {1}, {2}, {3}, {1,2}, {1, 3}, {2,3}, {1,2,3}} and cardinality is 8. It is 23. From the above examples, we can generalize that if cardinality of |A| is n then the cardinality of |P(A)| is 2n. Discrete Mathematics: A Concept-based Approach

8 Laws of Set Theory. Discrete Mathematics: A Concept-based Approach

9 Laws of set theory continued
. Discrete Mathematics: A Concept-based Approach

10 Principle of duality It is always interesting to note that the laws stated earlier are dual with respect to the operations  and . It deals with equality of set expressions. The two expressions involving sets and the operations are  and  only are said to be duals if we are able to get one expression from the other by replacing  by  and vice versa and Ø by U and vice versa. The sets can occur complemented in the expression. Example : Consider the laws of absorption. Let the expression s = A (A  B ) and its dual sd = A (A  B ) is obtained from replacing  by  and vice versa. Both the expressions are equal. It’s a generic case. Example : Consider s: A Ā = Ø and its dual is obtained replacing  by  and vice versa as sd : A Ā = U. Here Ø is replaced by U and vice versa. The laws listed motivate us to state the duality principle as “ if s is a law on sets involving  and  then its dual is also a law on sets”. Discrete Mathematics: A Concept-based Approach

11 Computer representation of sets
There are different ways of representing sets on computers. One can represent sets as arrays without ordering. The set operations become difficult as these involve large amount of searching. Consider a finite universal set. Let a 1 , a 2 ,.. a n define the sets on this universal set and represent it as a bit string of length n where in the ith bit is set to 1 if the element ai is belongs to the given subset. Otherwise the corresponding bit is set to zero. Discrete Mathematics: A Concept-based Approach

12 Example: Consider universal set U = {1,2,3,4,5,6,7,8,9, 10} and the increasing order is imposed on the set U. What bit strings represent the subset of all odd integers in U, the subset of all even integers in U and the subset of integers not exceeding 5 in U? Solution: The bit string representing the subset of all odd integers {1,3,5,7,9} in U is given by The first, third, fifth, seventh, and ninth bit positions contain 1 and other positions contain zeros. Similarly, the bit string corresponding to the subset of even integers {2,4,6,8,10} is given by The bit string corresponding to all integers that do not exceed 5, namely, {1,2,3,4,5} is given by Discrete Mathematics: A Concept-based Approach

13 Addition Principle In case of sets, the union of two sets involves the common elements to be counted only once. When we work with cardinalities of individual sets and to find the cardinality of |A  B|, it is useful to consider the common elements. The cardinality of |A  B| is equal to arithmetic sum of cardinalities of individual sets, when the sets are disjoint. |A  B| = |A| + |B|. If the sets are not disjoint, it is written as under: |A  B| = |A| + |B| - | A  B | The elements of A  B are counted twice, once in A and another in B and hence it is deducted once. In case of disjoint sets, | A  B | = Ø. The equation (1) is called the Addition principle or the Principle of Inclusion and Exclusion. It can be extended to more than two sets. Discrete Mathematics: A Concept-based Approach

14 |A| = 5 , |B| = 6, |A  B| = 9 and | | = 2.
Example . Consider A = {1,2,3,4,5 } and B = {3, 5, 6,8,11, 13}. The addition principle can be verified as under. |A| = 5 , |B| = 6, |A  B| = 9 and | | = 2. The sets are A B = {1,2,3,4,5,6,8,11,13} cardinality is 9. A  B = {3,5}= cardinality is 2 From the addition principle, |A  B| = |A| + |B| - | A  B| = – 2 = 9, hence the principle. Discrete Mathematics: A Concept-based Approach

15 Addition principle is extended for three sets, is as follows
Addition principle is extended for three sets, is as follows. |A  B  C| = |A| + |B| + |C| - | A  B| - | A  C| - | B  C | + |A B  C |. Discrete Mathematics: A Concept-based Approach

16 Regular Expressions A regular expression defines the regular language and for which regular grammar is possible to write. The regular languages are recognized by finite state automata. Regular expressions are used in Unix operating system for specifying commands and other utilities. Regular expressions are used in lex generators, text editors etc. The given regular expression defines precisely a language. The Regular expression is defined recursively. Discrete Mathematics: A Concept-based Approach

17 Continued 1. Є and ϕ is a regular expression. 2. Every symbol in the alphabet ∑ is a regular expression. 3. Let R1 and R2 be two regular expressions.Then R1 U R2 is also the regular expression. 4. The concatenation of R1 and R2 is also a regular expression (R1•R2). 5. The closure of R1 or R2 denoted by (R1)* or (R2)* is also a regular expression. 6. The (R1) and (R2) are also regular expressions. Discrete Mathematics: A Concept-based Approach

18 Summary The sets are the important concepts mainly used , relations, functions, regular expressions, coding theory etc. The coverage of the topics is more lucid. The sound knowledge of set theory fundamentals is essential for computer science students. The chapter fairly covers the essentials for reading the subsequent chapters in this book. Discrete Mathematics: A Concept-based Approach


Download ppt "Chapter 4 Introduction to Set Theory"

Similar presentations


Ads by Google