0% found this document useful (0 votes)
22 views

This Study Resource Was: King Saud University College of Computer and Information Sciences Computer Science Department

This document appears to be an assignment for a theory of computation course. It includes 4 exercises involving finite automata and regular expressions. Exercise 1 has students construct a deterministic finite automaton (DFA) equivalent to a given non-deterministic finite automaton (NFA) and give the corresponding regular expression. Exercise 2 has them build a DFA from a regular expression and compare it to the one from Exercise 1. Exercise 3 has them build an NFA from a regular expression. Exercise 4 has them apply the subset construction to the NFA from Exercise 3 to obtain an equivalent DFA and compare it to the previous DFAs.

Uploaded by

Rosa
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

This Study Resource Was: King Saud University College of Computer and Information Sciences Computer Science Department

This document appears to be an assignment for a theory of computation course. It includes 4 exercises involving finite automata and regular expressions. Exercise 1 has students construct a deterministic finite automaton (DFA) equivalent to a given non-deterministic finite automaton (NFA) and give the corresponding regular expression. Exercise 2 has them build a DFA from a regular expression and compare it to the one from Exercise 1. Exercise 3 has them build an NFA from a regular expression. Exercise 4 has them apply the subset construction to the NFA from Exercise 3 to obtain an equivalent DFA and compare it to the previous DFAs.

Uploaded by

Rosa
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

King Saud University

College of Computer and Information Sciences


Computer Science Department
CSC 601 Theory of Computation

Assignment 2

Due Date: Sunday, March 20th, 2016 8:00pm.

m
e r as
Exercise 1: (30=20+10)

co
Consider the following NFA, M=(K,∑ ,Δ , s, F) where K={A, B, C, D}, ∑={0,1}, s=A, F={A} and Δ

eH w
given by the following transition relation { (A, 0, B), (A, 0, C), (B, 1, A), (C, 1, D), (D, 0, A)}.

o.
1. Use the subset construction algorithm to produce an equivalent DFA. Explicit all the
calculation steps.
rs e
ou urc
2. Give the Regular Expression that generates L(M)
o

Solution:
aC s

1.
v i y re
ed d
ar stu
sh is
Th

2. (01 + 010)*

Exercise 2: (25=20+5)
Considerer the following Regular Expression R:
(ab + aba)*
1. Use the conversion algorithm from a regular expression to a DFA to generate the DFA
that accepts L(R). Explicit clearly the application of the algorithm.

https://www.coursehero.com/file/14281576/Solutions-assignment-2/
2. Compare this DFA with the one obtained in exercise 1.
Solution

m
e r as
co
eH w
o.
rs e
ou urc
o
aC s
v i y re
ed d

Exercise 3: (20)
ar stu

Consider again Regular Expression R:(ab + aba)*


Use the algorithm to convert a regular expression to a non-deterministic finite automaton
(NFA) to build an NFA accepting L(R). You are required to use the algorithm as presented in
sh is

class with its precise steps.


Th

Solution:

https://www.coursehero.com/file/14281576/Solutions-assignment-2/
m
e r as
co
eH w
o.
rs e
ou urc
o
aC s
v i y re
ed d
ar stu
sh is
Th

https://www.coursehero.com/file/14281576/Solutions-assignment-2/
Exercise 4: (25=20+5)
Consider the NFA obtained in exercise 3:
1. Apply on it the subset construction algorithm to obtain the equivalent DFA.
2. Compare this DFA with the ones obtained in exercises 1 and 2.

m
e r as
co
eH w
o.
rs e
ou urc
o
aC s
v i y re
ed d
ar stu
sh is
Th

https://www.coursehero.com/file/14281576/Solutions-assignment-2/

Powered by TCPDF (www.tcpdf.org)

You might also like