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

Assignment 2

This document is an assignment for the course CS224 on Formal Languages and Automata Theory, consisting of various tasks related to finite automata (FA) and transition graphs (TG). Students are instructed to work individually while allowing verbal collaboration and are required to list their collaborators. The assignment includes building FAs for specific languages, analyzing state requirements, and creating transition graphs, with a total of 92 marks available.

Uploaded by

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

Assignment 2

This document is an assignment for the course CS224 on Formal Languages and Automata Theory, consisting of various tasks related to finite automata (FA) and transition graphs (TG). Students are instructed to work individually while allowing verbal collaboration and are required to list their collaborators. The assignment includes building FAs for specific languages, analyzing state requirements, and creating transition graphs, with a total of 92 marks available.

Uploaded by

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

FL&TA CS224 PAGE 1

FORMAL LANGUAGES AND AUTOMATA THEORY


ASSIGNMENT # 2
REG#: __________________ NAME#: __________________________________

COURSE CODE: CS224 INSTRUCTOR: MUHAMMAD SAJID ALI

TOTAL MARKS: NINETY-TWO


--------------------------------------------------------------------------------------------------------------------------------------------------------------

Instructions

• You are free to consult each other for verbal help. However, copying or sharing the soft/hard copy with each
other will not only result in the cancellation of the current assignment, but it may also impact your grade
in all the future assignments and exams as well.
• List your collaborators on the last page of your assignment. Collaborators are any people you discussed this
assignment with. This is an individual assignment, so be aware of the course's collaboration policy.
• You must attach this assignment at the top of your solution.

Task 1. Build an FA that accepts only the language of all words with b as the second letter. Show both the picture
and the transition table for this machine and find a regular expression for the language (10 Marks)

Task 2. Build an FA that accepts only the words baa, ab and abb and no other strings longer or shorter (5 Marks)

Task 3. (15 Marks)

a. Build an FA with three states that accepts all strings


b. If an FA has three states and only one +, must it reject some inputs?
c. Build an FA that accepts only those words that have more than four letters

Task 4.
a. Recall from chapter 4 the language of all words over the alphabet {a, b} that have both the letter a and the
letter b in them, but not necessarily in that order. Build and FA that accepts this language. (10 Marks)
b. Build an FA that accepts the language of all words with only as or only b’s in them. Give a regular expression
for this language. (10 Marks)

Task 5. Build an FA such that when labels a and b are swapped the new machine is different from the old one but
equivalent (the language defined by these machines is the same) (10 Marks)

Task 6. Build a TG that accepts the language L1 of all words that begin and end with the same double letter, either
of the form aa….aa or bb…bb. Note aaa and bbb are not words in this language (10 Marks)

Task 7. Given a TG called TG1 that accepts the language L1 and a TG called TG2 that accepts the language L2, show
how to build a new TG called TG3 that accepts exactly the languae L1 + L2. (10 Marks)

Task 8. Verify that there are indeed three and only three ways for the TG on p.84 (chapter 6) of your book that
accept the word abbbabbbabba (7 Marks)

Task 9. For each of the five FAs pictured in problems 17, 19, and 20 in chapter 5, build a transition graph that
accepts the same language but has fewer states. (15 Marks)

You might also like