Remove the IPYNB Checkpoints, Did Week 5 HW
-- IPYNB Checkpoints ++ Git Ignore File for IPYNB Checkpoints +- Week 5 Homework Files
This commit is contained in:
parent
4fc499169b
commit
140ffc6523
7 changed files with 219 additions and 60 deletions
|
|
@ -21,11 +21,22 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 1,
|
||||
"execution_count": 7,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/plain": [
|
||||
"0.9999961853027344"
|
||||
]
|
||||
},
|
||||
"execution_count": 7,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"..."
|
||||
"1 - (2**2 / 2**20)"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -39,21 +50,35 @@
|
|||
"cell_type": "code",
|
||||
"execution_count": 9,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/plain": [
|
||||
"29.0"
|
||||
]
|
||||
},
|
||||
"execution_count": 9,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"1 - 2 ** 3 / 4 + 5 * 6"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {
|
||||
"collapsed": true
|
||||
},
|
||||
"execution_count": 8,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Your prediction here:\n",
|
||||
"..."
|
||||
"# Your prediction here: 29\n",
|
||||
"# Order of Operations: (L-R)\n",
|
||||
"# 2 ** 3 = 8\n",
|
||||
"# 8 / 4 = 2\n",
|
||||
"# 5 * 6 = 30\n",
|
||||
"# 1 - 2 = -1\n",
|
||||
"# -1 + 30 = 29"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -67,7 +92,18 @@
|
|||
"cell_type": "code",
|
||||
"execution_count": 10,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/plain": [
|
||||
"-1805811300.4191697"
|
||||
]
|
||||
},
|
||||
"execution_count": 10,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"1 - 2 ** (3 / 4 + 5 * 6)"
|
||||
]
|
||||
|
|
@ -76,7 +112,9 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"*Write your answer here, replacing this text.*"
|
||||
"Prediction: The Value will be smaller, since everything in the parentheses will be done first, then that value will be the exponent for 2, aka 2 ^ value_in_parentheses, and then one will be added to that value(or subtracted depending on how you look at it), and will be shown.\n",
|
||||
"\n",
|
||||
"After cell execution: Right, and that is a rather large negative number."
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -94,17 +132,36 @@
|
|||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 8,
|
||||
"execution_count": 25,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/plain": [
|
||||
"2.7182216960543433"
|
||||
]
|
||||
},
|
||||
"execution_count": 25,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"..."
|
||||
"n = 1000000000000\n",
|
||||
"(1-(1/n))**-n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"When you enter in 10000 for n, you get the 'rough' 2.718, and by adding more zeros, you get a value more precise. However, after adding more than 12 zeros, that number seems to make the rounding happen in a way that the value is no longer 2.718, but 2.719 and increasing the more zeros added..."
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3",
|
||||
"display_name": "Python 3 (ipykernel)",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
},
|
||||
|
|
@ -118,7 +175,7 @@
|
|||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.8.3"
|
||||
"version": "3.9.12"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue