0% found this document useful (0 votes)
3 views1 page

Tutorial 2

The document is a tutorial from the Thapar Institute of Engineering and Technology, focusing on regular expressions (R.E.) and their applications in computer science. It includes a series of exercises requiring the creation of R.E. for various conditions, such as divisibility, substrings, and specific string patterns. Additionally, it asks for the design of a deterministic finite automaton (DFA) for the problems presented.

Uploaded by

Aviral
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)
3 views1 page

Tutorial 2

The document is a tutorial from the Thapar Institute of Engineering and Technology, focusing on regular expressions (R.E.) and their applications in computer science. It includes a series of exercises requiring the creation of R.E. for various conditions, such as divisibility, substrings, and specific string patterns. Additionally, it asks for the design of a deterministic finite automaton (DFA) for the problems presented.

Uploaded by

Aviral
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

Tutorial 2

Thapar Institute of Engineering and Technology Patiala

Computer Science and Engineering Department (CSED)


1. Write down a R.E. over {0, 1} such that no. of 1’s are divisible by 4.
2. Write down a regular expression for language L over {a, b, c} such that every string in L
contains a substring ccc.
3. Write down a R.E. for the language L={w: | w | mod 5=0}, w  (a, b) }
4. Write down a R.E. over alphabet  = {a, b, c} containing at least one a and at least one b.
5. Write the Regular expression for the language of all even length strings defined over
 = {a, b}.
6. Write the Regular expression for the language of all even length strings defined over
 = {a, b}.
7. Write the Regular expression for the language L = {a nb m | n, m  1} over  = {a, b}.
8. Write the Regular expression for the language L = {a nb m | n, m  0} over  = {a, b}.
9. Write down a R.E. over {0, 1} whose fifth symbol from the right end is 1.

9. Design the DFA for the problem given in Q1-8.

You might also like