Question: Please Answers this 1-1. [3] Show that a + b can be less than min(a, b). (Assume that min(a,b) is a function that returns the
Please Answers this
1-1. [3] Show that a + b can be less than min(a, b). (Assume that min(a,b) is a function that returns the smaller of two integer values a and b)
- Present your answer as a proof with three elements:
- Statement:
- Assumptions:
- Chain of Reasoning:
- End with the statement Q.E.D. Thus, it is demonstrated.
1-3. [5] Design/draw a road network with two points a and b such that the fastest route between a and b is not the shortest route. (Your drawing can be by hand or on the computer - use Figures 1.2 and 1.3 from The Algorithm Design Manual as models.)
Proofs of Correctness
1-7. [3] Prove the correctness of the following recursive algorithm to multiply two natural numbers, for all integer constants c 2. (Same proof rules as question 1-1). Show your work as needed.
functionmultiply(y, z) comment Return the product yz. 1. if z = 0 then return(0) else 2. return(multiply(cy, z/c) + y (z mod c))
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
