BIT152 ยท 2082 ยท 5 marks
Prove the correctness of following recursive algorithm for computing an using induction. ``` Power(a, n) { if (n = 0) return 1; else return a * Power(a, n-1); } ```
Prove the correctness of following recursive algorithm for computing $a^n$ using induction.
Power(a, n)
{
if (n = 0) return 1;
else return a * Power(a, n-1);
}
[5]
Discrete StructureChapter 2: Proof TechniquesProving correctness of recursive algorithms