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

COS3701 ASSIGNMENT 3 2025

Rating
-
Sold
-
Pages
8
Grade
A+
Uploaded on
14-07-2025
Written in
2024/2025

Question 1 [10 Marks] You are given two languages:  L1 = (aa)* This means strings with zero or more repetitions of “aa”. Examples include: ε (empty string), aa, aaaa, aaaaaa, etc.  L2 = (a + b)*ab(a + b)* This language includes all strings that contain the substring "ab" somewhere in the middle, surrounded by any number of a’s and b’s on either side. Grammar for L1: We need to create a grammar G1 = (V, Σ, R, S) that generates only strings in (aa)*

Show more Read less
Institution
COS3701
Course
COS3701









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

Written for

Institution
COS3701
Course
COS3701

Document information

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

Content preview

COS3701
ASSIGNMENT 3 2025

UNIQUE NO.
DUE DATE: 2025

, Question 1 [10 Marks]

You are given two languages:

 L1 = (aa)*
This means strings with zero or more repetitions of “aa”. Examples include: ε
(empty string), aa, aaaa, aaaaaa, etc.
 L2 = (a + b)*ab(a + b)*
This language includes all strings that contain the substring "ab" somewhere in
the middle, surrounded by any number of a’s and b’s on either side.

Grammar for L1:

We need to create a grammar G1 = (V, Σ, R, S) that generates only strings in (aa)*

 Variables (V): {S}
 Alphabet (Σ): {a}
 Rules (R):
o S → aaS
o S→ε
 Start symbol: S

Explanation: This grammar repeatedly adds “aa” or stops with ε.

Grammar for L2:

We need to create a grammar G2 = (V, Σ, R, S) that generates strings with “ab” in the
middle.

 Variables (V): {S, A, B}
 Alphabet (Σ): {a, b}
 Rules (R):

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.
AMAZINGGRADES PEARSON
View profile
Follow You need to be logged in order to follow users or courses
Sold
343
Member since
3 year
Number of followers
182
Documents
1860
Last sold
3 months ago
EDUCATOR

Get the best grades✔✔✔✔✔✔✔✔ Your fellow student knows the best materials to research on and use. This guarantee you the best grades in your examination. Your fellow students use high quality materials, textbooks and notes on the assignment to ensure high quality.

4.3

70 reviews

5
48
4
9
3
5
2
4
1
4

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 tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card 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