Exo 2 Updates before checking the solution

parent db8b0c5d
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 4, "execution_count": 1,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
} }
], ],
"source": [ "source": [
"In [1]: from math import *\n", "from math import *\n",
"print(pi)" "print(pi)"
] ]
}, },
...@@ -57,16 +57,18 @@ ...@@ -57,16 +57,18 @@
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
"ename": "SyntaxError", "data": {
"evalue": "invalid syntax (<ipython-input-2-f24264f0d041>, line 5)", "text/plain": [
"output_type": "error", "3.128911138923655"
"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" },
] "execution_count": 2,
"metadata": {},
"output_type": "execute_result"
} }
], ],
"source": [ "source": [
"In [2]: import numpy as np\n", "import numpy as np\n",
"np.random.seed(seed=42)\n", "np.random.seed(seed=42)\n",
"N = 10000\n", "N = 10000\n",
"x = np.random.uniform(size=N, low=0, high=1) \n", "x = np.random.uniform(size=N, low=0, high=1) \n",
...@@ -85,7 +87,7 @@ ...@@ -85,7 +87,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 9, "execution_count": 3,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
...@@ -102,7 +104,7 @@ ...@@ -102,7 +104,7 @@
} }
], ],
"source": [ "source": [
"In [3]: %matplotlib inline\n", "%matplotlib inline\n",
"import matplotlib.pyplot as plt\n", "import matplotlib.pyplot as plt\n",
" \n", " \n",
"np.random.seed(seed=42)\n", "np.random.seed(seed=42)\n",
...@@ -127,19 +129,25 @@ ...@@ -127,19 +129,25 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 7, "execution_count": 4,
"metadata": {}, "metadata": {
"outputs": [], "scrolled": true
},
"outputs": [
{
"data": {
"text/plain": [
"3.112"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [ "source": [
"In [4] : 4*np.mean(accept)" "4*np.mean(accept)"
] ]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
} }
], ],
"metadata": { "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