Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
| Download
Path: Exam 1 F20/Exam 1.ipynb
Views: 146Image: ubuntu2004
Kernel: Python 3 (system-wide)
Exam 1
a)
In [87]:
Out[87]:
Enter number of children
Enter number of adults
Number of people is too many for a 50 seat theater
In [81]:
Out[81]:
Enter a positive integer
2.283333333333333
a)
In [0]:
b)
In [56]:
Out[56]:
[3, 6, 9, 12, 18, 27, 36, 54, 108, 129, 258, 387, 516, 774, 1161, 1548, 2322]
a)
In [65]:
Out[65]:
Account total after 15 years: $ 1830.5
b)
In [73]:
Out[73]:
Minimum monthly deposit to ensure $3000 after 15 years: $ 5
a)
In [0]:
b)
In [88]:
Out[88]:
---------------------------------------------------------------------------
RecursionError Traceback (most recent call last)
<ipython-input-88-8b79b06b28c9> in <module>
9 return stairs(s-1)+stairs(s-2)+stairs(s-5)
10
---> 11 stairs(15)
<ipython-input-88-8b79b06b28c9> in stairs(s)
7 return 5
8 else:
----> 9 return stairs(s-1)+stairs(s-2)+stairs(s-5)
10
11 stairs(15)
... last 1 frames repeated, from the frame below ...
<ipython-input-88-8b79b06b28c9> in stairs(s)
7 return 5
8 else:
----> 9 return stairs(s-1)+stairs(s-2)+stairs(s-5)
10
11 stairs(15)
RecursionError: maximum recursion depth exceeded in comparison
a)
In [113]:
Out[113]:
[<matplotlib.lines.Line2D at 0x7f77c9bf6fa0>]
b)
In [105]:
In [103]:
Out[103]:
5
In [112]:
Out[112]:
6.970001
In [111]:
Out[111]:
0.0021484375000000006