0% found this document useful (0 votes)
13 views

1.1 Introduction to Setfunction and Relation

Uploaded by

Sagar Dhami
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

1.1 Introduction to Setfunction and Relation

Uploaded by

Sagar Dhami
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

1.

Introduction to Formal Language, Logic and Proof (7 hours- 9


Marks)
1.1. Brief review of set theory, function and relation
1.2. Propositional logic, expressing statements in propositional logic, rules of inference and
proofs in propositional logic, introduction to predicate logic
1.3. Proofs, principle of mathematical induction, diagonalization principle, pigeonhole
principle
1.4. Alphabet and language
1.5. Operations on languages: Union, concatenation, Kleene star

TOC Introduction:
What is TOC?

The theory of computation is the branch that deals with whether and how efficiently problems can be
solved on a model of computation, using an algorithm.

The field is divided into three major branches:


1. automata theory,
2. computability theory

Set Theory, Functions, and Relations: A Detailed Review


1. Set Theory
1.1. Key Concepts and Notation

A set is a well-defined collection of distinct objects (elements). These elements can be anything:
numbers, symbols, or even other sets.
For example, the collection of the four letters a, b, c, and d is a
set, name L
The objects comprising / consists of a set are called its elements or members.

Notation:

 Roster (Listing) Method: Elements are explicitly listed: A = {1, 2, 3}.


 Set Builder Notation: Describes elements with a condition: A = {x | x is a positive integer and x <
4}.

e.g. L = {a, b, c, d}, S= {5,10,15,20}, V= {a, e, i, o , u}.

1|Page Notes by Er. Ravi Ranjan Jaiswal


 L={x∣x is a lowercase letter between a and d}.
 S={x∣x=5n,n∈Z+,1≤n≤4}
This describes S as the set of all X such that X is a multiple of 5 and lies between 5 and 20.

  For V:
V={x∣x is a vowel in the English alphabet}
This defines V as the set of all x where x is a vowel.
  For an element that belongs to a set:
Example: b is an element of the set L, which we write as: b∈L
This means L contains b.
  For an element that does not belong to a set:
Example: z is not an element of the set L, which we write as: z∉L
This means L does not contain z.

Important Properties:
- Elements are unique. A = {1, 2, 2} simplifies to A = {1, 2}.
- Order does not matter. {1, 2} = {2, 1}.

1.2. Types of Sets

1. Singleton Set: A set with exactly one element.

Characteristics:
- Also called a unit set.
- The cardinality of a singleton set is 1.
Example: S = {a}.

A = {f :x is a divisor of a prime number other than the prime itself}

= {1} .

2. Infinite Sets: A set that has an uncountable or infinite number of elements.


Characteristics:
The number of elements in the set is not finite, and it goes on indefinitely.
Includes uncountable sets like real numbers (ℝ) or countable sets like integers (ℤ).
Example: A = {x : is a natural number} = {1, 2, 3, 4, 5, 6, …….} .
3. Finite Set
A set that has a definite or countable number of elements.
Characteristics:
The number of elements in the set is finite and can be determined.
Example: A = {x:x is a vowel in the English language} = {a, e, i, o, u} .

4.. Empty set: A set that contains no elements. It is also called a null set.
Denoted by the symbol { } or Ø.
Any set other than the empty set is said to be nonempty
Example: A = {x: x is a male student in a girl's campus}

2|Page Notes by Er. Ravi Ranjan Jaiswal


1.2.1. Relation between sets
Two sets A and B (say) may have common elements between them and there may exist
relations between them defined as:

(a) Subset: A set A is said to be the subset of B if all elements of A belong to B. It is written as
A ⊆ B. For example,
A = { x : x is a letter in the English alphabet }
B = { x : x is a vowel }
Thus, B is a subset of A. B ⊆ A.

(b) Equal sets: Two sets A and B are said to be equal sets if they have the same elements in
any order. For example,
A = { a, e, i, o, u }
B = { a, i, e, o, u }
Then A = B.

(c) Intersecting sets: Two sets A and B are intersecting sets if they have at least one element
in common.
A = { a, e, i, o, u }
B = { a, b, c, d, e }

(d) Disjoint sets: Two sets A and B are disjoint if they have no element in common.
A = { a, b, c }
B = { y, z }

(e) Equivalent sets: Two sets A and B are said to be equivalent if they have the same number
of elements.
A = { 0, 1, 2 }
B = { a, b, c, d }
Here, n(A) = n(B).

(f) Power set: The power set is the set of any possible subset of any set.
A; i.e., a set containing ‘n’ elements has a powerset containing 2n elements.

For example,
A = { 0, 1 }
Then, power set of A: P(A) = 2^A = 2^2 = { {}, { 0 }, { 1 }, { 0, 1 } }.

Other examples of types of sets

(a) Universal set: A fixed state is a universal set if it contains all the subjects under discussion. For
example,
For the sets of people of different countries, the set of people in the world is universal set.

3|Page Notes by Er. Ravi Ranjan Jaiswal


(b) Uncountable set: A set is uncountable if it contains so many elements that they can't be put one
to one correspondence with the set of natural numbers. In other words, it is opposite to that of
countably infinite set.
For example, The set of real numbers in [0, 1]

(c) Countably infinite set: A set is said to be countably infinite set if its elements can be put one-
one correspondence with the set of natural numbers.
For example,
Z = { x : x is a element of integers }
= { -3, -2, -1, 0, 1, 2, 3, ... }
Here, we can't never count the cardinality of sets but if we arrange elements in such a way that
Z = { 0, -1, 2, -2, 2, -3, 3, ... }
And then if we are asked to count number of elements up to -3, we can do that. So, the set of
integers is the countably infinite set.

1.3. Operation on sets

a) Union: Union of two sets A and B is the set of all elements belonging to at least one of
the two sets or both. It is denoted by A ∪ B.
A ∪ B = { x : x ∈ A or x ∈ B }

b) Intersection: Intersection of two sets A and B is the set of all elements belonging to
both of the sets. It is denoted by A ∩ B.
A ∩ B = { x : x ∈ A and x ∈ B }

c) Difference: The difference of two sets A and B denoted by A - B is the set of all
elements of A that aren’t elements of B.
A - B = { x : x ∈ A and x ∉ B }

d) Symmetric difference: Symmetric difference of two sets A and B is the set of all
elements which are in either of the sets and not in their intersection. The symmetric
difference is denoted by
A Δ B = (A - B) ∪ (B - A)
e) Complement:The “complement” of set A, written as A is the set containing everything
that is not in A.

4|Page Notes by Er. Ravi Ranjan Jaiswal


1.4 Properties of set operation

Identity Laws:
A ∪ ∅ = A, A ∩ U = A, A ∩ ∅ = ∅.

5|Page Notes by Er. Ravi Ranjan Jaiswal


1.4. Applications in Theory of Computation
Set theory is used to represent languages as sets of strings and operations like union, intersection, and
complement correspond to combining or modifying languages.

Additional Terminology

 Order pair: An ordered pair is a pair formed by two elements that are separated by a
comma and written inside the parantheses. For example, (x, y) represents an ordered pair,
where 'x' is called the first element and 'y' is called the second element of the ordered pair.

Cartesian Product of sets A and B is defined as the set of all ordered pairs (x, y) such
that x belongs to A and y belongs to B. It is denoted by as A × B (read “A cross B”).
i.e A x B = { (x, y) : x є A and y є B }

For example,
if A = {1, 2} and B = {3, 4, 5},
then the Cartesian Product of A and B is {(1, 3), (1, 4), (1, 5), (2, 3), (2, 4), (2, 5)}.

6|Page Notes by Er. Ravi Ranjan Jaiswal


2. Relations : A relation is a connection or association between elements of two sets.
A relation is a correspondence between two sets (called the domain and the range) such that to
each element of the domain, there is assigned one or more elements of the range.
State the domain and range of the following relation. Is the relation a function? {(2, –3), (4, 6),
(3, –1), (6, 6), (2, 3)} The above list of points, being a relationship between certain x's and
certain y's, is a relation. The domain is all the x-values, and the range is all the y-values. To give
the domain and the range, just list the values without duplication:
domain: {2, 3, 4, 6}
range: {–3, –1, 3, 6}

Mathematical Definition of Relation:


A relation on sets S and T is a set of ordered pairs (s, t), where
(a) s є S (s is a member of S )
(b) t є T
(c) S and T need not be different
(d) The set of all first elements in the “domain” of the relation, and
(e) The set of all second elements is the “range” of the relation.

7|Page Notes by Er. Ravi Ranjan Jaiswal


Types of Relations
1. Reflexive Relation
2. Symmetric/Anti- symmetric relation
3. Transitive relation
4. Equivalence Relation
5. Partial order/Total Order Relation

Types of relation

Identity relation:

In an identity relation "R", every element of the set “A” is related to itself only. Note the conditions
conveyed through words “every” and “only”. The word “every” conveys that identity relation consists of
ordered pairs of element with itself - all of them. The word “only” conveys that this relation does not
consist of any other combination.

Consider a set A={1,2,3} Then, its identity relation is: R={(1,1), (2,2),(3,3)}

Reflexive relation: In reflexive relation, "R", every element of the set “A” is related to itself. The
definition of reflexive relation is exactly same as that of identity relation except that it misses the word
“only” in the end of the sentence
i.e. A relation R ⊆ A x A is reflexive if (a, a) ∈ R for each a ∈ A. The directed graph
representing a reflexive relation has a loop from each node to itself.
Consider a set

Let, A={1,2,3} Then, one of the possible reflexive relations can be:

R={(1,1), (2,2), (3,3), (1,2), (1,3)}

However, following is not a reflexive relation: R1={(1,1), (2,2), (1,2), (1,3)}

But we can say R= { (1, 1), (2, 2) , (3, 3) } is a reflexive relation defined on set A

8|Page Notes by Er. Ravi Ranjan Jaiswal


Symmetric relation:

Symmetric
A relation R ⊆ A x A is symmetric if (b, a) ∈ R whenever (a, b) ∈ R.
Let A= { 1, 2, 3}
then R= { (1, 2), (2, 1) , (2, 3) , (3, 2) } is a Symmetric relation defined on set A

In symmetric relation, the instance of relation has a mirror image.

condition of symmetric relation as:

Iff(x,y)∈R⇒(y,x)∈R for all x,y∈A

The symbol “Iff” means “If and only if”. Here one directional arrow means “implies”.

Alternatively, the condition of symmetric relation can be stated as: xRy⇒yRx for all x,y∈A

It means that if (1,3) is an instance, then (3,1) is also an instance in the relation. Clearly, an ordered pair
of element with itself like (1,1) or (2,2) is themselves their mirror images.

Consider some of the examples of the symmetric relation,


R1={(1,2),(2,1),(1,3),(3,1)}
R2={(1,2),(1,3),(2,1),(3,1),(3,3)}

Note: if the relation is not symmetric then it is anti -symmetric

Transitive relation:
A binary relation R is transitive if whenever (a, b) ∈ R and (b, c) ∈ R, then (a, c) ∈ R. The
relation {(a, b) : a, b ∈ P and a is an ancestor of b} is transitive, since if a is an ancestor of band
b is an ancestor of c, then a is an ancestor of c. So is the less-than-or-equal relation
Let A= { 1, 2, 3}
then R= { (1, 2), (2, 3) , (1, 3) } is a transitive relation defined on set A
If “R” be the relation on set A, then we state the condition of transitive relation as: Iff(x,y)∈R
and (y,z)∈R⇒(x,z)∈R for all a,b,c∈A
Alternatively, xRy and yRz⇒xRz for all x,y,z∈A
Equivalence relation:

A relation is equivalence relation if it is reflexive, symmetric and transitive at the same time. In
order to check whether a relation is equivalent or not, we need to check all three
characterizations.

A subset R of A x A is called an equivalence relation on A if R satisfies the following conditions:


(i) (a, a) є R for all a є A (R is reflexive)

9|Page Notes by Er. Ravi Ranjan Jaiswal


(ii) If (a, b) є R, then (b, a) є R, then (a, b) є R (R is symmetric)
(iii) If (a, b) є R and (b, c) є R, then (a, c) є R (R is transitive)
Let A= { 1, 2, 3}
then R= { (1, 1), (2, 2) , (3, 3) , (1, 2) , (1, 3) , (2, 3) , (2, 1) , (3, 1) , (3, 2) }

Partial Ordering Relations


A relation R on a set S is called a “Partial ordering” or a “Partial order”, if R is reflexive,
antisymmetric
and transitive.
Let A= { 1, 2, 3}
then R= { (1, 1), (2, 2) , (3, 3) , (1, 2), (2, 3) }
A set S together with a partial ordering R is called a “Partially ordered set” or “Poset”.
Partition
A Partition P of S is a collection {Ai} of nonempty subsets of S with the properties:
(i) Each a є S belongs to some Ai,
(ii) If Ai ≠ Aj, then Ai ∩ Aj = ø.

3. Functions :A function is a special type of relation where each element of the domain is related
to exactly one element of the codomain. Example: A = {1, 2, 3}, B = {x, y, z}, f = {(1, x), (2, y), (3, z)}.

Suppose every element of S occurs exactly once as the first element of an ordered pair. In Fig
shown, every element of S has exactly one arrow arising from it. This kind of relation is called a
“function”.

A function is otherwise known as “Mapping”. A function is said to map an element in its domain
to an element in its range. Every element in S in the domain, i.e., every element of S is mapped
to some element in the range. No element in the domain maps to more than one element in the
range.
Functions as relations
A function f :AB is a relation from A to B i.e., a subset of A x B, such that each a є A belongs
to a unique ordered pair (a, b) in f.
Kinds of Functions
(a) One-to-One Function (Injection): A function f : AB is said to be one-to-one if different
elements in the domain A have distinct images in the range.

10 | P a g e Notes by Er. Ravi Ranjan Jaiswal


A function f is one-to-one if f (a) = f (a') implies a = a'.

(b) Onto function (Surjection): A function f : AB is said to be an onto function if each element
of B is the image of some element of A. i.e., f :AB is onto if the image of f is the entire
codomain, i.e. if f (A) = B. i.e., f maps A onto B.

11 | P a g e Notes by Er. Ravi Ranjan Jaiswal


(c) One-to-one onto Function (Bijection): A function that is both one-to-one and onto is called a
“Bijection”. Such a function maps each and every element of A to exactly one element of B, with
no elements left over. Fig. below shows bijection

12 | P a g e Notes by Er. Ravi Ranjan Jaiswal

You might also like