Automata+Theory


 * __Automata Theory__**

> Automata theory is the study of automata (plural of automaton); //abstract machines// which use mathematical abstractions and reasoning to solve computational problems. A general overview of automata can be described as a set of //states// and //transitions// between states to create varying output based on input. Overall, automata theory has had a profound impact [[|1]] on modern computing and the way in which we resolve problems, impacting fields such as formal language theory, compiler design, and regular expression parsing.



> The definition of an automaton as a mathematical model allows for numerous interpretations, but the most prevalent variant that of a finite state machine (or automaton). Although other implementations exist, such as those involving infinite states or infinite input, most examples below pertain to the finite automaton. The definition below pertains to a deterministic finite automaton, one whose state can be used to interpret the input. [[|2]]
 * Finite State Machines**

> When started, the machine is given a sequence of input symbols (a word), run through in serial. Every frame the automaton compares this frame of input to a set of symbols/letters (an alphabet). At all times, the automaton is working within a state. Based on this input, the automaton will transition between states as decided by a //program// (aka transition function). Once the word is read it will have stopped and will be in its final state. From here, the automaton decides to either //accept// or //reject// the input word through checking whether this final state belongs to a pre-programmed subset of //accept states//. If it is recognized, it is accepted, otherwise it is rejected.
 * Informal Definition of a Deterministic Finite Automaton**


 * Formal Definition of a Deterministic Finite Automaton**

Described through the following tuple: **(Q,Σ,δ,q0,F)**3]
 * Q is the //finite// amount of states.
 * Σ is alphabet of input symbols the automaton can accept
 * δrepresents transition function
 * q0 represents the initial starting state
 * F Є Q is the set of final accepting states that determines the language

> **States** >> Each state has a programmed set of features, the key idea being that they //transition// from state to state, based on the input symbol. > **Accepted Words** >> Words recognized by the automaton if qn Є F. > **Recognized Language** >> A formal language recognized by the automaton. L ⊆ Σ if all the words are accepted by the automaton.

> When run, the automaton runs the input words in the start state, ending in the final state, thus determining whether the input word is an //accepted word,// making it a part of the //recognized language//. Note, however, that this is the definition of a finite automaton, while numerous variations of automata exist, for example, with an infinite number of states or infinite number of input symbols. > > The definition above is based on that described in the widely influential book [|Introduction to Automata Theory, Languages and Computation] by John Hopcroft and Jeffrey Ullman.

> There are many ways in which automata are utilized; some of the major applications of the theory are outlined below, and most pertain to finite state machines. While having a definite number of states gives the impression that this type of automata has a narrow range of uses, increasing the number of states makes finite automata very versatile. In computer science, finite state machines are the most common basis for modeling programming. [[|2]]
 * Applications of Automata Theory**



> Automata can be widely used for parsing Strings of input, creating the basis of the study of regular expressions used in programming. Regex can be used to determine, for example, whether a certain pattern exists within a larger String, or pattern identification and replacement. Extending these ideas, the concept of finite state automata is used to create compilers that understand the general language and syntax of the programming language to which they belong (i.e.the compilers and interpreters for Turing, Java, Python, and all other languages)[[|4]]. Beyond computer science, these automata carry over to the study of linguistic syntax in everyday speech.
 * Formal Language Theory**



> This form of decision making is also the basis of hardware design and computer engineering, used as a model for processors and logic boards. Automata easily and simply presents a solution as an "easy-to-use model for defining, testing and implementing complex control circuits".[[|5]] As a result, many types of hardware are engineered similar in structure to a finite state machine, allowing automata to thrive in numerous engineering fields.
 * Hardware and Logic**



> In real life, many events are driven and different actions are carried out based on the states of the actors. Video games, for example, often contain many different possible states, alternating between states as necessary. Based on the state of the game or its components, input will be handled differently, output rendered differently, etc. It is also often useful to create //state diagrams// to display this information, to be used in simulations of real world interaction.
 * Simulations and Scenarios**



> Cellular automata is a model based on the concept of states and transitions. It is set up as a grid of cells in any number of dimensions, with each cell in a finite number of possible states (usually on or off). Based on the states of the cells around each cell, the cell is able to adjust its state each frame to produce new output [[|6]]. Based on the preprogrammed set of rules and number of frames, the machine produces meaningful output.
 * Cellular Automata**



> In the study of biology, cellular automata can often be used to model behaviour and patterns that occur in nature. As models, they are useful for their ability to "produce very sophisticated self-organized structures" and their versatility in displaying "typical biological phenomena"[[|6]] In particular, the common 2D implementation of cellular automata is Conway's Game of Life is often used, using a set of common rules to create extensive patterns based on the initial configuration.

> From the [|Conway's Game of Life Website], the rules are as follows:
 * For a space that is 'populated':
 * Each cell with one or no neighbors dies, as if by loneliness.
 * Each cell with four or more neighbors dies, as if by overpopulation.
 * Each cell with two or three neighbors survives.
 * For a space that is 'empty' or 'unpopulated'
 * Each cell with three neighbors becomes populated.




 * The Turing Machine**

> Turing machines are mathematical devices designed by Alan Turing in 1937, as a foundation to carry out algorithms and processes in computer science[[|7]]. They are largely similar to finite state automata, but also incorporate an infinite one dimensional tape from which input is read and to which output is written. When the program ends, the output can be interpreted and used.

media type="youtube" key="E3keLeMwfHY" height="315" width="560" align="center"


 * Formal Definition**

Described through the following tuple: **(Q,Г,b,Σ,δ,q0,F)**
 * Q is the //finite// set of states.
 * Г is a finite set of acceptable tape symbols (alphabet)
 * b Є Г is the initial, blank symbol
 * Σ is alphabet of input symbols
 * δ : Q * Г * {L,R} represents transition function
 * q0 represents the initial starting state
 * F Є Q is the set of final accepting states


 * Informal Definition**

> The Turing Machine utilizes its tape by reading the input characters and writing output, which can then be read again. Through a programmable set of states and transitions, the Turing Machine is able to modify the tape from a set of blank symbols (typically zeros) to useful, legible output. The machine begins in the start state, and ends when there is no transition to match a particular input symbol for a given state.

> At any moment, the machine keeps track of what state it is currently in and what the input symbol on the tape is. At each step, the machine must change the state, write something at the current tape position, and move left or right along the tape. The state change, output, and direction of movement can all depend on the input at the tape position, resulting in different transitions for differing input.



> In the example program above, the machine begins with a blank tape of zeros, and in the first state (state 0). At the first frame, the input character is a zero, therefore, the machine enters the second state, replaces the zero with a one and moves to the right. At the second frame, the input character is a zero, and the machine enters the first state, replaces the zero with a one and moves to the left. The transitions continue until the machine has written four ones onto the blank tape, at which the machine is in state 1 but reads a one. Since there is no transition that matches this input, the program exits.

> Although based on a simple idea, its design causes the machine to be incredibly powerful. With the basic logic necessary, it would be simple to calculate addition, subtraction, powers, etc. using several states and transitions. Introduced by Tibor Rado, the Busy Beaver is a problem that illustrates the extent to which the machine can operate: //How many '1's can be written onto a blank tape of '0's given n number of maximum states?// > As the number of states increases, the maximum number of '1's increases exponentially, and the number of steps it takes to reach this maximum also increases exponentially. Although a maximum of six ones can be written with only three states, with six states this number increases to at least 1.29×10^865 ones, taking over 3×10^1730 steps.
 * The Busy Beaver**

media type="youtube" key="2PjU6DJyBpw" height="315" width="560" align="center"



> Today, the Turing Machine forms the foundation for most types of programming, allowing for simple implementations of if statements for selection and loops for iteration. Modern computers are based on the machine, with the states and transitions evolving into modern CPUs and the tape evolving into RAM (eight cells of binary make one byte)8]. Universal Turing Machines, ones that can emulate the behavior of a Turing Machine in itself, are also widely used as interpreters and compilers to create programming languages that run on an operating system. Furthermore, there exist many variations of the Turing Machine as there are variations of automata, each possibly suited for a different purpose. Nonetheless, as all computation is based on this original design, the discovery of the Turing Machine is one of the most important milestones in the field of computer science.
 * Applications of the Turing Machine**



> The simulation is used to read from a tape of initially blank cells (zeros), and always begins in the state zero. By adding more states and transitions between states, you can modify the output of the tape to a mix of binary. The program will stop and refuse to continue running if the current state does not have a transition associated with the current input. To scroll though the tape, use the arrows at the top of the screen. A character is read from the tape and all necessary transition operations are performed through the 'Step' button. It's also possible to load a preset example program through the 'Load..' button. Finally, it is possible to clear all drawings (states/transitions) or simply reset the current program and tape.
 * Our Turing Machine Simulation**

[|Encyclopaedia Britannica on Automata Theory] [|Conway's Game of Life] [|External Java Applet Turing Machine Simulator] [|Busy Beaver Website] [|Document Outlining Additional Applications of Automata]
 * External Links**

[[|1]] Weisstein, Eric W. "Automata Theory." //MathWorld--A Wolfram Web Resource//. Web. 27 Apr 2012. [] [[|2]] Ullman, Jeffrey. "CS154: Introduction to Automata and Complexity Theory." //Stanford University//. Stanford University, 21 May 2010. Web. 27 Apr 2012. [|http://infolab.stanford.edu/~ullman/ialc/spr10/spr10.html] 3] Hopcroft, John, and Jeffrey Ullman. //Introduction to Automata Theory, Languages, and Computation//. 2nd. Addison Wesley, 2000. Print. [[|4]] Hughes, Charles. "Formal Languages and Automata Theory." //University of Central Florida//. University of Central Florida, 2 Dec 2007. Web. 27 Apr 2012. [|http://www.cs.ucf.edu/courses/cot5310/Notes/COT5310Notes.pdf]] [[|5]] "Hardware Design and Simulation." //Donetsk National University//. Donetsk National University, n.d. Web. 27 Apr 2012. [|http://masters.donntu.edu.ua/2006/fvti/shishko/library/fsm.pdf] [[|6]] Alber, Mark S. et.al. "On Cellular Automaton Approaches Modeling Biological Cells." //Los Alamos National Laboratory//. Los Alamos National Laboratory, n.d. Web. 27 Apr 2012. [|http://math.lanl.gov/%7Eyi/Papers/CArev.pdf] [[|7]] Barker-Plummer, David. "Turing Machines." //The Stanford Encyclopedia of Philosophy//. Stanford University, 11 Feb 2011. Web. 27 Apr 2012. [|http://plato.stanford.edu/entries/turing-machine/] 8] Vitanyi, Paul M.B. "Turing Machine." //Scholarpedia//. Scholarpedia, 2009. Web. 27 Apr 2012. [|http://www.scholarpedia.org/article/Turing_machine#Formal_definition_of_Turing_machine]
 * Citations**