Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the use of finite automata? [closed]

What is the use of finite automata? And all the concepts that we study in the theory of computation. I've never seen their uses yet.

like image 778
nicky Avatar asked Oct 03 '09 20:10

nicky


People also ask

What is the use of finite automata?

Finite automata are used to recognize patterns. It takes the string of symbol as input and changes its state accordingly. When the desired symbol is found, then the transition occurs. At the time of transition, the automata can either move to the next state or stay in the same state.

What does mean the language is closed in automata?

Closure refers to some operation on a language, resulting in a new language that is of same “type” as originally operated on i.e., regular. Regular languages are closed under following operations.

What are DFA closed under?

Conclusion: A DFA recognizes L1 ∩ L2, so L1 ∩ L2 is regular, and the class of regular languages is closed under intersection. closed under the union operation.

What does it mean for a language to be closed under union?

Recall that a set S is closed under an operation X if the output of X is in S whenever the inputs were in S. So, for example, saying that the regular languages are "closed under union" means that if P and R are regular languages, then so is the union of P and R.


1 Answers

They are the theoretical underpinnings of concepts widely used in computer science and programming, and understanding them helps you better understand how to use them (and what their limits are). The three basic ones you should encounter are, in increasing order of power:

  • Finite automata, which are equivalent to regular expressions. Regular expressions are widely used in programming for matching strings and extracting text. They are a simple method of describing a set of valid strings using basic characters, grouping, and repitition. They can do a lot, but they can't match balanced sets of parentheses.
  • Push-down automata, equivalent to context-free grammars. Text/input parsers and compilers use these when regular expressions aren't powerful enough (and one of the things you learn in studying finite automata is what regular expressions can't do, which is crucial to knowing when to write a regular expression and when to use something more complicated). Context-free grammars can describe "languages" (sets of valid strings) where the validity at a certain point in parsing the string does not depend on what else has been seen.
  • Turing machines, equivalent to general computation (anything you can do with a computer). Some of the things you learn when you cover these enable you to understand the limits of computing itself. A good theory course will teach you about the Halting Problem, which enables you to identify problems for which it is impossible to write a program. Once you've identified such a problem, then you know to stop trying (or refine it to something that is possible).

Understanding the theory and limitations of these various computing mechanisms enable you to better understand problems and programs and think more deeply about programming.

There was a request-for-work published about a year ago on one of the freelance coding exchange sites asking, essentially, for a program which solved the Halting Problem. Several people responded with offers, saying they "understood the requirements" and could "start immediately". It was impossible to write a program which met the requirements. Understanding computing theory enables you to not be that bidder who demonstrates, in public, that he really doesn't understand computing (and doesn't bother to thoroughly investigate a problem before declaring understanding and making an offer).

like image 171
Michael Ekstrand Avatar answered Oct 02 '22 20:10

Michael Ekstrand