100% de satisfacción garantizada Inmediatamente disponible después del pago Tanto en línea como en PDF No estas atado a nada 4.2 TrustPilot
logo-home
Examen

COS3701 Assignment 3 (COMPLETE ANSWERS) 2025 - DUE 2025

Puntuación
-
Vendido
-
Páginas
13
Grado
A+
Subido en
03-08-2025
Escrito en
2025/2026

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. Question 3 [10] Using theorem 42 algorithm to determine whether the following grammar generate any words. S AB A BC C DA B CD D a A b Look at the reformulated version of Theorem 42 in your online study units Question 4 [15] Build a Turing Machine (TM) that • accepts all words in {an bn am | n ≥ 0; m > n} • loops forever on all words starting with b, and • rejects all other words. Assume that the alphabet is Σ = {a, b} Question 5 [15] Build a 2PDA that accepts the language {a2nbnanb2n | n > 0}.

Mostrar más Leer menos
Institución
Grado









Ups! No podemos cargar tu documento ahora. Inténtalo de nuevo o contacta con soporte.

Escuela, estudio y materia

Institución
Grado

Información del documento

Subido en
3 de agosto de 2025
Número de páginas
13
Escrito en
2025/2026
Tipo
Examen
Contiene
Preguntas y respuestas

Temas

Vista previa del contenido

COS3701 Assignment 3
(COMPLETE ANSWERS)
2025 - DUE 2025

For assistance contact
Email:

, Question 1: Grammars for Concatenated Languages
1. Grammars for L1=(aa)∗ and L2=(a+b)∗ab(a+b)∗Error! Filename not specified.
A grammar for a regular language is a regular grammar, also known as a right-linear grammar. It
has productions of the form A→wB or A→w, where A and B are non-terminals and w is a string
of terminals.
Grammar for L1=(aa)∗Error! Filename not specified.
The language L1 consists of strings with an even number of 'a's, including the empty string (Λ).
 Start symbol: S1Error! Filename not specified.
 Terminals: {a}Error! Filename not specified.
 Productions: S1→aaS1 S1→ΛError! Filename not specified.
This grammar correctly generates all strings in L1. The first production allows the generation of
pairs of 'a's, and the second production allows the derivation to terminate, including the case
where no 'a's are generated (the empty string).
Grammar for L2=(a+b)∗ab(a+b)∗Error! Filename not specified.
The language L2 consists of all strings over the alphabet {a,b} that contain the substring "ab".
 Start symbol: S2Error! Filename not specified.
 Terminals: {a,b}Error! Filename not specified.
 Non-terminals: {S2,A}Error! Filename not specified.
 Productions: S2→aS2∣bS2∣abA A→aA∣bA∣ΛError! Filename not specified.
The productions for S2 first generate any arbitrary string of 'a's and 'b's (the (a+b)∗ part) before
moving to the core substring "ab". Once "ab" is generated, the non-terminal A takes over to
generate the final arbitrary string of 'a's and 'b's (the second (a+b)∗ part). The production A→Λ
allows this final part to be the empty string.
2. Using Theorem 37 to find the grammar for L1L2Error! Filename not specified.
Theorem 37 states that if a grammar G1 generates L1 and a grammar G2 generates L2, a
grammar for the concatenated language L1L2 can be constructed. A common formulation of this
theorem for regular languages involves modifying the productions of G1 that contain the empty
string (Λ).
The procedure is as follows:
1. Take all the productions of G1 and G2.
2. If the start symbol of G1, S1, has a production S1→Λ, replace this production with S1
→S2, where S2 is the start symbol of G2.
$2.50
Accede al documento completo:

100% de satisfacción garantizada
Inmediatamente disponible después del pago
Tanto en línea como en PDF
No estas atado a nada

Conoce al vendedor

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
gabrielmusyoka940 db
Seguir Necesitas iniciar sesión para seguir a otros usuarios o asignaturas
Vendido
1461
Miembro desde
2 año
Número de seguidores
247
Documentos
1488
Última venta
3 días hace
Bstudy

provides latest exam paper

3.2

214 reseñas

5
68
4
28
3
49
2
20
1
49

Recientemente visto por ti

Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes