Skip to content

Instantly share code, notes, and snippets.

@nicolasbock
Last active August 29, 2015 14:09
Show Gist options
  • Save nicolasbock/a2506fe89f66790616ed to your computer and use it in GitHub Desktop.
Save nicolasbock/a2506fe89f66790616ed to your computer and use it in GitHub Desktop.
graph cost vs. sparsemath
import matplotlib.pyplot as plt
import numpy
N = 100
m = 10
M = numpy.array([ M for M in range(1, N) ])
y_graph = N/M*(M+2*m)**3
y_sparse = N*m**2
plt.plot(M, y_graph/y_sparse)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment