Question: Problem 3 : ( 1 5 points ) One question computer scientists often ask is , Is the algorithm correct? Consider proving the correctness the
Problem : points One question computer scientists often ask isIs the
algorithm correct? Consider proving the correctness the following algorithm:
def factn:
if n :
return
else:
return n factn
Let P n be defined as: factn n
a Correctness of factn: Prove that P n is true for all n in N
b Write a recursive algorithm similar to factn that calculates nn
c Prove that n nn for all n in N
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
