More Applications of The Pumping Lemma
1
The Pumping Lemma: For infinite contextfree language there exists an integer
for any string we can write
L
m
such that
w L,
 w m
w uvxyz
with lengths
 vxy  m and  vy  1
L, for all i 0
2
and i
Turing Machines
1
The Language Hierarchy
n n n?
abc
ww ?
ContextFree Languages
nn
R
ab
ww
Regular Languages
a*
a *b *
2
Languages accepted by
Turing Machines
ww
nnn
abc
ContextFree Languages
nn
R
ab
ww
Regular Languages
a*
a *b *
3
Tape
.
A Turing Machi
Variations
of the
Turing Machine
1
The Standard Model
Infinite Tape
aababbcac a
ReadWrite Head
(Left or Right)
Control Unit
Deterministic
2
Variations of the Standard Model
Turing machines with: StayOption
SemiInfinite Tape
OffLine
Multitape
Mult
A Universal Turing Machine
1
A limitation of Turing Machines:
Turing Machines are hardwired
they execute
only one program
Real Computers are reprogrammable
2
Solution:
Universal Turing Machine
Attributes:
Reprogrammable machine
Simulates any other Turi
Linear Bounded Automata
LBAs
1
Linear Bounded Automata (LBAs)
are the same as Turing Machines
with one difference:
The input string tape space
is the only tape space allowed to use
2
Linear Bounded Automaton (LBA)
Input string
[abcde]
Leftend
marker
Work
Undecidable problems
for
Recursively enumerable languages
continued
1
Take a recursively enumerable language L
Decision problems:
L is empty?
L is finite?
L contains two different strings
of the same length?
All these problems are undecidable
2
Theorem

V
4. Liq uid ammonia boils at 33.4oc (assume atmospheric pressure is 760 torr) , /
: 23.5 kJ/mol. what is th" ,l1gl_E.rIre of liquid ammonia at 50.0"()p_\
' tc>
(A) 759 torr
u1 '17 * \u
G) : l6 torr
and has a AHuo,
fi
+.ll x toro
(D)
1829 torr
,",s
Free Response Problems: Show all work for full cretlit, nonerasable ink must
be
used for work to be eligible for regrade. All numeric answers should have
units
where appropriate and the proper number of significant figures.
\rJg
(NIIroll)
'1.,A.but'fel.i
More Applications
of
The Pumping Lemma
1
The Pumping Lemma:
For infinite contextfree language
there exists an integer
m
w L,
for any string
L
such that
 w  m
we can write
w uvxyz
with lengths
 vxy  m and  vy  1
and it must be:
ii
uv xy z L,
for all
The Pumping Lemma
for
ContextFree Languages
1
Take an infinite contextfree language
Generates an infinite number
of different strings
Example:
S AB
A aBb
B Sb
Bb
2
S AB
A aBb
B Sb
Bb
In a derivation of a long string,
variables are repeated
A derivation:
CSCI 2400  Models of Computation
Exam 1 Solutions
Problem 1 (10 points) Prove that for any integer n 4, 2n n 2 . Solution: Using mathematical induction, Base Case: n = 4 24 = 16 42
Inductive hypothesis: Assume that 2k k 2 for some k 4. Induc
CSCI 2400  Models of Computation
Homework 1 Solutions
Problem 1 (25 points) Prove that if A and B are languages over the same alphabet and A B, then A B . Solution: We will prove by mathematical induction that Ak Bk , for all k 0. Base case:
Robert L. Anderson CSCI 240001 1. L ab n a : n 0 NFA: b q0 to DFA: b
{q0}
2/7/2008 HW2
a
q1
a
q2
( q 0 , a ) q1 (q 0 , b)
a a,b
{q2}
a b a,b
{q1}
( q1 , a ) q 2 ( q1 , b) q1 (q 2 , a ) (q 2 , b)
2. Define: second(
CSCI 2400  Models of Computation
Homework 3 Solutions
Problem 1 (25 points) Give a regular expression that describes the following language: L = {an bm : n + m = 3k, k 0}. Solution: (aaa) (aab + abb + ) (bbb) Problem 2 (75 = 5x15 points) Show that
CSCI2400
Models of Computation
1
Computation
CPU
memory
2
temporary memory
input memory
CPU
output memory
Program memory
3
Example:
f ( x) x
3
temporary memory
input memory
CPU
output memory
Program memory
compute
xx
compute
x x
2
4
f ( x) x
temporary me
Mathematical Preliminaries
1
Mathematical Preliminaries
Sets
Functions
Relations
Graphs
Proof Techniques
2
SETS
A set is a collection of elements
A cfw_1, 2, 3
B cfw_train, bus, bicycle, airplane
We write
1 A
ship B
3
Set Representations
C = cfw_ a,
Finite Automata
1
Finite Automaton
Input
String
Finite
Automaton
Output
Accept
or
Reject
2
Transition Graph
a, b
q5
b
q0 a
a
a
b
q1 b q2 b q3 a
initial
state
state
transition
a, b
q4
accepting
state
3
Initial Configuration
abba
Input String
a, b
q5
b
q0 a
Pushdown Automata
PDAs
1
Pushdown Automaton  PDA
Input String
Stack
States
2
Initial Stack Symbol
Stack
stack
head
Stack
$
z
top
bottom special symbol
Appears at time 0
3
The States
Pop
symbol
Input
symbol
q1
a, b c
Push
symbol
q2
4
q1
a, b c
q2
input
a
PDAs Accept
ContextFree Languages
1
Theorem:
ContextFree
Languages
(Grammars)
Languages
Accepted by
PDAs
2
Proof  Step 1:
ContextFree
Languages
(Grammars)
Languages
Accepted by
PDAs
Convert any contextfree grammar G
to a PDA M with: L(G ) L( M )
3
Pr
Some Common Combinational
Circuits
MUX (Multiplexor)
Decoder
Adder
Combinational Circuits
1
Some commonly used components
Decoders: n inputs, 2n outputs.
the inputs are used to select which output is
turned on. At any time exactly one output is on.
Mul