Partition (Block) Matrices
Draw a few lines through a big matrix and treat the rectangles inside as single objects. Blocks largely behave like scalars — you add and multiply them block-wise — and for block-diagonal or block-triangular layouts the determinant is just the product of the diagonal blocks' determinants.
What you'll learn
- Partitioning a matrix into blocks and multiplying block-wise (respecting order)
- Block-diagonal / block-triangular determinant = product of the diagonal blocks' determinants
- The inverse of a block-diagonal matrix is the block-wise inverse
Before you start
The last lesson tamed a big matrix by factoring it. Here is a different handle: just draw a few lines through it and treat the rectangles inside as single objects. That is a partitioned matrix — the same numbers, merely regrouped into blocks. The convenient surprise is that those blocks largely behave like scalars: you add and multiply them block by block, as if each block were one number — as long as the sizes line up so the inner products make sense. (It is not just exam bookkeeping: the covariance of two feature groups, a graph’s adjacency matrix, and a neural network’s weight layout all carry natural block structure this arithmetic exploits.)
Blocks behave like scalars
Multiplying two block matrices follows the ordinary row-times-column rule, with blocks in
place of numbers. For the 2×2 block layout above,
[ A B ] [ E F ] [ AE + BG AF + BH ]
[ C D ] [ G H ] = [ CE + DG CF + DH ]
— identical in shape to scalar 2×2 multiplication, except each product like AE is a
matrix product: A’s column count must match E’s row count, and the order AE must
be kept, never EA.
“Sizes line up” is doing more work in that sentence than it appears to. For ordinary matrices
you check one thing — left’s columns equal right’s rows. For blocks you must also check that
the two matrices were cut compatibly: the way you slice the columns of the left matrix has
to match, split for split, the way you slice the rows of the right one. Chop a 4×4 into
2+2 columns and multiply it by a 4×4 chopped into 3+1 rows and the block formula is
meaningless, even though the ordinary product is perfectly well defined. Same numbers,
incompatible partitions.
Run the rule once on real blocks and it stops feeling like notation. Let every block be 2×2,
with A = I, B = 2I, D = 3I, and the lower-left block zero:
M = [ A B ] M·M = [ A·A A·B + B·D ] A·B + B·D = 2I + 6I = 8I
[ 0 D ] [ 0 D·D ] D·D = 9I
Check one entry the long way. Written out, M carries a 2 at position (1, 3) and a 3 at
(3, 3), so entry (1, 3) of M·M is 1·2 + 2·3 = 8 — exactly the 8I the block formula
predicted, and no 4×4 bookkeeping was needed to get it.
The payoff GATE leans on: when the blocks land in a block-triangular (one off-diagonal block zero) or block-diagonal (both zero) pattern, two normally-painful operations turn trivial. The determinant collapses to the product of the diagonal blocks:
det [ A B ] = det(A) · det(D) (block-triangular: lower-left = 0)
[ 0 D ]
det diag(A, B, C, …) = det(A) · det(B) · det(C) · … (block-diagonal)
And a block-diagonal matrix inverts block by block: diag(A, B)⁻¹ = diag(A⁻¹, B⁻¹),
provided each diagonal block is itself invertible.
A worked example
Take M = diag(A, B) with A = [[2, 0], [0, 2]] (det = 4) and B = [[1, 1], [0, 3]]
(det = 3). Written out, M is the 4×4
M = [ 2 0 | 0 0 ]
[ 0 2 | 0 0 ]
[ ---------- ] det(M) = det(A) · det(B) = 4 · 3 = 12
[ 0 0 | 1 1 ]
[ 0 0 | 0 3 ]
No 4×4 cofactor expansion needed — the block structure does the work, turning 4 × 3 = 12 into the whole answer.
A question to carry forward
We have now broken matrices apart in several ways — into eigen-pieces QΛQᵀ, into
triangular LU factors, into blocks. But every one of those needed the matrix to be
square. Here is the thread onward: is there a single decomposition that works for any
matrix at all — rectangular, rank-deficient, anything — and reveals its true “stretch
directions” the way eigenvalues do for a square one?
In one breath
- A partitioned (block) matrix regroups the same numbers into rectangular blocks; blocks add and multiply block-wise like scalars — when sizes are conformable.
- Block multiplication is row-times-column with matrix blocks: each
AEis a matrix product, order kept (AE ≠ EA). - Block-triangular / block-diagonal determinant = product of the diagonal blocks’ determinants (
det diag(A,B) = det(A)·det(B)). - Block-diagonal inverse is block-wise:
diag(A,B)⁻¹ = diag(A⁻¹, B⁻¹)(each block invertible). - The determinant shortcut needs a zero off-diagonal block — a full block matrix does not give
det(A)·det(D).
Practice
Quick check
Practice this in an interview
All questionsA transformer block combines multi-head self-attention and a position-wise feed-forward network, with a residual addition and normalization around each sublayer. Post-norm normalizes after each residual addition; pre-norm normalizes the sublayer input before adding its output, usually making deep training more stable, though neither placement is universally best.
Small multiples (also called trellis or facet charts) repeat the same chart structure across panels, one per category, using identical scales, axes, and visual encodings. They let viewers compare patterns across groups without the visual tangle of many overlapping lines or bars, and are the right choice when you have more than three to four groups or when overlap obscures individual trends.