Professional Documents
Culture Documents
Take a look at the following illustration. It shows the scope of each type of grammar
specified in Chomsky Hierarchy−
Type - 3 Grammar
x Algorithm f(x)
1. Empty Set
A set that has no element should be called as Empty set. Another name for Empty set
could be Null set. Number of element in set X is represented as n(X). The empty set is
denoted as Φ. Thus, n(Φ) = 0. The cardinality of an empty set is zero since it has no element.
2. Singleton Set
A set that has one and only one element should be called as Singleton set. Sometimes,
it is known as unit set. The cardinality of singleton is one. If A is a singleton, then we can
express it as,
𝐴 = {𝑥 ∶ 𝑥 = 𝐴}
A set that has predetermined number of elements or finite number of elements are said
to be Finite set. Like {1 ,2, 3, 4, 5, 6} is a finite set whose cardinality is 6, since it has 6
elements.
Otherwise, it is called as infinite set. It may be uncountable or countable. The union of
some infinite sets are infinite and the power set of any infinite set is infinite.
Examples:
4. Union of Sets
Union of two or else most numbers of sets could be the set of all elements that
belongs to every element of all sets. In the union set of two sets, every element is written only
once even if they belong to both the sets. This is denoted as ‘∪’. If we have sets A and B,
𝐴 ∪ 𝐵 = {𝑥 ∶ 𝑥 ∈ 𝐴 𝑜𝑟 𝑥 ∈ 𝐵}.
5. Intersection of Sets
It should be the set of elements that are common in both the sets. Intersection is
similar to grouping up the common elements. The symbol should be denoted as ‘∩’. If A and
B are two sets, then the intersection is denoted as A ∩ B and called as A intersection B and
mathematically, we can write it as,
𝐴 ∩ 𝐵 = {𝑥 ∶ 𝑥 ∈ 𝐴 𝑎𝑛𝑑 𝑥 ∈ 𝐵}
6. Difference of Sets
The difference of set A to B should be denoted as A - B. That is, the set of element that are in
set A not in set B is
𝐴 − 𝐵 = {𝑥 ∶ 𝑥 ∈ 𝐴 𝑎𝑛𝑑 𝑥 ∉ 𝐵}
and, B - A is the set of all elements of the set B which are in B but not in A i.e.
𝐵 − 𝐴 = {𝑥 ∶ 𝑥 ∈ 𝐵 𝑎𝑛𝑑 𝑥 ∉ 𝐴}
and 𝐵 − 𝐴 = {6,7,8}
7. Subset of a Set
In set theory, a set P is the subset of any set Q, if the set P is contained in set Q. It
means, all the elements of the set P also belong to the set Q. It is represented as '⊆’ or P ⊆ Q.
If two sets A and B should have no common elements or we can say that the
intersection of any two sets A and B is the empty set, then these sets are known as disjoint
sets i.e. A ∩ B = ϕ. That means, when this condition n (A ∩ B) = 0 is true, then the sets are
disjoint sets.
Example:
𝐴 = {1,2,3} and 𝐵 = {4,5} then 𝑛(𝐴 ∩ 𝐵) = 0. Therefore, these sets A and B are disjoint
sets.
Two sets are said to be equal or identical to each other, if they contain the same elements.
When the sets P and Q is said to be equal, if P ⊆ Q and Q ⊆ P, then we will write as P = Q.
Examples:
Compiler
Compiler is a program that converts the given input into its equivalent output. Or
Convert the source language into its equivalent target language.
Input Output
Compiler
Compiler is reading the source program character by character and forms tokens.
Compiler scans the source program from left to right and finally accept the end of the
source program.
Finally it produces the target program.
In this, high language program instructions are converted into low level language
program instructions.
Automata
The term "Automata" is derived from the Greek word "αὐτόματα" which means "self-
acting". An automaton (Automata in plural) is an abstract self-propelled computing device
which follows a predetermined sequence of operations automatically.
An automaton with a finite number of states is called a Finite Automaton (FA) or
Finite State Machine (FSM).
In 1930 Alan Turing studied an abstract machine that had all the capabilities like
todays computer. In 1940 and 1950 number of researchers studied about finite automata. In
late 1950, N.Chomsky began the study of formal grammars. In 1960, S.Cook extended Alan
Turing’s Study on abstract machines.