Exam 1

  1. Question

    Given the following information:
    banana.png + pineapple.png + pineapple.png = 909
    banana.png + pineapple.png + banana.png = 516
    pineapple.png + orange.png + pineapple.png = 921
    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:
    ( 102 201 012 )·( x1 x2 x3 ) = ( 909 516 921 )

    This can be solved using any solution algorithm, e.g., elimination:
    x1 =41, x2 =53, x3 =434.

    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 =
    41 + 53 + 434 = 528.