1/47
Looks like no tags are added yet.
Theory of Computation
Is defined as "the branch that deals with how efficiently problems can be solved on a model of computation, using an algorithm"
Theory of Computation
Its purpose is to create computational mathematical models that can reflect real-world computers
Automata, computability, computational complexity
three branches of theory of computations (_____ theory)
Complexity Theory
deals with the efficiency with which a computer can solve a problem. Computer problems come in different varieties: some are easy, and some are hard.
Complexity Theory
its objective is to classify problems as easy ones and hard ones
Computability Theory
deals with the extent to which a computer can solve a problem
Computable
When a problem can be solved by a computer, the problems are called __________ problems.
Computability Theory
its objective is the classification of problems that are solvable and those problems that are not
Automata
is a theoretical branch of computer science and mathematics. It is the study of abstract machine.
Automata theory
deals with the definitions and properties of mathematical models of computation. These models play a role in several applied areas of computer science.
Finite automaton
Is used in text processing, compilers, and hardware design.
Context-free Grammar
Is used in programming languages and artificial intelligence.
Grammars, regular expressions
2 important notations that are not automaton like but play an important role in the study of automata and their applications
Grammars
are useful models when designing software that processes data with a recursive structure.
Example: ⟨SENTENCE⟩⇒⟨NOUN-PHRASE⟩⟨VERB-PHRASE⟩
*a boy sees
Variables, terminals, production rules, start variables
Grammar : (V, T, P, S)
Where
V : finite set of variables
T : finite set of terminals
P : finite set of production rules
S : start variables
Regular Expressions
denote the structure of data, especially text. The patterns of strings they describe are the same as what can be described by finite automata.
UNIX style regular expression
type of regular expression [A -Z] [a- z]*[ ] [A- Z] [ A -Z] that represents capitalized words followed by a space and two capital letters.
*
In UNIX style regular expression, the symbol _ represents "any number of the preceding expression"
Alphabet
It is defined as a finite set of symbols.
Alphabet
any nonempty finite set.
Symbols
The members of the alphabet are the _______ of the alphabet. Denoted by ⅀
String
A "______" over an alphabet is a finite sequence of symbols from that alphabet, which is usually written next to one another and not separated by commas
Length
The "______" of a string is its length as a sequence. The length of a string w is written as |w|
Reverse string
"tite" -> "etit"
Substring
z is a _________ of w if z appears consecutively within w. • Example: If ∑a = {a, b, ..., z) then "deck" is a substring of "abcdeckabcjkl"
Concatenation
the string obtained by appending y to the end of x, as in x1x2...xm y1 y2... yn
Suffix
last letter of the string
Prefix
first letter of the string
regular expression
can be defined as a language or string accepted by a finite automata.
regular expression
can also be described as a sequence of pattern that defines a string. The patterns of strings they describe are the same as what can be described by finite automata.
.
Wildcard which matches any character
[xyz]
Matches either an x, y or z character
[^xyz]
Matches all token except the character indicated
()
Groups token inside
\s
any whitespace character
\S
any non-whitespace
\d
Matches any digit
\D
Matches any Non-digit
?
matches zero or one occurrence of the preceding expression.
+
matches one or more occurrences of the preceding expression.
*
matches zero or more occurrences of the preceding expression.
x{3}
Matches exactly 3 consecutive `x` characters.
x{3,}
Matches at least 3 consecutive `x` characters.
x{3,6}
Matches any digit
Context-Free Grammar
A more powerful method of describing languages. First used in the study of human languages.
Context-Free Grammar
its Application occurs in the specification and compilation of programming languages.
Parser
a component that most compilers and interpreters have. extracts the meaning of a program before generating the compiled code
Variables, terminals, production rules, start variables
Grammar : (V, T, P, S)
Where
V : finite set of variables
T : finite set of terminals
P : finite set of production rules
S : start variables