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 5 páginas
Otro

COS3701 Jan/Feb Supplementary Exam Paper 2023

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

COS3701 Jan/Feb Supplementary Exam Paper 2023

Vista previa del contenido

UNIVERSITY EXAMINATIONS




Jan/Feb 2023

COS3701

Theoretical Computer Science III

80 Marks
Duration 2 Hours




Welcome to the COS3701 exam.

Examiner name: Ms DR Mokwana
Internal moderator name: Prof F Bankole

This paper consists of 5 pages.


Instructions:

• Upload you answer script in a single PDF file format not password protected
• No emailed scripts will be marked
• Preview your submission to ensure legibility and correct script file has been uploaded
• Students who have not utilised IRIS invigilation app will be subjected to disciplinary process
• Students suspected of dishonesty conduct during examination will be subjected to
disciplinary process
• Write neatly and legibly
• The mark for each question is in brackets next to the question

, COS3701
Jan/Feb 2023

Question 1 [16]

(a) Determine a regular expression for the language L over the alphabet {a, b} that consists of
all words that have at least one b but contain exactly one aa substring (and no other as).
Example of words in the language are aab, bbbaabbb, bbbbaabbbbbbbb etc.
Examples of words that are not in the language are a, aba, bbab, aaabbbb, baabbbbaabb
etc. (2)

(b) Design a deterministic finite automaton (DFA) that will recognise all of the words in L
as defined above. (4)

(c) Use Theorem 21 to develop a context-free grammar (CFG) for the language L. (4)

(d) Convert the following CFG to Chomsky Normal Form (CNF):


S → aX Y | Y b
X → X ZY Z | a
Y → bY | Λ
Z →a|Λ (6)

Question 2 [10]

Build a deterministic pushdown automata (DPDA) that accepts the language
L = {(ab)n (aa)m (ba)n−1 | n ≥ 1, m ≥ 1} over the alphabet Σ = {a, b}.

Question 3 [12]

The pumping lemma with length for context-free languages (CFLs) can be stated as follows: Let L
be a CFL generated by a CFG in CNF with p live productions.
Then any word w in L with length > 2p can be broken into five parts:

w = uvxyz such that
length(vxy) ≤ 2p
length(x) > 0
length(v) + length(y) > 0
and such that all the words uv n xy n z with n ∈ {2, 3, 4, . . .} are also in the language L.

Use the pumping lemma with length to prove that the language
L = {(a)n (b)2n+2 (a)n−1 | n ≥ 1}

over the alphabet Σ = {a, b} is non-context-free.

Información del documento

Subido en
1 de marzo de 2023
Número de páginas
5
Escrito en
2022/2023
Tipo
Otro
Personaje
Desconocido
$5.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.
StudyWellNotes
5.0
(1)
Vendido
42
Seguidores
31
Artículos
0
Última venta
3 meses 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