Calculator inputs
Use comma-separated numbers. The page stays single column, while the form fields adapt to screen size.
Example data table
| Dimension | Basis vectors | Target vector | Expected coefficients | Interpretation |
|---|---|---|---|---|
| 2 | v1 = [1, 0], v2 = [0, 1] | [4, 5] | c1 = 4, c2 = 5 | The target is a direct combination of the standard basis. |
| 3 | v1 = [1, 0, 0], v2 = [0, 1, 0], v3 = [1, 1, 1] | [3, 2, 1] | c1 = 2, c2 = 1, c3 = 1 | The solver confirms exact span membership and exact reconstruction. |
| 2 | v1 = [1, 1], v2 = [2, 2] | [1, 0] | No exact solution | The target sits outside the line spanned by the basis vectors. |
Formula used
The solver builds a matrix from the selected basis vectors and tests whether the target vector can be written as a weighted sum of those columns.
A · c = bHere, A is the matrix of basis vectors, c is the coefficient vector, and b is the target vector.
Gauss-Jordan elimination reduces the augmented matrix [A | b]. The rank test determines consistency:
rank(A) = rank([A|b]) → exact solution existsWhen an approximation is requested, the page uses normal equations with light regularization:
(AᵀA + λI) · c = AᵀbHow to use this calculator
- Select the dimension of each vector and the number of basis vectors.
- Enter each basis vector using comma-separated values.
- Enter the target vector you want to reproduce.
- Choose the output precision and optional least-squares approximation.
- Press Solve linear combination to see results above the form.
- Review coefficients, ranks, reconstruction, and the Plotly graphs.
- Use the export buttons to save a CSV or PDF report.
Frequently asked questions
1) What does this calculator solve?
It checks whether a target vector can be written from selected basis vectors. It also returns coefficients, matrix rank, determinant when square, residuals, and graphs.
2) What is a linear combination?
A linear combination is a weighted sum of vectors. Each weight is a coefficient. Changing coefficients changes the final target vector.
3) Why do rank values matter?
The ranks show whether the system is consistent. Matching ranks mean an exact combination exists. Different ranks mean the target is outside the span.
4) What does “exact with free variables” mean?
It means multiple coefficient sets can produce the same target. The vectors are linearly dependent, so at least one variable remains free.
5) When is the determinant shown?
The determinant appears only when the matrix is square. It helps indicate invertibility and whether a unique exact solution is possible.
6) What is the least-squares option for?
Least squares gives the best approximate coefficients when no exact solution exists. It minimizes the size of the residual vector.
7) Why might my input fail validation?
Each vector must contain exactly the chosen number of numeric entries. Missing values, extra values, or text will stop calculation.
8) What do the graphs show?
One graph shows coefficient sizes. The other shows the basis and target geometry in two or three dimensions, or a comparison chart for higher dimensions.