Computation Theory Course, 6803415-3: Homework One

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Kingdom of Saudi Arabia ‫المملكة العربية السعودية‬

Ministry of Education ‫وزارة التعليم‬

Umm AlQura University ‫جامعة أم القرى‬

Adam University College, female branch ‫ شطر الطالبات‬،‫الكلية الجامعية بأضم‬

Computer Science Department ‫قسم علوم الحاسب اآللي‬

First Semester of 2017-2018 Academic Year


Computation Theory Course, 6803415-3
Homework One
Solutions
Question One: 1 Mark
The following are the state diagrams of two DFAs, 𝑴𝟏 and 𝑴𝟐:

Answer the following questions about each of these machines.


a. What is the start state?
b. What is the set of accept states?
c. What sequence of states does the machine go through on input 𝑎𝑎𝑏𝑏?
d. Does the machine accept the string 𝑎𝑎𝑏𝑏?
e. Does the machine accept the string 𝜀?
The Answer of Qeustion One:
a.
M1 M2
q1 q1
b.
M1 M2
{q2} {q1, q4}
c.
M1 M2
q1, q2, q3, q1, q1 q1, q1, q1, q2, q4
d.
M1 M2
No, because the input has beed consumed and we ended up in a Yes, because the input has been consumed and we ended up in a
none final state. final state.
e.
M1 M2
No, it does not. Yes, it does because the start state is an accept state.

1
Question Two: 1 Mark
Give the formal description of the machines 𝑴𝟏 and 𝑴𝟐 pictured in Question One.
The Answer of Qeustion Two:
M1 M2
({q1, q2, q3}, {a, b}, 𝛿, q1, {q2}) ({q1, q2, q3, q4}, {a, b}, 𝛿, q1, {q1, q4})
𝛿: 𝛿:
a B a B
q1 q2 q1 q1 q1 q2
q2 q3 q3 q2 q3 q4
q3 q2 q1 q3 q2 q1
q4 q3 q4

Question Three: 1 Mark


The formal description of a DFA 𝑴 is ({𝒒𝒍, 𝒒𝟐, 𝒒𝟑, 𝒒𝟒, 𝒒𝟓}, {𝒖, 𝒅}, 𝜹, 𝒒𝟑, {𝒒𝟑}), where 𝜹 is given by the
following table:

Give the state diagram of this machine.


The Answer of Qeustion Three:

d d d d d
u
q1 q2 q3 q4 q5

u u u u

Good Luck my Great Students 😉


T.Mariah Sami Ahmed Khayat
Teacher Assistant @ Adam University College
mskhayat@uqu.edu.sa

You might also like