Question: This question are from the FSA machine. In these exercises, the alphabet is {,}{a,b}, and are take from the exercises to chapter 1 of Siper's

This question are from the FSA machine.

In these exercises, the alphabet is {,}{a,b}, and are take from the exercises to chapter 1 of Siper's book,

  1. {| contains at least three a's }

Here is the python code provided:

dfa_md = [None for i in range(13)]

dfa_md[1] = { 'states': [''], 'alphabet': [''], 'transitions': {('',''):''}, 'start': '', 'accept': [''] }

This is the test to be passed through the code:

dfa_test[1] = [ ('aaba',True), ('aabb',False) ]

def basic_test(): correct = 0 num_tests = len(dfa_test) for i in range(1,num_tests): print(" Exercise",i) try: tm = TestMachine(dfa_md[i]) if tm.run(dfa_test[i]): correct += 1 except Exception as exception: print(" *** exception thrown:", str(type(exception))) print("correct:",correct,"out of",num_tests-1)

basic_test()

If someone can show me how to do this question with the basic explanation is fine. Thank you!

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!