• ¿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 13 páginas
Examen

COS3701 Assignment 3 Memo | Due August 2025

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

COS3701 Assignment 3 Memo | Due August 2025. Step by Step Calculations Provided. 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}.

Vista previa del contenido

, PLEASE USE THIS DOCUMENT AS A GUIDE TO ANSWER YOUR ASSIGNMENT

 Question 1

1. 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: Find grammars for L1 and L 2
For L1 - (aa)* :
The language L1 consists of strings made up of zero or more repetitions of the string "aa". The grammar for
L 1 can be expressed as:



Here, 81 is the start symbol, which can produce the string "aa" followed by another instance of S1 , or it can
produce the empty string€, allowing for zero repetitions of "aa".

For L2 - (a + b)*ab(a + b)*:
The language L2 consists of strings over the alphabet { a, b} that include an "ab" somewhere in the string.
The grammar for L2 can be expressed as:



• X -t ax I bX I €
• Y -+ aY I bY I1:

Here, 82 is the start symbol, and it generates a string where X represents any sequence of "a"s and "b"s
before "ab", and Y represents any sequence of "a"s and "b"s after "ab".

Libro relacionado
 image
Editorial: 1996 ISBN: 9780471137726 Edición: Desconocido

Información del documento

Subido en
28 de julio de 2025
Número de páginas
13
Escrito en
2024/2025
Tipo
Examen
Contiene
Preguntas y respuestas
$3.10

¿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.
Aimark94
4.2
(663)
Vendido
7675
Seguidores
3177
Artículos
2392
Última venta
1 día hace

Reseñas de compradores verificados




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