Question: Need help with Part 2 and please draw the DFA. Consider scanning literals for representing carbohydrates in chemistry. Such literals consist of one or more

Need help with Part 2 and please draw the DFA.
Consider scanning literals for representing carbohydrates in chemistry. Such literals consist of one or more parts, each consisting of C, H, or O, optionally followed by a decimal integer greater than 1(it can greater than 9). You may use D0 to mean decimal digits 0-9, D1 to
mean 1-9, and D2 to mean 29.(This is a computer science question, not a chemistry question. In particular, this specification allows bogus chemical formulas such as H42.)
a. Give a regular expression for these carbohydrate literals. You may use the iteration
operators * and + and ?. ANSWER: ((C|H|0)(D2*| D1D0*| DO*))+
b. Give a DFA that recognizes exactly these literals (no edges). Dont forget to mark the
start state and all accepting states.
Make sure that you dont accept the empty string!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The question is incomplete because part b requires drawing the DFA which cannot be presented in text ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!