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


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< 222<br>if n 2 222 then<br>return n โ€“ 14<br>else<br>return MYSTERIOUS-FUNCTION(MYSTERIOUS-FUNCTION(n + 15))<br>end if<br>a) Implement the algorithm in Python<br>b) Try various inputs, within the valid range n < 222, what have you noticed of the<br>output?<br>c) 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< 222="" if="" n="" 2="" 222="" then="" return="" n="" โ€“="" 14="" else="" return="" mysterious-function(mysterious-function(n="" +="" 15))="" end="" if="" a)="" implement="" the="" algorithm="" in="" python="" b)="" try="" various="" inputs,="" within="" the="" valid="" range="" n="">< 222,="" what="" have="" you="" noticed="" of="" the="" output?="" c)="" 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 06, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions ยป

Submit New Assignment

Copy and Paste Your Assignment Here