Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Here is the solution I came up with: x[1] = (y[1] – c[3]) / a[1]; x[2] = (y[2] –

ID: 3838984 • Letter: H

Question

Here is the solution I came up with:

x[1] = (y[1] – c[3]) / a[1];

x[2] = (y[2] – c[4]) / a[2];

for(i = 3; i <= n–2; i++){

     x[i+1] = (y[i+1] - c[i] - b[i+3]) / a[i+1]);

}//endfor

x[n-1] = (y[n-1] – b[n-3]) / a[n-1];

x[n] = (y[n] – b[n-2]) / a[n];

I think that the right hand side of each assignment statement is incorrect. Can someone help me fix this solution?

2) Write an algorithm to apply a single iteration of Gauss-Seidel to an nxn pentadiagonal system of the following form: a 0 c a yn-1 n-1 n-2 Assume that ai is never zero and that n 3

Explanation / Answer

Start
Declare the var and read the order of the matrix
Read the stopping criteria
Read the coefficients aim
Do for k=1 to p
Do for m=1 to p
Read a[k][m]
Repeat for m
Repeat for k
Read the coefficients b[k] for k=1 to p
Initialize x0[k] = 0 for k=1 to p
Set key=0
For k=1 to p
Set sum = b[k]
For j=1 to p
If (j not equal to k)
Set sum = sum – a[k][m] * x0[m]
Repeat m
x[k] = sum/a[k][k]
If absolute value of ((x[k] – x0[k]) / x[k]) > error, then
Set key = 1
Set x0[k] = x[k]
Repeat k
If key = 1, then
Initialize x0[k] = 0 for k=1 to p