matrices/questions.rst
changeset 397 4aea9ed09983
parent 287 d9507624eb8f
equal deleted inserted replaced
396:f0c97fd60e5c 397:4aea9ed09983
     1 Objective Questions
     1 Objective Questions
     2 -------------------
     2 -------------------
     3 
     3 
     4 .. A mininum of 8 questions here (along with answers)
     4 .. A mininum of 8 questions here (along with answers)
     5 
     5 
     6 1. ``matrix(A) * matrix(B)`` and ``array(A) * array(B)`` are the same.
     6 1. ``array(A) * array(B)`` does matrix multiplication.
     7 
     7 
     8     a. True
     8     a. True
     9     #. False
     9     #. False
    10 
    10 
    11 Answer: False
    11 Answer: False
    12 
    12 
    13 2. ``matrix(A) * array(B)`` does,
    13 2. ``array(A) * array(B)`` does,
    14 
    14 
    15    a. Element wise multiplication.
    15    a. Element wise multiplication.
    16    #. Matrix multiplication.
    16    #. Matrix multiplication.
    17    #. Cannot multiply a matrix object and array object.
    17    #. Cannot multiply a matrix object and array object.
    18    #. Depends on the shape of A and B, if compatible matrix
    18    #. Depends on the shape of A and B, if compatible matrix
    19       multiplication will be done, otherwise element wise
    19       multiplication will be done, otherwise element wise
    20       multiplication.
    20       multiplication.
    21 
    21 
    22 Answer: Matrix multiplication
    22 Answer: Element wise multiplication.
    23 
    23 
    24 3. A and B are two matrix objects. Element wise multiplication in
    24 3. A and B are two array objects. Element wise multiplication in
    25    matrices are done by,
    25    matrices are done by,
    26 
    26 
    27    a. A * B
    27    a. A * B
    28    #. ``multiply(A, B)``
    28    #. ``multiply(A, B)``
    29    #. ``dot(A, B)``
    29    #. ``dot(A, B)``
    30    #. ``element_multiply(A,B)``
    30    #. ``element_multiply(A,B)``
    31 
    31 
    32 Answer: multiply(A, B)
    32 Answer: dot(A, B)
    33 
    33 
    34 4. ``norm(A)`` method determines the,
    34 4. ``norm(A)`` method determines the,
    35 
    35 
    36    a. Frobenius norm
    36    a. Frobenius norm
    37    #. Infinity norm
    37    #. Infinity norm
    48 Answer: False
    48 Answer: False
    49 
    49 
    50 6. The code snippet will work without an error,
    50 6. The code snippet will work without an error,
    51    ::
    51    ::
    52 
    52 
    53        A = matrix([[1, 2, 3, 4], [5, 6, 7, 8]])
    53        A = array([[1, 2, 3, 4], [5, 6, 7, 8]])
    54        inv(A)
    54        inv(A)
    55 
    55 
    56    a. True
    56    a. True
    57    #. False
    57    #. False
    58 
    58