Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

ASSIGNMENT # 1

SUBMITTED BY: IQRA REHMAT


ROLL NO# BC-01(B) U/18
SUBMITTED TO: DR.FOUZIA JABEEN
SUBJECT: THEORY OF AUTOMATA
TOPIC: EXAMPLES OF DESCRIPTIVE
LANGUAGE AND RECURSIVE LANGUAGE
SUBMISSION DATE: 3 November 2020,
Tuesday
DEPARTMENT: BS CS 5TH
INSTITUTE: SBBWUP

1
Table of Contents
ASSIGNMENT # 1.................................................................................1
EXAMPLES OF DESCRIPTIVE LANGUAGE DEFINATION:....................3
EXAMPLE # 1:.........................................................................................3
EXAMPLE # 2:.........................................................................................3
EXAMPLE # 3:.........................................................................................3
EXAMPLES OF RECURSIVE LANGUAGE DEFINATION:........................4
EXAMPLE # 1:.......................................................................................4
EXAMPLE # 2:.......................................................................................4
EXAMPLE # 3:.......................................................................................4

2
EXAMPLES OF DESCRIPTIVE LANGUAGE
DEFINATION:
EXAMPLE # 1:
The language L of string of even length, defined over ∑ ¿{c } can be written
as:
L= {cc, cccc, cccccc, cccccccc …}

EXAMPLE # 2:
The language L of string that does not start with “y” defined over ∑ ¿{ x , y , z }
can be written as:
L= {x, z, xz, xy, zx, zy, zzz, zzy, xxy…}

EXAMPLE # 3:
The language L of string of length 3, defined over ∑ ¿{2,4,6 } can be
written as:
L= {222, 224, 226, 246, 264, 462, 642, 666…}

3
EXAMPLES OF RECURSIVE LANGUAGE
DEFINATION:

EXAMPLE # 1:

Define a language positive of all positive natural numbers.


 Rule 1: 1 is in positive.
 Rule 2: if x and y are in positive, then so are x+y, x*y, x/y.
 Rule 3: the only element in the set positive are those that can be produced
from the two rules above.

EXAMPLE # 2:
Recursive definition of Σ* 
 Rule 1: Λ∈Σ*2.  
 Rule 2: For all x∈Σ* and all a∈Σ, xa∈Σ*. 
 Rule 3: Nothing else is in Σ* unless it can be obtained by a finite number
of applications of rules 1 and 2.

EXAMPLE # 3: 
Defining the language L, of strings containing cc or ee or ii, defined over
∑ ¿{c ,e ,i }. 
 Rule 1: cc, ee and ii are in L.
 Rule 2: s(cc)s, s(ee)s s(ii)s are also in L, where s belongs to Σ*.
 Rule 3: No strings except those constructed in above, are allowed to be
in L.

You might also like