theory of computation: lecture 11
DESCRIPTION
1) Showing functions to be primitive recursive 2) Primitive recursive predicates 3) Computable predicates 4) Compound predicates 5) Class home page is at http://vkedco.blogspot.com/2011/08/theory-of-computation-home.htmlTRANSCRIPT
![Page 1: Theory of Computation: Lecture 11](https://reader035.vdocuments.us/reader035/viewer/2022081404/55936fe11a28ab015c8b466e/html5/thumbnails/1.jpg)
CS 5000: Theory of Computation
Lecture 11
Vladimir KulyukinDepartment of Computer Science
Utah State University
![Page 2: Theory of Computation: Lecture 11](https://reader035.vdocuments.us/reader035/viewer/2022081404/55936fe11a28ab015c8b466e/html5/thumbnails/2.jpg)
Outline● Review● More Examples of Showing Functions to be Primitive
Recursive● Primitive Recursive Predicates● Compound Predicates
![Page 3: Theory of Computation: Lecture 11](https://reader035.vdocuments.us/reader035/viewer/2022081404/55936fe11a28ab015c8b466e/html5/thumbnails/3.jpg)
Review
![Page 4: Theory of Computation: Lecture 11](https://reader035.vdocuments.us/reader035/viewer/2022081404/55936fe11a28ab015c8b466e/html5/thumbnails/4.jpg)
Review: X! is Primitive Recursive
( ) ( )( )
( ) ( )( )
( ) ( )( ) ( )212221
2121 ,,,
where,,1
0
xxuxxusxxg
xhxgxh
xnsh
⋅=
=+
=
![Page 5: Theory of Computation: Lecture 11](https://reader035.vdocuments.us/reader035/viewer/2022081404/55936fe11a28ab015c8b466e/html5/thumbnails/5.jpg)
More Examples of Showing Functions to be Primitive Recursive
![Page 6: Theory of Computation: Lecture 11](https://reader035.vdocuments.us/reader035/viewer/2022081404/55936fe11a28ab015c8b466e/html5/thumbnails/6.jpg)
Example 1
Show that xy is primitive recursive.
![Page 7: Theory of Computation: Lecture 11](https://reader035.vdocuments.us/reader035/viewer/2022081404/55936fe11a28ab015c8b466e/html5/thumbnails/7.jpg)
Example 1
( )( ) xxxyxf
xxfyy ⋅==+
==+ 1
0
1,10,
![Page 8: Theory of Computation: Lecture 11](https://reader035.vdocuments.us/reader035/viewer/2022081404/55936fe11a28ab015c8b466e/html5/thumbnails/8.jpg)
Example 1
( ) ( ) ( )( )
( ) ( ) ( )( )( ) ( ) ( )321
33321
32321 ,,,,,, where
,,,,1, becomes 1,:Case cursiveRe
0, becomes 00,:Case Base
xxxuxxxuxxxgxyxhygyxhyxf
xnsxhxf
⋅==++
==
![Page 9: Theory of Computation: Lecture 11](https://reader035.vdocuments.us/reader035/viewer/2022081404/55936fe11a28ab015c8b466e/html5/thumbnails/9.jpg)
Example 1: Checking Our Solution
( ) ( )( )
( ) ( )( ) ( )( ) ( )( )( )
( ) ( )( ) ( )( ) ( )( )( ) 2
33
32
33
32
1,
,1,,1,1,,1,1,,111,
10,,0,,0,0,,0,0,,010,
10,
xxxxxhxxhuxxhuxxhgxh
xxxxhxxhuxxhuxxhgxh
xnsxh
=⋅=⋅
=⋅==+
=⋅=⋅=⋅==+
==
![Page 10: Theory of Computation: Lecture 11](https://reader035.vdocuments.us/reader035/viewer/2022081404/55936fe11a28ab015c8b466e/html5/thumbnails/10.jpg)
Example 2
( ) 1 if 10 if 0
:recursive primitive isfunction r predecesso that theShow
>−=
=xxx
xp
![Page 11: Theory of Computation: Lecture 11](https://reader035.vdocuments.us/reader035/viewer/2022081404/55936fe11a28ab015c8b466e/html5/thumbnails/11.jpg)
Example 2
( )( )
( )( ) ( )( )( ) ( ) ,,
where,,100
:derivation Formal
100
:insight Informal
212121 xxuxxgthtgth
h
ttpp
==+
=
=+=
![Page 12: Theory of Computation: Lecture 11](https://reader035.vdocuments.us/reader035/viewer/2022081404/55936fe11a28ab015c8b466e/html5/thumbnails/12.jpg)
Example 3
( )
( ) ( )
( ) ( )
( )( )xppxpp
xpxpx
xpxpx
yxpyx
xx
=
−
=
+−=
−=+−
=
−=+−
−=+−
=−
•
•••
••
••
•
0
10111
010
1
0
recursive primitive isfunction minusdot that theShow
![Page 13: Theory of Computation: Lecture 11](https://reader035.vdocuments.us/reader035/viewer/2022081404/55936fe11a28ab015c8b466e/html5/thumbnails/13.jpg)
Example 3
( )( )( ) ( )( ) ( )
( ) 230313
0012
02122232
==
−=−
===
=
−=
−=
−=−
••
••••
pp
pppppp
pppppp
![Page 14: Theory of Computation: Lecture 11](https://reader035.vdocuments.us/reader035/viewer/2022081404/55936fe11a28ab015c8b466e/html5/thumbnails/14.jpg)
Example 4
Show that |x-y| is primitive recursive
![Page 15: Theory of Computation: Lecture 11](https://reader035.vdocuments.us/reader035/viewer/2022081404/55936fe11a28ab015c8b466e/html5/thumbnails/15.jpg)
Example 4
−+
−=−
−
+
••
•
xyyxyx3.
recursive primitive is .2
recursive primitive is .1
![Page 16: Theory of Computation: Lecture 11](https://reader035.vdocuments.us/reader035/viewer/2022081404/55936fe11a28ab015c8b466e/html5/thumbnails/16.jpg)
Primitive Recursive Predicates
![Page 17: Theory of Computation: Lecture 11](https://reader035.vdocuments.us/reader035/viewer/2022081404/55936fe11a28ab015c8b466e/html5/thumbnails/17.jpg)
Example 5
≠=
=0 if 00 if 1
)(
recursive primitive is )( that Show
xx
x
x
α
α
![Page 18: Theory of Computation: Lecture 11](https://reader035.vdocuments.us/reader035/viewer/2022081404/55936fe11a28ab015c8b466e/html5/thumbnails/18.jpg)
Example 5
( )( ) ( )( ) ( ) ( )121 , where,,1
10:srecurrence Formal
0)1(1)0(
:srecurrence Informal
xnxxgthtgthh
t
==+=
=+=
αα
![Page 19: Theory of Computation: Lecture 11](https://reader035.vdocuments.us/reader035/viewer/2022081404/55936fe11a28ab015c8b466e/html5/thumbnails/19.jpg)
Motivation● Predicates are Boolean-valued functions
– 1 is TRUE– 0 is FALSE
● Since predicates are functions, it makes sense for us to ask which predicates are primitive recursive
● It makes sense for us to build a repository of primitive recursive predicates
![Page 20: Theory of Computation: Lecture 11](https://reader035.vdocuments.us/reader035/viewer/2022081404/55936fe11a28ab015c8b466e/html5/thumbnails/20.jpg)
Example 6
xx•−= 1)(
:solutionelegant moreA
α
![Page 21: Theory of Computation: Lecture 11](https://reader035.vdocuments.us/reader035/viewer/2022081404/55936fe11a28ab015c8b466e/html5/thumbnails/21.jpg)
Primitive Recursive Predicate 1
Show that x = y is primitive recursive.
![Page 22: Theory of Computation: Lecture 11](https://reader035.vdocuments.us/reader035/viewer/2022081404/55936fe11a28ab015c8b466e/html5/thumbnails/22.jpg)
Primitive Recursive Predicate 1
( )
≠=
=yxyx
yxd if 0 if 1
,
![Page 23: Theory of Computation: Lecture 11](https://reader035.vdocuments.us/reader035/viewer/2022081404/55936fe11a28ab015c8b466e/html5/thumbnails/23.jpg)
Primitive Recursive Predicate 1
( )( ) ( )||,
because recursive, primitive is ,yxyxd
yxd−= α
![Page 24: Theory of Computation: Lecture 11](https://reader035.vdocuments.us/reader035/viewer/2022081404/55936fe11a28ab015c8b466e/html5/thumbnails/24.jpg)
Primitive Recursive Predicate 2
Show that x ≤ y is primitive recursive
![Page 25: Theory of Computation: Lecture 11](https://reader035.vdocuments.us/reader035/viewer/2022081404/55936fe11a28ab015c8b466e/html5/thumbnails/25.jpg)
Primitive Recursive Predicate 2
( ) 1 ifonly and if 0 ifonly and if
=−=−
≤
yxyxyx
α
![Page 26: Theory of Computation: Lecture 11](https://reader035.vdocuments.us/reader035/viewer/2022081404/55936fe11a28ab015c8b466e/html5/thumbnails/26.jpg)
Theorem 5.1 (Ch. 3): Compound Predicates
.& and ,, are so then, tobelong that predicates
are , If class. PRC a be Let
QPQPPCQPC
∨¬
![Page 27: Theory of Computation: Lecture 11](https://reader035.vdocuments.us/reader035/viewer/2022081404/55936fe11a28ab015c8b466e/html5/thumbnails/27.jpg)
Proof 5.1 (Ch. 3)
( )
( )QPQPQPQP
PP
¬∧¬¬=∨⋅=∧
=¬
.3 .2 .1 α
![Page 28: Theory of Computation: Lecture 11](https://reader035.vdocuments.us/reader035/viewer/2022081404/55936fe11a28ab015c8b466e/html5/thumbnails/28.jpg)
Theorem 5.1 (Ch. 3): Corollaries
● Recall that we have shown that the classes of primitive recursive and computable functions are primitive recursively closed
● Theorem 5.1 furnishes us with two important corollaries that help us reason about computational properties of compound predicates
![Page 29: Theory of Computation: Lecture 11](https://reader035.vdocuments.us/reader035/viewer/2022081404/55936fe11a28ab015c8b466e/html5/thumbnails/29.jpg)
Corollary 5.2 (Ch. 3)
class. PRC a are functions recursive primitive because True,:Proof
.,, are so then ,predicates recursive primitive are and If :Claim
QPQPPQP
∨∧¬
![Page 30: Theory of Computation: Lecture 11](https://reader035.vdocuments.us/reader035/viewer/2022081404/55936fe11a28ab015c8b466e/html5/thumbnails/30.jpg)
Corollary 5.3 (Ch. 3)
class. PRC a are functions computable because True,:Proof
.,, are so then ,predicates computable are and If:Claim
QPQPPQP
∨∧¬
![Page 31: Theory of Computation: Lecture 11](https://reader035.vdocuments.us/reader035/viewer/2022081404/55936fe11a28ab015c8b466e/html5/thumbnails/31.jpg)
Primitive Recursive Predicate 3
recursive primitive is that Show yx <
![Page 32: Theory of Computation: Lecture 11](https://reader035.vdocuments.us/reader035/viewer/2022081404/55936fe11a28ab015c8b466e/html5/thumbnails/32.jpg)
Primitive Recursive Predicate 3
( )xyyx ≤¬< as same theis
![Page 33: Theory of Computation: Lecture 11](https://reader035.vdocuments.us/reader035/viewer/2022081404/55936fe11a28ab015c8b466e/html5/thumbnails/33.jpg)
Theorem 5.4 (Ch. 3): Definition by Cases
( ) ( ) ( )( )
( ) .,...,Then
otherwise. ,...,,..., if ,...,
,...,
Let . tobelong predicate theand , ,functions Let the class. PRC a be Let
1
1
111
Cxxf
xxhxxPxxg
xxf
CPhgC
n
n
nnn
∈
=
![Page 34: Theory of Computation: Lecture 11](https://reader035.vdocuments.us/reader035/viewer/2022081404/55936fe11a28ab015c8b466e/html5/thumbnails/34.jpg)
Proof 5.4 (Ch. 3)
( ) ( ) ( )( ) ( )( )nn
nnn
xxPxxhxxPxxgxxf
,...,,..., ,...,,...,,...,
11
111
α⋅+⋅=
![Page 35: Theory of Computation: Lecture 11](https://reader035.vdocuments.us/reader035/viewer/2022081404/55936fe11a28ab015c8b466e/html5/thumbnails/35.jpg)
Reading Suggestions
● Ch. 3, Computability, Complexity, and Languages, 2nd Edition, by Davis, Weyuker, Sigal