Exercise 11

Exercise 11#

Question 1#

Use one of the functions for creating arrays (along with a possible operation) to generate the following:

  • [0.0 0.1 0.2 0.3 0.4]

  • [10 9 8 7 6 5 4 3 2 1]

  • [5 5 5 5 5]

Question 2#

The NumPy function np.sum takes an array as an argument and returns a sum of all the items in the array (or along a specified axis in the case of multidimensional arrays).

Use this to calculate the following sums without using loops or list comprehension:

  1. (1)#\[\sum_{i = 1}^{100} i\]
  2. (2)#\[\sum_{i = 3}^{200} \frac{3}{2i} \tan \bigg(\frac{i \pi}{3} \bigg)\]