Problem 1: The Mysterious Function We have come through an old interesting function whose pseudo-code was defined as follows: Algorithm 1 MYSTERIOUS-FUNCTION(n) Require: n E Z An 350 then return n –...


Problem 1: The Mysterious Function<br>We have come through an old interesting function whose pseudo-code was defined as<br>follows:<br>Algorithm 1 MYSTERIOUS-FUNCTION(n)<br>Require: n E Z An< 350<br>if n > 350 then<br>return n – 47<br>else<br>return MYSTERIOUS-FUNCTION(MYSTERIOUS-FUNCTION(n + 48))<br>end if<br>a) Implement the an or.chm in Python<br>b) Try various inpi ts, with the valid range n < 350, what have you noticed of the<br>output?<br>Prove your thoughts, hypothesis, in part (b)<br>[Hint: use your implementation to prove a property of the output at a particular<br>input along with inductive scheme]<br>d) Empirically, show the performance curve of the algorithm using time measurements<br>

Extracted text: Problem 1: The Mysterious Function We have come through an old interesting function whose pseudo-code was defined as follows: Algorithm 1 MYSTERIOUS-FUNCTION(n) Require: n E Z An< 350="" if="" n=""> 350 then return n – 47 else return MYSTERIOUS-FUNCTION(MYSTERIOUS-FUNCTION(n + 48)) end if a) Implement the an or.chm in Python b) Try various inpi ts, with the valid range n < 350,="" what="" have="" you="" noticed="" of="" the="" output?="" prove="" your="" thoughts,="" hypothesis,="" in="" part="" (b)="" [hint:="" use="" your="" implementation="" to="" prove="" a="" property="" of="" the="" output="" at="" a="" particular="" input="" along="" with="" inductive="" scheme]="" d)="" empirically,="" show="" the="" performance="" curve="" of="" the="" algorithm="" using="" time="">

Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here