{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "b01a7d96",
   "metadata": {},
   "source": [
    "# Borne asymptotique inférieure $\\Omega$\n",
    "\n",
    "Ce notebook permet de comparer deux fonctions $f, g \\, : \\, \\mathbb{N} \\to\n",
    "\\mathbb{N}$ afin de déterminer expérimentalement si $f \\in \\Omega(g)$.\n",
    "\n",
    "On dit que $f$ est *grand-Omega* de $g$, noté $f \\in \\Omega(g)$, s'il existe une constante réelle $c > 0$ (facteur multiplicatif) et une constante entière $n_0 \\in \\mathbb{N}$ (seuil) telles que:\n",
    "  \n",
    "$$f(n) \\ge c \\cdot g(n) \\text{ pour tout } n \\ge n_0$$\n",
    "\n",
    "Intuition: $f$ est asymptotiquement minorée par une fonction proportionnelle à $g$."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "3efa0faa",
   "metadata": {},
   "outputs": [],
   "source": [
    "import utils\n",
    "\n",
    "### MODIFIER f, g, xrange, n0 ET c CI-DESSOUS\n",
    "\n",
    "# Fonction f\n",
    "def f(x: float) -> float:\n",
    "    return 5 * x**3 - 27 * x**2 + 45 * x - 76\n",
    "\n",
    "# Fonction g\n",
    "def g(x: float) -> float:\n",
    "    return 8 * x**3\n",
    "\n",
    "# Intervalle des valeurs de x\n",
    "xrange = (0, 20)\n",
    "\n",
    "# Seuil\n",
    "n0 = 10\n",
    "\n",
    "# Facteur multiplicatif\n",
    "c = 0.1\n",
    "\n",
    "### NE PAS MODIFIER CI-DESSOUS\n",
    "\n",
    "# Fonction x |-> c * g(x)\n",
    "def c_g(x):\n",
    "    c_g.__name__ = f\"{c} * g\"\n",
    "    return c * g(x)\n",
    "\n",
    "plt = utils.plotFunctions([f, g, c_g], xrange)\n",
    "plt.axvline(x = n0, color = 'y', label = f\"n0={n0}\")\n",
    "plt.legend()\n",
    "None"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "pyvenv-3.14 (3.14.7)",
   "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.14.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
