how the contribution in this is equal to x*y. can you please explain this approach?
Sum of all submatrix from a given Matrix Approach 3
hello @rahul_bansal
we need to find (i,j) will be part of how manu sumatrix .
so if we pick any cell from upper left part of (i,j) and treat it as upper left corner of matrix
and similary pick any cell from bottom right part of (i,j) and treat as bottom right.
these two corner can form a unique matrix and will contain (i,j)
hence we are having formula (i+1)(j+1) for upper left
and (n-i)(m-j) for bottom right corner
multiplication of both will give all possible matrices that contain (i,j)
1 Why we take 2 unique matrices if Top right matrix already contains the element.
2 Also from where (i+1)(j+1) for upper left and (n-i)(m-j) for bottom right corner this formula come.
Can you please this approach more briefly?
pls once rewatch the video , both the things are already explained
Actually I am not getting what actually what he wants to say thatswhy I ask in doubt section?
how many cells will be their on the top left of (i,j) ?
ok I got it how for TL matrix (i+1)(j+1) and BR (n-i)(m-j) comes but a little doubt why we are not taking a single matrix instead of 2 which contains i,j element?
not two matrix, these two are the regions from where we can pick corners of matrix.
we pick one cell from region 1 and another cell from region 2 and they will collectively form a mtrix
Ohh okay Got it. Thanks!!!
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.
I do not understand this part.
my question
how will it give all possible sub-matrices that contain (I,j)?
I just need a more elaborate explanation to understand the concept
@abdulajaz20
if there are n1 ways to achieve task1 and n2 ways to do task2 then total how many ways are there do both the task?