2014-12-19 06:59:26 +00:00
|
|
|
\documentclass[a4paper,10pt]{article}
|
2015-05-14 09:02:48 +00:00
|
|
|
<<<<<<< HEAD
|
2014-12-19 06:59:26 +00:00
|
|
|
\usepackage[utf8x]{inputenc}
|
|
|
|
\usepackage[francais]{babel}
|
|
|
|
\usepackage{amssymb}
|
|
|
|
\usepackage{amsmath}
|
|
|
|
\usepackage{amsfonts}
|
2014-08-29 12:33:04 +00:00
|
|
|
|
|
|
|
% Title Page
|
2014-12-19 06:59:26 +00:00
|
|
|
\title{Jouons avec DS\_géné et pyMath}
|
2014-08-29 12:33:04 +00:00
|
|
|
% \quatreC \quatreD \troisB \troisPro
|
2014-12-19 06:59:26 +00:00
|
|
|
\date{}
|
2014-08-29 12:33:04 +00:00
|
|
|
|
2015-05-14 09:02:48 +00:00
|
|
|
=======
|
2015-02-08 16:04:05 +00:00
|
|
|
\RequirePackage[utf8x]{inputenc}
|
|
|
|
\RequirePackage[francais]{babel}
|
|
|
|
\RequirePackage{amssymb}
|
|
|
|
\RequirePackage{amsmath}
|
|
|
|
\RequirePackage{amsfonts}
|
|
|
|
\RequirePackage{subfig}
|
|
|
|
\RequirePackage{graphicx}
|
|
|
|
\RequirePackage{color}
|
2014-08-29 12:33:04 +00:00
|
|
|
|
|
|
|
% Title Page
|
2015-02-08 16:04:05 +00:00
|
|
|
\title{Calcul littéral et statistiques}
|
|
|
|
\date{\today}
|
2015-05-14 09:02:48 +00:00
|
|
|
>>>>>>> origin/dev
|
2014-08-29 12:33:04 +00:00
|
|
|
|
|
|
|
\begin{document}
|
|
|
|
\maketitle
|
|
|
|
|
2015-05-14 09:02:48 +00:00
|
|
|
<<<<<<< HEAD
|
2015-03-19 21:06:19 +00:00
|
|
|
<<<<<<< HEAD
|
2014-12-19 06:59:26 +00:00
|
|
|
\section{Exercice de simplification de fraction}
|
|
|
|
\Block{do RdExpression.set_form("exp")}
|
|
|
|
\Block{set A = RdExpression("{a}/2+2")()}
|
|
|
|
\Block{set B = RdExpression("{a}/2+2")()}
|
2014-08-29 12:33:04 +00:00
|
|
|
Développer et réduire les expressions suivantes:
|
2014-12-19 06:59:26 +00:00
|
|
|
|
2014-08-29 12:33:04 +00:00
|
|
|
\begin{equation*}
|
2014-12-19 06:59:26 +00:00
|
|
|
A = \Var{ A } \qquad
|
2014-08-29 12:33:04 +00:00
|
|
|
B = \Var{ B }
|
|
|
|
\end{equation*}
|
2014-09-02 09:20:09 +00:00
|
|
|
|
|
|
|
Solutions:
|
|
|
|
\Var{A.simplify() | calculus}
|
|
|
|
\Var{B.simplify() | calculus(name = "B")}
|
2014-12-19 06:59:26 +00:00
|
|
|
|
|
|
|
\section{Mettre sous forme canonique}
|
|
|
|
\Block{set P = RdExpression("{a}x^2 + {b}x + {c}")()}
|
|
|
|
Mettre $\Var{P}$ sous la forme canonique.
|
|
|
|
|
|
|
|
Solution:
|
|
|
|
|
|
|
|
On simplifie le polynôme:
|
|
|
|
\begin{eqnarray*}
|
|
|
|
\Var{P.simplify() | calculus(name = "P(x) = ")}
|
|
|
|
\end{eqnarray*}
|
|
|
|
|
|
|
|
|
|
|
|
Calcul des coordonnées du sommet de la courbe:
|
|
|
|
\begin{eqnarray*}
|
|
|
|
\alpha & = & \frac{-b}{2a} = \\
|
|
|
|
\beta & = & -\frac{b^2 - 4ac}{4a} =
|
|
|
|
\end{eqnarray*}
|
|
|
|
|
2015-03-19 21:06:19 +00:00
|
|
|
=======
|
2014-08-29 12:33:04 +00:00
|
|
|
\Calc
|
|
|
|
Le barème est donné à titre indicatif, il pourra être modifié.
|
|
|
|
|
|
|
|
\begin{Exo}[4.5]
|
2015-01-06 08:22:52 +00:00
|
|
|
\Block{set A = Expression.random("{a} / 2 + 2")}
|
|
|
|
\Block{set P = Polynom.random(["{b}","{a}"])}
|
|
|
|
\Block{set Q = Polynom.random(["{b+2}","{a}"])}
|
|
|
|
\Block{set R = P('x')*Q('x') }
|
2014-08-29 12:33:04 +00:00
|
|
|
Développer et réduire les expressions suivantes:
|
2015-01-06 08:22:52 +00:00
|
|
|
\begin{eqnarray*}
|
|
|
|
A &=& \Var{ A } \\
|
|
|
|
P(x) &=& \Var{ P } \\
|
|
|
|
Q(x) &=& \Var{ Q }\\
|
|
|
|
R(x) &=& \Var{R}
|
|
|
|
\end{eqnarray*}
|
2014-09-02 09:20:09 +00:00
|
|
|
|
|
|
|
Solutions:
|
|
|
|
\Var{A.simplify() | calculus}
|
2015-01-06 08:22:52 +00:00
|
|
|
\Var{P(2).simplify() | calculus(name = "P(2)")}
|
|
|
|
\Var{Q(2).simplify() | calculus(name = "Q(2)")}
|
|
|
|
\Var{(P+Q) | calculus(name = "P(x) + Q(X)")}
|
|
|
|
\Var{(P('x')+Q('x')).simplify() | calculus(name = "P(x) + Q(X)")}
|
|
|
|
\Var{R.simplify() | calculus(name = "R(x)")}
|
2014-11-21 16:20:04 +00:00
|
|
|
|
2014-08-29 12:33:04 +00:00
|
|
|
\end{Exo}
|
|
|
|
|
2015-01-06 08:22:52 +00:00
|
|
|
\begin{Exo}
|
|
|
|
\Block{set P = Polynom.random(["{a}", "{b}", "{c}"])}
|
2015-05-14 09:02:48 +00:00
|
|
|
=======
|
2015-02-08 16:04:05 +00:00
|
|
|
|
|
|
|
\section{Polynômes}
|
|
|
|
|
|
|
|
|
|
|
|
\Block{set P = Polynom.random(["{a}", "{b}", "{c}"], ["{b}**2 - 4*{a}*{c} == 0"])}
|
2015-05-14 09:02:48 +00:00
|
|
|
>>>>>>> origin/dev
|
2015-01-06 08:22:52 +00:00
|
|
|
Résoudre l'équation suivante
|
|
|
|
\begin{eqnarray*}
|
|
|
|
\Var{P} & = & 0
|
|
|
|
\end{eqnarray*}
|
|
|
|
|
|
|
|
Solution:
|
|
|
|
|
|
|
|
On commence par calculer le discriminant
|
2015-02-08 16:04:05 +00:00
|
|
|
\Block{set Delta = Expression("{b}^2 - 4*{a}*{c}".format(a = P._coef[2], b = P._coef[1], c = P._coef[0]))}
|
2015-01-06 08:22:52 +00:00
|
|
|
\begin{eqnarray*}
|
2015-02-08 16:04:05 +00:00
|
|
|
\Delta & = & b^2-4ac \\
|
|
|
|
\Var{Delta.simplify()|calculus(name="\\Delta")}
|
2015-01-06 08:22:52 +00:00
|
|
|
\end{eqnarray*}
|
|
|
|
\Block{set Delta = Delta.simplified()}
|
2015-02-08 16:04:05 +00:00
|
|
|
|
|
|
|
\Block{if Delta > 0}
|
|
|
|
Alors $\Delta = \Var{Delta} > 0$ donc il y a deux solutions
|
|
|
|
|
|
|
|
\Block{set x1 = (-P._coef[1] - sqrt(Delta))/(2*P._coef[2])}
|
|
|
|
\Block{set x2 = (-P._coef[1] + sqrt(Delta))/(2*P._coef[2])}
|
|
|
|
|
|
|
|
\begin{eqnarray*}
|
|
|
|
x_1 & = & \frac{-b - \sqrt{\Delta}}{2a} = \frac{\Var{-P._coef[1]} - \sqrt{\Var{Delta}}}{2 \times \Var{P._coef[2]}} = \Var{x1 | round(2)} \\
|
|
|
|
x_2 & = & \frac{-b + \sqrt{\Delta}}{2a} = \frac{\Var{-P._coef[1]} + \sqrt{\Var{Delta}}}{2 \times \Var{P._coef[2]}} = \Var{x2 | round(2)}
|
|
|
|
\end{eqnarray*}
|
|
|
|
|
|
|
|
Les solutions sont donc $\mathcal{S} = \left\{ \Var{x1|round(2)}; \Var{x2|round(2)} \right\}$
|
|
|
|
|
|
|
|
\Block{elif Delta == 0}
|
|
|
|
Alors $\Delta = \Var{Delta} = 0$ donc il y a une solution
|
|
|
|
|
|
|
|
\Block{set x1 = Expression("-{b}/(2*{a})".format(b = P._coef[1], a = P._coef[2]))}
|
|
|
|
|
|
|
|
\begin{eqnarray*}
|
|
|
|
x_1 = \frac{-b}{2a} = \Var{" = ".join(x1.simplify())}
|
|
|
|
\end{eqnarray*}
|
|
|
|
|
|
|
|
Les solutions sont donc $\mathcal{S} = \left\{ \Var{x1.simplified()}\right\}$
|
|
|
|
|
|
|
|
\Block{else}
|
|
|
|
Alors $\Delta = \Var{Delta} < 0$ donc il n'y a pas de solution.
|
|
|
|
|
|
|
|
\Block{endif}
|
|
|
|
|
|
|
|
\bigskip
|
|
|
|
~\dotfill
|
|
|
|
\bigskip
|
2015-01-06 08:22:52 +00:00
|
|
|
|
|
|
|
|
2015-02-08 16:04:05 +00:00
|
|
|
\Block{set P = Polynom.random(["{a}", "{b}", "{c}"])}
|
|
|
|
\Block{set Q = Polynom.random(["{a}", "{b}", "{c}"])}
|
|
|
|
Résoudre l'équation suivante
|
|
|
|
\begin{eqnarray*}
|
|
|
|
\Var{P} & = & \Var{Q}
|
|
|
|
\end{eqnarray*}
|
|
|
|
|
|
|
|
Solution:
|
|
|
|
|
|
|
|
On commence par se ramener à une équation de la forme $ax^2+bx+c = 0$.
|
|
|
|
|
|
|
|
\begin{eqnarray*}
|
|
|
|
\Var{P} = \Var{Q} & \Leftrightarrow & \Var{P} - (\Var{Q}) = 0 \\
|
|
|
|
\Var{(P - Q)|calculus(name = "", sep = "\\Leftrightarrow", end = "= 0")}
|
|
|
|
\end{eqnarray*}
|
|
|
|
|
|
|
|
\Block{set R = (P-Q)[-1]}
|
|
|
|
On cherche maintenant à résoudre l'équation $\Var{R} = 0$.
|
2015-01-06 08:22:52 +00:00
|
|
|
|
2015-05-14 09:02:48 +00:00
|
|
|
<<<<<<< HEAD
|
2015-01-06 08:22:52 +00:00
|
|
|
\end{Exo}
|
2015-03-19 21:06:19 +00:00
|
|
|
>>>>>>> origin/dev
|
2015-05-14 09:02:48 +00:00
|
|
|
=======
|
2015-02-08 16:04:05 +00:00
|
|
|
On commence par calculer le discriminant
|
|
|
|
\Block{set Delta = Expression("{b}^2 - 4*{a}*{c}".format(a = R._coef[2], b = R._coef[1], c = R._coef[0]))}
|
|
|
|
\begin{eqnarray*}
|
|
|
|
\Delta & = & b^2-4ac \\
|
|
|
|
\Var{Delta.simplify()|calculus(name="\\Delta")}
|
|
|
|
\end{eqnarray*}
|
|
|
|
\Block{set Delta = Delta.simplified()}
|
|
|
|
|
|
|
|
\Block{if Delta > 0}
|
|
|
|
Alors $\Delta = \Var{Delta} > 0$ donc il y a deux solutions
|
|
|
|
|
|
|
|
\Block{set x1 = (-R._coef[1] - sqrt(Delta))/(2*R._coef[2])}
|
|
|
|
\Block{set x2 = (-R._coef[1] + sqrt(Delta))/(2*R._coef[2])}
|
|
|
|
|
|
|
|
\begin{eqnarray*}
|
|
|
|
x_1 & = & \frac{-b - \sqrt{\Delta}}{2a} = \frac{\Var{-R._coef[1]} - \sqrt{\Var{Delta}}}{2 \times \Var{R._coef[2]}} = \Var{x1 | round(2)} \\
|
|
|
|
x_2 & = & \frac{-b + \sqrt{\Delta}}{2a} = \frac{\Var{-R._coef[1]} + \sqrt{\Var{Delta}}}{2 \times \Var{R._coef[2]}} = \Var{x2 | round(2)}
|
|
|
|
\end{eqnarray*}
|
|
|
|
|
|
|
|
Les solutions sont donc $\mathcal{S} = \left\{ \Var{x1|round(2)}; \Var{x2|round(2)} \right\}$
|
|
|
|
|
|
|
|
\Block{elif Delta == 0}
|
|
|
|
Alors $\Delta = \Var{Delta} = 0$ donc il y a une solution
|
|
|
|
|
|
|
|
\Block{set x1 = Expression("-{b}/(2*{a})".format(b = R._coef[1], a = R._coef[2]))}
|
|
|
|
|
|
|
|
\begin{eqnarray*}
|
|
|
|
x_1 = \frac{-b}{2a} = \Var{" = ".join(x1.simplify())}
|
|
|
|
\end{eqnarray*}
|
|
|
|
|
|
|
|
Les solutions sont donc $\mathcal{S} = \left\{ \Var{x1.simplified()}\right\}$
|
|
|
|
|
|
|
|
\Block{else}
|
|
|
|
Alors $\Delta = \Var{Delta} < 0$ donc il n'y a pas de solution.
|
|
|
|
|
|
|
|
\Block{endif}
|
2015-05-14 09:02:48 +00:00
|
|
|
>>>>>>> origin/dev
|
2014-08-29 12:33:04 +00:00
|
|
|
|
|
|
|
|
|
|
|
\end{document}
|
|
|
|
|
|
|
|
%%% Local Variables:
|
|
|
|
%%% mode: latex
|
|
|
|
%%% TeX-master: "master"
|
|
|
|
%%% End:
|
|
|
|
|
2014-11-21 16:20:04 +00:00
|
|
|
|