Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

only P4.6.8 part a) needs to be solved. Thank you P4.6.7 (uses Java) In this problem we recursively define two more binary operators on naturals.

only P4.6.8 part a) needs to be solved. Thank you

image text in transcribed
P4.6.7 (uses Java) In this problem we recursively define two more binary operators on naturals. Each operation is defined only if the second argument is nonzero. We define R(0, y) to be 0, and define R(S(x), y) to be S(R(x, y) ) unless S(R(x, y)) = y, in which case R(Sx, y) = 0. We define Q(0, x) to be 0, and define Q(Sx, y) to be Q(x, y) unless R(Sx, y) = 0, in which case Q(Sx, y) = S(Q(x, y)). (a) Write recursive static pseudo-Java methods natural r(natural x, natural y) and natural q(natural x, natural y) to compute these two operations. (b) Compute the values Q(5, 2) and R(5, 2), either using your method or working directly with the definitions. P4.6.8 Using the definition of the operators R and Q in Problem 4.6.7, prove the following facts by induction for any fixed positive natural y. (a For any natural x, y(Q(x, y)) + R(x, y) = x. (b) For any natural z, Q(zy, y) = z and R(zy, y) = 0. (c) If x is any fixed positive natural, then for natural z, Q(Q(zxy, x), y) = Q(Q(zxy, y), x)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional Android 4 Application Development

Authors: Reto Meier

3rd Edition

1118223853, 9781118223857

More Books