Exo 2 Updates before checking the solution

parent db8b0c5d
......@@ -26,7 +26,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 1,
"metadata": {},
"outputs": [
{
......@@ -38,7 +38,7 @@
}
],
"source": [
"In [1]: from math import *\n",
"from math import *\n",
"print(pi)"
]
},
......@@ -57,16 +57,18 @@
"metadata": {},
"outputs": [
{
"ename": "SyntaxError",
"evalue": "invalid syntax (<ipython-input-2-f24264f0d041>, line 5)",
"output_type": "error",
"traceback": [
"\u001b[0;36m File \u001b[0;32m\"<ipython-input-2-f24264f0d041>\"\u001b[0;36m, line \u001b[0;32m5\u001b[0m\n\u001b[0;31m theta = np.random.uniform(size=N, low=0, high=%pi/2)\u001b[0m\n\u001b[0m ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m invalid syntax\n"
]
"data": {
"text/plain": [
"3.128911138923655"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"In [2]: import numpy as np\n",
"import numpy as np\n",
"np.random.seed(seed=42)\n",
"N = 10000\n",
"x = np.random.uniform(size=N, low=0, high=1) \n",
......@@ -85,7 +87,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 3,
"metadata": {},
"outputs": [
{
......@@ -102,7 +104,7 @@
}
],
"source": [
"In [3]: %matplotlib inline\n",
"%matplotlib inline\n",
"import matplotlib.pyplot as plt\n",
" \n",
"np.random.seed(seed=42)\n",
......@@ -127,19 +129,25 @@
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [],
"execution_count": 4,
"metadata": {
"scrolled": true
},
"outputs": [
{
"data": {
"text/plain": [
"3.112"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"In [4] : 4*np.mean(accept)"
"4*np.mean(accept)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment