Question: Why is the recurrence relation of recursive factorial algorithm this?

```
T(n)=1 for n=0
T(n)=1+T(n-1) for n>0

```

Why is it not this?

```
T(n)=1 for n=0
T(n)=n*T(n-1) for n>0

```

Putting values of n i.e 1,2,3,4...... the second recurrence relation holds(The factorials are correctly calculated) not the first one.

Answer: 
T(n) = T(n-1) + 1 is correct recurrence equation for factorial of n.
This equation gives you the time to compute factorial of n NOT value of the factorial of n.
TL;DR: The answer to your question actually depends on **what sequence** your recurrence relation is *defining*. That is, whether the sequence *Tn* in your question represents *the factorial function* or *the running-time cost of computing the factorial function*X.

---

### The factorial function

The *recursive* defintion of the factorial of *n*, *fn*, is:

*fn = n • fn-1* for *n > 0* with *f0 = 1*.

As you can see, the equation above is actually a *recurrence relation*, since it is an *equation* that, together with the *initial term* (i.e., *f0 = 1*), *recursively* defines a *sequence* (i.e., the factorial function, *fn*).

---

### Modelling the running-time cost of computing the factorial

Now, we are going to find a *model* for representing the running-time cost of computing the factorial of *n*. Let's call *Tn* the *running-time cost* of computing *fn*. 

Looking at the definition above of the factorial function *fn*, its running-time cost *Tn* will consist of the running-time cost of computing *fn-1* (i.e., this cost is *Tn-1*) plus the running-time cost of performing the multiplication between *n* and *fn-1*. The multiplication is achieved in constant time. Therefore we could say that *Tn = Tn-1 + 1*.

However, what is the value of *T0*? *T0* represents the running-time cost of computing *f0*. Since the value of *f0* is initially known by definition, the running-time cost for computing *f0* is actually constant. Therefore, we could say that *T0 = 1*.

Finally, what we obtain is:

*Tn = Tn-1 + 1* for *n > 0* with *T0 = 1*.

This equation above is also a *recurrence relation*. However, what it defines (together with the initial term), is a sequence that *models the running-time cost of computing the factorial function*. 

---

XTaking into account how the sequence in your recurrence relation is called (i.e., *Tn*), I think it very likely represents the latter, i.e., *the running-time cost of computing the factorial function*.