You are on page 1of 12

COLLEGE OF COMPUTING AND INFORMATION SCIENCES

Final Assessment Fall 2020 Semester


Class Id 105156/ 105157/105158 Course Title AUTOMATA THEORY
Program BS (CS) Campus / Shift NORTH CAMPUS
Date 11th – December 2020 Total Marks 40
Duration 03 hours Faculty Name M. FAHAD
Student Id 63022 Student Name Kiran Habib

• Filling out Student-ID and Student-Name on exam header is mandatory.


• Do not remove or change any part of exam header or question paper.
• Write down your answers in given space or at the end of exam paper with proper title “Answer
for Question# _ _”.
• Answers should be formatted correctly (font size, alignment and etc.)
• Handwritten text or image should be on A4 size page with clear visibility of contents.
• Only PDF format is accepted (Student are advised to install necessary software)
• In case of CHEATING, COPIED material or any unfair means would result in negative marking
or
ZERO.
 A mandatory recorded viva session will be conducted to ascertain the quality of answer scripts
where deemed necessary.

 Caution: Duration to perform Final-Term Assessment is 03 hours only. Extra 01 hour is given
to cater all kinds of odds in submission of Answer-sheet. Therefore, if you failed to upload
answer sheet on LMS (in PDF format) within 04 hours limit, you would be considered as
ABSENT/FAILED.
 Timing of the assessment is from 01:00 pm to 04:00 pm extended till 05:00 pm.

“I promise that all the answers provided in this assessment are provided solely by me. I haven’t
discussed anything related to this assessment with anyone else”

Name:

QUESTION TOTAL MARKS MARKS OBTAINED


QUESTION # 01 10
QUESTION # 02 10
QUESTION # 03 10
QUESTION # 04 10
QUESTION # 01 (a):

If we have complementing machine mentioned below, we know the output is complement of


input. What if, when we add 2 magnitude with input. What will be the output of machine? Give
reason with example.

For example by adding 1 magnitude output is given


QUESTION # 01 (b):

i- Why the out of Moore and Melay machine are varies from each other?

ANSWER:

Mealy Machine

1. The Mealy Machine has the capability of changing its output based on present state and
present input.
2. Output is placed on transitions.
3. Mealy is faster because output will change as soon as input transition begins.
4. Asynchronous generation of output though the state change synchronous to the clock.
5. It is faster.
6. Less states are needed which ultimately means that less hardware required to design.

Moore Machine

1. The Moore Machine has the capability of changing its output based on present state and
not on the present input.
2. Output is placed on state.
3. Moore is safer to use because they changes the states on the clock edge.
4. Both output and state change synchronous to the clock.
5. It is predictable.
6. More states are needed.
ii- Convert Moore machine to Mealy machine
QUESTION # 02:
i- In concatenation of two FA’s when first FA transition comes to final state, so we write
second FA initial state with it in new values (table). What is the reason behind it?
Elaborate with proper example.

ANSWER:

The explanation for that is on the grounds that we need to make such customary articulation
after link which fulfills the state of ordinary articulation 1 and afterward it likewise fulfills the
state of the normal articulation 2 that is the reason we need to record FA introductory state
esteems into the table.

ii- Below mentioned are two FA’s, take union of these FA’s and then take Closure of the
answer.

ANSWER:
QUESTION # 03:
There are almost three types of machines we study in Theory of Computer Science, i.e., Finite
Automata, Finite Automata with Outputs, Pushdown Automata, and Turning Machine. Which
one is the most powerful? Briefly justify your answer.
Given the following Turing Machine.
a. Which is the function that the TM carries out? Explain in detail.
ANSWER:
Turning machine is the most impressive on the grounds that it have ability of include , In
Finite automata it's just analyze the string and check whether it's substantial or not
legitimate but rather in turning machine we can include every one of the character in the
string so it's more efficient. The "TM" carry’s the present status and current image that
head read from tape essentially it contains boundless length of tape on which we perform
peruse and compose activity

b. Show the sequence of movements to process the input string “1010”.


QUESTION # 04:
How would one simulate a PDA on a Turing machine? Please do not write the Turing machine
itself, but rather write the key idea in your own words

Design PDA for language, L = {Wrev(W) | W is in (0+1)*}


ANSWER:
We show how a PDA can be mimicked by a non-deterministic two-tape TM. This would in a
subsequent advance be changed into a typical (deterministic, one-tape) TM utilizing the changes
appeared in the talk. We utilize the second tape of the TM to speak to the heap of the PDA,
while the primary tape is simply used to peruse the contribution of the PDA. The conditions of
the TM fundamentally speak to the conditions of the PDA. Likewise, we need some assistant
states (see beneath). The TM fills in as follows: Whenever the PDA would peruse an image, the
TM should peruse the image under the head on the primary tape and moves the head one stage
to one side. At whatever point the PDA utilizes the unfilled image as info image, the head on the
principal tape keeps its position. Simultaneously, the TM plays out the suitable activity on the
second tape in quite a manner the head is constantly situated on the "top-most" image:
• If the PDA devours an image from the stack however doesn't compose another one, the TM
erases the image under the head and moves the head one situation to one side.
• If the PDA burns-through an image from the stack and composes another one, the TM
overwrites the image underneath the head with the enhanced one.
• If the PDA doesn't burn-through an image from the stack yet composes another one, the TM
moves one stage to one side and composes the new image. For this we really need to perform
two stages which should be possible utilizing some assistant states (we need to recollect the
image to compose and the present status of the TM).
• If the PDA doesn't change the stack, the TM doesn't change the subsequent tape.
This TM acknowledges the contribution of the PDA if it stops in an acknowledge state (if there
are a few tolerating states in the PDA, we utilize an extra change that carries the TM from these
states to its single acknowledge state)

You might also like