Give a regular expression for a certain type of scientific notation for real num
ID: 3855385 • Letter: G
Question
Give a regular expression for a certain type of scientific notation for real numbers on which the following rules hold. Let sigma = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, "+", "-", e}. a. The number can be preceded by a "+" or "-", sign, or the sign may be absent. b. Numeric values must be of the form cb_1b_2...b_n where b_i is any digit, but c must be nonzero. c. The number may be followed by an exponent field of the form e"+" y_1y_2 or e"-"y_1y_2, where y_1 and y_2 can be any digit in {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}.Explanation / Answer
So the Regular language is
S = (+|-)?CB*(e(+|-)BB)?
C = 1|2|3|4|5|6|7|8|9
B = 0|C
And the regular expression is:
S = (+|-)?(1-9)(0-9)*(e(+|-)(0-9)(0-9))?
Happy with the answer?? Let me know
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.