Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Which one of the following gives a recursive algorithm for computing na, where n

ID: 3421615 • Letter: W

Question

Which one of the following gives a recursive algorithm for computing na, where n is a positive integer and a is a real
number?


procedure mult(a: real number, n: positive integer)
if n = 1 then mult(a, n) := a
else mult(a, n) := a + mult(a, n + 1)


procedure mult(a: real number, n: positive integer)
mult(a, n) := a + mult(a, n - 1)


procedure mult(a: real number, n: positive integer)
if n = 1 then mult(a, n) := a
else mult(a, n) := a + mult(a, n - 1)


procedure mult(a: real number, n: positive integer)
if n = 1 then mult(a, n) := a
else mult(a, n) := a + mult(a, n)

This is a Discrete math question

Explanation / Answer

Option C is the correct answer choice. The correct answer is :

procedure mult(a: real number, n: positive integer)

if n = 1 then mult(a, n) := a

else mult(a, n) := a + mult(a, n - 1)

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote