Datasets:
task_id stringlengths 6 6 | category stringclasses 6
values | prompt stringlengths 88 308 | api_description stringclasses 1
value | expected_output stringlengths 18 124 |
|---|---|---|---|---|
st-000 | elimination | Give the reduced row echelon form of A. Return three rows of four rationals each, so each row is eight integers [n1,d1,n2,d2,n3,d3,n4,d4]. | The tasks refer to these fixed matrices, all with integer entries.
A (3x4) B (3x3) C (3x3, symmetric) M (4x4)
[1 3 1 2] [2 1 1] [2 1 1] [2 0 1 3]
[2 6 4 8] [1 3 2] [1 2 1] [1 1 0 2]
[1 3 2 5] [1 0 0] [1 1 2] ... | {"rows": [[1, 1, 3, 1, 0, 1, 0, 1], [0, 1, 0, 1, 1, 1, 0, 1], [0, 1, 0, 1, 0, 1, 1, 1]]} |
st-001 | elimination | Give the pivot columns of A as 1-based indices, then its rank, then its nullity. Return one row: the pivot indices followed by the rank and the nullity. | The tasks refer to these fixed matrices, all with integer entries.
A (3x4) B (3x3) C (3x3, symmetric) M (4x4)
[1 3 1 2] [2 1 1] [2 1 1] [2 0 1 3]
[2 6 4 8] [1 3 2] [1 2 1] [1 1 0 2]
[1 3 2 5] [1 0 0] [1 1 2] ... | {"rows": [[1, 3, 4, 3, 1]]} |
st-002 | elimination | Give the rank of A, of B, of C and of M, in that order. Return one row of four integers. | The tasks refer to these fixed matrices, all with integer entries.
A (3x4) B (3x3) C (3x3, symmetric) M (4x4)
[1 3 1 2] [2 1 1] [2 1 1] [2 0 1 3]
[2 6 4 8] [1 3 2] [1 2 1] [1 1 0 2]
[1 3 2 5] [1 0 0] [1 1 2] ... | {"rows": [[3, 3, 3, 4]]} |
st-003 | elimination | Give the reduced row echelon form of B. Return three rows of three rationals, so each row is six integers. | The tasks refer to these fixed matrices, all with integer entries.
A (3x4) B (3x3) C (3x3, symmetric) M (4x4)
[1 3 1 2] [2 1 1] [2 1 1] [2 0 1 3]
[2 6 4 8] [1 3 2] [1 2 1] [1 1 0 2]
[1 3 2 5] [1 0 0] [1 1 2] ... | {"rows": [[1, 1, 0, 1, 0, 1], [0, 1, 1, 1, 0, 1], [0, 1, 0, 1, 1, 1]]} |
st-004 | elimination | How many free variables does each of A, B, C and M have — that is, columns minus rank? Return one row of four integers. | The tasks refer to these fixed matrices, all with integer entries.
A (3x4) B (3x3) C (3x3, symmetric) M (4x4)
[1 3 1 2] [2 1 1] [2 1 1] [2 0 1 3]
[2 6 4 8] [1 3 2] [1 2 1] [1 1 0 2]
[1 3 2 5] [1 0 0] [1 1 2] ... | {"rows": [[1, 0, 0, 0]]} |
st-005 | elimination | Give the rank of A transposed, and confirm the row rank equals the column rank by giving the rank of A as well. Return one row [rank_AT, rank_A]. | The tasks refer to these fixed matrices, all with integer entries.
A (3x4) B (3x3) C (3x3, symmetric) M (4x4)
[1 3 1 2] [2 1 1] [2 1 1] [2 0 1 3]
[2 6 4 8] [1 3 2] [1 2 1] [1 1 0 2]
[1 3 2 5] [1 0 0] [1 1 2] ... | {"rows": [[3, 3]]} |
st-006 | elimination | Give the rank of the matrix formed by stacking A on top of itself (a 6x4 matrix), and the rank of A. Return one row [rank_stacked, rank_A]. | The tasks refer to these fixed matrices, all with integer entries.
A (3x4) B (3x3) C (3x3, symmetric) M (4x4)
[1 3 1 2] [2 1 1] [2 1 1] [2 0 1 3]
[2 6 4 8] [1 3 2] [1 2 1] [1 1 0 2]
[1 3 2 5] [1 0 0] [1 1 2] ... | {"rows": [[3, 3]]} |
st-007 | subspaces | Give the special solutions spanning the nullspace of A, using the standard construction: one per free column, that free variable set to 1 and the other free variables 0, ordered by increasing column index. Return one row per solution, each of four rationals (eight integers). | The tasks refer to these fixed matrices, all with integer entries.
A (3x4) B (3x3) C (3x3, symmetric) M (4x4)
[1 3 1 2] [2 1 1] [2 1 1] [2 0 1 3]
[2 6 4 8] [1 3 2] [1 2 1] [1 1 0 2]
[1 3 2 5] [1 0 0] [1 1 2] ... | {"rows": [[-3, 1, 1, 1, 0, 1, 0, 1]]} |
st-008 | subspaces | Give the dimension of the nullspace of A, of its column space, and of the nullspace of A transposed (the left nullspace). Return one row of three integers. | The tasks refer to these fixed matrices, all with integer entries.
A (3x4) B (3x3) C (3x3, symmetric) M (4x4)
[1 3 1 2] [2 1 1] [2 1 1] [2 0 1 3]
[2 6 4 8] [1 3 2] [1 2 1] [1 1 0 2]
[1 3 2 5] [1 0 0] [1 1 2] ... | {"rows": [[1, 3, 0]]} |
st-009 | subspaces | For A, give the four subspace dimensions in the order row space, column space, nullspace, left nullspace. Then give the sum of the row space and nullspace dimensions. Return one row of five integers. | The tasks refer to these fixed matrices, all with integer entries.
A (3x4) B (3x3) C (3x3, symmetric) M (4x4)
[1 3 1 2] [2 1 1] [2 1 1] [2 0 1 3]
[2 6 4 8] [1 3 2] [1 2 1] [1 1 0 2]
[1 3 2 5] [1 0 0] [1 1 2] ... | {"rows": [[3, 3, 1, 0, 4]]} |
st-010 | subspaces | Is the vector [1, 0, 1] in the column space of C? Give 1 or 0, then the rank of C, then the rank of C with that vector appended as a fourth column. Return one row of three integers. | The tasks refer to these fixed matrices, all with integer entries.
A (3x4) B (3x3) C (3x3, symmetric) M (4x4)
[1 3 1 2] [2 1 1] [2 1 1] [2 0 1 3]
[2 6 4 8] [1 3 2] [1 2 1] [1 1 0 2]
[1 3 2 5] [1 0 0] [1 1 2] ... | {"rows": [[1, 3, 3]]} |
st-011 | subspaces | Give the nullspace dimension of C, and the rank of C. Then say whether C is invertible with 1 or 0. Return one row of three integers. | The tasks refer to these fixed matrices, all with integer entries.
A (3x4) B (3x3) C (3x3, symmetric) M (4x4)
[1 3 1 2] [2 1 1] [2 1 1] [2 0 1 3]
[2 6 4 8] [1 3 2] [1 2 1] [1 1 0 2]
[1 3 2 5] [1 0 0] [1 1 2] ... | {"rows": [[0, 3, 1]]} |
st-012 | subspaces | Give the special solutions of the nullspace of the 2x4 matrix formed by the FIRST TWO rows of A, under the same standard construction. Return one row per solution, each of four rationals (eight integers). | The tasks refer to these fixed matrices, all with integer entries.
A (3x4) B (3x3) C (3x3, symmetric) M (4x4)
[1 3 1 2] [2 1 1] [2 1 1] [2 0 1 3]
[2 6 4 8] [1 3 2] [1 2 1] [1 1 0 2]
[1 3 2 5] [1 0 0] [1 1 2] ... | {"rows": [[-3, 1, 1, 1, 0, 1, 0, 1], [0, 1, 0, 1, -2, 1, 1, 1]]} |
st-013 | determinants | Give det(B), det(C) and det(M) as exact rationals. Return three rows of [numerator, denominator]. | The tasks refer to these fixed matrices, all with integer entries.
A (3x4) B (3x3) C (3x3, symmetric) M (4x4)
[1 3 1 2] [2 1 1] [2 1 1] [2 0 1 3]
[2 6 4 8] [1 3 2] [1 2 1] [1 1 0 2]
[1 3 2 5] [1 0 0] [1 1 2] ... | {"rows": [[-1, 1], [4, 1], [-20, 1]]} |
st-014 | determinants | Give det(B*C) and det(B)*det(C) as exact rationals, to check they agree. Return two rows of [numerator, denominator]. | The tasks refer to these fixed matrices, all with integer entries.
A (3x4) B (3x3) C (3x3, symmetric) M (4x4)
[1 3 1 2] [2 1 1] [2 1 1] [2 0 1 3]
[2 6 4 8] [1 3 2] [1 2 1] [1 1 0 2]
[1 3 2 5] [1 0 0] [1 1 2] ... | {"rows": [[-4, 1], [-4, 1]]} |
st-015 | determinants | Give det(M transposed) and det(M). Then give det of M with its first two rows exchanged. Return three rows of [numerator, denominator]. | The tasks refer to these fixed matrices, all with integer entries.
A (3x4) B (3x3) C (3x3, symmetric) M (4x4)
[1 3 1 2] [2 1 1] [2 1 1] [2 0 1 3]
[2 6 4 8] [1 3 2] [1 2 1] [1 1 0 2]
[1 3 2 5] [1 0 0] [1 1 2] ... | {"rows": [[-20, 1], [-20, 1], [20, 1]]} |
st-016 | determinants | Give det of B with its first row multiplied by 5, and det(B), and the ratio of the first to the second. Return three rows of [numerator, denominator]. | The tasks refer to these fixed matrices, all with integer entries.
A (3x4) B (3x3) C (3x3, symmetric) M (4x4)
[1 3 1 2] [2 1 1] [2 1 1] [2 0 1 3]
[2 6 4 8] [1 3 2] [1 2 1] [1 1 0 2]
[1 3 2 5] [1 0 0] [1 1 2] ... | {"rows": [[-5, 1], [-1, 1], [5, 1]]} |
st-017 | determinants | Give det(B inverse) as an exact rational, and det(B), and their product. Return three rows of [numerator, denominator]. | The tasks refer to these fixed matrices, all with integer entries.
A (3x4) B (3x3) C (3x3, symmetric) M (4x4)
[1 3 1 2] [2 1 1] [2 1 1] [2 0 1 3]
[2 6 4 8] [1 3 2] [1 2 1] [1 1 0 2]
[1 3 2 5] [1 0 0] [1 1 2] ... | {"rows": [[-1, 1], [-1, 1], [1, 1]]} |
st-018 | factorisation | Give the exact inverse of B. Return three rows of three rationals, so each row is six integers. | The tasks refer to these fixed matrices, all with integer entries.
A (3x4) B (3x3) C (3x3, symmetric) M (4x4)
[1 3 1 2] [2 1 1] [2 1 1] [2 0 1 3]
[2 6 4 8] [1 3 2] [1 2 1] [1 1 0 2]
[1 3 2 5] [1 0 0] [1 1 2] ... | {"rows": [[0, 1, 0, 1, 1, 1], [-2, 1, 1, 1, 3, 1], [3, 1, -1, 1, -5, 1]]} |
st-019 | factorisation | Compute B times its inverse and give the result. Return three rows of three rationals (six integers each). | The tasks refer to these fixed matrices, all with integer entries.
A (3x4) B (3x3) C (3x3, symmetric) M (4x4)
[1 3 1 2] [2 1 1] [2 1 1] [2 0 1 3]
[2 6 4 8] [1 3 2] [1 2 1] [1 1 0 2]
[1 3 2 5] [1 0 0] [1 1 2] ... | {"rows": [[1, 1, 0, 1, 0, 1], [0, 1, 1, 1, 0, 1], [0, 1, 0, 1, 1, 1]]} |
st-020 | factorisation | Factor C as L*U with NO row exchanges and L having a unit diagonal. Give L as three rows of three rationals (six integers each). | The tasks refer to these fixed matrices, all with integer entries.
A (3x4) B (3x3) C (3x3, symmetric) M (4x4)
[1 3 1 2] [2 1 1] [2 1 1] [2 0 1 3]
[2 6 4 8] [1 3 2] [1 2 1] [1 1 0 2]
[1 3 2 5] [1 0 0] [1 1 2] ... | {"rows": [[1, 1, 0, 1, 0, 1], [1, 2, 1, 1, 0, 1], [1, 2, 1, 3, 1, 1]]} |
st-021 | factorisation | The same LU factorisation of C. Give U as three rows of three rationals (six integers each). | The tasks refer to these fixed matrices, all with integer entries.
A (3x4) B (3x3) C (3x3, symmetric) M (4x4)
[1 3 1 2] [2 1 1] [2 1 1] [2 0 1 3]
[2 6 4 8] [1 3 2] [1 2 1] [1 1 0 2]
[1 3 2 5] [1 0 0] [1 1 2] ... | {"rows": [[2, 1, 1, 1, 1, 1], [0, 1, 3, 2, 1, 2], [0, 1, 0, 1, 4, 3]]} |
st-022 | factorisation | Apply Gram-Schmidt to v1, v2, v3 in that order, WITHOUT normalising to unit length (which would introduce square roots), and then scale each resulting vector so its first non-zero entry is exactly 1. Return one row per vector, each of three rationals (six integers). | The tasks refer to these fixed matrices, all with integer entries.
A (3x4) B (3x3) C (3x3, symmetric) M (4x4)
[1 3 1 2] [2 1 1] [2 1 1] [2 0 1 3]
[2 6 4 8] [1 3 2] [1 2 1] [1 1 0 2]
[1 3 2 5] [1 0 0] [1 1 2] ... | {"rows": [[1, 1, 1, 1, 0, 1], [1, 1, -1, 1, 2, 1], [1, 1, -1, 1, -1, 1]]} |
st-023 | eigen | Give the coefficients of the characteristic polynomial det(xI - C), highest power of x first. Return one row of four rationals (eight integers). | The tasks refer to these fixed matrices, all with integer entries.
A (3x4) B (3x3) C (3x3, symmetric) M (4x4)
[1 3 1 2] [2 1 1] [2 1 1] [2 0 1 3]
[2 6 4 8] [1 3 2] [1 2 1] [1 1 0 2]
[1 3 2 5] [1 0 0] [1 1 2] ... | {"rows": [[1, 1, -6, 1, 9, 1, -4, 1]]} |
st-024 | eigen | The eigenvalues of C are all integers. Give them in increasing order, with repetitions. Return one row of three integers. | The tasks refer to these fixed matrices, all with integer entries.
A (3x4) B (3x3) C (3x3, symmetric) M (4x4)
[1 3 1 2] [2 1 1] [2 1 1] [2 0 1 3]
[2 6 4 8] [1 3 2] [1 2 1] [1 1 0 2]
[1 3 2 5] [1 0 0] [1 1 2] ... | {"rows": [[1, 1, 4]]} |
st-025 | eigen | Give the trace of C, the sum of its eigenvalues, the determinant of C, and the product of its eigenvalues — four integers showing the two identities. Return one row of four integers. | The tasks refer to these fixed matrices, all with integer entries.
A (3x4) B (3x3) C (3x3, symmetric) M (4x4)
[1 3 1 2] [2 1 1] [2 1 1] [2 0 1 3]
[2 6 4 8] [1 3 2] [1 2 1] [1 1 0 2]
[1 3 2 5] [1 0 0] [1 1 2] ... | {"rows": [[6, 6, 4, 4]]} |
st-026 | eigen | Give an eigenvector of C for its LARGEST eigenvalue, scaled so its first non-zero entry is exactly 1. Return one row of three rationals (six integers). | The tasks refer to these fixed matrices, all with integer entries.
A (3x4) B (3x3) C (3x3, symmetric) M (4x4)
[1 3 1 2] [2 1 1] [2 1 1] [2 0 1 3]
[2 6 4 8] [1 3 2] [1 2 1] [1 1 0 2]
[1 3 2 5] [1 0 0] [1 1 2] ... | {"rows": [[1, 1, 1, 1, 1, 1]]} |
st-027 | eigen | Give the DIMENSION of the eigenspace of C for its largest eigenvalue and for its smallest, and say with 1 or 0 whether C is diagonalisable (the dimensions must sum to 3). Return one row of three integers. | The tasks refer to these fixed matrices, all with integer entries.
A (3x4) B (3x3) C (3x3, symmetric) M (4x4)
[1 3 1 2] [2 1 1] [2 1 1] [2 0 1 3]
[2 6 4 8] [1 3 2] [1 2 1] [1 1 0 2]
[1 3 2 5] [1 0 0] [1 1 2] ... | {"rows": [[1, 2, 1]]} |
st-028 | eigen | Give the coefficients of the characteristic polynomial det(xI - B), highest power first, and then the trace of B and det(B). Return one row of four rationals (eight integers) followed by one row of two integers. | The tasks refer to these fixed matrices, all with integer entries.
A (3x4) B (3x3) C (3x3, symmetric) M (4x4)
[1 3 1 2] [2 1 1] [2 1 1] [2 0 1 3]
[2 6 4 8] [1 3 2] [1 2 1] [1 1 0 2]
[1 3 2 5] [1 0 0] [1 1 2] ... | {"rows": [[1, 1, -5, 1, 4, 1, 1, 1], [5, -1]]} |
st-029 | projection | For LS_A, compute the normal-equation matrix LS_A^T * LS_A. Return two rows of two rationals (four integers each). | The tasks refer to these fixed matrices, all with integer entries.
A (3x4) B (3x3) C (3x3, symmetric) M (4x4)
[1 3 1 2] [2 1 1] [2 1 1] [2 0 1 3]
[2 6 4 8] [1 3 2] [1 2 1] [1 1 0 2]
[1 3 2 5] [1 0 0] [1 1 2] ... | {"rows": [[4, 1, 6, 1], [6, 1, 14, 1]]} |
st-030 | projection | Solve the least-squares problem LS_A * x = b exactly by the normal equations. Return one row of two rationals (four integers). | The tasks refer to these fixed matrices, all with integer entries.
A (3x4) B (3x3) C (3x3, symmetric) M (4x4)
[1 3 1 2] [2 1 1] [2 1 1] [2 0 1 3]
[2 6 4 8] [1 3 2] [1 2 1] [1 1 0 2]
[1 3 2 5] [1 0 0] [1 1 2] ... | {"rows": [[11, 10, 8, 5]]} |
st-031 | projection | Give the projection of b onto the column space of LS_A — that is, LS_A times the least-squares solution. Return one row of four rationals (eight integers). | The tasks refer to these fixed matrices, all with integer entries.
A (3x4) B (3x3) C (3x3, symmetric) M (4x4)
[1 3 1 2] [2 1 1] [2 1 1] [2 0 1 3]
[2 6 4 8] [1 3 2] [1 2 1] [1 1 0 2]
[1 3 2 5] [1 0 0] [1 1 2] ... | {"rows": [[11, 10, 27, 10, 43, 10, 59, 10]]} |
st-032 | projection | Give the residual b minus its projection onto the column space of LS_A, and then the dot product of that residual with each of LS_A's two columns — which must both be zero. Return one row of four rationals (eight integers) for the residual, then one row of two rationals (four integers) for the dot products. | The tasks refer to these fixed matrices, all with integer entries.
A (3x4) B (3x3) C (3x3, symmetric) M (4x4)
[1 3 1 2] [2 1 1] [2 1 1] [2 0 1 3]
[2 6 4 8] [1 3 2] [1 2 1] [1 1 0 2]
[1 3 2 5] [1 0 0] [1 1 2] ... | {"rows": [[-1, 10, 3, 10, -3, 10, 1, 10], [0, 1, 0, 1]]} |
st-033 | projection | Give the projection matrix P = LS_A * (LS_A^T LS_A)^-1 * LS_A^T. Return four rows of four rationals (eight integers each). | The tasks refer to these fixed matrices, all with integer entries.
A (3x4) B (3x3) C (3x3, symmetric) M (4x4)
[1 3 1 2] [2 1 1] [2 1 1] [2 0 1 3]
[2 6 4 8] [1 3 2] [1 2 1] [1 1 0 2]
[1 3 2 5] [1 0 0] [1 1 2] ... | {"rows": [[7, 10, 2, 5, 1, 10, -1, 5], [2, 5, 3, 10, 1, 5, 1, 10], [1, 10, 1, 5, 3, 10, 2, 5], [-1, 5, 1, 10, 2, 5, 7, 10]]} |
st-034 | projection | Give the trace of that projection matrix P, and the rank of LS_A — for a projection onto a subspace they are equal. Return one row of two integers. | The tasks refer to these fixed matrices, all with integer entries.
A (3x4) B (3x3) C (3x3, symmetric) M (4x4)
[1 3 1 2] [2 1 1] [2 1 1] [2 0 1 3]
[2 6 4 8] [1 3 2] [1 2 1] [1 1 0 2]
[1 3 2 5] [1 0 0] [1 1 2] ... | {"rows": [[2, 2]]} |
strang-tasks-v1
35 exact linear-algebra tasks for the
strang-env RL
environment, on the topics of Introduction to Linear Algebra (Strang): elimination and RREF,
the four fundamental subspaces, determinants, LU and Gram-Schmidt, eigenvalues and
eigenvectors, projection and least squares.
| field | meaning |
|---|---|
task_id |
st-000 … st-034 |
category |
elimination / subspaces / determinants / factorisation / eigen / projection |
prompt |
the question, the normalisation convention, and the exact shape of the answer |
api_description |
the fixed integer matrices, plus the exact-arithmetic and normalisation rules |
expected_output |
JSON {"rows": [...]}, computed by executing a reference solution |
Categories: elimination 7, subspaces 6, determinants 5, factorisation 5, eigen 6, projection 6.
No dependencies — fractions and itertools are standard library, and numpy is deliberately
not installed.
Original matrices, not the book's exercises
The matrices are invented here. That matters more in this subject than most: the worked examples in a famous linear algebra text are reproduced in thousands of lecture notes, so their RREFs and eigenvalues are memorisable. These are not.
The trap: most linear-algebra answers are not unique
- A basis of the nullspace is not unique — any independent spanning set is correct. An environment that asks for "a basis" and compares vectors marks correct work wrong.
- An eigenvector is defined only up to scale, and up to any rotation inside an eigenspace of dimension greater than one.
- LU is not unique without saying which factor carries the unit diagonal.
- Gram-Schmidt is unique only up to sign.
What is unique: the RREF, rank, nullity, determinant, trace, the characteristic polynomial, the projection matrix, and the least-squares solution of a full-rank system. This dataset asks for those, and where it wants a non-unique object it states the normalisation — special solutions with the free variable set to 1 and ordered by column index, eigenvectors scaled so the first non-zero entry is 1, L with a unit diagonal.
Gram-Schmidt is deliberately not normalised to unit length: that would introduce square roots and leave nothing exact to grade. Scaling each vector by its first non-zero entry keeps everything rational and removes the sign ambiguity, which is the real obstacle to grading it.
No floats, anywhere
Entries are integers or exact rationals as [numerator, denominator]; a vector of rationals is
flattened, so (1/2, 3) is the row [1, 2, 3, 1]. This is not fastidiousness: floating-point
elimination on a nearly-singular matrix is the classic way to compute a confidently wrong
rank — a pivot that should be exactly zero comes out as 1e-17 and the rank is one too
large. An environment that graded floats would be teaching precisely the wrong lesson, so a
float never passes for an integer even when equal in value.
The helpers are cross-checked, not trusted
Before any answer key is built, the exact-arithmetic helpers are checked against independent
identities: det(AB) = det(A)det(B), det(Aᵀ) = det(A), A·A⁻¹ = I, rank + nullity = n, the
characteristic polynomial's trace and determinant terms, and every special solution actually
lying in the nullspace. Individual tasks assert more: that L·U reconstructs the matrix, that a
claimed eigenvector really satisfies Cv = λv, that the least-squares residual is orthogonal to
both columns, and that the projection matrix satisfies P² = P = Pᵀ.
Verify with python environments/strang_env/build_tasks.py --verify (35/35).
Source: https://github.com/eltociear/my-molt-agent/tree/main/environments/strang_env
- Downloads last month
- 28