Question

For each of the following regular expressions, give 2 examples of strings that are in the...

For each of the following regular expressions, give 2 examples of strings that are in the language described by the regular expression, and 2 examples of strings that are not in that language. In all cases the alphabet is {a,b}.

  1. ab*ba*
  2. (a ∪ ε)b*
  3. (a ∪ b)ε*(aa ∪ bb)

Homework Answers

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
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
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)
RegEx (Regular Expressions) 1. Make 2 regular expressions to filter a specific data set in Java...
RegEx (Regular Expressions) 1. Make 2 regular expressions to filter a specific data set in Java and explain what they do. 2. In addition to the each regular expression, provide two test cases that will pass the input and one that will fail.
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
1. Consider the following regular expressions: • R1 = (b*a)* • R2 = (ab*)* + (a*b)*...
1. Consider the following regular expressions: • R1 = (b*a)* • R2 = (ab*)* + (a*b)* For each of the following strings, answer one of the following: the string is accepted only by R1 the string is accepted only by R2 the string is accepted by BOTH R1 and R2 the string is accepted by NEITHER R1 nor R2 __bbaa    A. Only R2 __abb B. NEITHER R1 nor R2 __aba C. BOTH R1 and R2 __abba D. Only R1...
linux regular expression file name: lab3test.txt Create regular expressions that meet the following criteria. You may...
linux regular expression file name: lab3test.txt Create regular expressions that meet the following criteria. You may use grep or egrep to answer these questions. 1.Write a SED command that could replace all of the area codes that use parenthesis so that they are removed and replaced with a single dash like the others. Example: (222) 222-2222 should become 222-222-2222.
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...
Use C++ Your program should expect as input from (possibly re-directed) stdin a series of space-...
Use C++ Your program should expect as input from (possibly re-directed) stdin a series of space- separated strings. If you read a1 (no space) this is the name of the variable a1 and not "a" followed by "1". Similarly, if you read "bb 12", this is a variable "bb" followed by the number "12" and not "b" ,"b", "12" or "bb", "1" ,"2". Your program should convert all Infix expressions to Postfix expressions, including expressions that contain variable names. The...
Evaluate the following expressions and state the type of each expression: int a = 2; int...
Evaluate the following expressions and state the type of each expression: int a = 2; int b = 3; double c = 3.0; 1. b / 2.0 Type: ( double, boolean, decimal, int )? Value: ( answer )? 2. b ! = 3 Type: ( double, boolean, decimal, int )? Value: ( answer )? 3. a >= 2.0 Type: ( boolean, double, char, int )? Value: ( answer )?
Q2 [10 pts] Give DFA's accepting the following languages over the alphabet {0,1}: a) The set...
Q2 [10 pts] Give DFA's accepting the following languages over the alphabet {0,1}: a) The set of all strings whose 3rd symbol from the right end is a 0. b) The set of strings such that the number of 0's is divisible by 3 and the number of 1's divisible by 2.