Find a regular expression to describe:
The set of all strings over the alphabet {a, b,...
Find a regular expression to describe:
The set of all strings over the alphabet {a, b, c, d}
that contain exactly one a and exactly one b
So, for example, the following strings are in this
language:
ab, ba, cccbad, acbd, cabddddd, ddbdddacccc
and the following strings are NOT in this
language:
a, ccbc, acbcaaacba, acacac, bcbbbbbca, aca, c, d,
b
Question 2
a) Construct a Pushdown Automaton (PDA) for the language L (M) = {a, b}*...
Question 2
a) Construct a Pushdown Automaton (PDA) for the language L (M) = {a, b}* where, if there
are any a’s must precede all b's and the number of b's must be equal to or twice the number
of a’s.
a) Trace the computations for the strings aabb, bbb, and abb in the PDA obtained in Question 2
using dr.racket programing language
If we write a function that tests whether a list contains only...
using dr.racket programing language
If we write a function that tests whether a list contains only
strings, odd numbers, or even numbers, you will notice that the
code that iterates through the list stays the same, with the only
change being the predicate function that checks for the desired
list element. If we were to write a new function for each of the
tests listed above, it would be more error-prone and an example of
bad abstraction. We could write...
Problem 5 Regular Expressions.
a) Define a regular expression for all strings of odd length,
over...
Problem 5 Regular Expressions.
a) Define a regular expression for all strings of odd length,
over the alphabet of {0}.
b) Define a regular expression for identifiers over the
alphabet of {A,B,C,a,b,c,0,1,2,3,4,5,6,7,8,9}, such
that an identifier must begin with an alphabetic character and
must contain at least one numeric character.
c) Try to modify the definition above so that identifiers
still begin with an alphabetic character, but after
that, it must contain at least one numeric, at least one
lower-case...
Given an alphabet Σ = {a, b, c, d} Use Lecture definition to
construct a nondeterministic...
Given an alphabet Σ = {a, b, c, d} Use Lecture definition to
construct a nondeterministic automaton M such that L = {w ∈ Σ ∗ :
at least one letter from Σ is missing in w}
1. (5pts) Draw the diagram Just draw the diagram, do not list
the components
2. (2pts) Explain shortly why your M is nondeterministic and why
it is correct
3. (3pts) Show that (s, accabb) `M ∗ (q, e) by constructing a
computation of...
Consider permutations of the 26-character lowercase alphabet
Σ={a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}.
In how many of these permutations do
a,b,c...
Consider permutations of the 26-character lowercase alphabet
Σ={a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}.
In how many of these permutations do
a,b,c occur consecutively and in that
order?
In how many of these permutations does a appear before
b and b appear before c?