tiny matrices, big drama

matrix mint tutorial

how to play the 2x2 and 3x3 matrix mint puzzles

play matrix mint

matrix mint is a number puzzle with a tiny physics secret inside it. the game gives you a matrix A. you fill a symmetric matrix P with integers from -9 to 9. then you press attempt.

if you already know sdps or lmis, you can skip this page. the game itself is meant to be self-explanatory: press start game, fill P, press attempt, adjust, repeat. the rest of this tutorial is for anyone who wants the puzzle logic without needing control theory first.

think of it like sudoku with a timer: there is a hidden rule, your entries must fit the board, and the board only judges you when you ask it to.

how to play

  1. choose a size: 2x2 or 3x3.
  2. press start game. that reveals matrix A and starts the clock.
  3. fill the empty tiles of P. only the upper half is editable because P mirrors itself.
  4. use integers from -9 to 9.
  5. press attempt. if the board mints, you win. if not, change a few entries and try again.

the game is checking whether your P makes two things true:

P > 0 AT P + P A < 0

that looks fancy, but the game is mostly asking a friendly question: did you build a good energy score?

the spring cart hiding under the tiles

imagine a small cart attached to a wall by a spring. give it a shove and it moves. the spring pulls it back. friction bleeds away energy. if the friction is doing its job, the cart should stop shaking and settle down.

cart
velocity
energy score goes down

the state of this cart can be described with two numbers: position and velocity. matrix A says how those numbers push each other around. a good matrix P builds an energy-like score from the state.

for a 2-number state, the score has the shape:

energy = P11 position2 + 2P12 position velocity + P22 velocity2

the first test, P > 0, means the score is a real measuring bowl: it is positive whenever the cart is away from rest. the second test, AT P + P A < 0, means the bowl is draining while the cart moves.

  1. large motion
  2. smaller motion
  3. rest

that is why the puzzle is interesting: you are not just matching numbers. you are trying to find a little certificate that says, “this motion is calming down.”

symmetric matrices

a symmetric matrix mirrors itself across the diagonal. the top-right entry equals the bottom-left entry.

P =
21
13
symmetric because both off-diagonal entries are 1

in the game, you only type the upper half of P. the lower half fills itself in because P21 = P12, P31 = P13, and P32 = P23.

what is a determinant?

a determinant is one number made from a square grid of numbers. for a 2x2 matrix:

ab
cd
det = a d - b c

for example:

31
24
det = 3*4 - 1*2 = 10

another one:

2-1
53
det = 2*3 - (-1)*5 = 11

one way to picture it: the determinant tells you whether the grid has real area. if the determinant is zero, the grid has been flattened. if it is positive in the right places, the matrix is behaving like a healthy measuring tool.

for a 3x3 matrix, the determinant is still just one number. the game uses the standard formula:

abc
def
ghi
det = a(ei - fh) - b(di - fg) + c(dh - eg)

you do not have to calculate every determinant by hand while playing. the point is to know what the board is checking when it says an attempt missed.

adding and multiplying matrices

matrix addition is entry by entry:

12
34
+
56
78
=
68
1012

matrix multiplication uses rows from the first matrix and columns from the second matrix:

12
34
*
20
12
=
44
108

for the top-left result, use the first row and first column:

1*2 + 2*1 = 4

the game uses this multiplication to build AT P + P A.

how to compute D1, D2, and D3

the board uses leading principal minors. that just means: start in the top-left corner and grow a square.

D1

4
3
2

D2

41
13
2

D3

410
131
012

for this example:

D1 = 4 D2 = det([[4, 1], [1, 3]]) = 4*3 - 1*1 = 11 D3 = det(full 3x3) = 18

for matrix P, all of these need to be positive. then the game computes N = -(AT P + P A) and checks the same kind of top-left minors again.

the tests

for a 2x2 puzzle, your matrix is:

P =
P11P12
P12P22

first, the board checks that P is positive:

P11 > 0 det(P) > 0

then the board forms N = -(AT P + P A). it checks that N is positive too:

N11 > 0 det(N) > 0

for a 3x3 puzzle, your matrix is:

P =
P11P12P13
P12P22P23
P13P23P33

the board checks the top-left pieces of P. these are called leading principal minors:

D1(P) > 0 D2(P) > 0 D3(P) > 0

then it checks the same top-left pieces of N:

D1(N) > 0 D2(N) > 0 D3(N) > 0

here, D1 is the first top-left number, D2 is the determinant of the top-left 2x2 block, and D3 is the determinant of the full 3x3 matrix.

the sdp bit

in real control theory, finding a matrix P like this can be written as a semidefinite program, or sdp. a solver searches through many possible matrices and tries to find one that proves the energy goes down.

matrix mint is the pocket-sized version. the entries are small integers, the board is tiny, and you are the solver.

that is the whole trick: choose numbers, press attempt, and mint a certificate before the clock gets smug.

play matrix mint