You are on page 1of 2

COMSATS University Islamabad, Islamabad Campus

Department of Computer Science


Theory of Automata– CSC312

BCS – IV & VI Assignment1

Mapped to CLO1 Marks: [50]

CLO-1: Describe the fundamental concepts of automata and formal language theory.

Q1: What is the link of Automata Theory with the Theory of Computation? [5]

Q2: What is the role of Alan Turing in Theory of Automata? [5]

Q3: What are the different applications of Automata Theory? Mention at least 5. [10]

Q4: What Regular Expressions could solve the following real world problems [5×2=10]

i. Admin can search students through their registration numbers. To match the registration
number with the record a generalized regular expression will help the application. Possible
patterns of registration numbers include FA10-BCS-008, SP11-BSE-001, FA11-BDS-009,
SP20-BCY-087, FA21-BAI-002, FA10-RCS-011, and SP14-PCS-007.
ii. Provide regular expressions for the following
a) To match a yahoo email address
b) IP address
c) HTTP URL’s with .com domain
d) C variable

Q5: a) How the pacman game can be represented using finite automata (FA)? Consider the below [5]

mentioned case study of the pacman game for designing FA. Mention all the 5-tuples of FA, draw

the state transition table and state diagram for this problem.
For those unfamiliar with the gameplay, Pac-Man requires the player to navigate through a maze, eating
pellets and avoiding the ghosts who chase him through the maze. Occasionally, Pac-Man can turn the tables
on his pursuers by eating a power pellet, which temporarily grants him the power to eat the ghosts. When
this occurs, the ghosts’ behavior changes, and instead of chasing Pac-Man they try to avoid him.

The ghosts have following behaviors or exist in these states:

• Randomly wander the maze

• Chase Pac-man, when he is within line of sight

• Flee Pac-man, after Pac-Man has consumed a power pellet

• Return to the central base to regenerate if dead

States of the system are

 Pac-Man eats the Ghost , He will keep finding the dots and power pellets for eating them

 Ghost eats the Pac-Man, Game ends

b) How can we represent the working of an automatic washing machine using Finite state automata? [5]

c) What would be the possible accepted strings for the following languages [5]

i. Language of all strings having length greater than 3 and prefix bb over ∑={a,b}

ii. L = {anbn | n N},  = {a,b}

iii. Language of all strings having even number of 0’s and odd number of 1’s over ∑={0,1}
iv. Language of all strings having exactly two a’s and more than three b’s over ∑={a,b}
v. Language of PALINDROME over ∑={a,b} with length not greater than 5.

d) Prove that for all sets S, [3]

. (S+)* = (S*)*
(S+)+ = S+

e) Let S = {ab, bb} and let T = {ab, bb, bbbb}. Show that S* = T*. [2]

You might also like