Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

CompetencyIn this project, you will demonstrate your mastery of the following competencies:Interpret the properties of vector spacesUtilize advanced matrix techniques to solve complex linear...

1 answer below »

Competency


In this project, you will demonstrate your mastery of the following competencies:


  • Interpret the properties of vector spaces
  • Utilize advanced matrix techniques to solve complex linear problems

Scenario


You are employed as a computer programmer for a popular social media
site that stores a large amount of user media files. You believe you
have found a way to reduce costs by compressing image files using
singular-value decomposition (SVD). The compressed files would require
less storage space, which would result in savings for the company. You
think it will work, but you want to test your theory and record the
steps you take to use as a reference when sharing your idea with
management.


Directions


In order to guarantee that management fully understands the process,
you have mapped out the following steps to ensure you have captured the
process and have data to support your findings and to share with
management. Your plan is to demonstrate computations on a simple 3 x 3
matrix where the computations are easier to follow. Then you will
perform similar computations on a large image to compress the image data
without significantly degrading image quality.


To develop your idea proposal, work the problems described below. As
you complete each part, make sure to show your work and carefully
describe how you arrive at your final answer. Any MATLAB code or MATLAB
terminal outputs you generate should be included in your idea proposal
to support your answers and work.

Answered 1 days After Oct 09, 2022

Solution

Aditi answered on Oct 10 2022
58 Votes
Problem 1
(
%Generate Matrix A.
)Solution:
    A = [1
    2
    2;
    3
    4 5; 6 7 8]
    A = 3×3
1
    
    
2
    
    
2
    3
    
    4
    
    5
    6
    
    7
    
    8
    [U S V] =
U = 3×3
    svd(A)
    
    -0.2055
    -0.6658
    -0.7172
    -0.4900
    -0.5644
    0.6643
    -0.8471
    0.4880
    -0.2103
    S = 3×3
    
    
    14.4042
    0
    0
    0
    0.6450
    0
    0
    0
    0.3229
    V = 3×3
    
    
    -0.4692
    0.8820
    0.0433
    -0.5763
    -0.2687
    -0.7718
    -0.6691
    -0.3871
    0.6344
(
%Calculate the Rank 1 approximation of A.
A1 = U
(:,
1:1) * S(1:1, 1:1) * V(:,1:1)'
)
A1 = 3×3
    1.3889
    1.7059
    1.9807
    3.3118
    4.0678
    4.7230
    5.7253
    7.0322
    8.1649
(
%Verify rank = 1
ank(A1)
)
(
10
)
ans = 1
(
%Calculate the root-mean square e
or (RMSE) between A and A1.
RMSE1

=

norm(A-A1,
'fro'
)
(
3*3)
)
RMSE1 = 0.0801
Problem 2
(
%Calculate the Rank 2 approximation of A.
A2 = U
(:,
1:2) * S(1:2, 1:2) * V(:,1:2)'
)Solution:
A2 = 3×3
    1.0100
    1.8213
    2.1469
    2.9907
    4.1656
    4.8639
    6.0029
    6.9476
    8.0431
(
%Verify that rank = 2.
ank(A2)
)
(
%Calculate the root-mean square e
or between A and A2.
RMSE2

=

norm(A-A2,
'fro'
)
(
3*3)
)ans = 2
RMSE2 = 0.0359
Explain: According to the Project Two SVD Document, when K drops, the root-mean square e
or (RSME) increases, leading to a greater average e
or. This is accurate since RSME1 is equal to 0.0801 and RSME2 to 0.0359. These calculations plus the fact that A2's average e
or is lower than A1's would lead us to conclude that A2 is the better approximation, at least in terms of the average e
or noted before. When addressing compression ratios in Problems 6 and 7, this idea will be expanded upon further.
Problem 3
.
(
%
Seperate
U into three different vectors
in order to
calculate cross/dot
%
product
.
U1 = [-0.2055; -0.4900; -0.8471]
)Solution:
U1 = 3×1
-0.2055
-0.4900
(
U2 = [-0.6658; -0.5644; 0.4880]
)-0.8471
U2 = 3×1
-0.6658
-0.5644
(
U3 = [-0.7172; 0.6643; -0.2103]
)0.4880
U3 = 3×1
-0.7172
0.6643
(
%Calculate the dot product d1.
d1 =
dot(
U1, U2)
)-0.2103
d1 = -6.9000e-06
(
%Calculate the cross product(c), which should equal U3.
c = cross (U1, U2)
)
c = 3×1
-0.7172
0.6643
(
%Calculate the dot product d2.
d2 =
dot(
c, U3)
)-0.2103
d2 = 0.9999
Explain: Given that it equals U3, the cross product of U1 & U2 makes sense. This suggests that U1 & U2 are perpendicular vectors based on the knowledge gained through zyBooks. This result may be manually calculated, and its accuracy can be demonstrated by writing it down. The computation looks like this: (-0.4900 * 0.4880) \s- (-0.8471 * -0.5644) = -0.7172. Then, (-0.8471 * -0.6658) - (-0.2055 * 0.4880) = 0.6643. Last but not least, (-0.2055 * -0.5644) - (-0.4900 * -0.6658) = -0.2103.
Since c and U3 are identical in this product, the dot product d2 makes perfect sense to be 0.9999 (essentially 1), and this product may also be typed out directly like (-0.7172 * -0.7172) + (0.6642 * 0.6642) + (-0.2103 * -0.2103) = 0.5413 + 0.4411 + 0.0442 = 0.9999.
Problem 4
(
%Put the column vectors back into U.
U = [U1 U2 U3]
)Solution:
U = 3×3
    -0.2055
    -0.6658
    -0.7172
    -0.4900
    -0.5644
    0.6643
    -0.8471
    0.4880
    -0.2103
(
%The reduced matrix will have 3 pivot columns if the columns of U span R3.
educedU
=
ef
(U)
)
educedU = 3×3
    1
    0
    0
    0
    1
    0
    0
    0
    1
(
%Check the rank of the
the
reduced U matrix, which should be 3.
ank(
educedU
)
)
ans = 3
Explain: The columns of U span R3 because there are no zero rows in the reduced echelon form of U and there are three pivot columns in the reduced matrix. The rank of reducedU is 3, which further supports this.
Problem 5
(
%Load the image.

load

image.mat
;
% The dimensions are M = 3072
abd
N = 4608.
)Solution:
(
imshow
(A)
)
(
%Perform the
svd
function on A and put the results into U S V.
[U

S V] =
svd
(double(A))
) (
U =

3072×3072
-0.0220
0.0337
-0.0276
0.0071
-0.0003
0.0114
-0.0108
0.0043
-0.0220
0.0335
-0.0273
0.0066
-0.0002
0.0106
-0.0112
0.0037
-0.0220
0.0335
-0.0271
0.0062
-0.0003
0.0100
-0.0113
0.0029
-0.0220
0.0333
-0.0271
0.0057
-0.0003
0.0094
-0.0110
0.0023
-0.0219
0.0331
-0.0273
0.0053
-0.0003
0.0083
-0.0109
0.0020
-0.0219
0.0329
-0.0274
0.0049
-0.0007
0.0066
-0.0107
0.0017
-0.0219
0.0325
-0.0274
0.0041
-0.0012
0.0048
-0.0106
0.0012
-0.0218
0.0322
-0.0277
0.0037
-0.0012
0.0027
-0.0104
0.0008
-0.0218
0.0321
-0.0281
0.0028
-0.0020
0.0008
-0.0097
0.0003
-0.0218
0.0319
-0.0281
0.0020
-0.0025
-0.0009
-0.0093
-0.0001
S =
3072×4608
10
5

×
5.7986
0
0
0
0
0
0
0
0
0.6755
0
0
0
0
0
0
0
0
0.3657
0
0
0
0
0
0
0
0
0.3129
0
0
0
0
0
0
0
0
0.2842
0
0
0
0
0
0
0
0
0.2423
0
0
0
0
0
0
0
0
0.2325
0
0
0
0
0
0
0
0
0.2217
)
    0
    0
    0
    0
    0
    0
    0
    0
    0
    0
    0
    0
    0
    0
    0
    0
    V =...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here