Starting from:

$30

MATH366- Homework 1 Solved

Problem 1: Compute the following sum,

!

Hint: The first sum is from i = 0 to i = 10, however, the second inner sum is from j = 0 to j = i. In other words, after you choose a value of i, the limits of summation are determined for the inner sum. What this means is that you can think of the inner sum as S(i), as something that depends on i. Therefore, the sum is equal to,

i

                                                )      where           S(i) = Xsin(i2)cos(j2)

j=0

You will need to write a “double loop” i.e. a loop within a loop.

Problem 2: Create a function called ID. This function takes as an input a vector x and arranges the vector into an “anti-diagonal matrix” ID(x). Instead of the diagonal matrix going from the upper-left to the lower-right, the anti-diagonal matrix goes from the upper-right to the lower-left.

More products