<jupyter_start><jupyter_text>**Numpy Assignment** **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 <NAME>.*<jupyter_code>import numpy as np

def alexaxndreTheophile(inputVector, n, increasing):
  if increasing:
    outMatrix = np.matrix([x**i for x in inputVector for i in range(n)]).reshape(inputVector.size, n)
  else:
    outMatrix = np.matrix([x**(n-i-1) for x in inputVector for i in range(n)]).reshape(inputVector.size, n)
  return outMatrix

inputVector = np.array([1,2,3,4,5])

outMatrix = alexaxndreTheophile(inputVector, inputVector.size, increasing = True)
print("When Increasing = True: \n",outMatrix)

outMatrix = alexaxndreTheophile(inputVector, inputVector.size, increasing = False)
print("\nWhen Increasing = False: \n",outMatrix)<jupyter_output>When Increasing = True: 
 [[  1   1   1   1   1]
 [  1   2   4   8  16]
 [  1   3   9  27  81]
 [  1   4  16  64 256]
 [  1   5  25 125 625]]

When Increasing = False: 
 [[  1   1   1   1   1]
 [ 16   8   4   2   1]
 [ 81  27   9   3   1]
 [256  64  16   4   1]
 [625 125  25   5   1]]<jupyter_text>**Problem Statement**
**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 average sequence has n-k+1 elements as shown below.**

**The moving averages with k=4 of a ten-value sequence (n=10) is shown below:**

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

Thus, the moving average sequence has n-k+1=10-4+1=7 values.  **Question:**

*Write a function to find moving average in an array over a window:*

*Test it over [3, 5, 7, 2, 8, 10, 11, 65, 72, 81, 99, 100, 150] and window of 3.*<jupyter_code>def movingAverage(inputVector, windowLength):
  c = 1
  movingAvg = np.convolve(inputVector, np.ones(windowLength), 'valid') / windowLength
  for i in movingAvg:
    print("y{0} = {1:.2f}".format(c, i))
    c += 1

inputVector = np.array([3, 5, 7, 2, 8, 10, 11, 65, 72, 81, 99, 100, 150])
windowLength = 3

movingAverage(inputVector, windowLength)<jupyter_output>y1 = 5.00
y2 = 4.67
y3 = 5.67
y4 = 6.67
y5 = 9.67
y6 = 28.67
y7 = 49.33
y8 = 72.67
y9 = 84.00
y10 = 93.33
y11 = 116.33