Skip to content
This repository was archived by the owner on Aug 17, 2018. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions precourse.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,47 @@

# Free example function definition
# This function passes one of the 11 tests contained inside of test.py. Write the rest, defined in README.md, here, and execute python test.py to test. Passing this precourse work will greatly increase your odds of acceptance into the program.
import numpy as np

def f(x):
return x**2

def f_2(x):
return x**3

def f_3(x):
return x**3 + x*5

def d_f(x):
return x*2

def d_f_2(x):
return 3*x**2

def d_f_3(x):
return 3*x**2 + 5

def vector_sum(x, y):
return np.add(x, y)

def vector_less(x, y):
return np.subtract(x, y)

def vector_magnitude(x):
return np.linalg.norm(x)

def vec5():
return np.array([1,1,1,1,1])

def vec3():
return np.array([0,0,0])

def vec2_1():
return np.array([1,0])

def vec2_2():
return np.array([0,1])

def matrix_multiply(vec, matrix):
return np.inner(vec, matrix)