## Question 1 What is the correct output if the following matrix is given as input? $$matrix = \begin{bmatrix}1 & 2 & 3 \\4 & 5 & 6 \\ 7 & 0 & 9 \end{bmatrix}$$ ### Options 1. $$matrix = \begin{bmatrix}0 & 2 & 0 \\4 & 0 & 6 \\ 0 & 0 & 0 \end{bmatrix}$$ Incorrect ---------------------------- 2. $$matrix = \begin{bmatrix}1 & 0 & 3 \\4 & 0 & 6 \\ 0 & 0 & 0 \end{bmatrix}$$ Correct 0s corresponding row and column have been set to 0. ---------------------------- 3. $$matrix = \begin{bmatrix}1 & 0 & 3 \\4 & 0 & 6 \\ 7 & 0 & 9 \end{bmatrix}$$ Incorrect ---------------------------- 4. $$matrix = \begin{bmatrix}1 & 2 & 3 \\4 & 5 & 6 \\ 0 & 0 & 0 \end{bmatrix}$$ Incorrect ---------------------------- --------------------------------------------- ## Question 2 What is the correct output if the following matrix is given as input? $$matrix = \begin{bmatrix}1 & 2 & 3 & 4 \\4 & 5 & 6 & 7 \\ 8 & 9 & 4 & 6 \end{bmatrix}$$ ### Options 1. $$matrix = \begin{bmatrix}0 & 0 & 0 & 0 \\0 & 5 & 6 & 0 \\ 0 & 0 & 4 & 6 \end{bmatrix}$$ Incorrect ---------------------------- 2. $$matrix = \begin{bmatrix}0 & 0 & 3 & 4 \\0 & 0 & 0 & 0 \\ 8 & 0 & 4 & 6 \end{bmatrix}$$ Incorrect ---------------------------- 3. $$matrix = \begin{bmatrix}0 & 0 & 3 & 0 \\0 & 0 & 6 & 0 \\ 0 & 0 & 4 & 0 \end{bmatrix}$$ Incorrect ---------------------------- 4. $$matrix = \begin{bmatrix}1 & 2 & 3 & 4 \\4 & 5 & 6 & 7 \\ 8 & 9 & 4 & 6 \end{bmatrix}$$ Correct The matrix remains the same because there is no zero in the matrix. ---------------------------- --------------------------------------------- ## Question 3 What is the correct output if the following matrix is given as input? $$matrix = \begin{bmatrix}1 & 1 & 0 & 1 & 1 \\1 & 1 & 1 & 1 & 1 \\ 1 & 1 & 1 & 1 & 1 \\ 1 & 0 & 1 & 1 & 1 \\ 1 & 1 & 1 & 1 & 1 \end{bmatrix}$$ ### Options 1. $$matrix = \begin{bmatrix}0 & 0 & 0 & 0 & 0 \\1 & 0 & 0 & 1 & 1 \\ 1 & 0 & 0 & 1 & 1 \\ 0 & 0 & 0 & 0 & 0 \\ 1 & 0 & 0 & 1 & 1 \end{bmatrix}$$ Correct 0s corresponding rows and columns have been set to 0. ---------------------------- 2. $$matrix = \begin{bmatrix}0 & 0 & 0 & 0 & 0 \\0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 \end{bmatrix}$$ Incorrect ---------------------------- 3. $$matrix = \begin{bmatrix}0 & 0 & 0 & 0 & 0 \\1 & 1 & 1 & 1 & 1 \\ 1 & 1 & 1 & 1 & 1 \\ 0 & 0 & 0 & 0 & 0 \\ 1 & 1 & 1 & 1 & 1 \end{bmatrix}$$ Incorrect ---------------------------- 4. $$matrix = \begin{bmatrix}1 & 0 & 0 & 1 & 1 \\1 & 0 & 0 & 1 & 1 \\ 1 & 0 & 0 & 1 & 1 \\ 1 & 0 & 0 & 1 & 1 \\ 1 & 0 & 0 & 1 & 1 \end{bmatrix}$$ Incorrect ---------------------------- ---------------------------------------------