Challenge - 5 Problems
Matrix Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate2:00remaining
What is the output of this matrix multiplication?
Consider the following MATLAB code multiplying two matrices. What is the resulting matrix?
MATLAB
A = [1 2; 3 4]; B = [5 6; 7 8]; C = A * B; disp(C);
Attempts:
2 left
💡 Hint
Remember matrix multiplication sums the products of rows of the first matrix with columns of the second.
✗ Incorrect
Matrix multiplication multiplies rows of A by columns of B. For example, element (1,1) is 1*5 + 2*7 = 19.
❓ Predict Output
intermediate2:00remaining
What error does this matrix multiplication code produce?
What error will this MATLAB code produce when run?
MATLAB
A = [1 2 3; 4 5 6]; B = [7 8; 9 10]; C = A * B;
Attempts:
2 left
💡 Hint
Check the number of columns in A and rows in B for multiplication compatibility.
✗ Incorrect
Matrix multiplication requires the number of columns in A to equal the number of rows in B. Here, A is 2x3 and B is 2x2, so multiplication is invalid.
❓ Predict Output
advanced2:00remaining
What is the output of multiplying a matrix by identity matrix?
Given the code below, what is the output matrix C?
MATLAB
A = [3 4; 1 2]; I = eye(2); C = A * I; disp(C);
Attempts:
2 left
💡 Hint
Multiplying by the identity matrix should not change the original matrix.
✗ Incorrect
The identity matrix acts like 1 in multiplication, so A * I = A.
❓ Predict Output
advanced2:00remaining
What is the output of this matrix multiplication with a transpose?
What is the output of the following MATLAB code?
MATLAB
A = [1 2 3]; B = [4; 5; 6]; C = A * B; disp(C);
Attempts:
2 left
💡 Hint
Check the dimensions of A and B before multiplication.
✗ Incorrect
A is 1x3 and B is 3x1, so multiplication results in a 1x1 scalar: 1*4 + 2*5 + 3*6 = 32.
🧠 Conceptual
expert2:00remaining
How many elements does the resulting matrix have after multiplication?
If matrix A is 4x3 and matrix B is 3x5, how many elements will the matrix C = A * B have?
Attempts:
2 left
💡 Hint
The resulting matrix size is rows of A by columns of B.
✗ Incorrect
Multiplying a 4x3 by a 3x5 matrix results in a 4x5 matrix, which has 4*5=20 elements.