




























































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





























































































Recursive Definition: int factorial(int N) { if (N == 0) return 1; return N*factorial(N-1); } Where precisely was the inductive hypothesis used?
Recursive Definition: int factorial(int N) { if (N == 0) return 1; return N*factorial(N-1); } Where precisely was the inductive hypothesis used? In substituting K! for factorial(K).
int puzzle(int N) { if (N == 1) return 1; if (N % 2 == 0) return puzzle(N/2); else return puzzle(3*N+1); }
int puzzle(int N) { if (N == 1) return 1; if (N % 2 == 0) return puzzle(N/2); else return puzzle(3*N+1); }