 # Analytical Methods in CS (CIS 505)

## Presentation on theme: "Analytical Methods in CS (CIS 505)"— Presentation transcript:

Analytical Methods in CS (CIS 505)
Sanchita Mal-Sarkar

Sets A set is a collection of objects (duplicates are not allowed).
Objects in the set are called elements or members of the set. Examples: Set of students in Discrete Mathematics. Collection of all positive integers less than 4 A = {1, 2, 3} 1 2 3 A

Sets More Examples: Collection of all negative integers greater than -6 B = {-5, -4, -3, -2, -1} -2 -1 -3 - 4 A -5

Another way to represent sets (Set builder notation)
Sometimes it is impossible/inconvenient to describe a set by listing all its elements. In general, a set can be defined as: {x | P(x)} where P(x) represents a property that the elements of the set have in common. P(x) is a propositional function. Examples: Collection of all positive integers A = {x| x is a positive integer} B = {x | x is odd OR x is less than 10 }

Sets Two sets are equal if they have the same elements. Example:
If A = {1, 2, 3, 4} B = {x| x is a positive integer and x2 < 20} then A = B

Repeated elements can be ignored
Example: The set consists of the letter in the word “Book”. It can be denoted in three ways: {b, o, o, k} {b, o, k} {x| x is a letter in the word “book’}

Order is not important Example: Set of all integers less than 4
It can be represented as: A = {1, 2, 3} A = {2, 3, 1} A = {3, 2, 1}

x is an element of the set A
x Є A => x is an element of A Example: A = {1, 2, 3} 1 Є A 2 Є A 3 Є A 4 Є A { } Є A Ø Є A A Є A

Universal set Set of all possible elements under consideration.
Denoted by U (or sometimes W). In Venn diagram, the universal set U will be denoted by a rectangle and the sets within U will be denoted by circles. U A

Empty/Null Set A set that does not have any element in it.
Denoted by { } or by the symbol Ø. Examples: {x| x is a real number and x2 = -1} = Ø {x| x is a real number and x2 = -9} = Ø {x| x is a real number and x = x +1} = Ø

Subsets A is a subset of B if every element of A is an element of B
{1, 2, 3} is a subset of {1, 2, 3, 4, 5} (in fact a proper subset) A is a proper subset of B if it is a subset of B but not equal to B. Sets can have other sets as members – { f, {a}, {b}, {a, b}}

Cardinality of a set for some finite integer n where n Є N.
A set A is called finite if it has n distinct elements for some finite integer n where n Є N. Example of finite set: {1, 2, 3, 4} A set that is not finite is called infinite. Example of infinite set: {x| x is a positive integer} Cardinality of A: Number of distinct elements (n) of a set. Cardinality of A is denoted by |A|.

Power set Power set => Set of all subsets of a set.
If A is a set, then the set of all subsets of A is called the power set of A. Denoted by P(A) Note that the empty set is always considered to be a subset of every set.  Examples: A = {1,2,3} P(A) consists of the following subsets of A: { }, {1},{2}, {3}, {1,2}, {1,3}, {2,3}, and {1,2,3} What is the power set of {a, b, c}?

Venn Diagram Venn diagrams are often used to indicate relationships between sets. If A is a subset of B, we can write A B B A

Venn Diagram If A is not a subset of B, we can write A B A B

Venn Diagram Every set is a subset of itself. A A כֿ A Ø כֿ
For any set A, Ø A Since there are no elements of Ø that are not in A

Venn Diagram A = B , if and only if A B and B A

Venn Diagram {A} כֿ B {{A}} כֿ B However, B A כֿ
Let A be a set and let B ={A,{A}}. Then, A Є B and {A} Є B. Then {A} B and {{A}} B However, B A

Venn Diagram Draw a Venn diagram that represents the following relationships. x Є A, x Є B, x Є C, y Є B, y Є C, and y Є A A x B One solution y C

Venn Diagram A {2, 3} כֿ {1, 4} A כֿ {1, 2, 3} כֿ A
A = {1, {2, 3}, 4}. Identify whether true or false. 3 Є A {2, 3} Є A. {4} Є A A {2, 3} {1, 4} A {1, 2, 3} A

Download ppt "Analytical Methods in CS (CIS 505)"

Similar presentations