CMPS130 Final

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

What computational models did we study this term?

- DFA - NFA - e-NFA - PA - TM - RE - CFG/CFL

How can we prove a language is regular? List the ways covered in class.

- DFA - NFA - e-NFA - RE - Kleene's Theorem - Myhill-Nerode Theorem - Closure properties

How can we prove a language is not regular?

- Pumping Lemma - Myhill-Nerode Theorem

With respect to proving a language is regular or non-regular compare the the power of the Pumping Lemma and the Myhill-Nerode Theorem.

- The Pumping Lemma can only be used to prove a language is not regular (using the xy^iz form) or not context free (using the uv^iwx^iy form) - Myhill-Nerode can be used to prove either that a language is regular or irregular, much more powerful

The basis of the pumping lemma is that for any ________ language, all strings in the language which are ________ long must contain some non-void substring that can be pumped, where pumped means that if the string is modified by removing the substring or arbitrarily repeating it, the modified string will be _________.

- regular - sufficiently - in the language

What is a Turing Machine?

A Turing Machine is a 7-tuple (Q, Σ, Γ, δ, q0, qaccept, qreject), where Q, Σ, Γ are all finite sets and Q is a finite set of "states". Σ is the input alphabet not containing the blank symbol _, Γ is the tape alphabet, where _ ∈ Γ and Σ ⊆ Γ. δ: Q×Γ→Q×Γ×{L, R} is the "transition function". q0 ∈ Q is the "start state" qaccept ∈ Q is the "accept state" qreject ∈ Q is the "reject state", where qreject =/ qaccept

Given that the complement of any regular language is regular and that the intersection of any two regular languages is regular, prove that the union of any two regular languages is regular.

A and B are regular Given ¬A is regular Complement ¬B is regular Complement ¬A⋂¬B is regular Intersection ¬(¬A⋂¬B) is regular Complement A ⋃ B is regular De Morgan's

Write the formal definition of regular languages given in class

A language is called a regular language if some finite automaton recognizes it.

What is a universal Turing Machine?

A universal turing machine is a turing machine that is capable of simulating any other turing machine from the description of that machine.

Show that the language (a^nb^nc^n | n >= 0} is not a CFL, by proving you can win the Demon game regardless of what the Demon does.

Assume the language is a CFL. Therefore there exists a pumping length p and a sufficiently long string s of the form a^pb^pc^p such that |s| >= p. Following this model, we should be able to represent s as comprised of 5 parts, uv^iwx^iy. Where for every i >= 0, uv^iwx^iy ∈ L. In our model, v is comprised entirely of a's and x is comprised entirely of b's. We can then represent our string as a^aa^bb^a^b^bc^p, where (a+b = p). For i = 2, s = a^aa^2bb^ab^2bc^c, and a+2b should = p. For i = 0, then a+0b = p and that's only possible if vw = 0, which is not in our set of rules. Therefore, not a CFL.

Let Σ = {a, b}. Prove the language, L = {a^nb^n | n >= 0}, is non-regular by using the Myhill-Neorde Theorem.

Consider the set x = {a^p | for all p >= 0}, which is clearly infinite. Two members of this set will have the form a^i, a^j such that i =/ j. The string z = b^i distinguishes them since, a^ib^i ∈ L and a^jb^i ∈/ L. Therefore the language is not regular.

What does the Myhill-Nerode Theorem state?

Given an alphabet Σ, and a language L ⊆ Σ*, the following two statements are equivalent. 1. The language L is regular. 2. The index of RL is finite.

The language accepted or recognized by M is

L(M) = {x ∈ Σ* | x is accepted by M}.

A Deterministic Finite Automaton, DFA, is a structure M such that:

M = (Q, Σ, δ, s, F), where Q is a finite set of "states". Σ is a finite set of "symbols", an "alphabet". δ: Q×Σ→Q is the "transition function". For p, q ∈ Q and a ∈ Σ, δ(p, a) = q means state q is transitioned to when in state p scanning symbol a. s ∈ Q is the "start state" F ⊆ Q is the set of "final states".

What are decision problems and why is it reasonable to focus on them in the study of computational models?

Problems whose answer are yes or no - easier to analyze - can be as difficult as any other problem - many other problems can be solved with decision problems

Give the CFG that generates the language, L = {x ∈ {0, 1}* | x =/ ww for some w ∈ {0, 1}*}

S → AB | BA | A | B A → LAL | 0 B → LBL | 1 L → 0 | 1

Convert the following CFG to Chomsky Normal Form S → (S) | SS | e

S → P1P2 | SS | P1C C → SP2 P1 → ) P2 → (

How does the concept of language relate to the study of computational models?

Sets of strings are accepted by models

What does Kleene's Theorem state about languages that can be defined with DFAs and languages that can be denoted with regular expressions?

They are the same family of langauges

Compare and contrast DFAs and NFAs, how are they the same and how do they differ?

Transitions DFA - For each state and letter there must be one and only one arrow NFA - For each state and letter there may be Ø, 1, or more arrows. Acceptance DFA - Accepts if stops in an accept state NFA - Accepts if possible to end in an accept state

Given an arbitrary DFA, M, is it possible to determine (in a finite amount of time) if L(M) =/ Ø? Explain.

Yes, because if an accept state is reachable, then the language is not empty and contains at least one string.

Let Σ equal the alphabet {a, b, c}. For each of the following sets indicate if its cardinality is finite or infinite. If it is finite what is its cardinality and if it is not finite is it countable or uncountable? a. Σ b. 2^Σ* c. Σ* d. 2^Σ e. Ø

a. finite, size = 3 b. infinite, uncountable c. infinite, countable d. finite, size = 2^3 e. finite, size = 0

Let A = {1, 2} and B = {2, 4, 6, 8} a. A∪B b. A∩B c. B - A d. 2^A e. A x B

a. {1, 2, 4, 6, 8} b. {2} c. {4, 6, 8} d. {Ø, {1}, {2}, {1, 2} } e. { (1, 2), (1, 4), (1, 6), (1, 8), (2, 2), (2, 4), (2, 6), (2, 8) }

Write the formal definition of regular expression.

e is a RE. Ø is a RE. Va ∈ Σ, a is a RE. If r1, r2 are RE's, then (r1 + r2) and (r1 * r2) are RE's If r is a RE, then r* is RE. Nothing else is a RE.

Given an alphabet Σ , and a language L ⊆ Σ*. What is the definition of the Myhill-Nerode relationship, RL, for L on Σ*. Fill in the blanks. For any x, y ∈ Σ* x RL Y if and only if __________________

x is indistinguishable from y.

Prove that the complement of a CFL is not necessarily a CFL.

x | x =/ ww is a CFL with a grammar: S → AB | BA | A | B A → LAL | 0 B → LBL | 1 L → 0 | 1 , that has a complement that is known to not be a CFL. See question ____.

A string x ∈ Σ* is accepted by M if

δ'(s, x) ∈ F

The extended transition function for M is the function:

δ': Q×Σ*→Q, where δ'(q, e) = q, and δ'(q, xa) = δ(δ'(q, x), a).


Ensembles d'études connexes

Chapter 11: Maternal Adaptation During Pregnancy

View Set

Ch 24, Exam 4 - Biochemistry and Molecular Biology of the Gene - UNT BIOC 4570

View Set

Chapter 9 Life insurance license

View Set

Chapter 11 Quiz: The Fat-Soluble Vitamins: A, D, E, and K

View Set

PN NCLEX 6th Edition- Mental Health

View Set

Module 8 - Program and App Use and Development

View Set

BIO 111 General Biology Chapter 6 (Mastering Biology)

View Set

SCIENCE - 1.4 Molecules: (EVERYTHING)

View Set