Respuesta :
Answer:
Explanation:
Let's use python for this:
recursive_exponent(n, r):
if n == 0:
return 1
else:
return r*recursive_exponent(n - 0.5, r)
To use this function, simply call it:
print(recursive_exponent(n, r))
The way it works is that n would start from top, and for each step it would get reduced by 0.5 until it gets to 0. Hence there will be 2n steps. At each step, r gets multiplied by itself. In the end r will multiplied by itself 2n times. Therefore, [tex]r^{2n}[/tex]
Recursions are simply functions that calls itself.
The recursive algorithm, where comments are used to explain each line is as follows:
#This defines the function
recursive_algorithm(r, n):
#If n is negative, this returns 0
if n<0:
return 0
#If n is 0, this returns 1
elif n == 0:
return 1
#For every other value of n, this calculates the exponent [tex]\mathbf{r^{2n}}[/tex], recursively.
else:
return r*recursive_algorithm(r,n - 0.5)
The above recursion does not use loops or iterations.
Read more about recursive algorithm at:
https://brainly.com/question/16027903