******************************************************************************************
Please Upvote the answer as it matters to me a lot :)
*****************************************************************************************
As per HomeworkLib expert answering guidelines,Experts are supposed to
answer only certain number of questions/sub-parts in a post.Please
raise the remaining as a new question as per HomeworkLib
guidelines.
******************************************************************************************
regular expression from 33 to 99 is
(3+4+5+6+7+8+9)(0+1+2+3+4+5+6+7+8+9)
regular expression from 100 to 499 is
(1+2+3+4)(0+1+2+3+4+5+6+7+8+9)(0+1+2+3+4+5+6+7+8+9)
regular expression from 500 to 526 is
5(0+1)(0+1+2+3+4+5+6+7+8+9) + 52(0+1+2+3+4+5+6)
so the final answer is
(3+4+5+6+7+8+9)(0+1+2+3+4+5+6+7+8+9) + (1+2+3+4)(0+1+2+3+4+5+6+7+8+9)(0+1+2+3+4+5+6+7+8+9) + 5(0+1)(0+1+2+3+4+5+6+7+8+9) + 52(0+1+2+3+4+5+6)
6. [4 marks] Write a regular expression over the alphabet of numeric digits that matches strings...
Construct a regular expression that recognizes the following language of strings over the alphabet {0 1}: The language consisting of the set of all bit strings that contain two or three symbols.
Construct a regular expression that recognizes the following language of strings over the alphabet {0 1}: The language consisting of the set of all bit strings that start with 00 or end with 101 (or both). Syntax The union is expressed as R|R, star as R*, plus as R+, concatenation as RR. Epsilon is not supported but you can write R? for the regex (R|epsilon).
Find a regular expression for the following language over the alphabet Σ = {a,b}. L = {strings that begin and end with a and contain bb}.
Write a regular expression that matches: a) all strings that end with a dot character ".", without the quotes. b) all strings that begin with a "#" character, without the quotes. c) all floating-point numbers using standard notation (e.g., 12.345 or –12.345). Note that matching numbers may contain any number of digits before or after the decimal point. d) all floating-point numbers using scientific notation (e.g., 1.234e+5 or –1.234E–5). Again, matching numbers may contain any number of digits before or...
Using Regular Expression. 1. Write the regular expression that matches any string that ends with a capital letter. 2. Write the regular expression that matches any string that begins with a digit, ends with a digit, and has AT MOST only one digit in the middle of the string. (* means zero or more of preceding, +means one or more and ? means 0 or 1 (we did not look at the ? in class)) So your answer should match...
Regular expressions, DFA, NFA, grammars, languages
Regular Languages 4 4 1. Write English descriptions for the languages generated by the following regular expressions: (a) (01... 9|A|B|C|D|E|F)+(2X) (b) (ab)*(a|ble) 2. Write regular expressions for each of the following. (a) All strings of lowercase letters that begin and end in a. (b) All strings of digits that contain no leading zeros. (c) All strings of digits that represent even numbers. (d) Strings over the alphabet {a,b,c} with an even number of a's....
This question deals with NFAs, DFAs, and regular expressions. (a) Using only the symbols described in the lecture slides, write a regular expression that describes all strings over the alphabet Σ = {0,1} that are at are at least four bits long and begin and end with the same bit. (b) Draw a DFA, that accepts strings strings over the alphabet Σ = {0, 1} such that if you read the string from left to right, the difference between the...
Regular Expression processor in Java Overview: Create a Java program that will accept a regular expression and a filename for a text file. The program will process the file, looking at every line to find matches for the regular expression and display them. Regular Expression Format The following operators are required to be accepted: + - one or more of the following character (no groups) * - zero or more of the following character (no groups) [] – no negation,...
3. Create a CFG describing regular expressions over the alphabet {0, 1}. You will need to quote the regular expression operators and the template given you has them quoted as terminals. We expect the grammar to generate the following syntactic constructions: • Union via "|", for example, 0 1 "|" 1 should be in the language generated by the grammar • Intersection via "&", for example, 0 1 "&" 1 should be in the language • Concatenation: any nonempty sequence...
(4) [20 pts] Let L be the language defined by a regular expression (O | 1)0+(01 1)). over t alphabet f(o,1, +) (a) (4pt) Write down 5 different words from L (b) (8pt) Describe L using words. (c) (8pt) Draw an automaton accepting L (ideally, deterministic).
(4) [20 pts] Let L be the language defined by a regular expression (O | 1)0+(01 1)). over t alphabet f(o,1, +) (a) (4pt) Write down 5 different words from L (b) (8pt) Describe...