100% tevredenheidsgarantie Direct beschikbaar na je betaling Lees online óf als PDF Geen vaste maandelijkse kosten 4.2 TrustPilot
logo-home
Tentamen (uitwerkingen)

COS3701 ASSIGNMENT 03 2025 Due 21 AUGUST 2025

Beoordeling
-
Verkocht
-
Pagina's
16
Cijfer
A+
Geüpload op
25-07-2025
Geschreven in
2024/2025

Unlock your academic potential with the ultimate study resource for COS3701 ASSIGNMENT 03 2025 Due 21 AUGUST 2025 This 100% exam-ready assignment come with expert-verified answers, in-depth explanations, and reliable references, meticulously crafted to ensure you grasp every concept with ease. Designed for clarity and precision, these fully solved material is your key to mastering any subject and acing your exams. Don’t just study—study smart. Grab your path to academic success today and elevate your grades with confidence.

Meer zien Lees minder
Instelling
Vak










Oeps! We kunnen je document nu niet laden. Probeer het nog eens of neem contact op met support.

Gekoppeld boek

Geschreven voor

Instelling
Vak

Documentinformatie

Geüpload op
25 juli 2025
Aantal pagina's
16
Geschreven in
2024/2025
Type
Tentamen (uitwerkingen)
Bevat
Vragen en antwoorden

Onderwerpen

Voorbeeld van de inhoud

COS3701
Assignment 3

Due 21 August 2025

,Question 1

Given that L1 = (aa)∗ and L2 = (a + b)∗ ab(a + b)∗ , find grammars
for L1 and L2 . Then use Theorem 37 to find a grammar for L1 L2 .

The language L1 = (aa)∗ consists of all strings over {a} formed by zero or more repetitions
of the substring ”aa”. Examples include ϵ, aa, aaaa, and so on. Although this is a regular
language, we construct a context-free grammar (CFG) for the purpose of composition with
another CFG.

Grammar for L1 :

Variables: {S1 }

Terminals: {a, b}

Productions:



S1 → aaS1 | ϵ


Start symbol: S1

This grammar generates strings composed only of an even number of a’s. The terminal
b is included in the alphabet for compatibility with L2 , although it does not appear in
L1 ’s productions.

The language L2 = (a + b)∗ ab(a + b)∗ consists of all strings over {a, b} that contain at
least one occurrence of the substring ab. Examples include ab, aab, aba, and baaba.

To construct a CFG for L2 , the required substring ab is made explicit in the middle,
allowing arbitrary strings of a’s and b’s before and after it.

Grammar for L2 :

Variables: {S2 , X}


1

, Terminals: {a, b}

Productions:



S2 → XabX

X → aX | bX | ϵ


Start symbol: S2

This grammar ensures the presence of at least one ab within any derivation, with both
sides allowing arbitrary strings from X.

Theorem 37 states that if L1 and L2 are context-free languages with grammars G1 =
(V1 , Σ, P1 , S1 ) and G2 = (V2 , Σ, P2 , S2 ), and V1 ∩ V2 = ∅, then their concatenation L1 L2
is also context-free. A grammar for L1 L2 can be constructed as follows:

Variables: V = V1 ∪ V2 ∪ {S}

Terminals: {a, b}

Productions:



S → S1 S2

S1 → aaS1 | ϵ

S2 → XabX

X → aX | bX | ϵ


Start symbol: S

To validate the correctness of this grammar, we examine several sample derivations.

Example: “ab”



S → S1 S2 → ϵS2 → XabX → ϵabϵ = ab



2

Maak kennis met de verkoper

Seller avatar
De reputatie van een verkoper is gebaseerd op het aantal documenten dat iemand tegen betaling verkocht heeft en de beoordelingen die voor die items ontvangen zijn. Er zijn drie niveau’s te onderscheiden: brons, zilver en goud. Hoe beter de reputatie, hoe meer de kwaliteit van zijn of haar werk te vertrouwen is.
BeeNotes teachmetutor
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
281
Lid sinds
6 maanden
Aantal volgers
0
Documenten
486
Laatst verkocht
1 maand geleden
BeeNotes

BeeNotes: Buzzing Brilliance for Your Studies Discover BeeNotes, where hard-working lecture notes fuel your academic success. Our clear, concise study materials simplify complex topics and help you ace exams. Join the hive and unlock your potential with BeeNotes today!

4,0

35 beoordelingen

5
20
4
3
3
8
2
1
1
3

Recent door jou bekeken

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo makkelijk kan het dus zijn.”

Alisha Student

Veelgestelde vragen