Subjects linear algebra

Jacobi Gauss Seidel A53Ba3

Step-by-step solutions with LaTeX - clean, fast, and student-friendly.

Use the AI math solver

1. **Stating the problem:** We want to solve the system of linear equations using Jacobi and Gauss-Seidel iterations with initial guess $[x^{(0)}, y^{(0)}, z^{(0)}] = [1, 2, 3]$ and tolerance $\varepsilon = 0.2$. The system is: $$\begin{cases} 5x - 9 + z = 10 \\ 2x + 8y - z = 11 \\ -x + y + 4z = 3 \end{cases}$$ 2. **Rewrite equations in standard form:** First, rewrite the first equation correctly: $$5x - 9 + z = 10 \implies 5x + z = 19$$ So the system is: $$\begin{cases} 5x + z = 19 \\ 2x + 8y - z = 11 \\ -x + y + 4z = 3 \end{cases}$$ 3. **Express each variable explicitly for iteration:** Jacobi and Gauss-Seidel require isolating each variable: $$x = \frac{19 - z}{5}$$ $$y = \frac{11 - 2x + z}{8}$$ $$z = \frac{3 + x - y}{4}$$ 4. **Jacobi Iteration:** Use previous iteration values for all variables. Initial guess: $x^{(0)}=1$, $y^{(0)}=2$, $z^{(0)}=3$ Iteration 1: $$x^{(1)} = \frac{19 - z^{(0)}}{5} = \frac{19 - 3}{5} = \frac{16}{5} = 3.2$$ $$y^{(1)} = \frac{11 - 2x^{(0)} + z^{(0)}}{8} = \frac{11 - 2(1) + 3}{8} = \frac{11 - 2 + 3}{8} = \frac{12}{8} = 1.5$$ $$z^{(1)} = \frac{3 + x^{(0)} - y^{(0)}}{4} = \frac{3 + 1 - 2}{4} = \frac{2}{4} = 0.5$$ Check convergence by max difference: $$\max(|3.2 - 1|, |1.5 - 2|, |0.5 - 3|) = \max(2.2, 0.5, 2.5) = 2.5 > 0.2$$ Iteration 2: $$x^{(2)} = \frac{19 - z^{(1)}}{5} = \frac{19 - 0.5}{5} = \frac{18.5}{5} = 3.7$$ $$y^{(2)} = \frac{11 - 2x^{(1)} + z^{(1)}}{8} = \frac{11 - 2(3.2) + 0.5}{8} = \frac{11 - 6.4 + 0.5}{8} = \frac{5.1}{8} = 0.6375$$ $$z^{(2)} = \frac{3 + x^{(1)} - y^{(1)}}{4} = \frac{3 + 3.2 - 1.5}{4} = \frac{4.7}{4} = 1.175$$ Max difference: $$\max(|3.7 - 3.2|, |0.6375 - 1.5|, |1.175 - 0.5|) = \max(0.5, 0.8625, 0.675) = 0.8625 > 0.2$$ Iteration 3: $$x^{(3)} = \frac{19 - z^{(2)}}{5} = \frac{19 - 1.175}{5} = \frac{17.825}{5} = 3.565$$ $$y^{(3)} = \frac{11 - 2x^{(2)} + z^{(2)}}{8} = \frac{11 - 2(3.7) + 1.175}{8} = \frac{11 - 7.4 + 1.175}{8} = \frac{4.775}{8} = 0.596875$$ $$z^{(3)} = \frac{3 + x^{(2)} - y^{(2)}}{4} = \frac{3 + 3.7 - 0.6375}{4} = \frac{6.0625}{4} = 1.515625$$ Max difference: $$\max(|3.565 - 3.7|, |0.596875 - 0.6375|, |1.515625 - 1.175|) = \max(0.135, 0.040625, 0.340625) = 0.340625 > 0.2$$ Iteration 4: $$x^{(4)} = \frac{19 - z^{(3)}}{5} = \frac{19 - 1.515625}{5} = \frac{17.484375}{5} = 3.496875$$ $$y^{(4)} = \frac{11 - 2x^{(3)} + z^{(3)}}{8} = \frac{11 - 2(3.565) + 1.515625}{8} = \frac{11 - 7.13 + 1.515625}{8} = \frac{5.385625}{8} = 0.673203125$$ $$z^{(4)} = \frac{3 + x^{(3)} - y^{(3)}}{4} = \frac{3 + 3.565 - 0.596875}{4} = \frac{5.968125}{4} = 1.49203125$$ Max difference: $$\max(|3.496875 - 3.565|, |0.673203125 - 0.596875|, |1.49203125 - 1.515625|) = \max(0.068125, 0.076328125, 0.02359375) = 0.076328125 < 0.2$$ Since max difference $<$ EPS, stop. Jacobi solution approx: $$x \approx 3.50, y \approx 0.67, z \approx 1.49$$ 5. **Gauss-Seidel Iteration:** Use updated values immediately. Initial guess: $x^{(0)}=1$, $y^{(0)}=2$, $z^{(0)}=3$ Iteration 1: $$x^{(1)} = \frac{19 - z^{(0)}}{5} = \frac{19 - 3}{5} = 3.2$$ $$y^{(1)} = \frac{11 - 2x^{(1)} + z^{(0)}}{8} = \frac{11 - 2(3.2) + 3}{8} = \frac{11 - 6.4 + 3}{8} = \frac{7.6}{8} = 0.95$$ $$z^{(1)} = \frac{3 + x^{(1)} - y^{(1)}}{4} = \frac{3 + 3.2 - 0.95}{4} = \frac{5.25}{4} = 1.3125$$ Max difference: $$\max(|3.2 - 1|, |0.95 - 2|, |1.3125 - 3|) = \max(2.2, 1.05, 1.6875) = 2.2 > 0.2$$ Iteration 2: $$x^{(2)} = \frac{19 - z^{(1)}}{5} = \frac{19 - 1.3125}{5} = 3.3375$$ $$y^{(2)} = \frac{11 - 2x^{(2)} + z^{(1)}}{8} = \frac{11 - 2(3.3375) + 1.3125}{8} = \frac{11 - 6.675 + 1.3125}{8} = \frac{5.6375}{8} = 0.7046875$$ $$z^{(2)} = \frac{3 + x^{(2)} - y^{(2)}}{4} = \frac{3 + 3.3375 - 0.7046875}{4} = \frac{5.6328125}{4} = 1.408203125$$ Max difference: $$\max(|3.3375 - 3.2|, |0.7046875 - 0.95|, |1.408203125 - 1.3125|) = \max(0.1375, 0.2453125, 0.095703125) = 0.2453125 > 0.2$$ Iteration 3: $$x^{(3)} = \frac{19 - z^{(2)}}{5} = \frac{19 - 1.408203125}{5} = 3.118359375$$ $$y^{(3)} = \frac{11 - 2x^{(3)} + z^{(2)}}{8} = \frac{11 - 2(3.118359375) + 1.408203125}{8} = \frac{11 - 6.23671875 + 1.408203125}{8} = \frac{6.171484375}{8} = 0.771435546875$$ $$z^{(3)} = \frac{3 + x^{(3)} - y^{(3)}}{4} = \frac{3 + 3.118359375 - 0.771435546875}{4} = \frac{5.346923828125}{4} = 1.33673095703125$$ Max difference: $$\max(|3.118359375 - 3.3375|, |0.771435546875 - 0.7046875|, |1.33673095703125 - 1.408203125|) = \max(0.219140625, 0.066748046875, 0.071472168) = 0.219140625 > 0.2$$ Iteration 4: $$x^{(4)} = \frac{19 - z^{(3)}}{5} = \frac{19 - 1.33673095703125}{5} = 3.132654188$$ $$y^{(4)} = \frac{11 - 2x^{(4)} + z^{(3)}}{8} = \frac{11 - 2(3.132654188) + 1.33673095703125}{8} = \frac{11 - 6.265308376 + 1.336730957}{8} = \frac{6.071422581}{8} = 0.7589278226$$ $$z^{(4)} = \frac{3 + x^{(4)} - y^{(4)}}{4} = \frac{3 + 3.132654188 - 0.7589278226}{4} = \frac{5.373726365}{4} = 1.343431591$$ Max difference: $$\max(|3.132654188 - 3.118359375|, |0.7589278226 - 0.771435546875|, |1.343431591 - 1.33673095703125|) = \max(0.014294813, 0.012507724, 0.006700634) = 0.014294813 < 0.2$$ Stop iteration. Gauss-Seidel solution approx: $$x \approx 3.13, y \approx 0.76, z \approx 1.34$$ **Final answers:** - Jacobi method: $x \approx 3.50$, $y \approx 0.67$, $z \approx 1.49$ - Gauss-Seidel method: $x \approx 3.13$, $y \approx 0.76$, $z \approx 1.34$