COS3701
Assignment 3
(COMPLETE
ANSWERS) 2025
NO PLAGIARISM
[Pick the date]
[Type the company name]
, Exam (elaborations)
COS3701 Assignment 3 (COMPLETE
ANSWERS) 2025
Course
Theoretical Computer Science III (COS3701)
Institution
University Of South Africa (Unisa)
Book
Theoretical Computer Science
COS3701 Assignment 3 (COMPLETE ANSWERS) 2025 - DUE 2025; 100%
TRUSTED Complete, trusted solutions and explanations.. Ensure your success
with us..
Question 1 [10] Given that L1 = (aa)* and L2 = (a + b)*ab(a + b)*. Find
grammars for L1 and L2. Then use Theorem 37 to find L1L2.
✅ Step 1: Define grammars for L1 and L2
Language L1 = (aa)*
This means the strings consist of zero or more repetitions of “aa”. So valid strings are: ε, aa,
aaaa, aaaaaa, etc.
We define grammar G1 = (V1, Σ, R1, S1) where:
V1 = {S1}
Σ = {a}
R1:
o S1 → aaS1 | ε
✔ This generates zero or more "aa" substrings.
Language L2 = (a + b)ab(a + b)
Assignment 3
(COMPLETE
ANSWERS) 2025
NO PLAGIARISM
[Pick the date]
[Type the company name]
, Exam (elaborations)
COS3701 Assignment 3 (COMPLETE
ANSWERS) 2025
Course
Theoretical Computer Science III (COS3701)
Institution
University Of South Africa (Unisa)
Book
Theoretical Computer Science
COS3701 Assignment 3 (COMPLETE ANSWERS) 2025 - DUE 2025; 100%
TRUSTED Complete, trusted solutions and explanations.. Ensure your success
with us..
Question 1 [10] Given that L1 = (aa)* and L2 = (a + b)*ab(a + b)*. Find
grammars for L1 and L2. Then use Theorem 37 to find L1L2.
✅ Step 1: Define grammars for L1 and L2
Language L1 = (aa)*
This means the strings consist of zero or more repetitions of “aa”. So valid strings are: ε, aa,
aaaa, aaaaaa, etc.
We define grammar G1 = (V1, Σ, R1, S1) where:
V1 = {S1}
Σ = {a}
R1:
o S1 → aaS1 | ε
✔ This generates zero or more "aa" substrings.
Language L2 = (a + b)ab(a + b)