unit 1
unit 1
Describing a Set
Typically, a set is denoted by capital letter. There are three main ways to specify
a set:
1. by Listing all its members (list notation);
2. by stating a property of its elements (predicate notation);
3. by defining a set of rules that generates (defines) its members (recursive
rules).
List Notation:
the first method is suitable only for finite sets. In this case, we list the
elements of a set separated by commas and enclosed in braces.
Predicate Notation:
Empty set:
A set having no Element in it is called an empty set.
Identity and Cardinality:
Two sets are identical if and only if they have exactly the same members, that
is, A = B if for every x, x ∈ A ↔ x ∈ B.
Subset:
A set A is a subset of a set B if every element of A is also an element of B.
Such a relation between sets is denoted by A ⊆ B. If A ⊆ B and A ≠ B, we call A a
proper subset of B and write A ⊂ B.
Both signs can be negated using a slash (/) through the sign.
Operations on Sets: Union, Intersection
The Union of A and B, written A U B, is the set whose elements are just the
elements of A or B of both.
Ordered Pairs
ordered pair is written <a , b>, a will be considered as first member and b as
second member of the pair. So in general <a , b> ≠ <b , a>.
Cartesian Product
The cartesian product of two sets A and B is a set of all possible ordered pairs
whose first component is a member of A and whose second component is a
member of B. It is denoted by ‘X’.
Alphabet, String and Language
A Language is a dynamic set of visual, auditory or tactile symbols of
communication and the elements used to manipulate them.
There is only one word of length 0 , the Empty string can be denoted as Ԑ.
A graph with directed edges is called directed graph. Edges are given
by ordered pairs.
Undirected Graph
for a vertex. A self loop is counted twice. The degree is given for directed
1. There is one vertex called root which has no predecessors and from
2. From this root node, all the successors are ordered from left.
Trees
• Binary Tree: A binary tree is a data structure on which each node has at
most two children, which are called left and right child.
The depth of node n is the length of path from the root to the node.