Vous êtes sur la page 1sur 10

2014

Patel Kirtan

100010107052

[TOC : ASSIGNMENT-1]

1. Define one-to-one, onto and bijection function.

A. One-to-one: One-to-one means one element of B can be associated with only (at
most) one element of A. If f : AB, we say f is one-to-one, if no single element y
of B can be f(x) for more than one x in A. i.e. f is one-to-one if, whenever
f(x
1
)=f(x
2
), then x
1
=x
2
.


Onto: If f (A)= B (the range and codomain of f are equal, or every element of the
codomain is actually one of the values of the function), the function f is said to
be onto.


Bijection: A bijection is a function that is both one-to-one and onto. If f : AB is
a bijection, we can say that A and B are in one-to-one correspondence, or that
there is one-to-one correspondence between the to sets.


2. Explain relation.

A. A mathematical relation is a way of making more precise the intuitive idea of a
relationship between objects. The relation between A and B can be defined as:
It is simply a subset of AB. For an element a A, a corresponds to, or is related
to, an element b B if the pair (a,b) is in the subset. A relation on a set A is a
subset of AA.
Assume R is a set on relation A. We write aRb instead of (a,b) R to indicate that
a is related to b via the relation R.
1. R is reflexive if for every aA, aRa.
2. R is symmetric if for every a and b in A, if aRb, then bRa.



3. R is transitive if for every a,b and c in A, if aRb and bRc, then aRc.
4. R is equivalence relation on A if R is reflexive, symmetric and transitive.
Ex : - (a,b) is in R we can represent their relation as a R b



3. Explain Kleenes Theorem.

A. We define the set of all strings that can be obtained by concatenating any
number of elements of L:
L* =


The operation * in the formula is often called the Kleene star, after the
mathematician S.C.Kleene. This use of the * symbol is consistent with using * to
represent the set of strings over , because strings are simply concatenation of
zero or more symbols. Note that is always an element of L* , no matter what L
is, since L
0
= { }. Finally we denote L
+
the set of all strings obtainable by
concatenating one or more elements of L:
L
+
=


You can check that L
+
=L*L=LL* . The two languages L* and L
+
may in fact be
equal.

Theorem: Let R be a regular expression then there exists an NFA with a transition
that accepts L(R). This theorem is proved by induction method.
Basic(zero operation): Now, since r has zero operation, means r can be either
or or frame a input set .





Induction: This theorem can be true for n number of operation. In any type of
regular expression there are only three cases possible.
1) Union
2) Concatenation
3) Closure

Case 1: Union Case
Let r=r
1
+r
2
where r
1
and r
2
be regular.
NFAs M
1
=(Q
1
,
1
,
1
, { f
1
})
M
2
=(Q
2
,
2
,
2
, { f
2
})








Case 2: Concatenation Case
r=r
1
.r
2

M
1
and M
2
denoted by two machine such that
L(M
1
)=L(r
1
) and L(M
2
)=L(r
2
)
M=(Q
1
UQ
2
,
1
U
2
, , {q
1
},{ f
2
})






Case 3: Closure Case
r=r
1
* where r
1
be a regular expression.
The machine M
1
is such that L(M
1
)=L(r
1
)
M=(Q
1
U{ q
0
, f
0
},
1
,
1
, q
0
,{ f
2
})
The mapping function is given by:
i. (q
0
, )= (f
1
, )= {q
0
,f
0
}
ii. (q
0
, a)=
1
(q
1
, a) for a in Q
1
-{f
1
} and a in
1
U{ }
The machine M will be







Thus L(M)=L(M
1
)* is proved.

4. Prove 7+13+19++(6n+1) = n(3n+4) . Use mathematical induction.

A. The formula is true for every n1.
n=1 : LHS=7 RHS=7
n=2 : LHS=20 RHS=20
In general, for any value of k1, the formula for n=k(3k+4) can be derived
from the one for n=k as follows:
7+13+19++(6k+1)=k(3k+4)
For k+1
LHS=7+13+19++(6(k+1)+1)
=7+13+19+...+(6k+7)
=7+13+19++(6k+1)+(6k+7)
=k(3k+4)+(6k+7)
=3k
2
+10k+7
=(k+1)(3k+7)
=(k+1)(3(k+1)+4)
=RHS
Hence Proved.

5. Differentiate between: (1) NFA and DFA (2) NFA and NFA.

(1) NFA and DFA
NFA DFA
NFA is non- DFA is deterministic
deterministic finite
automata
finite automata
A Nondeterministic
finite automation,
abbreviated NFA, is a
5-tuple M=(Q, ,q0,A,
), where Q and are
nonempty finite sets,
q0 Q, A c Q, :
Q2Q
Q is the set of states,
is the alphabet, q0 is
the initial state, is the
transition function and
A is the set of
accepting states.
A deterministic finite
automation,
abbreviated DFA, is a
5-tuple M=(Q, ,q
0
,A,
), where Q and are
nonempty finite sets,
q
0
Q, A c Q, :
QQ
Q is the set of states,
is the alphabet, q
0
is
the initial state, is the
transition function

and
A is the set of
accepting states.

In NFA we may reach
to one or more then
one state for a single
input
In DFA for a given
input we reach to a
deterministic and a
unique state on a
given input


In NFA we may reach
to one or more then
one state for a single
input
In DFA for a given
input we reach to a
deterministic and a
unique state on a
given input
In NFA backtracking
may or may not be
allowed
In DFA backtracking is
allowed
NFA requires less
space
DFA requires more
space
NFA can use empty
string translation
DFA cannot use empty
string
NFA is easy to
construct
DFA is difficult to
construct

(2) NFA and -NFA
NFA - NFA
In this NFA it is not
definite that on some
input we may reach to
one or more than one
state for a single input.
Hence it is called non-
deterministic finite
automata.
Here are some moves
by which we can reach
from one state to another
.
Hence it is called NFA
with .
More generalized form
of NFA.


Allows flexibility in
handling NFA problem.
It does not have any
transitions.

It has transitions.

NFA , for more the same
input there can be more
than one different states.
The NFA with is
similar to NFA but it has
transition.


6. Find L1L2 and L1-L2.










A.


As both L1 and L2 generates the same set of strings ; the intersection of both
the language will represent the set of string and the diffence between
them will be empty set.

a. L
1
L
2
is






b. L
1
L
2
is




7. Define language, alphabets, substring, proper subset, improper subset.

A. Language
A language is simply a set of strings involving symbols from some
alphabet.

Alphabets
A finite set of collection of symbols is called Alphabets. Denoted by .

Substring
A string x is a substring of another string y if there are strings w and z,
either or both of which may be null, so that y=wxz. The string car is a
substring of each of the strings descartes, vicar, carthage, and car, but not of
the string charity.

Proper substring
If W is any string over alphabet , then the string other than W and are
considered as proper substring. If W=ADIT then
Proper substring={A,D,I,T,AD,DI,IT,ADI,DIT}

Improper substring
If W is any string over alphabet , then the string W itself and are
considered as improper substring. If W=ADIT then
Improper substring={ADIT, }


8. Define NFA and DFA.
A. NFA
A nondeterministic finite automation, abbreviated NFA, is a 5-tuple
M=(Q, ,q
0
,A, ), where Q and are nonempty finite sets, q
0
Q, A c Q,
: Q2
Q

Q is the set of states, is the alphabet, q
0
is the initial state,

is the
transition function

and A is the set of accepting states.

DFA

A deterministic finite automation, abbreviated DFA, is a 5-tuple M=(Q,
,q
0
,A, ), where Q and are nonempty finite sets, q
0
Q, A c Q,
: QQ
Q is the set of states, is the alphabet, q
0
is the initial state, is the
transition function

and A is the set of accepting states.


9. Properties of regular expression and regular language. Explain.

A. is considered as Regular Expression.
An empty set, is also RE.
Alphabet say A
1
is also considered RE.
If R
1
and R
2
are two regular expressions then R
1
.R
2
is

regular.
R
1
+R
2
is regular.

R
1
* is regular.
Properties:
1) +R=R
2) .R=R. =R
3) .R=R.=R
4) *=
5) R+R=R
6) PQ+PR=P(Q+R)
7) QP+RP=(Q+R)P
8) R*.R*=R*
9) R.R*=R*.R
10) +R.R*=R*
11) (P+Q)*=(P*.Q*)*
12) (P.Q)*=(P*+Q*)*

Vous aimerez peut-être aussi