Curious Minds

Clear answers to science and history questions

Matrix i j Notation Explained

· 8 min read · Science

In matrix notation, i and j are index variables: i typically identifies the row and j typically identifies the column of an entry, so the symbol aij means "the element of matrix A sitting in row i, column j." The pair of letters simply gives an address for every number in the grid, and which letter is used is a pure convention — any pair of index letters would do the same job.

That double-subscript convention is the backbone of linear algebra notation. It lets textbooks write a whole matrix as a single symbol, define multiplication in one compact line, and describe computer algorithms that loop over entries without ever drawing the grid. The rest of this article unpacks where the convention comes from, how it is used, where readers habitually mix it up, and why it survives in an age when software can handle the arithmetic.

Where the i and j convention comes from

Matrix ideas are old — rectangular arrangements of numbers appear in ancient Chinese mathematical texts, and the concept was used in Europe from the eighteenth century onward. The modern notation is largely associated with nineteenth-century British mathematicians, particularly Arthur Cayley, who developed matrix algebra as a formal system and wrote products of matrices as sums over indices. The letters themselves carry no mathematical weight; they are simply the conventional index names.

The choice hints at the underlying idea of a matrix as a function of two variables. If you picture the entries as values f(i, j) over a grid of positions, i and j are the two inputs. That is why a matrix can be read as a table: one index runs down the side, the other across the top, and the meeting point holds the entry.

Rows, columns, and the meaning of aij

The convention in most texts is row first, column second. In a matrix written out as

  • row 1: a11, a12, a13
  • row 2: a21, a22, a23

the entry a23 is the element in the second row and third column. The first index counts down, the second across. A general m × n matrix has m rows and n columns, and its entries are aij with i ranging from 1 to m and j from 1 to n.

A useful memory aid: the indices appear in the order you read the dimensions. An m × n matrix is indexed aij with i up to m and j up to n, so "m × n" and "ij" line up in the same order.

Some fields, especially in computing and some applied mathematics, start indexing at zero rather than one. A 3 × 3 array in a programming language may be addressed from (0,0) to (2,2). The mathematical convention usually starts at 1; the computational convention often starts at 0. Mixing the two is a classic source of off-by-one errors.

In physics, the letters i and j are also used as the imaginary unit and as generic vector labels, and in electrical engineering j is often used for the imaginary unit instead of i to avoid confusion with current. Context signals which meaning applies; a double subscript attached to a matrix symbol almost always means an index.

How index notation powers the standard operations

Much of the compactness of matrix algebra depends on index notation. Writing out a sum with a double index is the standard trick.

  1. Addition: if C = A + B, then cij = aij + bij. The entries combine position by position.
  2. Scalar multiplication: if B = kA, then bij = k·aij. Every entry is scaled by the same number.
  3. Matrix multiplication: if C = AB, then cij is the sum of aik·bkj over every intermediate index k. Each output entry is a dot product of row i of A with column j of B.
  4. Transpose: if B = Aᵀ, then bij = aji. The indices swap, reflecting rows and columns.

Step 3 is the heart of the matter. In the familiar example of a 2 × 2 multiplication, the top-left entry of the product uses row 1 of the first matrix and column 1 of the second; the top-right entry uses row 1 and column 2, and so on. Written with indices, the same rule covers any size.

One consequence worth knowing: the inner dimensions must match. You can multiply a 2 × 3 matrix by a 3 × 4 matrix because the 3s agree, and the result is 2 × 4. That shape rule falls straight out of the shared index k in the multiplication formula.

The Einstein summation convention and its relatives

Physicists often drop the summation sign entirely when an index appears twice in a term, assuming the reader sums over it. In this convention — usually called Einstein summation — repeating an index implies a sum, and an index that appears only once is free. It makes long tensor expressions readable, but it means the same letters can carry quite different meanings in different contexts.

Related notation includes the Kronecker delta, written δij, which equals 1 when i = j and 0 otherwise, functioning as an identity matrix entry. The Levi-Civita symbol, written with three indices, encodes parity and determinant formulas. All of these rely on the same double-index habit: the letters are placeholders, and the pattern of repetition decides what the reader is meant to compute.

Why the notation matters in practice

Index notation is the everyday working language of linear algebra, and in practice it shows up everywhere a table of numbers does. Computer algorithms written in pseudocode add, multiply and traverse matrices with loops whose counters might be named i and j. Finance models, graphics pipelines, machine learning libraries, and statistical procedures all rely on the same structure, even when the software hides it behind a call like a matrix product.

Index notation also acts as a checking tool. If you have written cij and need to know what shape the result is, the trailing index usually answers the question. If two terms in a derivation carry different index patterns, that mismatch is often a signal of an algebraic slip. For students, learning to translate a written formula back into a drawing of a grid — and back again — is one of the fastest routes to fluency in matrix manipulation.

Common mistakes and how to fix them

Errors with i and j notation tend to fall into a handful of familiar patterns.

  • Swapping row and column. Writing aji when aij is meant is the most common slip. Rehearse the order in the text you are reading; some conventions differ, though the row-first habit dominates.
  • Mixing 1-based and 0-based indexing. A formula written for mathematics starting at 1 will give wrong results in a language that starts at 0. Confirm the base before translating.
  • Confusing the two indices' ranges. In an m × n matrix, i runs to m and j runs to n; swapping the ranges produces square-shaped assumptions in non-square matrices.
  • Reusing i or j with other meanings. A letter used earlier for a sum counter or the imaginary unit may clash with a matrix index.
  • Forgetting dimension compatibility. In matrix products, the shared intermediate index must have the same range on both sides.

When a derivation goes wrong, rewriting the offending expression with explicit loops and concrete small matrices is usually the fastest fix: a 2 × 2 worked example exposes an index error almost immediately.

Frequently Asked Questions

Does i stand for row and j for column?

In most textbooks, yes. The first index of a double-subscripted entry is the row and the second is the column, so aij is row i, column j. Conventions elsewhere, such as computer code with zero-based indexing, keep the same order but change the starting value.

What does aij actually mean?

It means the single entry located at row i and column j of the matrix A. The subscript pair is an address, and the letter A names the whole array. Without both indices the position is not specified.

Why is matrix multiplication written with a sum over k?

Because each entry of the product combines a row of the first matrix with a column of the second. The index k runs across that row and down that column, pairing matching positions. The sum of those products is exactly the dot product of the two vectors.

Is the notation the same in all fields?

The basic meaning is shared, but usage varies. Mathematics and physics generally index from 1, many programming languages from 0, and physicists often suppress the summation sign entirely. Always check the local convention.

What is the difference between i and j in the Kronecker delta?

In δij the two indices are compared rather than used as a position. The symbol equals 1 when the indices are equal and 0 otherwise, so it acts like an identity matrix: only "row equals column" entries survive.

The double-subscript habit sits inside a broader family of index conventions. A vector entry vi uses a single index because a vector is a one-dimensional list. A tensor entry uses three or more indices. And in computer science, array indices are traditionally written arr[i][j], which mirrors the mathematical order but reminds the reader that the first index is the outer or row dimension.

Because the letters are conventional, clarity matters more than the specific choice. A common piece of practical advice is to keep the same index letters consistent throughout a calculation: if i is a row index early on, do not silently reuse it for a sum counter later. That one discipline prevents most confusion readers encounter with matrix i j notation.

In this article
  1. Where the i and j convention comes from
  2. Rows, columns, and the meaning of aij
  3. How index notation powers the standard operations
  4. The Einstein summation convention and its relatives
  5. Why the notation matters in practice
  6. Common mistakes and how to fix them
  7. Frequently Asked Questions
  8. Related notation worth knowing