department of computer science
college of computing
western delta university
first semester examination 2023/2024 session
CSC307 - formal language and automata theory time: 2hrs: 30mins
Attempt question one (1) and any other three (3) questions
Question 1 (Compulsory) (25 marks)
- Define the following:
- Automation
- Automata Theory
- Alphabets
- Strings
- Language
- Empty String
- State the objective of Automata Theory (2 marks)
- Using suitable diagrams only, represent Automation and its configuration. (4 marks)
- Consider the string "q r s t u v w x y z". Determine the length of the string. (2 marks)
- If x = "a b c d e f g h" and y = "m n o p q r st", compute the concatenation of xy. (2 marks)
- Given that w = 10111101011010001110. Find (w)R. (2 marks)
- Give a formal description of Context Free Grammer (CFG). Assume that the production rule for a regular expression is as follows:
(3 marks)S -> bS..................Rule 1
S -> e...................Rule 2 - Derive the string "bbbbbb" (4 marks)
- Give a formal description of Context Free Grammer (CFG). Assume that the production rule for a regular expression is as follows:
- Define the following:
Question 2 (15 marks)
- Define Derivation and Parse Tree. (2 marks)
- List and explain two (2) types of derivation. (3 marks)
- Write down four (4) properties of a parse tree. (4 marks)
- Consider the Grammer:
S -> aAS/aSS/e..................Rule 1
A -> SbA/ba.....................Rule 2- Using leftmost derivation, derive the string "aabaa"(3 marks)
- Show the corresponding parse treee. (3 marks)
Question 3 (15 marks)
- Define the following:
- Rightmost Derivation
- Rightmost Derivation Tree (4 marks)
- Context Free Grammers (CFG) are recognized by what automation? (2 marks)
- The production rule for a regular expression is given as follows:
S -> AB/e..................Rule 1
A -> aB....................Rule 2
B -> Sb....................Rule 3- Derive the string "abb"(5 marks)
- Draw the parse tree (4 marks)
- Define the following:
Question 4 (15 marks)
- Write a formal definition of finite automata. (3 marks)
- Write explanatory notes on transition diagram and transition table. (4 marks)
- Construct a Deterministic Finite Automata (DFA) accepting all strings over {x, y} ending with 'xy' using the following procedure:
- Develop a Mathematical Model. (2 marks)
- Generate the transition diagram. (3 marks)
- Draw the corresponding transition table. (3 marks)
Question 5 (15 marks)
- Why is Push Down Automata (PDA) more powerful than a Finite State Machine (FSM). State the three (3) components of a Push Down Automata. (4 marks)
- With the aid of a diagram only, illustrate the working principle of a Push Down Automata (PDA). (3 marks)
- Construct a push down automata that accepts L = {ikjk for k = 3}. Use the following steps:
- Draft a Mathematical Model. (2 marks)
- Show the contents of the stack for each iteration. (3 marks)
- Draw the transition diagram. (3 marks)
Question 6 (15 marks)
- A Turing machine has what data structure? Highlight four (4) rules of Operation of Turing machines. (5 marks)
- List and explain five (5) applications of Turing machines. (5 marks)
- Design a Turing machine which recognizes the language L = 01*0 (5 marks)