Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Consider the regular expression (0+1)*1(0+1)(0+1) over the alphabet {0,1}. Can y

ID: 3735634 • Letter: C

Question

Consider the regular expression (0+1)*1(0+1)(0+1) over the alphabet {0,1}. Can you describe the regular language that represents the RE?

A DFA that recognizes this regular expression is given below. Write a C++ program (no need of implementing object oriented) to implement the given DFA. Theprogram should be able to read a long string contained in a text file. The program should use the DFA to find and print out every substring (with its location) of length between 3 and 5 which are recognized by the DFA. Note that the same substring may occur more than once in the string. Let’s say it occurs twice. If it is accepted by the DFA, it should be printed twice.

0 1000 110 0 0 001 101 1011

Explanation / Answer

As per Chegg policy, I am answering only first question. In order to get the remaining questions please upload them again:

regular expression (0+1)*1(0+1)(0+1) over the alphabet {0,1} means third symbol from RHS is 1. (0+1)* means we can have any number of 0 and 1's. (0+1) means we can have either 0 or 1. So, we will have something like this:

L = { 100, 101, 110, 111, 0100, 0111, 1100, 11111,....}

which means third symbol from RHS is 1.