Question: ( 9 marks ) Based on our discussion of strings and languages in class, list all of the strings in each of the languages below.

(9 marks) Based on our discussion of strings and languages in class, list all of the strings in each
of the languages below. A first example is provided for you. See the bottom of the page for some
reminders of definitions, etc.
L ={0
m1
n
| m, n in Z
nonneg, m + n =5}
Answer: L ={00000,00001,00011,00111,01111,11111}
(a) L5={w in {a, b}
||w|<=3 and na(w) is even}
(b) L6={a
mb
nc
p
| m, n, p in Z
nonneg, m + n + p <=4, m > n, n = p}
(c) L7={w in {a, b, c}
||w|<=4, na(w)> nb(w), nb(w)= nc(w)}
Reminders:
Z
nonneg is the set of nonnegative integers, {0,1,2,3,}.
{a, b}
is the set of all possible strings of as and bs, which includes the empty string .
0 is an even number.
na(w) is the number of as in the string w, nb(w) is the number of bs in the string w, etc.
The notation |w| represents the length of string w.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!