Last active
January 2, 2016 12:09
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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"