CSE 355
Spring 2013 - Colbourn
Theory of Computing
Midterm # 2
ID: _
Page 1 of 6
CSE 355
Spring 2013 - Colbourn
Theory of Computing
Midterm # 2
ID: _
Page 2 of 6
CSE 355
Spring 2013 - Colbourn
i k j j i+k
cfw_a b c a b
: i,j,k
Theory of Computing
Midterm
CIS511
Introduction to the Theory of Computation
Formal Languages and Automata
Models of Computation
Jean Gallier
February 25, 2009
2
Chapter 1
Basics of Formal Language Theory
1.1
Generalities, Motivations, Problems
In this part of the course we want to
Solutions for Homework Six, CSE 355 1.
(8.1, 10 points) Let M be the Turing machine deded by B a b c q0 q1 ,B,R q1 q2 ,B,L q1 ,a,R q1 ,c,R q1 ,c,R q2 q2 ,c,L q2 ,b,L
a) Trace the computation for the input string aabca. b) Trace the computation for the inp
CSE 355 - Introduction to Theoretical Computer Science
Arizona State University - Spring 2014
G. Fainekos
Homework 2 - Due 2014.02.19 (at the beginning of class) - Total Points: 124
Instructions (read carefully):
1. You must submit BOTH electronically you
CSE 355 Introduction to theory of computation
Quiz 24
SOLUTION
Q1: Show that f1 (X) as dened below is not recursive/computable. (i.e., one can not have a
java/c/etc. program or even a Turing machine that can implement it)
f1 (X) = 1 if MX (X) = 0
= 0 if M
CSE 355 Introduction to theory of computation
Assignment 8 (100 pts)
SOLUTION
Problem 1: Given the propositional satisability (SAT) formula F = (p q r s) ( q r
p
s) ( q r s) ( q r s) transform it to a 3-SAT formula F such that F is satisable if and
p
p
CSE 355 Fall 2013
ASU G. Fainekos
Midterm I Solutions
Midterm Exam I Solutions
Instructions: This is a closed book, closed notes exam. You are only allowed to use your cheat sheet
(hand written), which you must submit with your exam at the end. Write your
Chapter 0
Terminology
Alphabet: A finite, nonempty set of objects called symbols
Argument: An input to a function
Binary relation: A relation whose domain is a set of pairs
Boolean operation: An operation on Boolean values
Boolean value: The values TRUE o
CSE 355
ASU G. Fainekos
Practice Midterm 1/01
Midterm Exam I/01
Instructions: This is a closed book, closed notes exam. You are only allowed to use your cheat sheet
(hand written), which you must submit with your exam at the end. Write your answers on the
Homework Assignment 1 Due on Tuesday, February 5
1
General introduction
There are 7 questions totalling 100 points. Answer all questions and submit
your answers by the beginning of the class on the due date.
2
2.1
Questions
(12pt)
Prove that 2 + 5 + . + (
Midterm 1 Review
CSE 355 Introduction to Theoretical Computer Science
Arizona State University
G eorgios Fainekos
General comment: You will be tested on Chapters 0, 1, 2.1, 2.2 (pages 111-116 Sipser Ed 3) and 2.4
(pages 130-131 Sipser Ed 3) from the textb
CSE 355
ASU G. Fainekos
Practice Midterm 1/01
Midterm Exam I/01 Solutions
Instructions: This is a closed book, closed notes exam. You are only allowed to use your cheat sheet
(hand written), which you must submit with your exam at the end. Write your answ
CSE 355
ASU G. Fainekos
Practice Midterm 1/02b
Midterm Exam I/02b
Instructions: This is a closed book, closed notes exam. You are only allowed to use your cheat sheet
(hand written), which you must submit with your exam at the end. Write your answers on t
CSE 355
ASU G. Fainekos
Practice Midterm 1/02b
Midterm Exam I/02b
Instructions: This is a closed book, closed notes exam. You are only allowed to use your cheat sheet
(hand written), which you must submit with your exam at the end. Write your answers on t
CSE 355 - Introduction to Theoretical Computer Science
Arizona State University - Fall 2013
G. Fainekos
Practice Problems for Midterm 2
1. L1 txM y | M is a TM and |LpM q| 3u.
Show that L1 is undecidable.
2. L2 txM y | M is a TM and |LpM q| Vu.
Show that
CSE 355 Introduction to theory of computation
Quiz 25
SOLUTION
Q1: Dene the class P.
A class problems that can be solved using a deterministic Turing machine in polynomial number
(in the size of the input) of transitions.
Q2: Dene the class NP. A class pr
CSE 355 Introduction to theory of computation
Notes on Turing Machines and Decidability
Quiz 23 Fill in the blank in item 7 below.
SOLUTION
1: Computation by a Turing machine (TM)
The partial function computed by a Turing machine M is dened as follows:
f
CSE 355 Introduction to theory of computation
Quiz 22
SOLUTION
Name :
ASU ID:
Q1: A Turing Machine is a 7-tuple M = (Q, , , , q0 , B, F ), where Q is a set of states, is a set of
tape symbols, is a set of input symbols, is a transition function from Q to
Modeling and Reasoning about Computation:
Theory and Applications of Automata, Languages, Undecidability,
BDD, SAT, and SMT Methods through Declarative Programming
Ganesh Gopalakrishnan and Tyler Sorensen
February 25, 2013
2
Contents
1 Introduction
1
2 A
CSE 355 Introduction to theory of computation
Assignment 7
SOLUTION
Problem 1 (25 pts) 1. (20 pts) Write a TM that increase a binary number by one. For example,
if input is 11 (binary representation of 3), then the output should be 100 (binary representat
CSE 355 Introduction to theory of computation
Assignment 5 (100 pts)
Due date: March 19, 2015 SOLUTION
Problem 1 (16*5 points) Find a CFG for each of the following languages:
1. L1 = cfw_w|w cfw_0, 1 , w has an odd length
S 0A|1A
A 0S|1S|
2. L2 = cfw_w|w
CSE 355 Introduction to theory of computation
Assignment 2 (100 pts)
SOLUTION
Problem 1 (15 pts) Given card(N) = card(N N). Show that card(N N) = card(N N N)
without making 3D pictures.
Since card(N) = card(N N), there exists a function f : N N N so that
CSE 355 Introduction to theory of computation
Assignment 4 (100 pts)
Problem 1 (50 pts) Write regular expressions for the following languages. In all parts, the
alphabet = cfw_0, 1.
1. cfw_w | w either begins or ends (or both) with 01
01(0 + 1)* + (0 + 1)
CSE 355 Introduction to theory of computation
Quiz 18
SOLUTION
Q1: Let P = (Q, , , , q0 , F ) be a Push Down Automata (PDA). Give the conditions when P is a
deterministic PDA. (By deterministic PDA we mean a PDA where at any situation there is at most
one
CSE 355 Introduction to theory of computation
Quiz 20
April 9th 2015
SOLUTION
Q1: Given two DFAs for L1 and L2 construct a DFA or an NFA or an -NFA for L1 L2 .
Let M1 = (Q1, 1 , 1 , q1 , F1 ) and M2 = (Q2, 2 , 2 , q2 , F2 ) recognize L1 and L2 respectivel
CSE 355 Introduction to theory of computation
Quiz 19
April 2nd 2015
SOLUTION
Q1: Fill in the blanks below to state the pumping lemma for Context Free Languages.
there exist
Let L be a context free language. Then
for all
w
can be
1. uv i xy i z
2. |vy|
3.
CSE 355 Introduction to theory of computation
Quiz 21
April 14th 2014
SOLUTION
Q1: A Turing Machine is a 7-tuple M = (Q, , , , q0 , B, F ), where Q is a set of states, is a set of
tape symbols, is a set of input symbols, is a transition function from Q to