You are on page 1of 6

L = all strings of DJs and is that have two or

three occurrences of , the first and second of


which are not consecutive

N Regular Expression ofL

**ABD**CD*U B**D*)
Notational Conventions
Regular Expression
-> Omit outermost brackets

-> Omit brackets when concatenating expressions


->
birds tighter' than concatenations
e.g
write aab* instead
of (aa)(b*)

Regular Expression to
Language
-> Each Regular Expression over some alphabet s

represents language
a
over 5

A
regular expression -- the
language R represents:
Language of (R) -

a
string consisting of symbols
From S and V, *, (, >, 2,0 a set of words over 5
Describing Regular Expressions by Recursion

The (infinite) set of all described


->
regular expressions over 3 is

recursively
Basis: 0,2 and each
symbol in alphabets are
regular
expressions
Recursive Steps: If Bandz are regular expressions then
so are (RE), (RUE) and (R*)

Regular Languages
that be
-> a
Regular Language is
any language can

represented by a regular expression


-> A
language his regular if L =
Language of (R)-

For some regular


expression
on

Regular Expression -
pattern

Regular Language = set of words following a


pattern
Regular Languages and NFAs

-> There is a general mechanical procedure p, that


converts any Regular Expression & to an NFA An such
that
L(AR) Language of (R)
=
-

-> There is a general mechanical procedure that


2

converts any NEA A to a


Regular Expression PA such
that
Language of (RA) L(A)
-
=

->
P, is in
syllabus but not Pa
->
Regular languages precisely
are those
languages
accepted by finite automata.

Procedure for Regular Expression to NFA

-> The procedure P. operates along the recursive description


of the regular expression R
Basis Cases:
if R 0
= then
Language of (R)
-
=
0 An: >

if R 2 then
=

Language of (R) 993


-
=

Ap: >

R Language of (R) 9a3 Ap:


a

it a
=
then -
= > 3

Recursive Cases:

Ap: accepts Language -


of (R)
T

Ap: accepts Language -


of (z)
T

ARuz: accepting Language -


of (RUz)
3

-=
--
ARz: accepts language - of (RE)
E
T -

AR*: accepts Language of (R*) -

&
*
I

I
E

->
essentially, make automata for each symbol or

required word
e.g for a, b, abba and then
combine as shown in regular expression

Nonregular Languages
-
Language thatcannot be converted to Regular
expression NEA or as NEs have finite memory
eg1 9aYb(n 1,2,3,..- 5
=
=

You might also like