Chapter 5: Q33E (page 359)
(a) Give a recursive definition of the function m(S) , which equals the smallest digit in a nonempty string of decimal digits.
(b) Use structural induction to prove that .
Chapter 5: Q33E (page 359)
(a) Give a recursive definition of the function m(S) , which equals the smallest digit in a nonempty string of decimal digits.
(b) Use structural induction to prove that .
All the tools & learning materials you need for study success - in one app.
Get started for freeDevise a recursive algorithm for computing the greatest common divisor of two nonnegative integers a and b with using the fact that gcd (a,b) = gcd (a,b - a) .
The well-ordering property can be used to show that there is a unique greatest common divisor of two positive integers. Let a and be positive integers, and let S be the set of positive integers of the form , where s and t are integers.
a) Show that s is nonempty.
b) Use the well-ordering property to show that s has a smallest element .
c) Show that if d is a common divisor of a and b, then d is a divisor of c.
d) Show that c I a and c I b. [Hint: First, assume that . Then , where . Show that , contradicting the choice of c.]
e) Conclude from (c) and (d) that the greatest common divisor of a and b exists. Finish the proof by showing that this greatest common divisor is unique.
Trace Algorithm 3 when it finds gcd (12,17) . That is, show all the steps used by Algorithm 3 to find gcd (12,17).
A stable assignment, defined in the preamble to Exercise 60 in Section 3.1, is called optimal for suitors if no stable assignment exists in which a suitor is paired with a suitee whom this suitor prefers to the person to whom this suitor is paired in this stable assignment. Use strong induction to show that the deferred acceptance algorithm produces a stable assignment that is optimal for suitors.
Prove that a set with n elements has subsets containing exactly two elements whenever n is an integer greater than or equal to 2.
What do you think about this solution?
We value your feedback to improve our textbook solutions.