Didn't undeerstanfd the recurrence relation

why do we add the third term ie the dimensions a[r]*a[k+1]*a[y+1].

Hey
You add this to add the cose of multiplying the two submatrices together

I didn’t understand why is it done.I mean what’s the significance

Now this happens because at every step you’re breaking the problem into sub-parts, that is you’re breaking the current sequence of matrices into two small sequences at every step,
so for the ans of that particulae step, you’ll have to add three things, one- cost of multiplication of matrices in the first sequence among themselves, two- cost of multiplication of matrices in the second sequence among themselves, three- cost of multiplication of the two small sequences with each other, now this third thing is what the third term is!!

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.