Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mooc-rr
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fe77b5323a938dbf30e79610829bed48
mooc-rr
Commits
6df2878a
Commit
6df2878a
authored
Nov 26, 2020
by
fe77b5323a938dbf30e79610829bed48
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avance jusqu'à 1.3 non inclut
parent
0cedbe83
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
8 deletions
+40
-8
toy_notebook_fr.ipynb
module2/exo1/toy_notebook_fr.ipynb
+40
-8
No files found.
module2/exo1/toy_notebook_fr.ipynb
View file @
6df2878a
...
@@ -4,23 +4,21 @@
...
@@ -4,23 +4,21 @@
"cell_type": "markdown",
"cell_type": "markdown",
"metadata": {},
"metadata": {},
"source": [
"source": [
"#
toy_notebook_fr
"
"#
A propos du calcul de $\\pi$
"
]
]
},
},
{
{
"cell_type": "markdown",
"cell_type": "markdown",
"metadata": {},
"metadata": {},
"source": [
"source": [
"##
March 28,2019\n
"
"##
En demandant à la lib maths
"
]
]
},
},
{
{
"cell_type": "markdown",
"cell_type": "markdown",
"metadata": {},
"metadata": {},
"source": [
"source": [
"1.A propos du calcul de :pi:\n",
"Mon ordinateur m'indique que $\\pi$ vaut *approximativement*"
"1.1 En demandant à la lib maths\n",
"Mon ordinateur m'indique que :pi: vaut *approximativement*"
]
]
},
},
{
{
...
@@ -41,12 +39,46 @@
...
@@ -41,12 +39,46 @@
"print(pi)"
"print(pi)"
]
]
},
},
{
"cell_type": "markdown",
"metadata": {
"hideOutput": true
},
"source": [
"## En utilisant la méthode des aiguilles de Buffon"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Mais calculé avec la **méthode** des aiguilles de Buffon, on obtiendrait comme **approximation** :"
]
},
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count":
null
,
"execution_count":
3
,
"metadata": {},
"metadata": {},
"outputs": [],
"outputs": [
"source": []
{
"data": {
"text/plain": [
"3.128911138923655"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"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",
"theta = np.random.uniform(size=N, low=0, high=pi/2)\n",
"2/(sum((x+np.sin(theta))>1)/N)"
]
}
}
],
],
"metadata": {
"metadata": {
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment