Question

Give a regular expression for each of the following sets: a) set of all string of...

Give a regular expression for each of the following sets:

a) set of all string of 0s and 1s beginning with 0 and end with 1.

b) set of all string of 0s and 1s having an odd number of 0s.

d) set of all string of 0s and 1s containing at least one 0.

e) set of all string of a's and b's where each a is followed by two b's.

f) set of all string of 0s and 1s containing exactly two 0s.

Homework Answers

Answer #1

a) set of all string of 0s and 1s beginning with 0 and end with 1.

Regular expression will be 0(0 + 1)*1.

It will starts with 0 and ends with 1. In between then any numbe of occurance 0 or 1 can occur

b) set of all string of 0s and 1s having an odd number of 0s.

Regular expression will be 1*0 (1 + 01*0)*

Here any number of 1's can be possible and then one 0 possible. In parentheses also 2 0's are there. So, total odd zero's possible.

d) set of all string of 0s and 1s containing at least one 0.

Regular expression will be (0 + 1)*0(0 + 1)*

Any number of 0's and 1's can be possible but one 0 is must.

e) set of all string of a's and b's where each a is followed by two b's.

Regular expression will be b*(abb)*b*

When a comes, there are 2 b's must.

f) set of all string of 0s and 1s containing exactly two 0s.

Regular expression will be 1*01*01*

Any number of 1's can possible but exactly 2 0's

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Which one of the following languages over the alphabet {0,1} is described by the regular expression...
Which one of the following languages over the alphabet {0,1} is described by the regular expression (0+1)* 0 (0+1)* 0 (0+1)* ? a.The set of all strings that begin and end with either 0 or 1 b.The set of all strings containing at most two zeros c.The set of all strings containing at least two zeros. d.The set of all strings containing the substring 00
Give a regular expression for the set of all strings on the alphabet {0,1} with no...
Give a regular expression for the set of all strings on the alphabet {0,1} with no runs of length greater than 3(for example, no substrings 0^i or 1^i with i > 3)
Question 4 Write a regular expression that generates each of the following language constructs: (1) String...
Question 4 Write a regular expression that generates each of the following language constructs: (1) String constants with the following specifications: A string constant consists of any sequence of characters enclosed by the quotation marks: “ and ”       The sequence may be empty.                    The sequence cannot span multiple lines.       Don’t worry about escape characters (assume that they won’t appear in the input).       (2)  Multiple-line comment in C, C++ and JAVA with the following specifications:        The comment consists of any sequence...
Problem 2.1 Which of the following are sets? Assume that a proper universal set has been...
Problem 2.1 Which of the following are sets? Assume that a proper universal set has been chosen and answer by listing the names of the collections of objects that are sets. Warning: at least one of these items has an answer that, while likely, is not 100% certain. (i) A = {2,3,5,7,11,13,19} (ii) B={A,E,I,O,U} (iii) C={√x : x < 0} (iv) D = {1,2,A,5,B,Q,1,V} (v) E is the list of first names of people in the 1972 phone book in...
. For each of the following sets of data, provide the genotypes of all individuals involved...
. For each of the following sets of data, provide the genotypes of all individuals involved in the cross.  The letter symbol you use to indicate the genes is your choice.  Be sure to follow standard genetics conventions in naming alleles.   First generation: Agouti (gray fur) crossed with a black fur mouse                      Progeny:       all agouti      2nd generation: two Agouti progeny from the 1st cross are crossed                                 Progeny:       8 Agouti, 3 black fur Include all possibilities in your answers: where more than 1 possibility exists,...
The domain for the first input variable to predicate T is a set of students at...
The domain for the first input variable to predicate T is a set of students at a university. The domain for the second input variable to predicate T is the set of Math classes offered at that university. The predicate T(x, y) indicates that student x has taken class y. Sam is a student at the university and Math 101 is one of the courses offered at the university. Give a logical expression for each sentence. Please provide some explanation...
question 1: The following data give the time (in minutes) that each of 20 students waited...
question 1: The following data give the time (in minutes) that each of 20 students waited in line at their bookstore to pay for their textbooks in the beginning of Spring 2012 semester. 14 35 23 23 12 46 41 51 22 37 22 34 14 46 32 20 41 36 27 25 Construct a ranked stem-and-leaf display for the data. Question 2: Following are the temperatures (in   ∘F) observed during eight wintry days in a midwestern city (sample):                             23⁢    ...
1. Write the following sets in list form. (For example, {x | x ∈N,1 ≤ x...
1. Write the following sets in list form. (For example, {x | x ∈N,1 ≤ x < 6} would be {1,2,3,4,5}.) (a) {a | a ∈Z,a2 ≤ 1}. (b) {b2 | b ∈Z,−2 ≤ b ≤ 2} (c) {c | c2 −4c−5 = 0}. (d) {d | d ∈R,d2 < 0}. 2. Let S be the set {1,2,{1,3},{2}}. Answer true or false: (a) 1 ∈ S. (b) {2}⊆ S. (c) 3 ∈ S. (d) {1,3}∈ S. (e) {1,2}∈ S (f)...
ANSWER IN C++ ONLY A string of characters including only alphabets (lowercase letters) is provided as...
ANSWER IN C++ ONLY A string of characters including only alphabets (lowercase letters) is provided as an input. The first task is to compute the frequency of each character appearing in the string. In the output, the characters have to be arranged in the same order as they appear in the input string. Then characters have to be rearranged, such that all the characters having a specific frequency, say xx, come together. Let the frequency of a character, lying in...
For each of the following situations, give the degrees of freedom for the group (DFG), for...
For each of the following situations, give the degrees of freedom for the group (DFG), for error (DFE), and for the total (DFT). State the null and alternative hypotheses, H0 and Ha, and give the numerator and denominator degrees of freedom for the F statistic. (a) A poultry farmer is interested in reducing the cholesterol level in his marketable eggs. He wants to compare two different cholesterol-lowering drugs added to the hen's standard diet as well as an all-vegetarian diet....
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT