Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started