I CODED THE PROGRAM BUT DON'T KNOW WHY STATEMENT IS NOT SHOWING, Using the singular value decomposition, prove that σ¯(AB) ≤ σ¯(A)¯σ(B)

% USING SINGULAR VALUE DECOMPOSITION WE HAVE TO PROVE THE GIVEN CONDITION %
>> %///CODE///%
>> A = randi(100,5); % RANDOM INTEGER VARIABLE IS DECLARED FOR A MATRIX %
>> B = randi(100,5); % RANDOM INTEGER VARIABLE IS DECLARED FOR B MATRIX %
>> % NOW WE WILL DECLARE OUR SVD COMPONENTS U, S AND V %
>> [U1, S1, V1] = svd(A);
>> [U2, S2, V2] = svd(B);
>> [U12, S12, V12] = svd(A*B);
>> sigma_A = diag(S1);
>> sigma_B = diag(S2);
>> sigma_AB = diag(S12);
>> sigma_X = sigma_A.*sigma_B;
>> for i=10: size(A, 1)
if sigma_AB(i)<=sigma_X(i)
disp('THE GIVEN STATEMENT IS TRUE' )
else
disp('THE GIVEN STATEMENT IS FALSE' )
end
end
>> % AS PER QUESTION WE HAVE TO TAKE TWO SAMPLES TESTS %
>> % TEST-1 %
>> sigma_AB
sigma_AB =
1.0e+04 *
5.4496
0.4558
0.1910
0.1132
0.0912
>> sigma_X
sigma_X =
1.0e+04 *
5.6453
0.6107
0.3209
0.1247
0.0355
AFTER THIS THE GIVEN STATEMENT SHOW SHOW BY COMPARING BOTH'S OUTPUT BUT IT IS NOW SHOWING %
WHRE I AM DOING WRONG??

2 Comments

Must I point out that you cannot prove the validity of such a question by a numerical example? At best, you could disprove it (were it false) using a valid counter-example.
I realize the code isn't working as intended, but it looks like it's trying to verify that all singular values satisfy the conjecture. However, the problem statement looks like (I can't tell for sure) that the conjecture is only applicable to the maximum singular values of the matrices A and B.

Sign in to comment.

 Accepted Answer

The problem is:
for i=10: size(A, 1)
size(A, 1) replies 5. Then the loop from 10 up to 5 is not entered at all.
Do you mean:
for i = 1:size(A, 1)

2 Comments

By the way, UPPERCASE is considered as shouting in internet forum's. Therefore it should be used carefully.

Sign in to comment.

More Answers (1)

I assume your question applies to a theorem about the singular values of the product of matrices. That is, if we compute the singular values of matrices A and B, then the singular values of the product of the two matrices, while not known, must follow an inequality. So if the singular values are sorted in decreasing order, then we must have that the singular values of the product matrix must be less than the corresponding product of the singular values of A and the MAXIMUM singlar value of B.
For the above to be true, then it must also be true that the product of the matrices is POSSIBLE! In the code you wrote, with A and B matrices that were both 100x5, you CANNOT form A*B. PERIOD.
So lets try this with a problem where we can actually do the computations. In this example, I'll use A as a SQUARE matrix.
A = magic(5)
A = 5×5
17 24 1 8 15 23 5 7 14 16 4 6 13 20 22 10 12 19 21 3 11 18 25 2 9
That means we can multiply A by a matrix with 5 rows. 100 rows is impossible, as the matrices do not conform for matrix multiplication. This one should do for B:
B = hilb(5)
B = 5×5
1.0000 0.5000 0.3333 0.2500 0.2000 0.5000 0.3333 0.2500 0.2000 0.1667 0.3333 0.2500 0.2000 0.1667 0.1429 0.2500 0.2000 0.1667 0.1429 0.1250 0.2000 0.1667 0.1429 0.1250 0.1111
So a 5x5 Hilbert matrix. The elements of B have the property that B(i,j) = 1/(i+j-1). They are both non-singular matrices, but that is not important for the question at hand, except that a singular matrix would introduce issues with floating point arithmetic.
I've used deterministic matrices, so it will be easier for you to follow what I did. If you wanted to use random matrices, well, whatever floats your boat is ok with me.
SA = svd(A); % we don't care about U and V
SB = svd(B);
SAB = svd(A*B);
format long g
[SA,SB,SAB,SA.*SB(1)]
ans = 5×4
65 1.56705069109823 92.0326402680898 101.858294921385 22.5470886858797 0.208534218611013 3.93990600771026 35.3324309074608 21.6874253552026 0.0114074916234198 0.228025839057194 33.9852948910116 13.4035659979915 0.000305898040151194 0.00536460977982926 21.0040673603333 11.9007895448612 3.28792877218263e-06 4.28556064609412e-05 18.6491404808893
Now, the question is if the product of the singular values of A with the largest singular value of B is greater than the singular values of the product matrix.
SAB <= SA.*SB(1)
ans = 5×1 logical array
1 1 1 1 1
all(SAB <= SA.*SB(1))
ans = logical
1
So that is true, at least for this example. This is not a proof, merely an example. But that seems to be your goal.
However, be careful, as it is not true that we can form the product of all the singular values, and then assume an inequality applies to the singular values of the product of the matrices.
For example:
[SAB,SA.*SB,SAB < SA.*SB]
ans = 5×3
92.0326402680898 101.858294921385 1 3.93990600771026 4.70183952106314 1 0.228025839057194 0.247399123073017 1 0.00536460977982926 0.00410012456982277 0 4.28556064609412e-05 3.91289483562393e-05 0
There you see the inequality does not apply.
If you wanted a proof of the assertion I show by example, look here:

Products

Release

R2019a

Asked:

on 23 Feb 2022

Commented:

Jan
on 24 Feb 2022

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!