Documente Academic
Documente Profesional
Documente Cultură
NAME: __________________________________________________________________________
RUID:___________________________________________________________________________
Electronic Devices are not permitted during the quiz. These include but are not restricted to calculators,
computers and cell phones.
No communication between students or anyone outside of class is permitted during the quiz.
Textbooks, notes and any other written materials are not permitted during the quiz.
_____________________ a)
_____________________ b)
_____________________ c)
ab
_____________________ d)
abb
_____________________ e)
aba
_____________________ f)
ba
_____________________ g)
baab
_____________________ h)
aababa
_____________________ i)
aaa
_____________________ j)
ababa
______________ b) S aA, A a, A b
______________ c) S ABa, AB a
______________ e) S bA, A B, B a
______________ g) S bA, A b, S
______________ j) S A, A B, B
_____________________ a)
_____________________ b)
_____________________ c)
aa
_____________________ d)
ab
_____________________ e)
aba
_____________________ f)
abb
_____________________ g)
baa
_____________________ h)
abaab
_____________________ i)
abab
_____________________ j)
ababa
5. A palindrome is a string that reads the same backward as it does forward. In other words, a
palindrome is string w, where w = wR, where wR is the reversal of the string w. Find a context-free
grammar that generates the set of all palindromes over the alphabet {0, 1}. List the productions
in the space provided below. Use only five productions and only one nonterminal, S.
Scratch Paper