
So how can we fix this problem? Well, the first thing

we should think about is, well, can we give a base case.

All right. All of the recursive definitions we had. We had a

way of stopping. So, we had a base case. Right. With, factorial,

we said, we are going to predefine, that we know the value

of factorial when the input is 0. We know that the value

is 1. We are not going to define it, in terms of factorial.

We are going to note it's value. We did this for palindrome we

said, palindrome, we have a base case, when the input

string is an empty string, it's predefined as a palindrome We

don't have to do anything else. And we did this

for fibonacci, where we had two bases cases? But for all

these definitions, we had some starting point, that was not

defined in terms of thing we are defining. And that's why

it was good recursive definition, because we had the base case.

We don't have one here. So let's try to invent one.

Let's suppose that we made our base case. So if

we're going to fix this, what we need to do

is invent a base case. Maybe that will solve our

problem. So let's try and add a base case. So.

Suppose we assume we know the popularity of Alice and

sadly Alice is not very popular. Her popularity score is

a 1. So that looks like a base case, right

we define the base case for factorial for 0 for palindrome

for space. Let's pick Alice as our base case

now. And. That works like this for the mathematical

definition. For the python code, what we would need

to do is add the base case, as in a

statement. So we would insert a line here that

says that if p is Alice, return Alice's popularity

score which is our base case which is 1.

So this looks more like the recursive definitions we've seen.

Now we have a question. See if this

actually works. So the question is, would this definition

work? The possible answers are, only if everyone

is friends with Alice, only if no one is

friends with Alice, only if, from every person

in the network,. There's some way that you can

follow links that eventually reaches Alice. Only if there

are no cycles in the graph. So there's no

way to start from one person and end

up at the same person by following friendship's, by

following friendship links. And the final choice is no,

that there's really no situation where this works well.