---
title: "Gauss elimination, partial pivoting, 4 unknowns"
subject: "Numerical Method"
chapter: 3
key: "semester_4/numerical_method:gauss-elimination-four-pivoting"
source: https://www.bctengineer.com/q/semester_4/numerical_method/gauss-elimination-four-pivoting
site: BCT Engineering
---

# Gauss elimination, partial pivoting, 4 unknowns

Numerical Method · Chapter 3: Solution of system of linear algebraic equations

- Asked in: 2069 Poush, 8 marks
- Video: [Gaussian Elimination with Partial Pivoting](https://www.youtube.com/watch?v=3aO2eG9lGk4) — AF Math & Engineering
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_4/numerical_method/gauss-elimination-four-pivoting
- Whole chapter: https://www.bctengineer.com/md/semester_4/numerical_method/chapter-3

## Question

Solve the following system of linear equations using the Gauss Elimination method with partial pivoting.
x + 2y - 12z + 8v = 27
5x + 4y + 7z - 2v = 4
-3x + 7y + 9z + 5v = 11
6x - 12y - 8z + 3v = 49

## Short answer

The system is solved by partial pivoting: at each step the row with largest pivot is swapped to the top. Forward elimination yields an upper triangular matrix; back substitution gives x=3.0000, y=-2.0000, z=1.0000, v=5.0000.

## Answer

**Gauss elimination with partial pivoting:** at each stage the row having the largest absolute value in the pivot column is brought to the pivot position (row swap) before elimination. This reduces round-off error. Then back substitution is used.

#### Step 1: System
```text
x + 2y - 12z + 8v = 27
5x + 4y + 7z - 2v = 4
-3x + 7y + 9z + 5v = 11
6x - 12y - 8z + 3v = 49
```

#### Step 2: Forward elimination (reduce to upper triangular form)

Augmented matrix [A | b]:

```text
  1.0000    2.0000  -12.0000    8.0000  |   27.0000
  5.0000    4.0000    7.0000   -2.0000  |    4.0000
 -3.0000    7.0000    9.0000    5.0000  |   11.0000
  6.0000  -12.0000   -8.0000    3.0000  |   49.0000
```

Column 1: largest pivot is in row 4, so swap R1 ↔ R4:

```text
  6.0000  -12.0000   -8.0000    3.0000  |   49.0000
  5.0000    4.0000    7.0000   -2.0000  |    4.0000
 -3.0000    7.0000    9.0000    5.0000  |   11.0000
  1.0000    2.0000  -12.0000    8.0000  |   27.0000
```

R2 ← R2 − (0.8333) R1; R3 ← R3 − (-0.5000) R1; R4 ← R4 − (0.1667) R1:

```text
  6.0000  -12.0000   -8.0000    3.0000  |   49.0000
  0.0000   14.0000   13.6667   -4.5000  |  -36.8333
  0.0000    1.0000    5.0000    6.5000  |   35.5000
  0.0000    4.0000  -10.6667    7.5000  |   18.8333
```

R3 ← R3 − (0.0714) R2; R4 ← R4 − (0.2857) R2:

```text
  6.0000  -12.0000   -8.0000    3.0000  |   49.0000
  0.0000   14.0000   13.6667   -4.5000  |  -36.8333
  0.0000    0.0000    4.0238    6.8214  |   38.1310
  0.0000    0.0000  -14.5714    8.7857  |   29.3571
```

Column 3: largest pivot is in row 4, so swap R3 ↔ R4:

```text
  6.0000  -12.0000   -8.0000    3.0000  |   49.0000
  0.0000   14.0000   13.6667   -4.5000  |  -36.8333
  0.0000    0.0000  -14.5714    8.7857  |   29.3571
  0.0000    0.0000    4.0238    6.8214  |   38.1310
```

R4 ← R4 − (-0.2761) R3:

```text
  6.0000  -12.0000   -8.0000    3.0000  |   49.0000
  0.0000   14.0000   13.6667   -4.5000  |  -36.8333
  0.0000    0.0000  -14.5714    8.7857  |   29.3571
  0.0000    0.0000    0.0000    9.2475  |   46.2377
```

#### Step 3: Back substitution

```text
v = (46.2377) / 9.2475 = 5.0000
z = (29.3571 − (8.7857)(5.0000)) / -14.5714 = 1.0000
y = (-36.8333 − (13.6667)(1.0000) − (-4.5000)(5.0000)) / 14.0000 = -2.0000
x = (49.0000 − (-12.0000)(-2.0000) − (-8.0000)(1.0000) − (3.0000)(5.0000)) / 6.0000 = 3.0000
```

**Answer: x = 3.0000, y = -2.0000, z = 1.0000, v = 5.0000**

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. Why is R1 swapped with R4 in column 1?
   A. 6 has the largest absolute value in column 1, and a large pivot reduces round-off error
   B. 6 is the largest right-hand side
   C. R4 has the most negative entries
   D. R1 must always be swapped
   Answer: A. Partial pivoting brings the largest absolute value in the column to the pivot position. (Key point: Why swap rows)

2. After the swap, what multiplier removes the 5 in row 2?
   A. 6/5 = 1.2
   B. 5/6 = 0.8333
   C. -3/6 = -0.5
   D. 1/6 = 0.1667
   Answer: B. Multiplier = entry/pivot = 5/6 = 0.8333. (Key point: Multiplier)

3. In column 3, why are R3 and R4 swapped?
   A. Because 4.0238 is negative
   B. Because the right-hand side is smaller
   C. |-14.5714| is larger than |4.0238|, so it becomes the pivot
   D. Because R3 has a zero in column 2
   Answer: C. The pivot is the entry of largest magnitude among those on and below the diagonal. (Key point: Second pivot swap)

4. Which unknown is found first in back substitution?
   A. v = 5, from the last row
   B. x = 3, from the first row
   C. y = -2, from the second row
   D. z = 1, from the third row
   Answer: A. The last row has only v: 9.2475 v = 46.2377 gives v = 5; then z, y, x follow. (Key point: Back substitution start)

## Close variants set in other exams

- [Gauss elimination/Jordan with pivoting](https://www.bctengineer.com/question.md?key=semester_4%2Fnumerical_method%3Agauss-jordan-partial-pivoting) — Numerical Method, chapter 3, asked 2×
- [Gauss elimination: x+2y+3z=6](https://www.bctengineer.com/question.md?key=semester_4%2Fnumerical_method%3Agauss-elimination-x-2y-3z) — Numerical Method, chapter 3, asked 3×
- [Gauss elimination: 4x4 system](https://www.bctengineer.com/question.md?key=semester_4%2Fnumerical_method%3Agauss-elimination-4x4-eleven) — Numerical Method, chapter 3, asked 3×

## Related in Numerical Method

- [Gauss-Seidel: four unknowns](https://www.bctengineer.com/question.md?key=semester_4%2Fnumerical_method%3Agauss-seidel-four-unknowns) — Numerical Method, chapter 3
- [Gauss-Seidel: 10x+y-z=11.19](https://www.bctengineer.com/question.md?key=semester_4%2Fnumerical_method%3Agauss-seidel-10x-y-z) — Numerical Method, chapter 3
- [Matrix inverse by Gauss elimination](https://www.bctengineer.com/question.md?key=semester_4%2Fnumerical_method%3Ainverse-gauss-elimination) — Numerical Method, chapter 3
- [Gauss-Jordan pseudo-code](https://www.bctengineer.com/question.md?key=semester_4%2Fnumerical_method%3Agauss-jordan-pseudocode) — Numerical Method, chapter 3, asked 4×

## Related in other subjects

- [Solve x y''+2y'=6x](https://www.bctengineer.com/question.md?key=semester_1%2Fmathematics_i%3Ade-xy2-plus-2y1-6x) — Mathematics I, chapter 4
- [Diagonal canonical form of (z⁻¹+2z⁻²)/(1+0.7z⁻¹+0.12z⁻²)](https://www.bctengineer.com/question.md?key=semester_6%2Fdigital_control_system%3Adiagonal-form-0-7-0-12) — Digital Control System, chapter 5, asked 13×
- [Solve ODE by Laplace transform y''−3y'+2y=4x+e^(3x)](https://www.bctengineer.com/question.md?key=semester_3%2Fmathematics_iii%3Asolve-ode-by-laplace-transform-y-ten) — Mathematics III, chapter 3, asked 14×
- [Solve y''−2y'+y=x²e^(3x)](https://www.bctengineer.com/question.md?key=semester_1%2Fmathematics_i%3Ade-y2-minus-2y1-plus-y-x2e3x) — Mathematics I, chapter 4
