100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

COS3701 Assignment 2 (COMPLETE ANSWERS) 2025

Rating
-
Sold
-
Pages
9
Grade
A+
Uploaded on
01-07-2025
Written in
2024/2025

COS3701 Assignment 2 (COMPLETE ANSWERS) 2025










Whoops! We can’t load your doc right now. Try again or contact support.

Document information

Uploaded on
July 1, 2025
Number of pages
9
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Content preview

, COS3701 Assignment 2 (COMPLETE
ANSWERS) 2025 – DUE 2025; 100% TRUSTED
Complete, trusted solutions and
explanations.
Question 1 10 Find CFGs for all words that do not
have the substring aba over the alphabet Σ = {a
b}. Question 2 10 Convert the grammar below to
CNF (Hint: Consult the online study material) S aX |
Yb X ZXYZ | a Y b | bY | ᴧ Z a | ᴧ Question 3 15
Build a DPDA that accepts the language L =
{(ab)n(ba)n-2| n > 2}. Question 4 15 Prove that
the language L = {an+1b2n (aa)n b | n > 0} is
non-context free. Use the pumping lemma with
length.


Question 1 [10]
Find a Context-Free Grammar (CFG) for all
words that do not have the substring aba
over Σ = {a, b}.
Solution:
We need a CFG that generates all strings over {a,
b} that do not contain the substring aba.
This is best done using a finite automaton
without aba and converting it to CFG. But here's a
direct approach using memory of last 2 characters.

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
ScholarsCompas CHARMBERLAIN SCHOOL OF NURSING
View profile
Follow You need to be logged in order to follow users or courses
Sold
124
Member since
1 year
Number of followers
0
Documents
232
Last sold
1 week ago

4,0

25 reviews

5
13
4
4
3
4
2
2
1
2

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can immediately select a different document that better matches what you need.

Pay how you prefer, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card or EFT and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions