Professional Documents
Culture Documents
Homework 1
1. Given A R10002 , B R21000 and C R10001 , write down the number of real number multiplications needed to compute
the product ABC by the two procedures indicated below:
A(BC)
2. Prove that the eigenvalues of a real symmetric matrix are real.
3. If U RN N satisfies U T U = I, then U is called an orthonormal/unitary matrix.
Prove that the eigenvalues of U lie on the unit circle in the complex plane.
Prove that kxk2 = kbk2 .
Is kxk1 = kbk1 ?
4. Prove the following properties of a lower-triangular matrix:
Product of two lower triangular matrix is again lower triangular
EM
bk
As
rn
^
(AB)C
vr
Am
^ a
An incomplete code in the file named HW1 P7.cpp has been provided. Add your code to the above file. Make sure all the
relevant checks are done on the input. For instance, you need to check if that rows are positive integers, the entires are indeed
real numbers and so on. If there is any error in the input, your output should be INPUT ERROR.
FileName: Do not change the name of your .cpp file; It should be HW1 P7.cpp.
Input Format:
The first line contains the number of rows (positive integer) in the matrix.
The second line contains the number of columns (positive integer) in the matrix.
The third line onwards contains the entries (real number) of the matrix row-wise.
Output Format:
Print a single number as the kAk1 .
Ef
Sample Input 1:
2
2.71
Sample Output 1:
INPUT ERROR
Sample Input 2:
3.14
Sample Output 2:
INPUT ERROR
Sample Input 3:
2
3
e
Sample Output 3:
INPUT ERROR
Ef
vr
Am
^ a
EM
bk
As
rn
^
Sample Input 4:
2
3
3.0
5.0
6.25
7
1.98
0.31
Sample Output 4:
10.0