Answered step by step
Verified Expert Solution
Link Copied!

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 image text in transcribed

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Learn To Program Databases With Visual Basic 6

Authors: John Smiley

1st Edition

1902745035, 978-1902745039

More Books

Students also viewed these Databases questions

Question

=+(0

Answered: 1 week ago

Question

Connect with your audience

Answered: 1 week ago