Theory

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

Expressions

Finite strings of symbols from the alphabet

Transition Graphs (TG)

Graph with transitions like abbb->bb

Generalized Transition Graphs (GTG)

Graph with transitions of reg expressions like a*->a+b*

Moore machine

If the output at a given point of time depends solely on the state the FA

Chomsky Normal Form Theorem

L is a context-free language if and only if L - {empty string} can be generated by a CNF grammar.

Kleene's Theorem

L is accepted by an FA if and only if L is denoted by an RE L accepted by FA -> L accepted by NFA -> L accepted by TG -> L accepted by GTG -> L denoted by RE -> L accepted by NFA

Empty String / Null String

The empty string is not a member of the alphabet. It's an entity of a completely different kind. Length of empty string is 0

alphabet

The fundamental units from which a language is built come from a finite non-empty set of objects

Words

The strings which are members of the language

Regular Expressions

a + b, a*b, a*+b*, etc

Finite Automata

1) A finite set S of entities called states. One of these is designated as a starting state and some (possibly none) are designated as final states. It is permitted that the starting state also be a final state. 2) An input alphabet. (Which of course is finite and non-empty by our definition of alphabet. ) 3) A transition function. The transition function tells us which state to go to next. It is a function of two variable - the present state and the present input.

Total Function

If a Turing computable function is defined for all inputs

Church-Turing Thesis

If there is an algorithm to compute a natural number function, then there is a Turing machine to compute it

Bachus-Naur Form

S ⇒ SS | a | Λ

Proving Theorem

1) To show that if L - {empty string} can be generated by a CNF grammar, then L is context-free. This is trivial, because a CNF grammar is, in particular, a context-free grammar. 2) To show that if L is a context-free language, then L - {empty string} can be generated by a CNF grammar. We do this by showing how to convert any given context free grammar to a Chomsky Normal Form grammar that generates L - {empty string}. Toward this end, we first note that if a production rule is not one of the two required forms, then it is one of the type below. i) A null production; that is, one of the form non-terminal -> empty string Such productions are also called empty string-productions ii) A unit production; that is, one of the form non-terminal -> non-terminal [X -> Y, eliminate chains and cycles](The non-terminals indicated are not necessarily the same.) iii) A production where the right side of the arrow has more than one symbol, at least one of which is a terminal. [V -> bZc] iv) A production where the right side of the arrow consists of three or more non-terminals. [V -> XYZW]

Context-Free Grammars

1. An alphabet Σ, whose members we call terminals, from which we make the strings of the language to be generated. We frequently use lower case letters for terminals. 2. A finite set, disjoint from the terminals, called non-terminals, one of which is the start symbol. We frequently use S for the start symbol and other upper case letters for the remaining non-terminals. 3. A finite set of symbolic rules, called production rules, each of the form non-terminal → string The string on the right of the arrow is permitted to be empty, a string of terminals, a string of non-terminals, or mixed. Example: X → bZ applied to the string bXcX bXcX ⇒ bbZcX bXcX ⇒ bXcbZ

Closure Under Intersection

A + B = c ( c(A) u c(B) ). To see why this holds, apply DeMorgan's Law (from your discrete math course) to the right side. Now this identity is telling us that we can represent intersection in terms of union and complement. But we've already seen that the family of regular sets is closed under these operation, so if A and B are regular, so is the right side, but then so is the left side

Universal Turing Machine

A Turing machine to compute 0| regarded as the theoretical forerunner of the modern "stored program" computer. In computing fn for input m, we can think of the lefthand string of 1's (in the figure above) as a program. The universal machine "decodes" this string to arrive at the 5-tuples for Tn and then simulates the actions of these 5-tuples. f(x, y) = fx(y) where f0, f1, f2,..., fn, .... is the standard enumeration of the Turing computable functions of one variable. The function of two variables f captures the behavior of every Turing computable function of one variable

Chomsky Normal Form Grammars (CNF)

A context-free grammar is said to be a Chomsky Normal Form grammar if every production rule has the form non-terminal -> terminal non-terminal -> (non-terminal)(non-terminal)

Turing Computable

A function from a subset of N into N is Turing Computable if it is the function determined by some Turing machine

Computational Complexity

A language L is polynomial-time, non-deterministically decidable if there is a non-deterministic Turing machine T that accepts L and a polynomial p such that for every string w that is accepted, there is an accepting computation of length <= p( |w| )

Empty string never generated by production rules

A language L is regular if and only if L - {empty string} is generated by a regular grammar

Turing Decidability

A relation on the natural numbers is said to be Turing decidable (decidable for short) if there is a Turing machine which outputs 1 when the relation holds and 0 when the relation fails. A set S of natural numbers is a Turing decidable set if the relation x in S is Turing decidable

Recursively Enumerable Sets

A set of natural numbers is called recursively enumerable if it is the range of a total Turing computable function. If set S is recursively enumerable, then it is the totality of output of some Turing machine, and it can be arranged as a sequence a0, a1, a2, ............... where each a>n is obtained by inputting n. for an algorithm to enumerate S would be to successively feed in 0, 1, 2,...... to a Turing machine that decides S, and each time you get an output of 1, append the input to the sequence generated so far.

Parse Trees

Derive based on order of derivation

Every recursively enumerable set S is Turing decidable

False

Pumping Lemma

Idea: In sorting mail into pigeon holes, if you have more mail than pigeon holes, than there are at least two pieces of mail that share the same pigeon hole. If L is a regular language and x is in L and |x| >= n , where n is the number of states in a FA that accepts L, then x can be written x = uvw, where 1) v is not an empty string, and 2) u(v^i)w is in L for all i = 0, 1, 2, .....

Kleene star

If L = { ab } , then L* = { L, ab, abab, ababab . . . . . . . } .

Total Language Tree

If a derivation has length n, then the string which it derives appears on the total language tree at depth n.

Corollaries for Pumping Lemma

If an FA accepts anything at all, it will accept a string whose length is less than the number of its states. If a state q in an FA is reachable by some string, then it will be reachable by a string w whose length is less than the number of states.

Mealy Machine

If the output when you arrive at a node depends on which node you came from and on which arrow you came in on. Every Moore machine is equivalent to some Mealy machine, and every Mealy machine is equivalent to some Moore machine; it being understood that the initial output of the Moore machine is not counted.

Deciding Whether an Arbitrary FA Accepts at Least One String

Input all the strings of length less than the number of states of the given FA. If it accepts one of these, you're finished. If it won't accept any of these, it won't accept any at all.

Decidablility

Is there an algorithm to tell of an arbitrary context-free grammar and an arbitrary string of terminals from its alphabet, whether the string is in the language generated by the grammar?

Rice's Theorem

Let B be a class of Turing computable functions of one variable which is non-empty and not the entire class of Turing computable functions of one variable, then the relation on the natural numbers " fx Î B" is not Turing decidable

Closure Under Complementation

Let L be a regular language, then by Kleene's Theorem, L is accepted by an FA. If we interchange the status of the final and non-final states in this FA; that is making the final ones non-final and the non-final ones final, we get a machine that accepts exactly those string which the original FA rejects. In other word, this new machine accepts the complement of L

Gödel numbers

Numbers h(T) that encode Turing machines T

Chomsky Hierarchy

Regular languages live inside of Context free which live inside Context Sensitive which live inside Phase structure.

Denumerability

Set A set is said to be denumerable if it has the same cardinality as the set of N = {0, 1, 2, .....}, the set of natural numbers. Another way of saying that a set A is denumerable, is that its members can be arranged into an infinite sequence all of whose terms have different values

concatenation

The concatenation of string v = ab with w = bba is the string vw = abbba

The empty set

The empty set is considered to be a legitimate language. It has no words at all

The Input Alphabet

The input alphabet is a subset of the tape alphabet. It does not include the blank symbol.

Symbols

The members of the alphabet

The Halting Problem

The problem of finding an algorithm for telling of an arbitrary Turing machine and an arbitrary input whether or not the machine eventually halts when started on that input. Thm: The relation on the natural numbers " Tx eventually halts when started with input y ", is not a Turing decidable relation.

Closure Under Union, Concatenation, and Kleene Star

The recursive definitions (in the text book) of the notions of regular expression and set denoted by a regular expression have closure under these three operations built into them.

Turing Machines As Function Computers

The set of natural numbers N starts with 0. Each Turing machine determines a function f(x) from a subset of N into N as follows: For a given input n, we start the machine with the string 1^(n + 1) consisting of n + 1 occurrences of the symbol 1 on consecutive squares of the tape. Thus, To input 0 we start with the string 1 on the tape. To input 1 we start with the string 11 on the tape. To input 2 we start with the string 111 on the tape. etc. This ensures that there is a left-most non-blank symbol on the tape. We start the machine scanning the leftmost 1. If the machine halts, the number of 1's on the tape is considered to be the value of f(n). If the machine fails to halt, the function is considered undefined for the given input.

Closure Properties of Regular Languages

The set of regular languages is closed under the operations of Union, Concatenation, Kleene Star, and Intersection. This means, for example, that the union of two regular languages is a regular language.

NP = P

The statement P=NP means that if a problem takes polynomial time on a non-deterministic TM, then one can build a deterministic TM which would solve the same problem also in polynomial time. NP-complete problem means an NP problem X, such that any NP problem Y can be reduced to X by a polynomial reduction. That implies that if anyone ever comes up with a polynomial-time solution to an NP-complete problem, that will also give a polynomial-time solution to any NP problem. Thus that would prove that P=NP. Conversely, if anyone were to prove that P!=NP, then we would be certain that there is no way to solve an NP problem in polynomial time on a conventional computer.

If S is Turing decidable, then it is recursively enumerable.

True

If a relation is not Turing decidable, the function f is not Turing computable.

True

Language

a certain specified set of expressions built from its alphabet

Context-free grammar

a regular grammar if all the productions are of the form non-terminal -> terminal non-terminal -> (terminal)(non-terminal)

Turing Machine

can be thought of as a device with finitely many states (q0, q1, ...) together with a tape along which the device moves. Each square is occupied by a symbol (a1, a2, ...) from the machine's finite tape alphabet. Each step in a computation is specified by a 5-tuple of the form: " qi aj ak qm D " and " * " as the blank symbol

Sigma*

denotes the set of all strings based on alphabet sigma, it always has the empty string in it

Non-Deterministic Finite Automata (NFA)

each (state, input) pair does not have a uniquely determined next state

Converting FA's to RG's

q0 -> a q1 q0 -> a q0 -> b q0 q1 -> a q1 q1 -> a q1 -> b q0

P

the Turing machine is deterministic, we say that the language is polynomial-time, deterministically decidable. Clearly, P is a subset of NP, since we can regard every deterministic Turing machine as a special case of a non-deterministic machine.

Turing Machine Being Deterministic

the action at a step is completely determined by the state the machine is in and the symbol that is being scanned (starting leftmost) while in that state

Halting

the machine is in some state qi and scanning a symbols aj , but there is no 5-tuple in the set to cover that situation

NP

the set of all languages which are polynomial-time, non-deterministically decidable


Kaugnay na mga set ng pag-aaral

Philosophy 6 name that philosopher

View Set

Investment Banking Accounting Technical Questions

View Set

CS 124: Chapter 7 - Lists and Tuples

View Set

Nature and the Environment - English 9A

View Set

Chapter 56: Management of Patients with Dermatologic Disorders and Wounds

View Set