Skip to player
Skip to main content
Skip to footer
Search
Connect
Watch fullscreen
Like
Comments
Bookmark
Share
Add to Playlist
Report
Learn Programming Technique C to Master Skills - Program of Multiplication of two Matrices ( Continue ...)
Tutorials Arena
Follow
10/20/2024
Category
š
Learning
Transcript
Display full video transcript
00:00
Hi, today I am going to explain this 9th one program that is multiplication of 2 by 2 matrix.
00:10
So how multiplication of 2 by 2 matrix take place, how one matrix is multiplied with another
00:18
one and then how the resulted value is going to store inside the third matrix that I am
00:25
going to explain, this 9th one multiplication of 2 by 2 matrix.
00:33
So first of all I am going to explain this program in a diagrammatical formation then
00:40
I am going to implement the same program in C. So let us understand how multiplication
00:46
will take place, what is the methodology, how the multiplication of 2 matrices take
00:53
place and the resulted value stored inside the third one.
00:58
So here is the diagrammatical approach to understand the multiplication of 2 matrices.
01:07
This is the first array, first 2 dimensional array A which is having 2 rows and 2 columns,
01:16
this is the second one by the name of B which is also having 2 rows and 2 columns.
01:23
Now what is the procedure, what is the method, how multiplication take place, let us understand.
01:29
The first row of first matrix that is of A matrix is going to multiplied with the first
01:41
column of second matrix that is of B matrix.
01:48
The first row is going to multiply with the first column of second matrix and the sum
02:02
of it whatever the sum of it that will be going to store inside the third matrix that
02:10
is in the C matrix in which location 0 row 0 column.
02:16
Let us see when I multiply the first row of A matrix with the first column of B matrix
02:25
what will happen, 20 is multiplied with 2 that is 20 into 240 then 10 is multiplied
02:35
with 1 so 10 into 1 that is 10 and then submission will take place.
02:41
If you see here I am indicating that is 40 plus 10 that will be what 50, so this resulted
02:48
value is going to store inside the third matrix that is in the C matrix 0 row 0 column okay
02:57
that is shifted here and the first row this first row of first matrix that is of A matrix
03:05
is going to multiply with the second column of B matrix okay so 20 into 120 10 into 440
03:16
so here 20 into 120 10 into 440 and the sum of it that is what 60 that 60 is going to
03:23
store inside 0 row first column of the third matrix that is in the C matrix okay.
03:31
Now the second row or the second row of A matrix is going to multiply it with the first
03:40
column of B matrix okay so the second row first column and the second row second column
03:48
so the first row of the first matrix is going to multiply with the first column of the second
03:56
matrix okay so 30 into 2 that is what 60 so here I have done okay then 20 into 1 that
04:04
is what 20 and the resulted value is going to store inside the first row 0 column of
04:13
third matrix that is in the C matrix so the sum of it is going to store here.
04:19
Then the second row second column the multiplication of the second row of the first matrix and
04:27
the second column of the second matrix the multiplication of it will take place okay
04:33
and the sum will take place and the resulted value is going to store inside the first row
04:38
first column of the third matrix okay so that is what 30 into 1 30 20 into 4 okay and the
04:48
multiplication took place and the resulted value that is 110 that is stored inside first
04:56
row first column of third matrix that is of C matrix so this is the procedure and in this
05:03
way the values are going to store and then it is going to display in a matrix form.
05:08
Now why to do in this way why not directly to multiply the values why not to do in the
05:14
same way as we do or as we have adopted when we have add the values not to directly multiply
05:24
and get the result that is 20 into 2 40 and then 10 into 1 10 and then 30 into 1 30 then
05:31
20 into 4 80 like this why don't we store it why is there is to multiply and then add
05:37
and then to put the values inside it what is the reason behind it that I am going to
05:41
explain here is an example for it this there there are two shop there is a shop number
05:49
one and there is a shop number two in the shop number one if you see a 0 to 0 column
05:58
and 0 first column the rate of the pen and pencils are given okay and in the shop number
06:03
two and first to zero column and in the first row first column the rate of pen and pencils
06:09
are given okay so this a matrix is having the rate of pen and pencil of both the shops
06:16
shop number one and shop number two now in the second matrix B it's having the quantity
06:22
okay so in 0 to 0 column on the Monday the quantity which the pen is having that is two
06:33
okay and the pen the pencil quantity is that is what one and in Tuesday it is having what
06:39
quantity one and of pencil the quantity is what four of pen the quantity is one and of
06:48
pencil it's four so it's having the same quantity for both the shops for shop number one and
06:53
the shop number two they used to give on the same quantity of pen and pencils on Monday
07:03
and Tuesday okay so I have used simple numbers for the calculation so that we can easily
07:12
do it and understand okay so on Monday the quantity of pen which the shops or the shops
07:20
having that is pen the quantity of pen is what two and the pen and the quantity of pencil
07:26
is what one on Tuesday they are they both the shops having what only one and the pencil
07:33
is what that is what four okay so for the easy calculation I have I have taken not a
07:41
big or a large numbers I have taken a small number for us for that the calculation can
07:47
take easily and we can understand it okay now what we will achieve we will achieve the
07:56
total amount of stock of both the shops on a Monday and Tuesday by multiplying the by
08:04
multiplying the both the matrices that will be achieved so what what is that what what
08:09
is the total amount of shop number one on Monday and what is the total amount of stock
08:16
of shop number two on Monday that will be achieved okay and the same way how much the
08:23
total amount of stock the shop number one is having on Tuesday and how much amount of
08:30
total stock the shop number two is having on Tuesday that will be achieved by multiplying
08:35
A and B matrices so let us see the shop number one is having the pan rate is what 20 and on
08:47
Monday it's having the quantity what 2 so what 20 into 2 that is what 40 okay so we'll get the
08:56
total amount of pan and then the shop number one is having the pencil of rate 10 but the
09:05
quantity which it's having a pencil on Monday that is 1 so 10 into 1 that is what 10 okay
09:12
so the total amount of total amount of stock of pen and pencil that is what 50 and that is the
09:21
shop number one is having which is kept here okay on the jio through and jio column of C matrix so
09:28
on Monday the total amount of stock which a shop number one is having that is that amount is what
09:35
50 then this this row is again going to multiply it with the second column okay so on Tuesday the
09:46
stock of shop number one for the pen is 1 and for the pencil is what 4 so let us calculate a
09:53
total amount of stock so 20 into 1 that is what 20 and 10 into 4 that is what 40 okay so 20 is the
10:04
amount of pen and 40 is the amount of pencil and when we sum it so this will be the total amount
10:11
of stock on the Tuesday and that is kept here okay yeah on the jio through and first column the C
10:18
matrix okay so we have got the total amount of stock on Monday of shop number one and the total
10:27
amount of stock amount of stock on Tuesday of shop number one in the same way the same method
10:34
will be applicable for the shop number two the second row of the first column first matrix is
10:43
going to multiply with the first column of the second matrix and then the second row of the first
10:51
matrix is going to multiply with the second column of the second matrix so let us do the second in
10:59
this the same thing the shop number two is having the rate 30 of the pen and the 30 is going to
11:06
multiply with one okay that is first of all with the two we have to calculate for the Monday so
11:16
30 into 2 that will be what if you see 60 then the rate of the pencil that is what 20 that is
11:26
going to multiply with the quantity that is 1 so 20 into 120 and then the sum will take place so
11:33
the total amount of stock that is what 80 that is of the shop number 2 on Monday in the same way
11:39
the rate of pen and pencil going to multiply it with the quantity or which is there on the Tuesday
11:47
okay that is 30 into 1 that is of the pen and 20 into 4 that is what 80 okay so that is calculated
11:54
and 110 is the amount that is the total amount of shop number shop number 2 on Tuesday so in
12:02
this way we will get the total amount of stock which the shop number one is having on Monday
12:08
and and on Tuesday in the same way we will be able to get the total amount of stock the shop
12:15
number two is having on Monday and on Tuesday with this methodology so I hope that how the
12:24
multiplication of matrices take place and what is the reason to use this methodology or to use this
12:32
procedure to do the multiplication that first to multiply and to then add it or to do the sum why
12:39
there is what is the reason behind it why we do this provide this example must be clear now I'm
12:45
going to make the program in my next video of multiplication of two matrices okay thanks for today
Recommended
17:20
|
Up next
Learn Programming Technique C to Master Skills - Program of Multiplication of two Matrices
Tutorials Arena
11/1/2024
14:36
Learn Programming Technique C to Master Skills - Program of Sum of two Matrices
Tutorials Arena
11/1/2024
3:16
Learn Programming Technique C to MasterĀ Skills - First Program of Function ( Continue ...)
Tutorials Arena
11/3/2024
3:37
Learn Programming Technique C to Master Skills - Pointers And Arrays Program ( Continue...)
Tutorials Arena
11/9/2024
3:28
Learn Programming Technique C to Master Skills - Switch Case Program ( Continue ...)
Tutorials Arena
10/19/2024
9:09
Learn Programming Technique C to Master Skills - Second Program( Call by Reference)
Tutorials Arena
11/8/2024
5:59
Learn Programming Technique C to Master Skills - File Handling Second Program (Continue..)
Tutorials Arena
11/18/2024
6:03
Learn Programming Technique C to Master Skills - Linked List ( Second Program)
Tutorials Arena
11/30/2024
3:52
Learn Programming Technique C to Master Skills - Second Program of Loop (Flow Chart)
Tutorials Arena
10/17/2024
7:52
Learn Programming Technique C to MasterĀ Skills - Second Program of Function ( Return Value ) - II
Tutorials Arena
11/3/2024
11:41
Learn Programming Technique C to Master Skills - Second Program of Array
Tutorials Arena
11/1/2024
4:03
Learn Programming Technique C to Master Skills - Second Program of Loop ( For Loop )
Tutorials Arena
10/17/2024
13:04
Learn Programming Technique C to Master Skills - Double Dimension Array Program
Tutorials Arena
10/20/2024
4:57
Learn Programming Technique C to Master Skills - Loop with If Statement Second Program Continue...
Tutorials Arena
10/17/2024
8:07
Learn Programming Technique C to Master Skills - Loop with if Statement Second Program
Tutorials Arena
10/17/2024
2:34
Learn Programming Technique C to MasterĀ Skills - Second Program of Function ( Return Val) - I
Tutorials Arena
11/3/2024
7:02
Learn Programming Technique C to Master Skills - Sixth Program of Array (Loop with if)
Tutorials Arena
11/1/2024
6:12
Learn Programming Technique C to Master Skills - Second Program(Array with Function , Call by Reference)
Tutorials Arena
11/9/2024
4:14
Learn Programming Technique C to Master Skills - Explanation of Second Program
Tutorials Arena
10/8/2024
7:12
Learn Programming Technique C to Master Skills - Third Program (Passing Entire Array in Function)
Tutorials Arena
11/9/2024
4:07
Learn Programming Technique C to Master Skills - Second Program of Loop (While Loop)
Tutorials Arena
10/17/2024
3:21
Learn Programming Technique C to Master Skills - Third Program - Call by Reference (continue...)
Tutorials Arena
11/8/2024
2:38
Learn Programming Technique C to Master Skills - First Program - Array with Function(Call by Value) Continue..
Tutorials Arena
11/9/2024
3:30
Learn Programming Technique C to Master Skills - Third Program ( Passing Entire Array in Function ,continue...)
Tutorials Arena
11/9/2024
4:57
Learn Programming Technique C to Master Skills - Loop With If Statement Program ( Flow Chart )
Tutorials Arena
10/13/2024