Create the appropriate graphs. Label all axes and titles.
Let’s say you’re given a choice between two ways to make money. 1: You receive $5 every day. 2: Your amount doubles every day. Model both of these as equations and then graph them. Then, create a legend where the first model is labeled “Add $5” and the second is “Double $”. The x-axis should be the days and the y-axis should be the amount of money made.
Plot two Normal distributions (histograms) with one subplot on top of the other. The first represents the heights of a sample of 50 13-year-old girls, with a mean of 59 inches and standard deviation of 3 inches. The second represents the heights of a sample of 50 13-year-old boys, with a mean of 63 inches and standard deviation of 4 inches.
Also, adjust the figure size to be 6 inches x 4 inches.
Resources:
Slides: https://docs.google.com/presentation/d/1STabsCa0odMQcYhnoUv_K2HdW17B8s1Vg4qu058wWK0/edit?usp=sharing
Code: https://replit.com/@Shrav816/IntroToPython-Class23#main.py
Contact Info:
shravyassathish@gmail.com (mentor)
kingericwu@gmail.com (TA)
felixguo41@gmail.com (TA)
1.
import matplotlib.pyplot as plt
import numpy as np
x = np.arange(1, 11)
y1 = np.array([i*5 for i in x])
y2 = np.array([2**(i-1) for i in x])
plt.plot(x, y1, label='Add 5')
plt.plot(x, y2, label='double')
plt.xlabel("Days")
plt.ylabel("Amount of money made")
plt.title("double money vs + 5 every day")
plt.show()