Question: Dear i want solve it like the example Example of encoding FA in a program: Consider the following FA M: Even Odd 1 0 0

Dear i want solve it like the example Dear i want solve it like the example Example of encoding FA

in a program: Consider the following FA M: Even Odd 1 0

Example of encoding FA in a program: Consider the following FA M: Even Odd 1 0 0 The following Pseudo code encode the operation of M (EOI denotes End Of Input): STATE = Even Do { Read Input_Symbol; Switch (STATE) { case Even: Switch (Input_Symbol) { case 1: {STATE = Odd; break; } case 0: {STATE = Even; break; } case EOI: {Output REJECT"; break; } 3 case Odd: Switch (Input_Symbol) { case 1: { STATE = Even; break; } case 0: {STATE = Odd; break; } case EOI: {Output ACCEPT"; break; } } } while (Input_Symbol + EOI) Q1. Write a program that reads a string over {0,1}* and accepts (outputs ACCEPTED") only strings that have a substring 000 (3 consecutive Os) and do not have 11 as a substring. Your program must decide to accept or not based only on a deterministic finite state automaton (So you must encode the automaton in your program). You may use C or C++. Submit only the source and two sample run outputs for each case (accept/reject)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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!