Exam 1

  1. Question

    Given the following information:
    banana.png + pineapple.png + banana.png = 564
    banana.png + pineapple.png + pineapple.png = 873
    orange.png + pineapple.png + pineapple.png = 864
    Compute:
    banana.png + orange.png + pineapple.png = ?

    Solution

    The information provided can be interpreted as the price for three fruit baskets with different combinations of the three fruits. This corresponds to a system of linear equations where the price of the three fruits is the vector of unknowns x:
    x1 = banana.png x2 = orange.png x3 = pineapple.png
    The system of linear equations is then:
    ( 201 102 012 )·( x1 x2 x3 ) = ( 564 873 864 )

    This can be solved using any solution algorithm, e.g., elimination:
    x1 =85, x2 =76, x3 =394.

    Based on the three prices for the different fruits it is straightforward to compute the total price of the fourth fruit basket via:
    banana.png + orange.png + pineapple.png =
    x1 + x2 + x3 =
    85 + 76 + 394 = 555.