This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: Bounded Minimization 1
f(x) = µ z (z ≤ x) [ P(z) ] if
such a z,
= x+1, otherwise
where P(z) is primitive recursive.
Can show f is primitive recursive by
f(0) = 1P(0)
f(x+1) = f(x)
if f(x) ≤ x
= x+2P(x+1) otherwise
Dec 2,
10/4/11 © UCF (Charles E. 11 Bounded Minimization 2
f(x) = µ z (z < x) [ P(z) ] if such a z,
= x, otherwise
where P(z) is primitive recursive.
Can show f is primitive recursive by
f(0) = 0
f(x+1) = µ z (z ≤ x) [ P(z) ] Dec 2,
10/4/11 © UCF (Charles E. 22 Intermediate Arithmetic
x // y:
x//0 = 0
: silly, but want a value
x//(y+1) = µ z (z<x) [ (z+1)*(y+1) >
x]
x  y: x is a divisor of y
xy = ((y//x) * x) == y Dec 2,
10/4/11 © UCF (Charles E. 33 Primality
firstFactor(x): first nonzero, nonone factor of x.
µ z (2 ≤ z ≤ x) [ zx ] , firstfactor(x) =
0 if none
isPrime(x): isPrime(x) = firstFactor(x) == x && (x>1)
prime(i) = ith prime:
prime(0) = 2
prime(x+1) = µ z(prime(x)< z ≤prime(x)!+1)
Dec 2,
10/4/11 © UCF (Charles E. 44 Exponents
x^y:
x^0 = 1
x^(y+1) = x * x^y
exp(x,i): the exponent of pi in number
x.
exp(x,i) = µ z (z<x) [ ~(pi^(z+1) 
x) ]
Dec 2,
10/4/11 © UCF (Charles E. 55 Pairing Functions
• • pair(x,y) = <x,y> = 2x (2y + 1) – 1
with inverses
<z>1 = exp(z+1,0) <z>2 = ((( z + 1 ) // 2 <z>1 ) – 1 ) // 2
•
These are very useful and can be
extended to encode ntuples
<x,y,z> = <x, <y,z> > (note: stack
analogy)
Dec 2,
10/4/11 © UCF (Charles E. 66 Assignment # 3
Show that prfs are closed under mutual
recursion. That is, assuming F1, F2 and
G1 and G2 are pr, show that H1 and H2
are, where
H1(0, x) = F1(x); H2(0, x) = F2(x)
H1(y+1, x) = G1(y,x,H2(y,x)); H2(y+1, x)
= G2(y,x,H1(y,x))
Hint: The pairing function is useful here. Due: September 17
Dec 2,
10/4/11 © UCF (Charles E. 77 ...
View
Full
Document
This note was uploaded on 10/03/2011 for the course COT 5310 taught by Professor Staff during the Spring '08 term at University of Central Florida.
 Spring '08
 Staff

Click to edit the document details