Docsity

Practice Assignment 2 - Languages and Computation | CS 3240, Assignments of Computer Science

Toggle sidebar
bg1
CS 3240 : Languages and Computation
Homework II
Due Beginning of Class, Tuesday, February 7
th
2008
Total Points : 100
Guidelines:
1. You can discuss the homework problems at a higher level with other students.
However, you must write the homework solutions completely independently and
also report the names of the collaborators with whom you discussed the
homework. Do not copy solutions from any other source under any circumstance
.
2. Answers should be concise, complete and precise
3. Return a hard copy of the homework, the homework is due at the beginning of the
class; no late homework submission please.
Questions: Give state diagrams of DFAs for the following languages (10 pts each)
1. {w | w starts with 1 and has an odd length or w starts with 0 and has even
length}, alphabet = {0, 1}
2. {w | w contains an odd number of 0โ€™s or contains exactly two 1โ€™s and ends on a
0}, alphabet = {0, 1}
3. {w | w is any string not in a*b* that can be derived from {a, b}}
4. {w | w is any string that can be derived from alphabet except 111 or 1111},
alphabet = {0, 1}
5. All the strings of lengths five or higher that start with the letter `bโ€™ and end with a
letter `dโ€™ or `mโ€™ โ€“ alphabet is [a-z]
From the following regular expressions, generate a NFA first and then convert it
into a DFA โ€“ please show important steps of conversion from NFA to DFA (20 pts
each)
6. a* b+ (aba)*
7. a*b*a+
Show minimal DFA (with minimum number of possible states) for the following
string and informally argue why it is minimal (ie, nothing smaller can exist) (10 pts)
8. All strings derived from {0, 1} that have 11 as the prefix and have even (excluding
zero) number of 0โ€™s

Partial preview of the text

Download Practice Assignment 2 - Languages and Computation | CS 3240 and more Assignments Computer Science in PDF only on Docsity!

CS 3240 : Languages and Computation

Homework II

Due Beginning of Class, Tuesday, February 7

th

Total Points : 100

Guidelines:

  1. You can discuss the homework problems at a higher level with other students. However, you must write the homework solutions completely independently and also report the names of the collaborators with whom you discussed the

homework. Do not copy solutions from any other source under any circumstance.

  1. Answers should be concise, complete and precise
  2. Return a hard copy of the homework, the homework is due at the beginning of the class; no late homework submission please.

Questions: Give state diagrams of DFAs for the following languages (10 pts each)

  1. {w | w starts with 1 and has an odd length or w starts with 0 and has even length}, alphabet = {0, 1}
  2. {w | w contains an odd number of 0โ€™s or contains exactly two 1โ€™s and ends on a 0}, alphabet = {0, 1}
  3. {w | w is any string not in ab that can be derived from {a, b}}
  4. {w | w is any string that can be derived from alphabet except 111 or 1111}, alphabet = {0, 1}
  5. All the strings of lengths five or higher that start with the letter bโ€™ and end with a letterdโ€™ or `mโ€™ โ€“ alphabet is [a-z] From the following regular expressions, generate a NFA first and then convert it into a DFA โ€“ please show important steps of conversion from NFA to DFA (20 pts each)
  6. a* b+ (aba)*
  7. aba+ Show minimal DFA (with minimum number of possible states) for the following string and informally argue why it is minimal (ie, nothing smaller can exist) (10 pts)
  8. All strings derived from {0, 1} that have 11 as the prefix and have even (excluding zero) number of 0โ€™s