Some decision properties of Regular Languages
Print this page
First   |   Last   |   Prev   |   Next

Keeps count of this number.

Note that, a state p here is annotated with if it the output symbol is associated with the state p i.e. if .

Every state outputs 0 except the state q3 which outputs 1 start state q0, following any path, we arrive at state q3 the last three input symbols read must be . As soon as we arrive at q3, it outputs 1(prior to that it outputs all 0s) indicating that it has read the sub string in the input. From q3 we can arrive at q1 on input b and then again arrive at q3(following some path) provided the last three input symbols read are . Thus, the machine outputs 1 as soon as it read the sub string ; otherwise, it outputs 0s. So, the number of sub string in the input is given by the number of 1s in the output string at the point when the machine finishes processing the input string.

For example, on input the machine will go through the states producing the output sequence 000000010000010 indicating that the sub string occurs twice in the input string as the number of 1s in the output string is 2.

First   |   Last   |   Prev   |   Next