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

Assignment 01

The document provides instructions for an assignment on formal languages and finite automata. It contains 3 questions - the first asks students to list the strings and cardinalities of various languages; the second asks students to design deterministic finite automata (DFAs) accepting several languages; the third asks students to draw finite automata accepting specific languages over the alphabet {a,b}. The assignment is worth 30 total marks and is due on April 3, 2023. Late submissions will not be accepted.

Uploaded by

Rizwan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
192 views

Assignment 01

The document provides instructions for an assignment on formal languages and finite automata. It contains 3 questions - the first asks students to list the strings and cardinalities of various languages; the second asks students to design deterministic finite automata (DFAs) accepting several languages; the third asks students to draw finite automata accepting specific languages over the alphabet {a,b}. The assignment is worth 30 total marks and is due on April 3, 2023. Late submissions will not be accepted.

Uploaded by

Rizwan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

TOA

Assignment 01
Total Marks: 30
Due Date: 03 April 2023
Instructions:

1. This is your individual handwritten assignment.


2. Your assignment should be plagiarism free. In case of plagiarism, straight Zero would be
rewarded.
3. You have to attempt all the questions of the assignment.
4. No late submissions would be entertained in any case.

Q1.
Give the strings of each language of the following problems in ascending order of word length and also
give the cardinalities of the languages.
Example: L= {𝑤 𝑜𝑣𝑒𝑟 Σ = {a, b} | |𝑤| ≤ 3 }, list the members of L and what is the cardinality of L.
L = {Λ, a, b, aa, ab, ba, bb, aaa, aab, aba, abb, baa, bab, bba, bbb}.
Cardinality of L = |L| = 15.
a. 𝐿2 = {𝑤 𝑜𝑣𝑒𝑟 Σ | |𝑤| > 2 𝑎𝑛𝑑 |𝑤| ≤ 5 𝑎𝑛𝑑 |𝑤| 𝑖𝑠 𝑜𝑑𝑑 }
b. 𝐿5 = {𝑤 𝑜𝑣𝑒𝑟 Σ | |𝑤| > 2 𝑎𝑛𝑑 |𝑤| ≤ 5 𝑎𝑛𝑑 |𝑤| 𝑖𝑠 𝑜𝑑𝑑 𝑎𝑛𝑑 𝑤 𝑠𝑡𝑎𝑟𝑡𝑠 𝑤𝑖𝑡ℎ 𝑎 𝑎𝑛𝑑 𝑒𝑛𝑑𝑠 𝑎𝑡 𝑏 }.
c. 𝐿6 = {𝑤 𝑜𝑣𝑒𝑟 Σ | |𝑤| > 2 𝑎𝑛𝑑 |𝑤| ≤ 5, 𝑡ℎ𝑖𝑟𝑑 𝑐ℎ𝑎𝑟𝑐𝑡𝑒𝑟 𝑜𝑓 𝑤 𝑖𝑠 𝑏 }.

Now consider Σ = {0,1,2}

a. 𝐿1 = {𝑠 𝑜𝑣𝑒𝑟 Σ | |𝑠| ≤ 4 𝑎𝑛𝑑 𝑠𝑢𝑚 𝑜𝑓 𝑑𝑖𝑔𝑖𝑡𝑠 𝑖𝑛 𝑠 𝑎𝑟𝑒 ≥ 5 𝑎𝑛𝑑 ≤ 10}


b. 𝐿2 = 𝐿4 = {𝑠 𝑜𝑣𝑒𝑟 Σ | |𝑠| ≤ 4 𝑎𝑛𝑑 𝑠𝑢𝑚 𝑜𝑓 𝑑𝑖𝑔𝑖𝑡𝑠 𝑖𝑛 𝑠 𝑖𝑠 𝑑𝑖𝑣𝑖𝑠𝑖𝑏𝑙𝑒 𝑏𝑦 2 𝑜𝑟 𝑑𝑖𝑣𝑖𝑠𝑖𝑏𝑙𝑒 𝑏𝑦 3 }

Q2.
Consider Σ = {0, 1, 2} design DFA of the following languages.
a. 𝐿1 = {𝑠 𝑜𝑣𝑒𝑟 Σ | 𝑠𝑢𝑚 𝑜𝑓 𝑑𝑖𝑔𝑖𝑡𝑠 𝑖𝑛 𝑠 𝑎𝑟𝑒 ≥ 5 𝑎𝑛𝑑 ≤ 10}
b. 𝐿2 = {𝑠 𝑜𝑣𝑒𝑟 Σ | 𝑠𝑢𝑚 𝑜𝑓 𝑑𝑖𝑔𝑖𝑡𝑠 𝑖𝑛 𝑠 𝑖𝑠 𝑑𝑖𝑣𝑖𝑠𝑖𝑏𝑙𝑒 𝑏𝑦 2 }
c. 𝐿4 = {𝑠 𝑜𝑣𝑒𝑟 Σ | |𝑠| ≤ 4 𝑎𝑛𝑑 𝑠𝑢𝑚 𝑜𝑓 𝑑𝑖𝑔𝑖𝑡𝑠 𝑖𝑛 𝑠 𝑖𝑠 𝑑𝑖𝑣𝑖𝑠𝑖𝑏𝑙𝑒 𝑏𝑦 2 𝑜𝑟 𝑑𝑖𝑣𝑖𝑠𝑖𝑏𝑙𝑒 𝑏𝑦 3 }
d. 𝐿 = {𝑤 ∈ {𝑎, 𝑏}∗ |𝑤 𝑒𝑛𝑑𝑠 𝑤𝑖𝑡ℎ 𝑎𝑏𝑏}
e. 𝐿 = {𝑤 ∈ {𝑎, 𝑏}∗ |𝑤 𝑐𝑜𝑛𝑡𝑎𝑖𝑛 𝑠𝑢𝑏𝑠𝑡𝑟𝑖𝑛𝑔 𝑎𝑏𝑏𝑎𝑎𝑏}
f. 𝐿 = {𝑤 ∈ {𝑎, 𝑏}∗ |𝑤 𝑐𝑜𝑛𝑡𝑎𝑖𝑛𝑠 𝑎𝑡𝑙𝑒𝑎𝑠𝑡 𝑡ℎ𝑟𝑒𝑒 𝑎′𝑠}
g. 𝐿 = {𝑤 ∈ {0,1, 2,3}∗ |𝑠𝑢𝑚 𝑜𝑓 𝑑𝑖𝑔𝑖𝑡𝑠 𝑖𝑛 𝑤 𝑎𝑟𝑒 𝑒𝑖𝑡ℎ𝑒𝑟 𝑑𝑖𝑣𝑖𝑠𝑖𝑏𝑙𝑒 𝑏𝑦 4 𝑜𝑟 6}
h. 𝐿 = {𝑤 ∈ {𝑎, 𝑏, 𝑐}∗ |𝑛𝑎 (𝑤) 𝑎𝑛𝑑 𝑛𝑏 (𝑤) 𝑎𝑟𝑒 𝑒𝑣𝑒𝑛 𝑏𝑢𝑡 𝑛𝑐 (𝑤) 𝑎𝑟𝑒 𝑜𝑑𝑑}
𝐿 = {𝑤 ∈ Σ ∗ | 𝑤 contains the substring 010, but does not contain the substring 0101}

Q 3:
In each part below, draw an FA accepting the indicated language over {a, b}.
a. The language of all strings containing exactly two a’s.
b. The language of all strings containing at least two a’s.
c. The language of all strings that do not end with ab.
d. The language of all strings that begin or end with aa or bb.
e. The language of all strings not containing the substring aa.
f. The language of all strings in which the number of a’s is even.
g. The language of all strings in which both the number of a’s and the number of b’s are
even.

================================ GOOD LUCK ================================

You might also like