00:01
Hello and welcome.
00:01
We are looking at chapter 5, section 4, problem 12.
00:07
And we're being asked to devise a recursive algorithm for finding x to the end mod m.
00:19
So we have three variables, x, n, and m.
00:23
And we're given the fact that this equals x to the n minus one mod m times x mod m so this looked kind of familiar to what we were working with for problems four and five i believe or maybe it was five and six but so if we want to use this uh let's start by building our naming our procedure so we can call it modulo and then we can look at our variables so let me put it as in the same order as they give it so we'll do n xm and in problem 12, the restriction is, i think they use like a semicolon or something.
01:28
They are positive integers.
01:31
So we'll just say positive ints.
01:37
All right.
01:37
So the thing that's being decreased, kind of the thing that we're iterating over recursively is n.
01:46
And is going from n to n minus one.
01:48
Everything else is really static around it...