Skip to content

Instantly share code, notes, and snippets.

@mos3abof
Last active January 2, 2016 12:09
Show Gist options
  • Save mos3abof/8301235 to your computer and use it in GitHub Desktop.
Save mos3abof/8301235 to your computer and use it in GitHub Desktop.
Plot the equation "y = 5 ** x" for the integer values between 1 and a million.
import math
from matplotlib import pyplot
figsize = (15, 5)
pyplot.figure(figsize=figsize)
pyplot.title('Paying it forward')
data = []
end = 1000000
for idx in range(end):
data.append(math.log(5) * math.log(idx + 1))
pyplot.xlabel('Number of people receiving a gift')
pyplot.ylabel('Paying it forward cycles')
pyplot.plot(range(end), data)
pyplot.show()
@mos3abof
Copy link
Author

mos3abof commented Jan 7, 2014

A friend on facebook posted this status update :

"Who likes to get surprises in the mail or at work?! Everyone right? So PAYING IT FORWARD 2014 is something I will try. Here's how it works; The first 5 people to comment on this status will receive from me, some time in the next calendar year, a gift: perhaps a book, or a baked good, or a candle, music - a surprise! There will likely be no warning. The catch? Those same 5 people must make this offer in their FB status. That simple."

So I thought it would be interesting to graph the "paying it forward cycles"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment