Numpy Assignment
Numpy Assignment
Assignment 1 Question
Numpy: Assignment 1
Table of Contents
1.Introduction
2.Problem Statement
3.Output
1.Introduction
This assignment will help you to consolidate the concepts learnt in the session.
2.Problem Statement
Problem Statement 1:
Write a function so that the columns of the output matrix are powers of the input
vector.
The order of the powers is determined by the increasing boolean argument. Specifically, when
increasing is False, the i-th output column is the input vector raised element-wise to the power
of N - i - 1.
HINT: Such a matrix with a geometric progression in each row is named for Alexandre-
Theophile Vandermonde.
Problem Statement 2:
Given a sequence of n values x1, x2, ..., xn and a window size k>0, the k-th moving average of
the given sequence is defined as follows:
The moving averages with k=4 of a ten-value sequence (n=10) is shown below
i 1 2 3 4 5 6 7 8 9 10
===== == == == == == == == == == ==
Input 10 20 30 40 50 60 70 80 90 100
y1 25 = (10+20+30+40)/4
y2 35 = (20+30+40+50)/4
y3 45 = (30+40+50+60)/4
y4 55 = (40+50+60+70)/4
y5 65 = (50+60+70+80)/4
y6 75 = (60+70+80+90)/4
y7 85 = (70+80+90+100)/4
Note: Solution submitted via github must contain all the detailed steps.
3.Output
This assignment consists of 200 marks and needs to be submitted in the upcoming session for
evaluation.