• ¿Documento equivocado? Cámbialo gratis
  • Escrito por estudiantes que aprobaron
  • Inmediatamente disponible después del pago
  • Leer en línea o como PDF
Vender
¿Dónde estudias?
Tu idioma
Document preview thumbnail
Vista previa 2 fuera de 7 páginas
Examen

COS3701 Assignment 3 2026

Document preview thumbnail
Vista previa 2 fuera de 7 páginas

Theoretical Computer Science III - COS3701 Assignment 3 2026; 100 % TRUSTED workings, Expert Solved, Explanations and Solutions. For assistance call or W.h.a.t.s.a.p.p us on ...(.+.2.5.4.7.7.9.5.4.0.1.3.2) Question 1 [10] Let L1 be the grammar generating (a + b)∗ . Let L2 be the grammar generating (aa)*b(a + b)*. First provide the grammars generating L1 and L2 respectively. Then apply the applicable theorem from Chapter 17 (Theorem 36) to determine L1 + L2. A CFG which generates L1 is S → aS | bS | Λ This can easily be seen by applying the production rules. A CFG which generates L2 is S → XbY X → aaX | Λ Y → Ya | Yb | Λ Once again this can easily be seen by applying the production rules. We now apply Theorem 36 on page 376 of Cohen to find a CFG for L1 + L2 First we write the CFG for L1 as S1 → aS1 | bS1 | Λ And we write the CFG for L2 as S2 → XbY X → aaX | Λ Y → Ya | Yb | Λ By Theorem 36, the CFG for L1 + L2 is then S → S1 | S2 S1 → aS1 | bS1 | Λ S2 → XbY X → aaX | Λ Y → Ya | Yb | Λ Note that Theorem 36 does not guarantee that this is the simplest (or only) CFG for L1 + L2.

Vista previa del contenido

COS3701
ASSIGNMENT 3 2026
UNIQUE NO:
DUE DATE:

, THEORETICAL COMPUTER SCIENCE III - COS3701

ASSIGNMENT 3 2026

Question 1 [10]

Let $L_1$ be the grammar generating $(a+b)^{*}$. Let $L_2$ be the grammar
generating $(aa)^{*}b(a+b)^{*}$. First, provide the grammars generating $L_1$ and
$L_2$ respectively. Then apply the applicable theorem from Chapter 17 (Theorem 36)
to determine $L_1 + L_2$.

 CFG generating $L_1$:

$$S \rightarrow aS \mid bS \mid \Lambda$$

 CFG generating $L_2$:

$$S \rightarrow XbY$$

$$X \rightarrow aaX \mid \Lambda$$

$$Y \rightarrow Ya \mid Yb \mid \Lambda$$

 Applying Theorem 36 to find a CFG for $L_1 + L_2$: First, rewrite the
grammar for $L_1$ using a distinct start symbol $S_1$:

$$S_1 \rightarrow aS_1 \mid bS_1 \mid \Lambda$$

And keep the grammar for $L_2$ with start symbol $S_2$:

$$S_2 \rightarrow XbY$$

$$X \rightarrow aaX \mid \Lambda$$

$$Y \rightarrow Ya \mid Yb \mid \Lambda$$

Libro relacionado
 image
Editorial: 1979 ISBN: 9782881249617 Edición: Desconocido

Información del documento

Subido en
21 de octubre de 2026
Número de páginas
7
Escrito en
2026/2027
Tipo
Examen
Contiene
Preguntas y respuestas
$4.69

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

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.
LIBvault
4.2
(17)
Vendido
149
Seguidores
1
Artículos
287
Última venta
14 horas hace



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