You solve a non-singular system of 1,000 linear equations with 1,000 unknowns. Your code uses the Gauss-Jordan algorithm with partial pivoting using double precision numbers and arithmetics. Why would the 2-norm of the residual of your solution not be zero?

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

You solve a non-singular system of 1,000 linear equations with 1,000 unknowns. Your code uses the Gauss-Jordan algorithm with partial pivoting using double precision numbers and arithmetics. Why would the 2-norm of the residual of your solution not be zero?

Expert Solution
Step 1

Program: a system of linear equations A*x=b.


 Method: calls Gauss-J elimination (with scaled pivoting).

Implicit none:

integer, parameter : n=3;

double exactness a(n, n), b(n), x(n)

integer l, m;

(1) Matrix A :

  1.   input (a(1,l), l=1,3) [ 0.0, 1.0, 2.0 ]
  2.   input (a(2,l), l=1,3) [ 2.0, 1.0, 4.0 ]
  3.   input (a(3,l), l=1,3) [ 2.0, 4.0, 6.0 ]

(2) Matrix b :

  input (b(l), l=1,3) [ 4.0, 3.0, 7.0 ]

  Print could be a header and therefore the initial equations:

  w (*, 100)

  do l = 1, n;

     w (*, 101)

           (a(l, m),m = 1,n), b(l);

  end do

decision Gauss-J_2(a, b, x, n) :

  Print matrix A and vector b when the cancellation :

  w (*, 102)

  do l = 1, n;

     w (*, 101)

      (a(l, m),m = 1, n), b(m);

  end do

 

 print solutions :

  w (*, 103)

  w (*, 101) (x(l),l=1, n)

100 format (' Gauss-J elimination with scaling and pivoting ' & ' Matrix A and vector b').

101 format (3f6.3).

102 format (' Matrix A and vector b when elimination').

103 format (' Solutions x(n)').

end.

end subprogram Gauss-J_2
Subroutine gauss_2(a, b, x, n).

 

 

steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Maximum Flow
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education