feat(2nd): début du chapitre le l'échantillonnage
This commit is contained in:
parent
5ab2f0162a
commit
c63d442803
BIN
2nd/18_Echantillonnage/1B_fluctuation.pdf
Normal file
BIN
2nd/18_Echantillonnage/1B_fluctuation.pdf
Normal file
Binary file not shown.
37
2nd/18_Echantillonnage/1B_fluctuation.tex
Normal file
37
2nd/18_Echantillonnage/1B_fluctuation.tex
Normal file
@ -0,0 +1,37 @@
|
||||
\documentclass[a4paper,10pt]{article}
|
||||
\usepackage{myXsim}
|
||||
|
||||
\author{Benjamin Bertrand}
|
||||
\title{Echantillonnage - Cours}
|
||||
\date{mai 2023}
|
||||
|
||||
\pagestyle{empty}
|
||||
|
||||
\begin{document}
|
||||
|
||||
|
||||
\maketitle
|
||||
|
||||
\begin{definition}[Échantillon]
|
||||
Lorsqu’on répète $n$ fois, de façon identique et indépendante, une même expérience aléatoire, on obtient une série de $n$ résultats que l’on appelle échantillon de taille $n$.
|
||||
\end{definition}
|
||||
|
||||
\begin{definition}[Fluctuation de l'échantillon]
|
||||
Lorsqu’on effectue plusieurs échantillons de même taille, la fréquence d’un caractère observé varie d’un échantillon à l’autre. C’est ce qu’on appelle la \textbf{fluctuation d’échantillonnage}.
|
||||
\end{definition}
|
||||
|
||||
\begin{propriete}[Estimation d'une probabilité]
|
||||
Dans une population, la proportion p d’individus présentant un certain caractère est inconnue.
|
||||
|
||||
On prélève dans cette population un échantillon aléatoire de taille $n$.
|
||||
|
||||
On note $f$ la fréquence d’apparition du caractère dans l’échantillon.
|
||||
|
||||
La fréquence observée f est appelée une estimation de la proportion $p$.
|
||||
\end{propriete}
|
||||
|
||||
|
||||
\begin{propriete}[Intervalle de fluctuation]
|
||||
|
||||
\end{propriete}
|
||||
\end{document}
|
299
2nd/18_Echantillonnage/1E_piece_de.ipynb
Normal file
299
2nd/18_Echantillonnage/1E_piece_de.ipynb
Normal file
@ -0,0 +1,299 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "f7b010a9",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"# Echantillonnage\n",
|
||||
"\n",
|
||||
"Dans ce TP, vous allez cherche à savoir si une pièce ou un dé est truqué. C'est à dire s'il donne plus souvent un résultat qu'un autre.\n",
|
||||
"\n",
|
||||
"Si vous le souhaitez, vous pouvez utiliser les outils de programmation pour répondre mais ce n'est pas necessaire."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "3574ed56",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## Pièce trucquée?\n",
|
||||
"\n",
|
||||
"On importe 3 pièces sous la forme de 3 fonctions Python"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 1,
|
||||
"id": "f8574d02",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"from echantillons import piece1, piece2, piece3"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "a008af30",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"Pièce 1"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 2,
|
||||
"id": "df8982e6",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/plain": [
|
||||
"'pile'"
|
||||
]
|
||||
},
|
||||
"execution_count": 2,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"piece1()"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "c858e103",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"Pièce 2"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 3,
|
||||
"id": "b98436c2",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/plain": [
|
||||
"'face'"
|
||||
]
|
||||
},
|
||||
"execution_count": 3,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"piece2()"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "2f71532e",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"Pièce 3"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 4,
|
||||
"id": "fa5868a0",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/plain": [
|
||||
"'pile'"
|
||||
]
|
||||
},
|
||||
"execution_count": 4,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"piece3()"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "14eff698",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"Que pensez-vous? Est-ce que ces pièces sont équilibrées?"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "b86ec551",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "c168731c",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "625a5dfd",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## Dé trucqué?\n",
|
||||
"\n",
|
||||
"On importe 3 dés sous la forme de 3 fonctions Python."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 5,
|
||||
"id": "fab62eff",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"from echantillons import de1, de2, de3"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "9a43f807",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"Dé 1"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 7,
|
||||
"id": "582c9ec8",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/plain": [
|
||||
"6"
|
||||
]
|
||||
},
|
||||
"execution_count": 7,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"de1()"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "3cb2d6e7",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"Dé 2"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 8,
|
||||
"id": "66b777f8",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/plain": [
|
||||
"6"
|
||||
]
|
||||
},
|
||||
"execution_count": 8,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"de2()"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "a241a4d4",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"Dé 3"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 9,
|
||||
"id": "05781d0a",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/plain": [
|
||||
"3"
|
||||
]
|
||||
},
|
||||
"execution_count": 9,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"de3()"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "bd4bb96e",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"Est-ce qu'un dé donne un nombre anormalement élevé de 6? D'un autre nombre? Lequel semble bien équilibré?"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "c391b26c",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "81d2f6fa",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3 (ipykernel)",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
},
|
||||
"language_info": {
|
||||
"codemirror_mode": {
|
||||
"name": "ipython",
|
||||
"version": 3
|
||||
},
|
||||
"file_extension": ".py",
|
||||
"mimetype": "text/x-python",
|
||||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.10.10"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 5
|
||||
}
|
28
2nd/18_Echantillonnage/echantillons.py
Normal file
28
2nd/18_Echantillonnage/echantillons.py
Normal file
@ -0,0 +1,28 @@
|
||||
from random import random
|
||||
|
||||
def piece_builder(p):
|
||||
def piece():
|
||||
r = random()
|
||||
if r < p:
|
||||
return "pile"
|
||||
return "face"
|
||||
|
||||
return piece
|
||||
|
||||
piece1 = piece_builder(0.5)
|
||||
piece2 = piece_builder(0.4)
|
||||
piece3 = piece_builder(0.2)
|
||||
|
||||
def de_builder(steps):
|
||||
assert sorted(steps) == steps
|
||||
assert steps[-1] == 1
|
||||
def de():
|
||||
r = random()
|
||||
for i in range(6):
|
||||
if r < steps[i]:
|
||||
return i+1
|
||||
return de
|
||||
|
||||
de1 = de_builder([(i+1)*1/6 for i in range(6)])
|
||||
de2 = de_builder([0.1, 0.2, 0.3, 0.4, 0.5, 1])
|
||||
de3 = de_builder([0.01, 0.3, 0.4, 0.6, 0.8, 1])
|
7
2nd/18_Echantillonnage/exercises.tex
Normal file
7
2nd/18_Echantillonnage/exercises.tex
Normal file
@ -0,0 +1,7 @@
|
||||
\begin{exercise}[subtitle={<++>}, step={1}, origin={<++>}, topics={ Echantillonnage }, tags={ Probabilité, Statistiques, Python, Tableur }]
|
||||
<++>
|
||||
\end{exercise}
|
||||
|
||||
\begin{solution}
|
||||
<++>
|
||||
\end{solution}
|
39
2nd/18_Echantillonnage/index.rst
Normal file
39
2nd/18_Echantillonnage/index.rst
Normal file
@ -0,0 +1,39 @@
|
||||
Echantillonnage
|
||||
###############
|
||||
|
||||
:date: 2023-05-03
|
||||
:modified: 2023-05-03
|
||||
:authors: Benjamin Bertrand
|
||||
:tags: Probabilité, Statistiques, Python, Tableur
|
||||
:category: 2nd
|
||||
:summary: Étude de la fluctuation d'un échantillon.
|
||||
|
||||
|
||||
Éléments du programme
|
||||
=====================
|
||||
|
||||
|
||||
Progression
|
||||
===========
|
||||
|
||||
Étape 1: Construction d'échantillon
|
||||
-----------------------------------
|
||||
|
||||
Activité avec Capytale, les élèves ont 3 pièces à eux de déterminer une méthode pour savoir si elle est équilibrée. Ils auront ensuite trois dés. Ils devront rédiger leur méthode sur le cahier de groupe.
|
||||
|
||||
Le but est de faire émerger les notions suivantes:
|
||||
|
||||
- d'échantillon
|
||||
- de tendance de la fréquence à se stabliliser sur la probabilité.
|
||||
|
||||
Bilan: echantillon, stabilisation de la fréquence et intervalle de fluctuation.
|
||||
|
||||
Étape 2: Stabilisation de la fréquence
|
||||
--------------------------------------
|
||||
|
||||
Si le temps le permet: activité tableur pour observer cette stabilisation.
|
||||
|
||||
Étape 2: Intervalle de fluctuation
|
||||
----------------------------------
|
||||
|
||||
Exercices techniques d'utilisation de l'intervalle de fluctuation.
|
44
2nd/18_Echantillonnage/plan_de_travail.tex
Normal file
44
2nd/18_Echantillonnage/plan_de_travail.tex
Normal file
@ -0,0 +1,44 @@
|
||||
\documentclass[a4paper,12pt]{article}
|
||||
\usepackage{myXsim}
|
||||
|
||||
\author{Benjamin Bertrand}
|
||||
\title{Echantillonnage - Plan de travail}
|
||||
\tribe{2nd}
|
||||
\date{mai 2023}
|
||||
|
||||
\pagestyle{empty}
|
||||
|
||||
\DeclareExerciseCollection{banque}
|
||||
\xsimsetup{
|
||||
}
|
||||
|
||||
|
||||
\begin{document}
|
||||
\maketitle
|
||||
|
||||
% Résumé
|
||||
|
||||
\bigskip
|
||||
|
||||
Savoir-faire de la séquence
|
||||
\begin{itemize}
|
||||
\item
|
||||
\end{itemize}
|
||||
|
||||
\bigskip
|
||||
|
||||
Ordre des étapes à respecter
|
||||
|
||||
|
||||
\section{}
|
||||
|
||||
\listsectionexercises
|
||||
|
||||
|
||||
\pagebreak
|
||||
|
||||
\input{exercises.tex}
|
||||
\printcollection{banque}
|
||||
|
||||
|
||||
\end{document}
|
28
2nd/18_Echantillonnage/solutions.tex
Normal file
28
2nd/18_Echantillonnage/solutions.tex
Normal file
@ -0,0 +1,28 @@
|
||||
\documentclass[a4paper,10pt]{article}
|
||||
\usepackage{myXsim}
|
||||
|
||||
\usetikzlibrary{shapes.geometric}
|
||||
|
||||
\author{Benjamin Bertrand}
|
||||
\title{Echantillonnage - Solutions}
|
||||
\tribe{2nd}
|
||||
\date{mai 2023}
|
||||
|
||||
\DeclareExerciseCollection{banque}
|
||||
\xsimsetup{
|
||||
exercise/print=false,
|
||||
solution/print=true,
|
||||
}
|
||||
|
||||
\pagestyle{empty}
|
||||
|
||||
|
||||
\begin{document}
|
||||
|
||||
\maketitle
|
||||
|
||||
\input{exercises.tex}
|
||||
%\printcollection{banque}
|
||||
%\printsolutions{exercises}
|
||||
|
||||
\end{document}
|
Loading…
Reference in New Issue
Block a user