00:01
Hello and welcome.
00:02
We are looking at chapter 5, section 4, problem 17.
00:10
That's where i started to make a recursive algorithm based on this fact that if you're multiplying two non -negative integers, we have these two cases here.
00:25
X times y over two.
00:30
So that's pretty self -explanatory.
00:33
When y is even and when y is odd this is the more interesting one we have x times y equals two times x times four function plus x all right so this is the more interesting one uh so we want to define our procedure we'll call it product it'll take two non -negative integers x and y and then we have to check.
01:33
Once we're given our x and y, we need to ask yourself, is y even or odd? so if y is even, then we can simplify it.
01:50
We can take x times y, and we can rewrite it as this right here, which is two times the product of x times y, sorry, getting ahead of myself, the product of x and y over two.
02:19
So y, you notice, is the thing i'm chipping away at the thing i'm decreasing.
02:29
So maybe we should actually make this the second statement, because we got to have our kind of base case.
02:35
I notice in the question mentions an initial case...