Question

In: Advanced Math

23. Consider the 5 x 6 matrix A whose (i,j)h element is aij i+j; (a) What...

23. Consider the 5 x 6 matrix A whose (i,j)h element is aij i+j;

(a) What is A(10:20)?

(b) What is k such that A(k) = A(3,4)?

(c) Show how A is stored in sparse column format

(d) Show how A is stored in sparse row format

(e) What is the sparsity ratio?

Solutions

Expert Solution

Matlab code

A=zeros(5,6);
for i=1:5
for j=1:6
A(i,j)=i+j;
end
end
A
A(10:20)%(a)
A(3,4)
A(10)%k=10 (b)
S=sparse(A)%(c)sparse column format
S'%(d)Sparse row format
sparsity_ratio=1-nnz(A)/numel(A)%(e)1-The density of a matrix is the ratio of nonzeros to the total number of elements

Output

A =

2 3 4 5 6 7
3 4 5 6 7 8
4 5 6 7 8 9
5 6 7 8 9 10
6 7 8 9 10 11


ans =

7 4 5 6 7 8 5 6 7 8 9


ans =

7


ans =

7


S =

(1,1) 2
(2,1) 3
(3,1) 4
(4,1) 5
(5,1) 6
(1,2) 3
(2,2) 4
(3,2) 5
(4,2) 6
(5,2) 7
(1,3) 4
(2,3) 5
(3,3) 6
(4,3) 7
(5,3) 8
(1,4) 5
(2,4) 6
(3,4) 7
(4,4) 8
(5,4) 9
(1,5) 6
(2,5) 7
(3,5) 8
(4,5) 9
(5,5) 10
(1,6) 7
(2,6) 8
(3,6) 9
(4,6) 10
(5,6) 11


ans =

(1,1) 2
(2,1) 3
(3,1) 4
(4,1) 5
(5,1) 6
(6,1) 7
(1,2) 3
(2,2) 4
(3,2) 5
(4,2) 6
(5,2) 7
(6,2) 8
(1,3) 4
(2,3) 5
(3,3) 6
(4,3) 7
(5,3) 8
(6,3) 9
(1,4) 5
(2,4) 6
(3,4) 7
(4,4) 8
(5,4) 9
(6,4) 10
(1,5) 6
(2,5) 7
(3,5) 8
(4,5) 9
(5,5) 10
(6,5) 11


sparsity_ratio =

0


Related Solutions

Determine all possible Jordan canonical forms J for a matrix of order 6 whose minimal polynomial is
Determine all possible Jordan canonical forms J for a matrix of order 6 whose minimal polynomial is  \( m(\lambda)=\bigg(\lambda-1\bigg)^3\bigg(\lambda-3\bigg)^2 \)
For x ∈ [−2, 6],h(x) = 2x, j(x) = x2, and k(x) = 2x. 1. Represent...
For x ∈ [−2, 6],h(x) = 2x, j(x) = x2, and k(x) = 2x. 1. Represent each function with a sample table 2. Graph all three functions on the same coordinate system 3. Find the average rate of change for each function at x = . -1, x = 2, and x = 4
Let h( x) = ( x − 5)( x − 6)( x − 7) a. Explain...
Let h( x) = ( x − 5)( x − 6)( x − 7) a. Explain why Rolle’s Theorem can be applied on the interval [-5,7]. b. Find all values of c in the open interval (5,7) such that f'(c)=0.
Consider the matrix P = I - X(XTX)-1X T . If matrix X has 4 rows...
Consider the matrix P = I - X(XTX)-1X T . If matrix X has 4 rows and 6 columns, what are the dimensions of matrix I? Prove that P is idempotent.
Let x ∈ R3 be nonzero and let A be the matrix whose columns are x,...
Let x ∈ R3 be nonzero and let A be the matrix whose columns are x, 2x, 3x in this order. Show that x is an eigenvector of A and find a basis for the null space of A.
I bought a stock on 10/05/2018 for $150 and collected $5 on 11/23/2018 and another $5 on 5/23/2019 and another $6 on 11/23/2019
I bought a stock on 10/05/2018 for $150 and collected $5 on 11/23/2018 and another $5 on 5/23/2019 and another $6 on 11/23/2019. i sold it on 1/23/2020 for $175. what is the internal rate of return on the investment?
Suppose that A is a 6 x 6 matrix that can be written as a product...
Suppose that A is a 6 x 6 matrix that can be written as a product of matrices A = BC where B is 6 x 4 and C is 4 x 6. Prove that A is not invertible. An economist builds a Leontief input-output model for the interaction between the mining and energy sectors of a local economy using the following assumptions: In order to produce 1 million dollars of output, the mining sector requires 0.1 million dollars of...
5. Find a matrix A of rank 2 whose nullspace N(A) has dimension 3 and whose...
5. Find a matrix A of rank 2 whose nullspace N(A) has dimension 3 and whose transposed nullspace N(AT) has dimension 2.
Consider the following bivariate data. Point A B C D E F G H I J...
Consider the following bivariate data. Point A B C D E F G H I J x 0 1 1 2 3 4 5 6 6 7 y 5 5 6 5 4 3 2 0 1 1 (a) Construct a scatter diagram of the given bivariate data. (Do this on paper. Your instructor may ask you to turn in this work.) (b) Calculate the covariance. (Give your answer correct to two decimal places.) (c) Calculate sx and sy. (Give...
Consider the following demand curve: A B C D E F G H I J P...
Consider the following demand curve: A B C D E F G H I J P $0.50 $0.45 $0.40 $0.35 $0.30 $0.25 $0.20 $0.15 $0.10 $0.05 QD 1 2 4 6 9 12 16 20 25 30 Calculate elasticities for pairs of points to check statements that were made during class and in the text. When making the calculations, use average price and average quantity for the two points. The formula for this should be in your notes. It is...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT