Question: 1. Program to DFA: Note in binary if x = 1012 = 5 and y = 10112 = 11 then y = 2 x +

1. Program to DFA: Note in binary if x = 1012 = 5 and y = 10112 = 11 then y = 2 x + 1. Remember x mod 3 = 2 is the remainder when you divide x by 3. Consider the following program:

q = 0

loop until no more characters

get(c) % c {0, 1}

q = (2 q + c) mod 3 % q {0, 1, 2}

end loop

if q = 0 then return(accept)

else return(reject)

end if

(a) What language does this program accept?

(b) Convert the program into a DFA.

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!