# © Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Manish Kumar PRE. 1 Theory Of Computation Pre-requisite.

## Presentation on theme: "© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Manish Kumar PRE. 1 Theory Of Computation Pre-requisite."— Presentation transcript:

© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Manish Kumar PRE. 1 Theory Of Computation Pre-requisite

© Bharati Vidyapeeth’s Institute of Computer Applications and Management,, New Delhi-63, by Manish Kumar PRE. 2 Learning Objective  Understanding the basic concepts of sets and properties  Understanding of Functions

© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Manish Kumar PRE. 3 Introduction

© Bharati Vidyapeeth’s Institute of Computer Applications and Management,, New Delhi-63, by Manish Kumar PRE. 4 Basic Concepts of Set Roughly speaking, a set is a collection of objects that satisfy a certain property, but in set theory, the words “set” and “element” are intentionally left as undefined. There is also another undefined relation , called the “membership” relation. If S is a set and a is an element of S, then we write a  S, and we can say that a belongs to S.

© Bharati Vidyapeeth’s Institute of Computer Applications and Management,, New Delhi-63, by Manish Kumar PRE. 5 Basic Concepts of Set The { } notation If a set M has only a finite number of elements say, 3, 7, and 11, then we can write M = {3, 7, 11} (the order in which they appear is unimportant.) A set can also be specified by a defining property, for instance S = {x   : -2 < x < 5} (this is almost always the way to define an infinite set).  = Set of Real numbers

© Bharati Vidyapeeth’s Institute of Computer Applications and Management,, New Delhi-63, by Manish Kumar PRE. 6 Basic Concepts of Set Two sets are equal if and only if they have the same elements. For example, {1, 2, 3} = {3, 1, 2} = {1, 2, 3, 2} Subsets: Given two sets A and B, we say that A is a subset of B, denoted by In other words, A is a subset of B if all elements in A are also in B.

© Bharati Vidyapeeth’s Institute of Computer Applications and Management,, New Delhi-63, by Manish Kumar PRE. 7 Basic Concepts of Sets An example of subset: Let E be the English alphabet, hence it is a set of 26 letters E = {a, b, c, …, x, y, z} In the Hawaiian alphabet however, it contains only 7 consonants H = { a, e, i, o, u, h, k, l, m, n, p, w} Hence H is a subset of E.

© Bharati Vidyapeeth’s Institute of Computer Applications and Management,, New Delhi-63, by Manish Kumar PRE. 8 Basic Concepts of Sets Proper Subsets: Given two sets A and B, we say that A is a proper subset of B, denoted by BA  if BABA  and In other words, A is a proper subset of B if all elements in A are also in B but A is “smaller” than B.

© Bharati Vidyapeeth’s Institute of Computer Applications and Management,, New Delhi-63, by Manish Kumar PRE. 9 Basic Concepts of Set Exercises Determine whether each statement is true or false. a) 3  {1,2,3} True b) 1  {1} False c) {2}  {1, 2 } False d) {3}  {1, {2}, {3}} True e) 1  {1} True f) {2}  {1, {2},{3}} False g) {1}  {1, 2} True h) 1  {{1}, 2} False i) {1}  {1, {2}} True j) {1}  {1} True

© Bharati Vidyapeeth’s Institute of Computer Applications and Management,, New Delhi-63, by Manish Kumar PRE. 10 What is an Operating System? Operations of Sets: Let A and B be two subsets of a larger set U, we can define the following, 2. Intersection of A and B, 3. Difference of B minus A, 4. Complement of A, 1. Union of A and B,

© Bharati Vidyapeeth’s Institute of Computer Applications and Management,, New Delhi-63, by Manish Kumar PRE. 11 Basic Concepts of Set Cartesian Products: For any two sets A and B, the Cartesian Product of A and B, denoted by A×B (read A cross B), is the set of all ordered pairs of the form (a, b) where a  A and b  B. Given sets A 1, A 2, …, A n we can define the Cartesian product A 1 × A 2 × · · ·× A n as the set of all ordered n-tuples. e.g. {a,b}  {1,2} = {(a,1),(a,2),(b,1),(b,2)}

© Bharati Vidyapeeth’s Institute of Computer Applications and Management,, New Delhi-63, by Manish Kumar PRE. 12 Laws of Set theory

© Bharati Vidyapeeth’s Institute of Computer Applications and Management,, New Delhi-63, by Manish Kumar PRE. 13 Function A function “f “ from a set A to a set B is an assignment of exactly one element of B to each element of A. We write f(a) = b if b is the unique element of B assigned by the function f to the element a of A. If f is a function from A to B, we write f: A  B (note: Here, “  “ has nothing to do with if… then)

© Bharati Vidyapeeth’s Institute of Computer Applications and Management,, New Delhi-63, by Manish Kumar PRE. 14 Function Cont. If f:A  B, we say that A is the domain of “f” and B is the codomain of function f. If f(a) = b, we say that b is the image of a and a is the pre-image of b. The range of f:A  B is the set of all images of elements of A. We say that f:A  B maps A to B.

© Bharati Vidyapeeth’s Institute of Computer Applications and Management,, New Delhi-63, by Manish Kumar PRE. 15 Function Cont. Let us take a look at the function f:P  C with P = {Linda, Max, Kathy, Peter} C = {Boston, New York, Hong Kong, Moscow} f(Linda) = Moscow f(Max) = Boston f(Kathy) = Hong Kong f(Peter) = New York Here, the range of f is C.

© Bharati Vidyapeeth’s Institute of Computer Applications and Management,, New Delhi-63, by Manish Kumar PRE. 16 Function Cont. Let us re-specify f as follows: f(Linda) = Moscow f(Max) = Boston f(Kathy) = Hong Kong f(Peter) = Boston Is f still a function? What is its range? {Moscow, Boston, Hong Kong} yes

© Bharati Vidyapeeth’s Institute of Computer Applications and Management,, New Delhi-63, by Manish Kumar PRE. 17 Function Cont. Other ways to represent f: BostonPeter Hong Kong Kathy BostonMax MoscowLindaf(x)x LindaMax Kathy PeterBoston New York Hong Kong Moscow

© Bharati Vidyapeeth’s Institute of Computer Applications and Management,, New Delhi-63, by Manish Kumar PRE. 18 Function Cont. If the domain of our function f is large, it is convenient to specify f with a formula, e.g.: f:R  R f(x) = 2x This leads to: f(1) = 2 f(3) = 6 f(-3) = -6 …

© Bharati Vidyapeeth’s Institute of Computer Applications and Management,, New Delhi-63, by Manish Kumar PRE. 19 References www.csee.umbc.edu/~artola www.csie.ndhu.edu.tw/~rschang www.grossmont.edu/carylee/Ma245/presentations www.mgt.ncu.edu.tw/~ylchen/dismath Kenneth H. Rosen, “Discrete mathematics and its applications”, Forth Edition,

Download ppt "© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63, by Manish Kumar PRE. 1 Theory Of Computation Pre-requisite."

Similar presentations