Describe in plain english what the following regular expressions match:
ab+c
[A-Z][0-9]{6}
\d+ ([A-Z][a-z]+)+\n([A-Z][a-z]+)+,[A-Z]{2} \d{5}\
Write a finite state machine for each of the previous regexs.
The first Regular expression:
[A-Z][0-9]{6} -> It matches a string whose first character is a capital letter from A to Z , followed by 6 digits.
eg. A123456
The finite state machine (NFA) is given below:
The second regular expression.
\d+([A-Z][a-z]+)+\n([A-Z][a-z]+)+,[A-Z]{2} \d{5}\ -> It matches a string starting with atleast one digit, then it has a group one or more times, which contains one capital letter followed by one or more small letters. The string then must have a newline symbol . Then it has another group with properties exactly same as previous group. A comma is there after that. Then there are two capital letter, followed by 5 digits .
The finite state machine (NFA) is given below:
Describe in plain english what the following regular expressions match: ab+c [A-Z][0-9]{6} \d+ ([A-Z][a-z]+)+\n([A-Z][a-z]+)+,[A-Z]{2} \d{5}\ Write...
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....
1. Generate five strings from each of these regular expressions A. b ( ab ) * B. b (a + b)* C. (aa + b) * b D. a ( a + b)(a + b)b E. ab ( ab)* ab 2. Finite state machines for each of the above regular expression
1. Construct a DFA for each of the following regular expressions: a) ab + c b) a*b + c c) ab*c*+ ac 2. Construct an NFA for the following regular expression: a) (a + b)*ab b) a*b* c) a*b* + c d) a* + b* e) a* + b* + ac*
Finite state machines & Regular Expressions
Please select the best option
1.
For the following questions Let r, s, t be regular expressions
for the same alphabet "á" (left column). Get the property on the
right side that produces equality for each regular expression.
2.
From the diagram of the solution M = (Σ, Q, s,, F) is
respectively:
e would be NONE.
3.
The following graph corresponds to a diagram of:
A. Transition machine and states
b. Transition...
For each of the following pairs of regular expressions and strings, indicate the reason that the string does not match the regular expression Regular Expression String Reason for mismatch AbCdEfG AbCdefG [A-Z][a-zl*! CamelCase! Abc\.def Abcxdef 4 qwqwqwqX 6.I-11-90-9) [A-Z][A-Zlla-z] Xpp 8 Ovla-ZA-ZO-9]+ Ovalpha-bet3 [aeiou][a-z]*[A-Z]ayrunAway 10. [a-c-((de)l(fg))? m-defg
2. Properties of the following: (a) Regular languages (b) Context-free languages (c) Regular expressions (d) Non-deterministic finite automaton (e) Turing-recognizable and Turing-decidable languages (f) A <m B and what we can then determine (g) A <p B and what we can then determine (h) NP-hard and NP-complete.
Find the complement of the following expressions b) (AB+C)0%E 2. Given the Boolean function F -xy + x'y' y'z 1. Implement it with AND, OR, and inverter 2. Implement it with OR and inverter gates, and 3. Implement it with AND and inverter gate 3. Express the following function in sum of minterms and product of maxterms: a) F(A,B,C,D) - B'DA'D BD b) F (AB+C)(B+C'D) 4.Express the complement of the following function in sum of minterms a) F (A,B,C,D)-2 (0,2,6,11,13,14)...
6. Regular Expressions/SQL. Write SQL for the following problems on the university database. A. Find students whose name is properly capitalized (both first and last name start from an upper-case letter, rest of the name is lower-case). Hint: you can use [A-Z] to represent any upper case letter in regular expressions. B. Find course titles that consist of exactly 3 words (e.g., “Theory of Computation”). C. Find students whose SSN numbers has a pattern of 321 repeated twice (sequentially).
Create a CFG for the following expressions: 6. a) ab(a+b)*ba (10) b) a*ba* (10) c) Convert the previous CFGs into Chomsky's normal form, CNF (20) d) Draw the syntax tree for one word from each of the previous CFGs. (10)
Create a CFG for the following expressions: 6. a) ab(a+b)*ba (10) b) a*ba* (10) c) Convert the previous CFGs into Chomsky's normal form, CNF (20) d) Draw the syntax tree for one word from each of the previous CFGs. (10)
please Answer the following regular expressions questions(also do number 9) Q4 Choose the pattern that finds all filenames in which the first letters of the filename are astA, followed by a digit, followed by the file extension .txt. 1) astA[[:digit:]]\.txt 2) astA[[0-9]].txt 3) astA.\.txt 4) astA[[:digit:]].txt Q5 What's the difference between [0-z]+ and \w+ ? 1) The first one accepts 0 and z and the other doesn't. 2) The first one doesn't allow for uppercase letters. 3) The first one...