Close Menu
    Facebook LinkedIn YouTube WhatsApp X (Twitter) Pinterest
    Trending
    • Sulfur lava exoplanet L 98-59 d defies classification
    • Hisense U7SG TV Review (2026): Better Design, Great Value
    • Google is in talks with Marvell Technology to develop a memory processing unit that works alongside TPUs, and a new TPU for running AI models (Qianer Liu/The Information)
    • Premier League Soccer: Stream Man City vs. Arsenal From Anywhere Live
    • Dreaming in Cubes | Towards Data Science
    • Onda tiny house flips layout to fit three bedrooms and two bathrooms
    • Best Meta Glasses (2026): Ray-Ban, Oakley, AR
    • At the Beijing half-marathon, several humanoid robots beat human winners by 10+ minutes; a robot made by Honor beat the human world record held by Jacob Kiplimo (Reuters)
    Facebook LinkedIn WhatsApp
    Times FeaturedTimes Featured
    Sunday, April 19
    • Home
    • Founders
    • Startups
    • Technology
    • Profiles
    • Entrepreneurs
    • Leaders
    • Students
    • VC Funds
    • More
      • AI
      • Robotics
      • Industries
      • Global
    Times FeaturedTimes Featured
    Home»Artificial Intelligence»Understanding Matrices | Part 1: Matrix-Vector Multiplication
    Artificial Intelligence

    Understanding Matrices | Part 1: Matrix-Vector Multiplication

    Editor Times FeaturedBy Editor Times FeaturedMay 27, 2025No Comments14 Mins Read
    Facebook Twitter Pinterest Telegram LinkedIn Tumblr WhatsApp Email
    Share
    Facebook Twitter LinkedIn Pinterest Telegram Email WhatsApp Copy Link


    are basic objects in numerous fields of contemporary pc science and arithmetic, together with however not restricted to linear Algebra, machine studying, and pc graphics.

    Within the present collection of 4 tales, I’ll current a manner of decoding algebraic matrices in order that the bodily that means of assorted Matrix evaluation formulation will change into clearer. For instance, the components for multiplying 2 matrices:

    [begin{equation}
    c_{i,j} = sum_{k=1}^{p} a_{i,k}*b_{k,j}
    end{equation}]

    or the components for inverting a series of matrices:

    [begin{equation}
    (ABC)^{-1} = C^{-1}B^{-1}A^{-1}
    end{equation}]

    In all probability for many of us, once we had been studying matrix-related definitions and formulation for the primary time, questions like the next ones arose:

    • what does a matrix truly signify,
    • what’s the bodily that means of multiplying a matrix by a vector,
    • why multiplication of two matrices is carried out by such a non-standard components,
    • why for multiplication the variety of columns of the primary matrix should be equal to the variety of rows of the second,
    • what’s the that means of transposing a matrix,
    • why for sure forms of matrices, inversion equals to transposition,
    • … and so forth.

    On this collection, I plan to current a method of answering many of the listed questions. So let’s dive in!

    However earlier than beginning, listed here are a few notation guidelines that I take advantage of all through this collection:

    • Matrices are denoted by uppercase (like A, B), whereas vectors and scalars are denoted by lowercase (like x, y or m, n),
    • ai,j – The worth of i-th row and j-th column of matrix ‘A‘,
    • xi – the i-th worth of vector ‘x‘.

    Multiplication of a matrix by a vector

    Let’s put apart for now the best operations on matrices, that are addition and subtraction. The subsequent easiest manipulation might be the multiplication of a matrix by a vector:

    [begin{equation}
    y = Ax
    end{equation}]

    We all know that the results of such an operation is one other vector ‘y‘, which has a size equal to the variety of rows of ‘A‘, whereas the size of ‘x‘ must be equal to the variety of columns of ‘A‘.

    Let’s think about “n*n” sq. matrices for now (these with equal numbers of rows and columns). We are going to observe the conduct of rectangular matrices a bit later.

    The components for calculating yi is:

    [begin{equation}
    y_i = sum_{j=1}^{n} a_{i,j}*x_j
    end{equation}]

    … which, if written within the expanded manner, is:

    [begin{equation}
    begin{cases}
    y_1 = a_{1,1}x_1 + a_{1,2}x_2 + dots + a_{1,n}x_n
    y_2 = a_{2,1}x_1 + a_{2,2}x_2 + dots + a_{2,n}x_n
    ;;;;; vdots
    y_n = a_{n,1}x_1 + a_{n,2}x_2 + dots + a_{n,n}x_n
    end{cases}
    end{equation}]

    Such expanded notation clearly reveals that each cell ai,j is current within the system of equations solely as soon as. Extra exactly, ai,j is current because the issue of xj, and participates solely within the sum of yi. This leads us to the next interpretation:

    Within the product of a matrix by a vector “y = Ax”, a sure cell ai,j describes how a lot the output worth yi is affected by the enter worth xj.

    Having that mentioned, we are able to draw the matrix geometrically, within the following manner:

    Geometrical interpretation of a 3×3 matrix “A” (written on the left). The suitable stack (purple gadgets) corresponds to the inputs of the matrix, that are the values of vector ‘x’. The left stack (inexperienced gadgets) corresponds to the outputs of the matrix, that are the values of vector ‘y’. Each arrow beginning at ‘xj‘ and ending at ‘yi‘ corresponds to a sure cell “ai,j“.

    And as we’re going to interpret matrix ‘A‘ as influences of values xj on values yi, it’s affordable to connect values of ‘x‘ to the proper stack, which is able to end in values of ‘y‘ being current on the left stack.

    Putting values of an enter vector “x = (x1, x2, x3)” on the proper stack clearly reveals how the values of the output vector “y = (y1, y2, y3)” are obtained on the left stack.

    I want to name this interpretation of matrices as “X-way interpretation”, as the location of offered arrows seems to be just like the English letter “X”. And for a sure matrix ‘A‘, I want to name such a drawing as “X-diagram” of ‘A‘.

    Such interpretation clearly reveals that the enter vector ‘x‘ goes by means of some sort of transformation, from proper to left, and turns into vector ‘y‘. That is the explanation why in Linear Algebra, matrices are additionally known as “transformation matrices”.

    If taking a look at any ok-th merchandise of the left stack, we are able to see how all of the values of ‘x‘ are being accrued in the direction of it, whereas being multiplied by coefficients aok,j (that are the ok-th row of the matrix).

    The buildup of all enter values (x1, x2, x3) in the direction of the output worth ‘y2‘ is highlighted with crimson arrows. The enter values are multiplied by coefficients (9, 4, 6) respectively, that are the 2nd row of matrix ‘A’.

    On the identical time, if taking a look at any ok-th merchandise of the proper stack, we are able to see how the worth xok is being distributed over all values of ‘y’, whereas being multiplied by coefficients ai,ok (which at the moment are the ok-th column of the matrix).

    The distribution of the enter worth ‘x3‘ in the direction of all output values (y1, y2, y3) is highlighted with crimson arrows. The enter worth ‘x3‘ is being multiplied by coefficients (7, 6, 8) respectively, which at the moment are the third column of matrix ‘A’.

    This already provides us one other perception, that when decoding a matrix within the X-way, the left stack might be related to rows of the matrix, whereas the proper stack might be related to its columns.

    Certainly, if we’re concerned about finding some worth ai,j, taking a look at its X-diagram just isn’t as handy as trying on the matrix in its unusual manner – as an oblong desk of numbers. However, as we are going to see later and within the subsequent tales of this collection, X-way interpretation explicitly presents the that means of assorted algebraic operations over matrices.


    Rectangular matrices

    Multiplication of the shape “y = Ax” is allowed provided that the size of vector ‘x‘ is the same as the variety of columns of matrix ‘A‘. On the identical time, the end result vector ‘y‘ may have a size equal to the variety of rows of ‘A‘. So, if ‘A‘ is an oblong matrix, vector ‘x‘ will change its size whereas passing by means of its transformation. We will observe it by taking a look at X-way interpretation:

    X-way interpretation of a 3*4 matrix ‘A’. We see that its left stack has a top of three (depend of rows of ‘A’), whereas its proper stack has a top of 4 (depend of columns of ‘A’). There are 3*4=12 arrows general, every equivalent to a single cell ai,j.

    Now it’s clear why we are able to multiply ‘A‘ solely on such a vector ‘x‘, the size of which is the same as the variety of columns of ‘A‘: as a result of in any other case the vector ‘x‘ will merely not match on the proper facet of the X-diagram.

    Equally, it’s clear why the size of the end result vector “y = Ax” is the same as the variety of rows of ‘A‘.

    Viewing rectangular matrices within the X-way strokes, we now have beforehand made an perception, which is that gadgets of the left stack of the X-diagram correspond to rows of the illustrated matrix, whereas gadgets of its proper stack correspond to columns.


    Observing a number of particular matrices in X-way interpretation

    Let’s see how X-way interpretation will assist us to know the conduct of sure particular matrices:

    Scale / diagonal matrix

    A scale matrix is such a sq. matrix that has all cells of its primary diagonal equal to some worth ‘s‘, whereas having all different cells equal to 0. Multiplying a vector “x” by such a matrix ends in each worth of “x” being multiplied by ‘s‘:

    [begin{equation*}
    begin{pmatrix}
    y_1 y_2 vdots y_{n-1} y_n
    end{pmatrix}
    =
    begin{bmatrix}
    s & 0 & dots & 0 & 0
    0 & s & dots & 0 & 0
    & & vdots
    0 & 0 & dots & s & 0
    0 & 0 & dots & 0 & s
    end{bmatrix}
    *
    begin{pmatrix}
    x_1 x_2 vdots x_{n-1} x_n
    end{pmatrix}
    =
    begin{pmatrix}
    s x_1 s x_2 vdots s x_{n-1} s x_n
    end{pmatrix}
    end{equation*}]

    The X-way interpretation of a scale matrix reveals its bodily that means. As the one non-zero cells listed here are those on the diagonal – ai,i, the X-diagram may have arrows solely between corresponding pairs of enter and output values, that are xi and yi.

    X-diagram of a scale matrix. Each output worth ‘yi‘ is affected solely by the enter worth ‘xi‘, which is why all of the arrows within the diagram are strictly horizontal. Scale matrix multiples values of enter vector “x” by ‘s’, which is why coefficients close to all arrows are equal to ‘s’.

    A particular case of a scale matrix is the diagonal matrix (additionally known as an “id matrix”), typically denoted with the letters “E” or “I” (we are going to use “E” within the present writing). It’s a scale matrix with the parameter “s=1″.

    [begin{equation*}
    begin{pmatrix}
    y_1 y_2 vdots y_{n-1} y_n
    end{pmatrix}
    =
    begin{bmatrix}
    1 & 0 & dots & 0 & 0
    0 & 1 & dots & 0 & 0
    & & vdots
    0 & 0 & dots & 1 & 0
    0 & 0 & dots & 0 & 1
    end{bmatrix}
    *
    begin{pmatrix}
    x_1 x_2 vdots x_{n-1} x_n
    end{pmatrix}
    =
    begin{pmatrix}
    x_1 x_2 vdots x_{n-1} x_n
    end{pmatrix}
    end{equation*}]

    Identification matrix “E” is a scale matrix with the worth “s=1” on the principle diagonal.

    We see that doing the multiplication “y = Ex” will simply go away the vector ‘x‘ unchanged, as each worth xi is simply multiplied by 1.

    90° rotation matrix

    A matrix, which rotates a given level (x1, x2) across the zero-point (0,0) by 90 levels counter-clockwise, has a easy type:

    [begin{equation*}
    begin{pmatrix}
    y_1 y_2
    end{pmatrix}
    =
    begin{bmatrix}
    0 & -1
    1 & phantom{-}0
    end{bmatrix}
    *
    begin{pmatrix}
    x_1 x_2
    end{pmatrix}
    =
    begin{pmatrix}
    -x_2 phantom{-}x_1
    end{pmatrix}
    end{equation*}]

    Counter-clockwise rotation on a airplane. We see that if the unique (crimson) level has coordinates (x1, x2), then the rotated (blue) level’s coordinates are (y1, y2) = (-x2, x1).

    X-way interpretation of the 90° rotation matrix reveals that conduct:

    The X-way interpretation of 90° rotation matrix reveals the trade between x1 and x2 coordinates on the airplane.

    Change matrix

    An trade matrix ‘J‘ is such a matrix that has 1s on its anti-diagonal, and has 0s in any respect different cells. Multiplying it by a vector ‘x‘ ends in reversing the order of values of ‘x‘:

    [begin{equation*}
    begin{pmatrix}
    y_1 y_2 vdots y_{n-1} y_n
    end{pmatrix}
    =
    begin{bmatrix}
    0 & 0 & dots & 0 & 1
    0 & 0 & dots & 1 & 0
    & & vdots
    0 & 1 & dots & 0 & 0
    1 & 0 & dots & 0 & 0
    end{bmatrix}
    *
    begin{pmatrix}
    x_1 x_2 vdots x_{n-1} x_n
    end{pmatrix}
    =
    begin{pmatrix}
    x_n x_{n-1} vdots x_2 x_1
    end{pmatrix}
    end{equation*}]

    This reality is explicitly proven within the X-way interpretation of the trade matrix ‘J‘:

    X-way interpretation of ‘J’ reveals that the i-th from the highest worth of enter vector “x” goes solely to the i-th from the underside worth of output vector “y”. The coefficients of these arrows are all the time 1. That’s why vector “y” turns into the reverse of sequence “x”.

    The 1s reside solely on the anti-diagonal right here, which signifies that output worth y1 is affected solely by enter worth xn, then y2 is affected solely by xn-1, and so forth, having yn affected solely by x1. That is seen on the X-diagram of the trade matrix ‘J‘.

    Shift matrix

    A shift matrix is such a matrix that has 1s on some diagonal, parallel to the principle diagonal, and has 0s in any respect remaining cells:

    [begin{equation*}
    begin{pmatrix}
    y_1 y_2 y_3 y_4 y_5
    end{pmatrix}
    =
    begin{bmatrix}
    0 & 1 & 0 & 0 & 0
    0 & 0 & 1 & 0 & 0
    0 & 0 & 0 & 1 & 0
    0 & 0 & 0 & 0 & 1
    0 & 0 & 0 & 0 & 0
    end{bmatrix}
    *
    begin{pmatrix}
    x_1 x_2 x_3 x_4 x_5
    end{pmatrix}
    =
    begin{pmatrix}
    x_2 x_3 x_4 x_5 0
    end{pmatrix}
    end{equation*}]

    Multiplying such a matrix by a vector “x” ends in the identical vector however all values shifted by ‘ok‘ positions up or down. ‘ok‘ is the same as the space between the diagonal with 1s and the principle diagonal. Within the offered instance, we now have “ok=1″ (diagonal with 1s is just one place above the principle diagonal). If the diagonal with 1s is within the upper-right triangle, as it’s within the offered instance, then the shift of values of “x” is carried out upwards. In any other case, the shift of values is carried out downwards.

    Shift matrix can be illustrated explicitly within the X-way:

    The X-diagram of a shift matrix reveals that each enter worth “xi” is simply being transferred to the output worth “yi-k“, the place ‘ok’ is the space between the diagonal with 1s and the principle diagonal. This ends in the values of the enter vector “x” being shifted by ‘ok’ positions. Right here we now have “ok=1”.

    Permutation matrix

    A permutation matrix is a matrix composed of 0s and 1s, which rearranges all values of the enter vector “x” in a sure manner. The impression is that when multiplied by such a matrix, the values of “x” are being permuted.

    To realize that, the n*n-sized permutation matrix ‘P‘ will need to have ‘n‘ 1s, whereas all different cells should be 0. Additionally, no two 1s should seem in the identical row or the identical column. An instance of a permutation matrix is:

    [begin{equation*}
    begin{pmatrix}
    y_1 y_2 y_3 y_4 y_5
    end{pmatrix}
    =
    begin{bmatrix}
    0 & 0 & 0 & 1 & 0
    1 & 0 & 0 & 0 & 0
    0 & 0 & 0 & 0 & 1
    0 & 0 & 1 & 0 & 0
    0 & 1 & 0 & 0 & 0
    end{bmatrix}
    *
    begin{pmatrix}
    x_1 x_2 x_3 x_4 x_5
    end{pmatrix}
    =
    begin{pmatrix}
    x_4 x_1 x_5 x_3 x_2
    end{pmatrix}
    end{equation*}]

    If drawing the X-diagram of the talked about permutation matrix ‘P‘, we are going to see the reason of such conduct:

    X-diagram of the permutation matrix offered above.

    The constraint that no two 1s should seem in the identical column signifies that just one arrow ought to depart from any merchandise of the proper stack. The constraint that no two 1s should seem on the identical row signifies that just one arrow should arrive at each merchandise of the left stack. Lastly, the constraint that every one the non-zero cells of a permutation matrix should be 1 signifies that a sure enter worth xj, whereas arriving at output worth yi, won’t be multiplied by any coefficient. All this ends in the values of vector “x” being rearranged in a sure method.

    Triangular matrix

    A triangular matrix is a matrix that has 0s in any respect cells both under or above its primary diagonal. Let’s observe upper-triangular matrices (the place 0s are under the principle diagonal), because the lower-triangular ones have related properties.

    [
    begin{equation*}
    begin{pmatrix}
    y_1 y_2 y_3 y_4
    end{pmatrix}
    =
    begin{bmatrix}
    a_{1,1} & a_{1,2} & a_{1,3} & a_{1,4}
    0 & a_{2,2} & a_{2,3} & a_{2,4}
    0 & 0 & a_{3,3} & a_{3,4}
    0 & 0 & 0 & a_{4,4}
    end{bmatrix}
    *
    begin{pmatrix}
    x_1 x_2 x_3 x_4
    end{pmatrix}
    =
    begin{pmatrix}
    begin{aligned}
    a_{1,1}x_1 + a_{1,2}x_2 + a_{1,3}x_3 + a_{1,4}x_4
    a_{2,2}x_2 + a_{2,3}x_3 + a_{2,4}x_4
    a_{3,3}x_3 + a_{3,4}x_4
    a_{4,4}x_4
    end{aligned}
    end{pmatrix}
    end{equation*}
    ]

    Such an expanded notation illustrates that any output worth yi is affected solely by enter values with higher or equal indexes, that are xi, xi+1, xi+2, …, xN. If drawing the X-diagram of the talked about upper-triangular matrix, that reality turns into apparent:

    Within the X-diagram of an upper-triangular matrix, all arrows are both horizontal or directed upwards, which illustrates the truth that any output worth ‘yi‘ is affected solely by enter values with the identical or higher index – ‘xi‘, ‘xi+1‘, ‘xi+2‘, …, ‘xN‘.

    Conclusion

    Within the first story of the collection, which is dedicated to the interpretation of algebraic matrices, we checked out how matrices might be offered geometrically, and known as it “X-way interpretation”. Such interpretation explicitly highlights numerous properties of matrix-vector multiplication, in addition to the conduct of matrices of a number of particular sorts.

    Within the subsequent story of this collection, we are going to discover an interpretation of the multiplication of two matrices by working on their X-diagrams, so keep tuned for the second arrival!


    My gratitude to:
    – Roza Galstyan, for cautious overview of the draft,
    – Asya Papyan, for the exact design of all of the used illustrations ( https://www.behance.net/asyapapyan ).

    For those who loved studying this story, be happy to attach with me on LinkedIn, the place, amongst different issues, I may even submit updates ( https://www.linkedin.com/in/tigran-hayrapetyan-cs/ ).

    All used photographs, except in any other case famous, are designed by request of the creator.



    Source link

    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Editor Times Featured
    • Website

    Related Posts

    Dreaming in Cubes | Towards Data Science

    April 19, 2026

    AI Agents Need Their Own Desk, and Git Worktrees Give Them One

    April 18, 2026

    Your RAG System Retrieves the Right Data — But Still Produces Wrong Answers. Here’s Why (and How to Fix It).

    April 18, 2026

    Europe Warns of a Next-Gen Cyber Threat

    April 18, 2026

    How to Learn Python for Data Science Fast in 2026 (Without Wasting Time)

    April 18, 2026

    A Practical Guide to Memory for Autonomous LLM Agents

    April 17, 2026

    Comments are closed.

    Editors Picks

    Sulfur lava exoplanet L 98-59 d defies classification

    April 19, 2026

    Hisense U7SG TV Review (2026): Better Design, Great Value

    April 19, 2026

    Google is in talks with Marvell Technology to develop a memory processing unit that works alongside TPUs, and a new TPU for running AI models (Qianer Liu/The Information)

    April 19, 2026

    Premier League Soccer: Stream Man City vs. Arsenal From Anywhere Live

    April 19, 2026
    Categories
    • Founders
    • Startups
    • Technology
    • Profiles
    • Entrepreneurs
    • Leaders
    • Students
    • VC Funds
    About Us
    About Us

    Welcome to Times Featured, an AI-driven entrepreneurship growth engine that is transforming the future of work, bridging the digital divide and encouraging younger community inclusion in the 4th Industrial Revolution, and nurturing new market leaders.

    Empowering the growth of profiles, leaders, entrepreneurs businesses, and startups on international landscape.

    Asia-Middle East-Europe-North America-Australia-Africa

    Facebook LinkedIn WhatsApp
    Featured Picks

    The Rise of AI Girlfriends You Don’t Have to Sign Up For

    June 7, 2025

    Turkish court issues arrest warrants for 29 individuals, including top-tier players

    December 12, 2025

    Ofcom slams O2 over unexpected mobile phone contract price rise

    October 30, 2025
    Categories
    • Founders
    • Startups
    • Technology
    • Profiles
    • Entrepreneurs
    • Leaders
    • Students
    • VC Funds
    Copyright © 2024 Timesfeatured.com IP Limited. All Rights.
    • Privacy Policy
    • Disclaimer
    • Terms and Conditions
    • About us
    • Contact us

    Type above and press Enter to search. Press Esc to cancel.