Escrito por estudiantes que aprobaron Inmediatamente disponible después del pago Leer en línea o como PDF ¿Documento equivocado? Cámbialo gratis 4,6 TrustPilot
logo-home
Document preview thumbnail
Vista previa 2 fuera de 14 páginas
Examen

COS3701 Assignment 2 [Unique No:830417] 2022

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

COS3701 Assignment 2 Solutions A+ Guaranteed. Contact us if you have any queries. Note do not submit the file as it is, to avoid plagiarism use this document as a guide for your own assignment .

Vista previa del contenido

For Assistance with other modules
Call or Whatsapp +27682021794
www.myassignments.co.za




COS3701
Assignment 02
2022

Due date
7 July 2022,
11:00 PM

UNIQUE NUMBER:
830417

+27682021794 www.myassignments.co.za [AUTHOR NAME]

, QUESTION 1
Build a DPDA to show that the language



is deterministic context free.

The smallest word in this language is when n= 3. This word is abababaaaba. All words in this
language start with three or more abs and end with one or more bas where there are always
two more abs than bas.

The trick to showing that this language is context free is to use the PDA to "match" the
occurrences of ab to the occurrences of ba which appear later in the string. We should also
take care of the fact that there have to be two more abs than bas but there has to be at least
one ba (and three abs).The aaa string in the middle is a separator and does not affect the
decision of whether or not the language is context free.

Our PDA can thus be outlined as

1. Read two instances of ab (but do nothing to the stack). These are the extra abs that we can
simply get rid of because we know there should be exactly two of them.

2. Read in one instance of ab (this matches with the one required ba).

3. Read in additional instances of ab and for each such instance push an X onto the stack.
Here we are essentially counting how many abs we have.

4. Read in aaa (but do nothing to the stack).

5. Read in the one required ba.

6. Read in instances of ba and for each instance pop an X off the stack. Here each ba is ticked
off against an ab that was read at the beginning of the string.

7. When all of the bas have been read then check that the input string and the stack are both
empty. We can now build a PDA to do this. The PDA is shown in diagram below.




2

Información del documento

Subido en
5 de julio de 2022
Número de páginas
14
Escrito en
2021/2022
Tipo
Examen
Contiene
Preguntas y respuestas
$15.92

¿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.
MyAssignments
3.8
(21)
Vendido
176
Seguidores
144
Artículos
42
Última venta
2 semanas 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