File Name: capabilities and limitations of finite state machine .zip
- Automata Theory
- Capabilities and limitations of finite state machine fsm
- Capabilities and Limitations of FSM
Computer science enables us to program, but it is possible to do a lot of programming without understanding the underlying computer science concepts. When we drive a car, we only concern ourselves with two or three pedals, a gearshift, and a steering wheel. You can safely operate a car without having any clear idea of how it works.
However, if you want to operate a car at the very limits of its capabilities, you need to know a lot more about automobiles than just the three pedals, gearshift and steering wheel. The same is true of programming. A lot of everyday work can be accomplished with little or no understanding of computer science. However, if you plan to write code that requires serious computation, you will need to understand a bit more about how computation works under the hood.
The purpose of this article is to provide some fundamental background for computation. If there is interest, I may follow up with some more advanced topics, but right now I want to look at the logic behind one of the simplest abstract computational devices — a finite state machine.
In simpler terms, a state machine will read a series of inputs. When it reads an input, it will switch to a different state. Each state specifies which state to switch to, for a given input. This sounds complicated but it is really quite simple. Imagine a device that reads a long piece of paper. The arrows are the transitions. Well, it turns out that you can run a tape through the state machine and tell something about the sequence of letters, by examining the state you end up on.
This may sound pointless, but there are an awful lot of problems that can be solved with this type of approach. A very simple example would be to determine if a page of HTML contains these tags in this order:. The state machine can move to a state that shows it has read the html tag, loop until it gets to the head tag, loop until it gets to the head close tag, and so on. If it successfully makes it to the final state, then you have those particular tags in the correct order.
Finite state machines can also be used to represent many other systems — such as the mechanics of a parking meter, pop machine, automated gas pump, and all kinds of other things. From any state, there is only one transition for any allowed input. At first, this sounds silly to even make this distinction. What good is a set of decisions if the same input can result in moving to more than one state?
The output of a state machine is its final state. It goes through all its processing, and then the final state is read, and then an action is taken. It processes, and when it gets to the end, the state is read and something external triggers the desired action for example, dispensing a soda can.
This is an important concept when it comes to non-deterministic finite state machines. Non-deterministic finite state machines are finite state machines where a given input from a particular state can lead to more than one different state. A very simple way to represent this is with a state machine that looks like the one below, where a final state of t means that the string was accepted and matches the pattern.
Do you see the problem? There are a few ways to solve this problem. One is by backtracking. You simply take all the possible paths, and ignore or back out of the ones where you get stuck.
This is basically how most chess playing computers work. They look at all the possibilities — and all the possibilities of those possibilities — and choose the path that gives them the greatest number of advantages over their opponent. One of the interesting attributes of a non-deterministic machine is that there exists an algorithm to turn any non-deterministic machine into a deterministic one.
However, it is often much more complicated. Fortunately for us, the example above is only slightly more complicated. In fact, this one is simple enough that we can transform it into a deterministic machine in our head, without the aid of a formal algorithm.
The machine below is a deterministic version of the non-deterministic machine above. In the machine below, a final state of t or v is reached by any string that is accepted by the machine. The non-deterministic model has four states and six transitions. The deterministic model has six states, ten transitions and two possible final states. A moderately sized non-deterministic machine can produce an absolutely huge deterministic machine.
Regular expressions and finite state machines are functionally equivalent. Anything you can accept or match with a regular expression, can be accepted or matched with a state machine. Regular expressions and finite state machines also have the same limitations. In particular, they both can only match or accept patterns that can be handled with finite memory. At first, this looks like an easy job for a finite state machine. In other words, neither a regular expression nor a finite state machine can be constructed that will recognize all the strings that do match the pattern.
Within any pair of tags, you may have any number of other matching pairs of tags. There is a theoretical device that is similar to a state machine, called a Turing Machine. It is similar to a finite state machine in that it has a paper strip which it reads. But, a Turing Machine can erase and write on the paper tape. Explaining a Turing Machine will take more space that we have here, but there are a few important points relevant to our discussion of finite state machines and regular expressions.
Turing Machines are computationally complete — meaning anything that can be computed, can be computed on a Turing Machine. Since a Turing Machine can write as well as read from the paper tape, it is not limited to a finite number of states.
The paper tape can be assumed to be infinite in length. Turing Machines give us an imaginary mechanical device that lets us visualize and understand how the computational process works. It is particularly useful in understanding the limits of computation. Regardless of their limitations, state machines are a very central concept to computing. In particular, it is significant that for any non-deterministic state machine you can design, there exists a deterministic state machine that does the same thing.
This is a key point, because it means you can design your algorithm in whichever way is the easiest to think about. Once you have a working algorithm, you can convert it into whatever form is most efficient. The understanding that finite state machines and regular expressions are functionally equivalent opens up some incredibly interesting uses for regular expression engines — particularly when it comes to creating business rules that can be changed without recompiling a system.
And I know how to convert a solution for Y into a solution for X. Therefore, I now know how to solve X. If you like this article, you might enjoy my YouTube channel where I create an occasional video or cartoon about some aspect of creating software.
I also have a mailing list for people who would like an occasional email when I produce something new. Originally published at blog. If this article was helpful, tweet it. Learn to code for free. Get started. Forum Donate. When we program, we work at a much higher level of abstraction. Finite State Machines A finite state machine is a mathematical abstraction used to design algorithms. A paper tape, with eight letters printed on it As the state machine reads each letter, it changes state.
Well, you kind of can with a state machine. Non-deterministic Finite State Machines Non-deterministic finite state machines are finite state machines where a given input from a particular state can lead to more than one different state. Pattern matching finite state machine Do you see the problem? The other option is to convert the non-deterministic machine into a deterministic machine.
A deterministic finite state machine The non-deterministic model has four states and six transitions. Examples would be: ab aabb aaaaaabbbbbb aaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbb At first, this looks like an easy job for a finite state machine. Turing Machines So how do you recognize non-regular patterns? Why does this matter? How is this going to help you create that next PHP form?
Capabilities and limitations of finite state machine fsm
Computer science enables us to program, but it is possible to do a lot of programming without understanding the underlying computer science concepts. When we drive a car, we only concern ourselves with two or three pedals, a gearshift, and a steering wheel. You can safely operate a car without having any clear idea of how it works. However, if you want to operate a car at the very limits of its capabilities, you need to know a lot more about automobiles than just the three pedals, gearshift and steering wheel. The same is true of programming.
katcompany.org - finite automata are much more restrictive in their capabilities than Turing machines. For example, we can show that it is not possible for a finite-state.
Capabilities and Limitations of FSM
Finite Automata FA is the simplest machine to recognize patterns. The finite automata or finite state machine is an abstract machine which have five elements or tuple. It has a set of states and rules for moving from one state to another but it depends upon the applied input symbol. Basically it is an abstract model of digital computer. Following figure shows some essential features of a general automation.
List of ebooks and manuels about Capabilities and limitations of finite state machine fsm. Finite state machine- capabilities and limitations, Finite- State Machines
Automata Theory is an exciting, theoretical branch of computer science. It established its roots during the 20th Century, as mathematicians began developing - both theoretically and literally - machines which imitated certain features of man, completing calculations more quickly and reliably. The word automaton itself, closely related to the word "automation", denotes automatic processes carrying out the production of specific processes. Simply stated, automata theory deals with the logic of computation with respect to simple machines, referred to as automata. Through automata, computer scientists are able to understand how machines compute functions and solve problems and more importantly, what it means for a function to be defined as computable or for a question to be described as decidable.
Skip to Main Content. A not-for-profit organization, IEEE is the world's largest technical professional organization dedicated to advancing technology for the benefit of humanity. Use of this web site signifies your agreement to the terms and conditions.