diff --git "a/Chapitre 9 - Produits scalaires et espaces euclidens/9.3-9.4 Norme, in\303\251galit\303\251 de Cauchy-Schwarz, orthogonalit\303\251, inegalit\303\251 du triangle, Pythagore.ipynb" "b/Chapitre 9 - Produits scalaires et espaces euclidens/9.3-9.4 Norme, in\303\251galit\303\251 de Cauchy-Schwarz, orthogonalit\303\251, inegalit\303\251 du triangle, Pythagore.ipynb" index acee4aa..3dee009 100644 --- "a/Chapitre 9 - Produits scalaires et espaces euclidens/9.3-9.4 Norme, in\303\251galit\303\251 de Cauchy-Schwarz, orthogonalit\303\251, inegalit\303\251 du triangle, Pythagore.ipynb" +++ "b/Chapitre 9 - Produits scalaires et espaces euclidens/9.3-9.4 Norme, in\303\251galit\303\251 de Cauchy-Schwarz, orthogonalit\303\251, inegalit\303\251 du triangle, Pythagore.ipynb" @@ -1,117 +1,623 @@ { "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# **Concept(s)-clé(s) et théorie**\n", "\n", "## Définition 1 - Norme et Distance\n", "Soit $V$ un $\\mathbb{R}$-espace vectoriel muni d'un produit scalaire $\\langle \\cdot, \\cdot \\rangle$. On définit la **norme** de $v \\in V$, notée par $||v||$, par \n", "\n", "\\begin{equation}\n", "||v|| = \\sqrt{\\langle v, v\\rangle}\n", "\\end{equation}\n", "\n", "Aussi, on définit la **distance** enre deux vecteurs $u,v \\in V$ comme étant $||u-v||$.\n", "\n", "## Propriétés 1 - Propriétés de la norme\n", "Soient $V$ un $\\mathbb{R}$-espace vectoriel muni d'un produit scalaire $\\langle\\cdot,\\cdot\\rangle$ et $v \\in V$. Alors les affimations suivantes sont vérifiées.\n", "1. $||v|| \\geq 0$\n", "2. Si $||v|| = 0$, alors $v=0$\n", "3. $||\\alpha v|| = |\\alpha|||v|| \\ \\forall \\alpha \\in \\mathbb{R}$\n", "\n", "## Théorème 1 - Inégalitè de Cauchy-Schwarz\n", "Soit $V$ un $\\mathbb{R}$-espace vectoriel muni d'un produit scalaire $\\langle \\cdot, \\cdot \\rangle$. Alors\n", "\n", "\\begin{equation}\n", "|\\langle u,v \\rangle| \\leq ||u|| \\ ||v||\n", "\\end{equation}\n", "\n", "ceci pour tout $u,v \\in V$.\n", "\n", "## Dèfiniton 2 - Angle entre deux vecteurs\n", "Soient $V$ un $\\mathbb{R}$-espace vectoriel muni d'un produit scalaire $\\langle\\cdot,\\cdot\\rangle$ et $u,v \\in V$ deux vecteurs non-nuls. Alors l'**angle** entre $u$ et $v$ est défini comme étant l'angle $0\\leq\\theta\\leq\\pi$ tel que\n", "\n", "\\begin{equation}\n", "\\cos\\theta = \\dfrac{\\langle u,v \\rangle}{||u|| \\ ||v||}\n", "\\end{equation}\n", "\n", "## Théorème 2 - Inègalitè du Triangle\n", "Soit $V$ un $\\mathbb{R}$-espace vectoriel muni d'un produit scalaire $\\langle \\cdot,\\cdot \\rangle$. Alors, pour tous $u,v \\in V$, on a\n", "\n", "\\begin{equation}\n", "||u+v|| \\leq ||u|| + ||v||\n", "\\end{equation}\n", "\n", "## Théorème 3 - Pythagore Géneralisé\n", "Soit $V$ un $\\mathbb{R}$-espace vectoriel muni d'un produit scalaire $\\langle \\cdot,\\cdot \\rangle$ et supposons que $u_1, \\dots, u_t \\in V$ soient des vecteurs deux-à-deux orthogonaux (i.e. $\\langle u_i,u_j \\rangle = 0 \\quad \\forall i,j \\in \\{1,\\dots,t\\}$ telles que $i \\neq j$). Alors\n", "\n", "\\begin{equation}\n", "||u_1 + \\dots + u_t||^2 = ||u_1||^2 + \\dots + ||u_t||^2\n", "\\end{equation}" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Exercises et Exemples" ] }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + " \n", + " " + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "import Librairie.AL_Fct as al\n", + "import Corrections.corrections as corrections\n", + "import numpy as np" + ] + }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Exercise 1\n", - "\n" + "\n", + "Considérez les déclarations suivantes et marquez celles qui sont vraies.\n", + "\n", + "1. Soit $V=\\mathbb{R}^n$, muni du produit scalaire standard. Alors $$\\dfrac{\\left(\\sum_{i=1}^n u_i\\right)^2}{\\sum_{i=1}^n v_i} \\leq \\sum_{i=1}^n \\dfrac{u_i^2}{v_i} \\qquad \\forall \\ u,v \\in V$$\n", + "2. L'inégalité triangulaire et l'inégalité Cauchy-Schwarz portent toutes deux un signe d'égalité soit si au moins un des deux vecteurs est nul, soit si les deux vecteurs sont orthogonaux.\n", + "3. Soit $V$ un $\\mathbb{R}$-espace vectoriel, equipped with the inner product $\\langle \\cdot,\\cdot \\rangle$. The angle between the vectors $u$ and $\\tilde{v} =: v - \\dfrac{\\langle u,v \\rangle}{\\langle u,u \\rangle} u$, whichever $u,v \\in V$ non-null, is equal to $0$.\n", + "4. Let $V=\\mathcal{C}([-\\pi;\\pi]; \\mathbb{R})$, muni du produit scalaire standard $\\langle f,g \\rangle = \\int_{-\\pi}^{\\pi} f(t) \\ g(t) \\ dt$. Alors le théorème de Pythagore généralisé s'applique à la famille des vecteurs $\\mathcal{F}_1 = \\big\\{\\cos(kx)\\big\\}_{k=0}^{N_c} \\cup \\big\\{\\sin(kx)\\big\\}_{k=1}^{N_s}$, quelles que soient les valeurs de $N_c$ et $N_s$.\n", + "5. Soit $V = \\mathcal{C}([-1;1]; \\mathbb{R})$ muni du produit scalaire standard $\\langle f,g \\rangle = \\int_{-1}^{1} f(t) \\ g(t) \\ dt$. Alors le théorème de Pythagore généralisé s'applique à la famille des vecteurs $\\mathcal{F}_2 = \\big\\{x^{2n}\\big\\}_{n=0}^{N_e} \\cup \\big\\{x^{2m+1}\\big\\}_{m=0}^{N_o}$, quelles que soient les valeurs de $N_e$ et $N_o$.\n", + "6. Soit $V = \\mathcal{M}_{4\\times4}(\\mathbb{R})$ muni du produit scalaire standard $\\langle A,B \\rangle = Tr(A^TB)$. Alors le théorème de Pythagore généralisé s'applique à la famille des vecteurs $\\mathcal{F}_3 = \\Bigg\\{\\begin{bmatrix} 1/2 & -1/2 \\\\ 0 & 0 \\end{bmatrix}, \\begin{bmatrix} 1 & 1 \\\\ 0 & 0 \\end{bmatrix}, \\begin{bmatrix} 0 & 0 \\\\ -2 & -2 \\end{bmatrix}, \\begin{bmatrix} 0 & 0 \\\\ 1/4 & -1/4 \\end{bmatrix}\\Bigg\\}$." + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Cliquer sur CTRL pour sélectionner plusieurs réponses\n" + ] + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "c559cf2b59af41bfb9e4fa5187c780c6", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "interactive(children=(SelectMultiple(description='La déclaration est vraie dans les cas:', layout=Layout(heigh…" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "corrections.Ex1Chapitre9_3_4()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Exercise 2\n", "\n", - "Given some couples of matrices (different from notebook 9.2), compute the angle and the LHS and RHS of Pythagore theorem" + "## Exercise 2\n", + "Étant donné les couples de matrices suivants, déterminez l'angle entre les deux et les termes de gauche et de droite de l'égalité dans le thoerem de Pythagore, par rapport au produit scalaire défini via l'opérateur de trace\n", + "\n", + "1. $ \\qquad A = \\begin{pmatrix} -1 & 2 & 1 \\\\ 0 & 1 & -1 \\\\ -2 & 3 & 0 \\end{pmatrix} \\qquad \\quad \\ \\ \n", + " B = \\begin{pmatrix} 0 & -1 & 2 \\\\ 1 & 3 & -2 \\\\ 1 & 1 & 1 \\end{pmatrix}$ \n", + "2. $ \\qquad A = \\begin{pmatrix} 1 & -1 \\\\ 0 & 3 \\end{pmatrix} \\qquad \\qquad \\quad\n", + " B = \\begin{pmatrix} 0 & 2 \\\\ 1 & -1\\end{pmatrix}$\n", + "3. $ \\qquad A = \\begin{pmatrix} 0 & 1 & 3 & 0 \\\\ 1 & 0 & 1 & 0 \\\\ -1 & -2 & 2 & 1 \\\\ 3 & 4 & 1 & 2 \\end{pmatrix} \\qquad\n", + " B = \\begin{pmatrix} 3 & 1 & -1 & 2 \\\\ 2 & 2 & 0 & 1 \\\\ -1 & 1 & -1 & 3 \\\\ -1 & 1 & 1 & -1 \\end{pmatrix}$\n", + "4. $ \\qquad A = \\begin{pmatrix} 1 & 0 \\\\ -1 & 3 \\end{pmatrix} \\qquad \\qquad \\quad\n", + " B = \\begin{pmatrix} -1 & -5 \\\\ 2 & -3 \\end{pmatrix}$" ] }, { - "cell_type": "markdown", + "cell_type": "code", + "execution_count": 3, "metadata": {}, + "outputs": [ + { + "data": { + "text/latex": [ + "Insérez les valeurs des quantités listées ci-dessous. Entrez les valeurs avec 4 chiffres après la virgule! Si l'angle n'est pas défini, entrez -999!" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "1faad93f940d49eea8c0352864215f5c", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "FloatText(value=0.0, description='$\\\\theta$:', step=0.0001, style=DescriptionStyle(description_width='initial'…" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "fd04499eebae4ee7afc419720af9a6d2", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "FloatText(value=0.0, description='$||A+B||^2$', step=0.0001, style=DescriptionStyle(description_width='initial…" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "8a4483d110f24bc09e5b81b2f2f6116c", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "FloatText(value=0.0, description='$||A||^2 + ||B||^2$', step=0.0001, style=DescriptionStyle(description_width=…" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "187849f96b17455ba486907f10952707", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "interactive(children=(Button(description='Run Interact', style=ButtonStyle()), Output()), _dom_classes=('widge…" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "540a1af5f6b342d2bcb4ed0c79af40f9", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "HBox(children=(Button(description='Solution', disabled=True, style=ButtonStyle()),))" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "023caca58ba94cb49136e257ce11d8e8", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "Output()" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], "source": [ - "## Exercise 3\n", - "\n", - "Given some couples of functions (different from notebook 9.2), compute the angle and the LHS and RHS of Pythagore theorem" + "# Cas Nombre 1\n", + "corrections.Ex2Chapitre9_3_4(case_nb=1)" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "data": { + "text/latex": [ + "Insérez les valeurs des quantités listées ci-dessous. Entrez les valeurs avec 4 chiffres après la virgule! Si l'angle n'est pas défini, entrez -999!" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "f2757f98c06048e581a00a66a1b68925", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "FloatText(value=0.0, description='$\\\\theta$:', step=0.0001, style=DescriptionStyle(description_width='initial'…" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "ea00e91e47994ed6945351e6e5a92a34", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "FloatText(value=0.0, description='$||A+B||^2$', step=0.0001, style=DescriptionStyle(description_width='initial…" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "c76199672be84201bed50a8c3c1811b1", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "FloatText(value=0.0, description='$||A||^2 + ||B||^2$', step=0.0001, style=DescriptionStyle(description_width=…" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "511a70c30cbf4c4f90888d4bdf11383d", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "interactive(children=(Button(description='Run Interact', style=ButtonStyle()), Output()), _dom_classes=('widge…" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "2815f3b7a5a34125b53e58ea31580169", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "HBox(children=(Button(description='Solution', disabled=True, style=ButtonStyle()),))" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "a67efce4a3824943b7dd79dbeeac7ee3", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "Output()" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "# Cas Nombre 2\n", + "corrections.Ex2Chapitre9_3_4(case_nb=2)" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "data": { + "text/latex": [ + "Insérez les valeurs des quantités listées ci-dessous. Entrez les valeurs avec 4 chiffres après la virgule! Si l'angle n'est pas défini, entrez -999!" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "44e2e91ff958479293ca386e98afc8d7", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "FloatText(value=0.0, description='$\\\\theta$:', step=0.0001, style=DescriptionStyle(description_width='initial'…" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "501002cc84f045e1b750a282dcff7927", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "FloatText(value=0.0, description='$||A+B||^2$', step=0.0001, style=DescriptionStyle(description_width='initial…" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "081e05c3cf3f4890a43313d4a6fcd542", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "FloatText(value=0.0, description='$||A||^2 + ||B||^2$', step=0.0001, style=DescriptionStyle(description_width=…" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "6573557cdc2648e69b1b80f1bc78e2ec", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "interactive(children=(Button(description='Run Interact', style=ButtonStyle()), Output()), _dom_classes=('widge…" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "cc44df3fc2c44a58aab093611baced7b", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "HBox(children=(Button(description='Solution', disabled=True, style=ButtonStyle()),))" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "5e83c67ad5864e9fb0767a844e8b6f03", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "Output()" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "# Cas Nombre 3\n", + "corrections.Ex2Chapitre9_3_4(case_nb=3)" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 6, "metadata": {}, - "outputs": [], - "source": [] + "outputs": [ + { + "data": { + "text/latex": [ + "Insérez les valeurs des quantités listées ci-dessous. Entrez les valeurs avec 4 chiffres après la virgule! Si l'angle n'est pas défini, entrez -999!" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "2b49a93d55ce438b90f1b3a405ff7507", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "FloatText(value=0.0, description='$\\\\theta$:', step=0.0001, style=DescriptionStyle(description_width='initial'…" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "ed6968359fe942288d758a4ef4693448", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "FloatText(value=0.0, description='$||A+B||^2$', step=0.0001, style=DescriptionStyle(description_width='initial…" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "cadf69365a6543efb339298509f12644", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "FloatText(value=0.0, description='$||A||^2 + ||B||^2$', step=0.0001, style=DescriptionStyle(description_width=…" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "51ce317aa6284d0e95d26b21aa9f6856", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "interactive(children=(Button(description='Run Interact', style=ButtonStyle()), Output()), _dom_classes=('widge…" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "c5d828137ae84807a372e894fdc4c3cc", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "HBox(children=(Button(description='Solution', disabled=True, style=ButtonStyle()),))" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "2b07cc1bb1a14b24a7fef78436635be6", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "Output()" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "# Cas Nombre 4\n", + "corrections.Ex2Chapitre9_3_4(case_nb=4)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Exercise 3\n", + "\n", + "Given some couples of functions (different from notebook 9.2), compute the angle and the LHS and RHS of Pythagore theorem" + ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "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.7.4" } }, "nbformat": 4, "nbformat_minor": 4 }