I cannot come up with the right answers for my matrix.

I need to write as a system of equation and solve the system.
1 2 3 x 1
1 1 1 y = 12
-1 1 2 z 2

The answers I come up with are
31
15
15
when I check these, they will not work, what I am doing wrong?

1 2 3 1

1 1 1 12
-1 1 2 2
I want the first column to be 1 0 0 so subtract second from first and add third to first
1 2 3 1
0 1 2 -11
0 3 5 3
I want the second column to be 0 1 0 so
subtract twice the second from the first and subtract 3 times the second from the third
1 0 -1 23
0 1 2 -11
0 0 -1 36
I want the third column to be 0 0 1 so multiply the third row by -1 first
1 0 -1 23
0 1 2 -11
0 0 1 -36
now add the third to the first and subtract twice the third from the second
1 0 0 -13
0 1 0 61
0 0 1 -36
so I get x = -13 , y = 61, z = -36

when I am adding and subtracting I mean rows by the way.

The idea is that I can add anything times and row to any other row, just as I can add anything times any equation to any other equation. In fact that is exactly what I am doing.

I select what I want to multiply each by to get an identity matrix on the left, column by column, thereby separating the variables. I am really solving the equations by elimination, just in a particular fashion.

Oh, to write as a system of equations, multiply the coefficient matrix by the variable column

1 2 3 x 1
1 1 1 y = 12
-1 1 2 z 2
means
1 x + 2 y + 3 z = 1
1 x + 1 y + 1 z = 12
-1 x + 1 y + 2 z = 2

Oh, the particular fashion is often called Gauss-Jordan reduction

To solve this system of equations, let's use the method of Gaussian elimination. Here are the steps:

Step 1: Write the augmented matrix
Write the augmented matrix for the given system of equations by combining the coefficients and constant terms:

[1 2 3 | 1]
[1 1 1 | 12]
[-1 1 2 | 2]

Step 2: Perform row operations
Now, we'll perform row operations to transform the augmented matrix into row-echelon form.

1. R2 = R2 - R1:
[1 2 3 | 1]
[0 -1 -2 | 11]
[-1 1 2 | 2]

2. R3 = R3 + R1:
[1 2 3 | 1]
[0 -1 -2 | 11]
[0 3 5 | 3]

3. R3 = R3 + 3R2:
[1 2 3 | 1]
[0 -1 -2 | 11]
[0 0 -1 | 36]

Step 3: Back-substitution
Now we can perform back-substitution to find the values of x, y, and z.

From the third row, we get:
-1z = 36
=> z = -36

Substitute z = -36 into the second row:
-1y - 2(-36) = 11
=> -y + 72 = 11
=> -y = -61
=> y = 61

Substitute z = -36 and y = 61 into the first row:
x + 2(61) + 3(-36) = 1
=> x + 122 - 108 = 1
=> x + 14 = 1
=> x = 1 - 14
=> x = -13

Therefore, the solution to the system of equations is:
x = -13
y = 61
z = -36

Please make sure to double-check your calculations to verify the correctness of the solution.