Deterministic finite automata
In the theory of computation, a deterministic finite state machine or deterministic finite automaton (DFA) is a finite state machine where for each pair of state and input symbol there is one and only one transition to a next state. DFAs recognize the set of regular languages and no other languages.
A DFA will take in a string of input symbols. For each input symbol it will then transition to a state given by following a transition function. When the last input symbol has received it will either accept or reject the string depending on if it is in an accepting state or not.
Formal definition
A DFA is a 5-tuple,
(S, Σ, T, s, A), consisting of
- a finite set of states (S)
- a finite set called the alphabet (Σ)
- a transition function (T : S × Σ → S)
- a start state (s ∈ S)
- a set of accept states (A ⊆ S)
Let M be a DFA such that M = (S, Σ, T, s, A), and X = x0x1 ... xn be a string over the alphabet Σ. M accepts the string X if a sequence of states,
r0,r1, ..., rn, exists in S with the following conditions:
# r0 = s
# ri+1 = T(ri, xi), for i = 0, ..., n-1
# rn ∈ A.
As shown in the first condition, the machine starts in the start state s.
The second condition says that given each character of string X, the machine will transition from state to state as ruled by the transition function T.
The last condition says that the machine accepts if the last input of X causes the machine to be in one of the accepting states. Otherwise, it is said to reject the string. The set of strings it accepts form a language, which is the language the DFA recognises.
Example
The following example is of a DFA M, with a binary alphabet, which determines if the input contains an even number of 0s.
M = (S, Σ, T, s, A) where
- Σ = ,
- S = ,
- s = S1,
- A = , and
- T is defined by the following state transition table:
The state diagram for M is:
:Image:DFAexample.png
Simply put, the state S1 represents that there has been an even number of 0s in the input so far, while S2 signifies an odd number. A 1 in the input does not change the state of the automaton. When the input ends, the state will show whether the input contained an even number of 0s or not.
The language of M can be described by the regular language given by this regular expression:
:
Advantages and disadvantages
DFAs are one of the most practical models of computation, since there is a trivial linear time, constant-space, online algorithm to simulate a DFA on a stream of input. Given two DFAs there are efficient algorithms to find a DFA recognizing the union, intersection, and complements of the languages they recognize. There are also efficient algorithms to determine whether a DFA accepts any strings, whether a DFA accepts all strings, whether two DFAs recognize the same language, and to find the DFA with a minimum number of states for a particular regular language.
On the other hand, DFAs are of strictly limited power in the languages they can recognize — many simple languages, including any problem that requires more than constant space to solve, cannot be recognized by a DFA.
References
- Michael Sipser. Introduction to the Theory of Computation. PWS, Boston. 1997. ISBN 053494728X. Section 1.1: Finite Automata, pp.31–47. Subsection "Decidable Problems Concerning Regular Languages" of section 4.1: Decidable Languages, pp.152–155.
See also
- Acyclic deterministic finite automata
- Nondeterministic finite state machine
- Turing machine
Category:Computational models
ja:決定性有限オートマトン
Theory of computationThe theory of computation is the branch of computer science that deals with whether and how efficiently problems can be solved on a computer. The field is divided into two major branches: computability theory and complexity theory, but both branches deal with formal models of computation.
In order to perform a rigorous study of computation, computer scientists work with a mathematical abstractions of computers called a model of computation. There are several formulations in use, but the most commonly examined is the Turing machine. A Turing machine can be thought of as a desktop PC with an infinite memory capacity, though it can only access this memory in small discrete chunks. Computer scientists study the Turing machine because it is simple to formulate, can be analyzed and used to prove results, and because it represents what many consider the most powerful possible "reasonable" model of computation. While the infinite memory capacity might be considered an unphysical attribute, for any problem actually solved by a Turing machine the memory used will always be finite, so any problem that can be solved on a Turing machine could be solved on a desktop PC which has enough memory installed.
Computability theory
Computability theory deals primarily with the question of whether a problem is solvable at all on a computer. The halting problem is one of the most important results in computability theory, as it is an example of a concrete problem that is both easy to formulate and impossible to solve using a Turing machine. Much of computability theory builds on the halting problem result.
Computability theory is closely related to the branch of mathematical logic called recursion theory, which removes the restriction of studying only models of computation which are close to physically realizable. Many mathematicians who study recursion theory will refer to it as computability theory. There is no real difference between the fields other than whether a researcher working in this area has his or her office in the computer science or mathematics department.
Complexity theory
Complexity theory considers not only whether a problem can be solved at all on a computer, but also how efficiently the problem can be solved. Two major aspects are considered: time complexity and space complexity, which are respectively how many steps does it take to perform a computation, and how much memory is required to perform that computation.
In order to analyze how much time and space a given algorithm requires, computer scientists express the time or space required to solve the problem as a function of the size of the input problem. For example, finding a particular number in a long list of numbers become harder as the list of numbers grows larger. If we say there are numbers in the list, then if the list is not sorted or indexed in any way we may have to look at every number in order to find the number we're seeking. We thus say that in order to solve this problem, the computer needs to perform a number of steps that grows linearly in the size of the problem.
To simplify this problem, computer scientists have adopted Big O notation, which allows functions to be compared in a way that ensures that particular aspects of a machine's construction do not need to be considered, but rather only the asymptotic behavior as problems become large. So in our previous example we might say that the problem requires steps to solve.
Perhaps the most important open problem in all of computer science is the question of whether a certain broad class of problems denoted NP can be solved efficiently. This is discussed further at Complexity classes P and NP.
Other formal definitions of computation
Aside from a Turing machine, other equivalent (See: Church-Turing thesis) models of computation are in use.
;lambda calculus: A computation is an initial lambda expression (or two if you want to separate the function and its input) plus a finite sequence of lambda terms, each deduced from the preceding term by one application of Beta reduction.
;recursive functions: a computation is be a recursive function, i.e. its defining sequence, any input value(s) and a sequence of recursive functions appearing in the defining sequence with inputs and outputs. Thus, if in the defining sequence of a recursive function the functions and appear, then terms of the form 'g(5)=7' or 'h(3,2)=10' might appear. Each entry in this sequence needs to be an application of a basic function or follow from the entries above by using composition, primitive recursion or mu recursion. For instance if , then for 'f(5)=3' to appear, terms like 'g(5)=6' and 'h(3,6)=3' must occur above. The computation terminates only if the final term gives the value of the recursive function applied to the inputs.
;markov algorithm: a string rewriting system that uses grammar-like rules to operate on strings of symbols.
In addition to the general computational models, some simpler computational models are useful for special, restricted applications. Regular expressions, for example, are used to specify string patterns in UNIX and in some programming languages such as Perl. Another formalism mathematically equivalent to regular expressions, Finite automata are used in circuit design and in some kinds of problem-solving. Context-free grammars are used to specify programming language syntax. Non-deterministic pushdown automata are another formalism equivalent to context-free grammars. Primitive recursive functions are a defined subclass of the recursive functions.
Different models of computation have the ability to do different tasks. One way to measure the power of a computational model is to study the class of formal languages that the model can generate; this leads to the Chomsky hierarchy of languages.
Further reading
- Part Two: Computability Theory, chapters 3–6, pp.123–222.
- Hein, James L: Theory of Computation. Sudbury, MA: Jones & Bartlett, 1996. A gentle introduction to the field, appropriate for second-year undergraduate computer science students.
- Hopcroft, John E., and Jeffrey D. Ullman: Introduction to Automata Theory, Languages, and Computation. Reading, MA: Addison-Wesley, 1979. One of the standard references in the field.
- Taylor, R. Gregory: Models of Computation. New York: Oxford University Press, 1998. An unusually readable textbook, appropriate for upper-level undergraduates or beginning graduate students.
- Hartley Rogers, Jr, Theory of Recursive Functions and Effective Computability, MIT Press, 1987, ISBN 0-262-68052-1 (paperback)
- [http://www.cis.upenn.edu/~giorgi/cl.html Computability Logic]: A theory of interactive computation. The main web source on this subject.
-
Regular languageA regular language is a formal language (i.e., a possibly infinite set of finite sequences of symbols from a finite alphabet) that satisfies the following equivalent properties:
- it can be accepted by a deterministic finite state machine
- it can be accepted by a nondeterministic finite state machine
- it can be accepted by an alternating finite automaton
- it can be described by a regular expression
- it can be generated by a regular grammar
- it can be generated by a prefix grammar
- it can be accepted by a read-only Turing machine
- it can be defined in monadic second-order logic
Regular languages over an alphabet
The collection of regular languages over an alphabet Σ is defined recursively as follows:
- the empty language Ø is a regular language.
- the empty string language is a regular language.
- For each a ∈ Σ, the singleton language is a regular language.
- If A and B are regular languages, then A U B (union), A • B (concatenation), and A - (Kleene star) are regular languages.
- No other languages over Σ are regular.
All finite languages are regular. Other typical examples include the language consisting of all strings over the alphabet which contain an even number of a's, or the language consisting of all strings of the form: several a's followed by several b's.
If a language is not regular, it requires a machine with at least O(log log n) space to recognize (where n is the input size). In other words, DSPACE(o(log log n)) equals the class of regular languages. In practice, most nonregular problems are solved by machines taking at least logarithmic space.
Closure properties
The results of the union, intersection and set-difference operations when applied to regular languages is itself a regular language; the complement of every regular language over its alphabet is a regular language as well. Reversing every string in a regular language yields another regular language. Concatenating two regular languages (in the sense of concatenating every string from the first language with every string from the second one) also yields a regular language. The shuffle operation, when applied to two regular languages, yields another regular language. The right quotient and the left quotient of a regular language by an arbitrary language is also regular.
Deciding whether a language is regular
To locate the regular languages in the Chomsky hierarchy, one notices that every regular language is context-free. The converse is not true: for example the language consisting of all strings having the same number of a's as b's is context-free but not regular. To prove that a language such as this is not regular, one uses the Myhill-Nerode theorem or the pumping lemma.
There are two purely algebraic approaches to defining regular languages. If Σ is a finite alphabet and Σ - denotes the free monoid over Σ consisting of all strings over Σ, f : Σ - → M is a monoid homomorphism where M is a finite monoid, and S is a subset of M, then the set f −1(S) is regular. Every regular language arises in this fashion.
If L is any subset of Σ - , one defines an equivalence relation ~ on Σ - as follows: u ~ v is defined to mean
:uw ∈ L if and only if vw ∈ L for all w ∈ Σ -
The language L is regular if and only if the number of equivalence classes of ~ is finite; if this is the case, this number is equal to the number of states of the minimal deterministic finite automaton accepting L.
References
- Chapter 1: Regular Languages, pp.31–90. Subsection "Decidable Problems Concerning Regular Languages" of section 4.1: Decidable Languages, pp.152–155.
External resources
- Department of Computer Science at the University of Western Ontario: Grail+, http://www.csd.uwo.ca/Research/grail/. A software package to manipulate regular expressions, finite-state machines and finite languages. Free for non-commercial use.
Category:Formal languages
ja:正規言語
N-tuple:For the musical term, see tuplet.
In mathematics, a tuple is a finite sequence of objects, that is, a list of a limited number of objects (an infinite sequence is a family). Tuples are used to describe mathematical objects that consist of certain components. For example, a directed graph is defined as a tuple (V, E) where V is the set of nodes and E is a subset of V × V that denotes the edges.
Names of tuples
The term originated as an abstraction of the sequence: single, double, triple, quadruple, quintuple, ... n-tuple. A tuple of length n is usually described as an n-tuple. A 2-tuple is an ordered pair; a 3-tuple is a triple or triplet. The n can be any positive integer; thus one can for example say that a quaternion can be represented as a 4-tuple, and further constructed names are possible, such as octuple, but many mathematicians find it quicker to write "8-tuple", even if still pronouncing "octuple".
Formal definitions
The main properties that distinguish a tuple from, for example, a set are that (1) it can contain an object more than once and (2) the objects appear in a certain order. Note that (1) from a multiset and (2) distinguishes it from an ordered set. This is often formalized by giving the following rule for the identity of two n-tuples:
: (a1, a2, ...,an) = (b1, b2, ..., bn) iff a1 = b1, a2 = b2 and so on.
Another way of formalizing tuples is by mapping them to more primitive constructs in set theory such as ordered pairs. For example, an n-tuple (with n > 2) can be defined as an ordered pair of its first entry and an (n−1)-tuple containing the remaining entries:
: (a1, a2, ..., an) = (a1, (a2, ..., an))
Using the usual set-theoretic definition of an ordered pair and letting the empty set represent the empty tuple, this results in the following inductive definition:
# the 0-tuple (i.e. the empty tuple) is represented by ∅
# if x is an n-tuple then is an (n + 1)-tuple.
Using this definition, (1,2,2) would be
: (1,(2,(2,()))) = (1,(2, )) = (1, ) =
There is an important similarity here with the way Lisp originally used the ordered pair abstraction to inductively create all of its n-tuple and list structures:
# a special symbol NIL represents the empty list;
# if X is a list and A an arbitrary value then the pair (A, X) represents a list with the head (i.e. first element) A and the tail (i.e. the remainder of the list without the head) X.
Usage in computer science
In computer science, tuple can have two distinct meanings. Typically in functional and some other programming languages, a tuple is a data object that holds several objects, similar to a mathematical tuple. Such an object is also known as a record.
In some languages and especially in database theory, a tuple is usually defined as a finite function that maps field names to a certain value. Its purpose is the same as in mathematics, namely to indicate that a certain entity or object consists of certain components and/or has certain properties, but here these components are identified by a unique field name and not by a position, which often leads to a more user-friendly notation.
A small example of a tuple would be:
: ( player : "Harry", score : 25 )
which is a function that maps the field name "player" to the string "Harry" and the field name "score" to the number 25. Note that the order of the components is not relevant, so the same tuple can also be written as:
: ( score : 25, player : "Harry" )
In the relational model such tuples are typically used to represent a single proposition, in this case that there exists a player named "Harry", and that he has a score of 25.
In programming languages tuples are used to form data structures. For example, the following could be a structure that represents a node in a doubly linked list:
: ( value : 16, previous-node : 1174782, next-node : 1174791 )
Names for tuples of specific length
Pair, triple(t), quadruple, quintuple, sextuple, septuple, octuple.
See also
- Tuple calculus
ja:タプル
Category:Sequences
Category:Mathematical notation
Category:Data management
Function (mathematics)In mathematics, a function is a relation, such that each element of a set (the domain) is associated with a unique element of another (possibly the same) set (the codomain, not to be confused with the range). The concept of a function is fundamental to virtually every branch of mathematics and every quantitative science.
The terms function, mapping, map and transformation are usually used synonymously. The term operation is frequently used for binary functions; functions whose domain is a set of functions, or a vector space, are often called operators (see also operator (programming)).
Intuitive introduction
Essentially, a function is a "rule" or procedure that assigns an "output" value to each given "input" value. The following are examples of functions:
- In a group of people, each person has a favorite colour—from the set of red, orange, yellow, green, cyan, blue, indigo, or violet. Here, the input is the person, and the output is one of the 8 colours. The favorite colour is a function of the person. For example, John has favorite colour red, while Kim has favorite colour violet. Note that more than one person may be associated with a given colour (e.g., John and Kim may both like red), but one person cannot have more or less than one favorite color.
- A stone is dropped from different stories of a tall building. The dropped stone may take 2 seconds to fall from the second story, and 4 seconds to fall from the 8th story. Here, the input is the story, and the output is the number of seconds. The relevant function describes the relationship between the time it takes the stone to reach the ground and the story. (See acceleration)
The "rule" defining a function can be specified by a formula, a relationship, or simply a table listing the outputs against inputs. The most important feature of a function is that it is consistent, or deterministic, always producing the same output from a given input. In this way, a function may be thought of as a mechanism or "machine" (a "black box") consistently converting a given valid input into its unique associated output. In certain technical contexts, the input is often called the argument of the function, and the output the value of the function.
A very common type of function occurs when the argument (input) and the value (output) are both numbers, the functional relationship is expressed by a formula, and the value (output) of the function is obtained by direct substitution of the argument into the formula. Consider for example
:
which for any number x, assigns to x the associated value the square of x.
A straightforward generalization is to allow functions depending on several arguments. For instance,
:
is a function which takes the input, two expressions x and y, and assigns to it its product (output), xy. It might seem that this is not really a function as we described above, because this "rule" depends on two inputs. However, if we think of the two inputs together as a single pair (x, y), then we can interpret g as a function -- the argument (unified single input) is the ordered pair (x, y), and the function value (output) is xy.
Such functions whose input consists of ordered pairs are called "binary" or "2-ary".
In the sciences, we often encounter functions that are not given by (known) formulas. Consider for instance the temperature distribution on earth over time: this is a function which takes location and time as arguments and gives as output value the temperature at the indicated location at the indicated moment in time.
We have seen that the intuitive notion of function is not limited to computations using single numbers and not even limited to computations; the mathematical notion of function is still more general and is not limited to situations involving numbers. Rather, a function links a "domain" (set of inputs) to a "codomain" (set of possible outputs) in such a way that every element of the domain is associated to precisely one element of the codomain. Functions are abstractly defined as certain relations, as will be seen below. Because of this generality, the function concept is fundamental to virtually every branch of mathematics and the quantitative sciences.
History
As a mathematical term, "function" was coined by Leibniz in 1694, to describe a quantity related to a curve, such as a curve's slope or a specific point of a curve. The functions Leibniz considered are today called differentiable functions, and they are the type of function most frequently encountered by nonmathematicians. For this type of function, one can talk about limits and derivatives; both are measurements of the change of output values associated to a change of input values, and these measurements are the basis of calculus.
The word function was later used by Euler during the mid-18th century to describe an expression or formula involving various arguments, e.g. f(x) = sin(x) + x3.
During the 19th century, mathematicians started to formalize all the different branches of mathematics. Weierstrass advocated building calculus on arithmetic rather than on geometry, which favoured Euler's definition over Leibniz's (see arithmetization of analysis).
By broadening the definition of functions, mathematicians were then able to study "strange" mathematical objects such as continuous functions that are nowhere differentiable. These functions were first thought to be only theoretical curiosities, and they were collectively called "monsters" as late as the turn of the 20th century. However, powerful techniques from functional analysis have shown that these functions are in some sense "more common" than differentiable functions. Such functions have since been applied to the modeling of physical phenomena such as Brownian motion.
Towards the end of the 19th century, mathematicians started trying to formalize all of mathematics using set theory, and they sought to define every mathematical object as a set. Dirichlet and Lobachevsky independently and almost simultaneously gave the modern "formal" definition of function (see formal definition below).
In this definition, a function is a special case of a relation. In most cases of practical interest, however, the differences between the modern definition and Euler's definition are negligible.
The notion of function as a rule for computing, rather than a special kind of relation, has been formalized in mathematical logic and theoretical computer science by means of several systems, including the lambda calculus, the theory of recursive functions and the Turing machine.
Formal definition
Formally a function f from a set X to a set Y, written f : X → Y, is an ordered triple (X, Y, G(f)), where G(f) is a subset of the cartesian product X × Y, such that for each x in X, there is a unique y in Y such that the ordered pair (x, y) is in G(f). X is called the domain of f, Y is called the codomain of F, and G(f) is called the graph of f. For each "input value" x in the domain, the corresponding unique "output value" y in the codomain is denoted by f(x).
Equivalently a function f can be defined as a relation between X and Y which satisfies:
# f is total, or entire: for all x in X, there exists a y in Y such that x f y (x is f-related to y), i.e. for each input value, there is at least one output value in Y.
# f is many-to-one, or functional: if x f y and x f z, then y = z. i.e., many input values can be related to one output value, but one input value cannot be related to many output values.
A relation between X and Y that satisfies condition (1) is a multivalued function. Every function is a multivalued function, but not every multivalued function is a function. A relation between X and Y that satisfies condition (2) is a partial function. Every function is a partial function, but not every partial function is a function. In this encyclopedia, the term "function" will mean a relation satisfying both conditions (1) and (2), unless otherwise stated.
Consider the following three examples:
| image:notMap1.png | This relation is total but not many-to-one; the element 3 in X is related to two elements b and c in Y. Therefore, this is a multivalued function, but not a function. |
| image:notMap2.png | This relation is many-to-one but not total; the element 1 in X is not related to any element of Y. Therefore, this is a partial function, but not a function. | |
| image:mathmap2.png | This relation is both total and many-to-one, and so it is a function from X to Y. Note that the emphasis is on "-to-one" as "many" may actually mean "one". The function can be given explicitly by specifying its graph G(f) = or as
: |
|
|
| :: RELATED NEWS :: |
Miotacz ognia RPO Ryś
RPO Ryś (РПО Рысь, ros. rakietowy miotacz ognia piechoty "Ryś") - radziecki rakietowy miotacz ognia.
Wady klasycznych plecakowych miotaczy ognia sprawiły że w USA podjęto w latach sześćdziesiątych prace nad bronią która mogłaby je zastąpić. W ich efekcie pod koniec lat sześćdziesiątych
|
Szilárd Németh
Szilárd Németh (ur. 8 sierpnia 1977 w Komarnie) to słowacki piłkarz występujący na pozycji napastnika.
Karierę rozpoczynał w Slovanie Bratysława, z którego później przeniósł sie do Kosz
|
Szilard Nemeth
Szilárd Németh (ur. 8 sierpnia 1977 w Komarnie) to słowacki piłkarz występujący na pozycji napastnika.
Karierę rozpoczynał w Slovanie Bratysława, z którego później przeniósł sie do Kosz
|
|
Bob Beamon
Bob Beamon (ur. 29 sierpnia 1946 na Jamajce) - amerykański lekkoatleta, uczestnik Igrzysk Olimpijskich w Meksyku w 1968. Zdobywca złotego medalu w Read More... |
Radecznica
Radecznica - wieś, siedziba gminy w powiecie zamojskim, w Szczebrzeszyńskim Parku Krajobrazoym. Około 920 mieszkańców.
W skład gminy wchodza następujące wsie
Zaburze
Mokrelipie
Dzielce
Gorajec Stara Wieś
Gorajec Zagroble
Gorajec Kolonia
Zaporze
Latyczyn
Chłopków
Podborcze
Czarnystok
Podlesie Male
Podlesie Duze
Adresy w Sieci
[http://www.Radecznica.ZamoscOnLine.net RadecznicaOnLin
|
Sala Podwójnych Toporów
Sala Podwójnych Toporów (Sala Obusiecznych Toporów) to komnata Króla Minosa znajdująca się w Pałacu Knossos, zaliczajaca się do jego prywatnych apartamentów. Nazwę zaczerpnięto od obusiecznych toporów które zdobiły wejście do komnaty. Obusieczne topory są także jednym z głównych symboli pałacu, obok rogów byka. Znaki w tym kształcie zostały takze odcisnięte na kamiennych ścianach całego pałacu.
11 czerwca 1904 w Krakowie, zm. 30 maja 1964 w Krakowie), historyk polski, profesor i rektor Uniwersytetu Jagiellońskiego, członek Polskiej Akademii Umiejętności, redaktor naczelny Polskiego Słownika B
|
|