Question: In all problems, binary string refers to any string or word on the alphabet = { 0 , 1 } . Unless otherwise specified, our
In all problems, "binary string" refers to any string or word on the alphabet Unless otherwise
specified, our alphabet is always
For this worksheet, make sure to discuss actively with your groupmates! Coming up with regexes that match what
you want them to match, as well as describing the languages of given regexes, takes a lot of practice. It is a creative
process and there is a lot of room for error. But you will learn the tricks of the trade quicker if you discuss frequently
with others.
REGULAR EXPRESSIONS
If is a regular expression, write down another regular expression such that
xinL
Write down a regular expression whose language is
any string except
Write down a regular expression that matches exactly those binary strings which when thought of as
numbers in base are divisible by Let us assume that we only consider a binary string to represent
a valid number if it either starts with a or if the whole string equals
Let Describe in words.
Write down a regular expression for the language that contains exactly those strings without two consec
utive s Discuss and convince each other that you haven't missed anything or have anything extra.
Write down a regular expression whose language is
has exactly two and least two
Discuss and convince each other that you haven't missed anything or have anything extra.
For each of the problems and try to come up with regular expressions that match precisely the
strings that do not match the regular expression from the problem. You can either try to do this directly
based on the descriptions of the language, or try to do it by manipulating the regular expressions. Can
you find a systematic method for this?
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
