{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "### Example 2.3 (Asymptotics of Surjections)\n", "Asymptotic investigation of surjections from their exponential generating function. \n", "*Requirements: Internet access (partially)*" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "'F(z) = ' -1/(e^z - 2)" ] }, "execution_count": 1, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# First, define z as a variable\n", "var('z')\n", "\n", "# Next, define the (exponential) generating function\n", "F = 1/(2-exp(z))\n", "show(\"F(z) = \",F)" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[1, 1, 3, 13, 75, 541, 4683, 47293, 545835, 7087261, 102247563, 1622632573, 28091567595, 526858348381, 10641342970443, 230283190977853, 5315654681981355, 130370767029135901, 3385534663256845323, 92801587319328411133]\n" ] } ], "source": [ "# The coefficients of the power series expansion of C at the origin form the number of surjections divided by n!\n", "# Here we recover the number of surjections\n", "ser = F.series(z,20).list()\n", "surj = [ser[k]*factorial(k) for k in range(20)]\n", "print(surj)" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "0: A000670: Fubini numbers: number of preferential arrangements of n labeled elements; or number of weak orders on n labeled elements; or number of ordered partitions of [n].\n" ] } ], "source": [ "# Search the OEIS (oeis.org) for the sequence\n", "# This requires internet access\n", "oe = oeis(surj)\n", "print(oe)" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "0: E.g.f.: 1/(2-exp(x)).\n", "1: a(n) = Sum_{k=1..n} binomial(n, k)*a(n-k), a(0) = 1.\n", "2: The e.g.f. y(x) satisfies y' = 2*y^2 - y.\n", "3: a(n) = A052856(n) - 1, if n>0." ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Here are a few of the formulas available on the OEIS\n", "oe[0].formulas()[1:5]" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "0: Also number of asymmetric generalized weak orders on n points.\n", "1: Also called the ordered Bell numbers.\n", "2: A weak order is a relation that is transitive and complete.\n", "3: Called Fubini numbers by Comtet: counts formulas in Fubini theorem when switching the order of summation in multiple sums. - _Olivier GĂ©rard_, Sep 30 2002" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Here are a few of the examples listed on the OEIS\n", "oe[0].comments()[1:5]" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "'F(z) = ' (-1/2)*(z - log(2))^(-1) + 1/4 + (-1/24)*(z - log(2)) + Order((z - log(2))^2)" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# The residue of F at the dominant singularity z=log(2) is -1/2\n", "show(\"F(z) = \", F.series(z==log(2),2))" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "s_n\\sim 1/2*factorial(n)/log(2)^(n + 1)" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Because this is a simple pole, we get the asymptotic approximation\n", "var('n')\n", "asm = factorial(n)/2/log(2)^(n+1)\n", "show(LatexExpr(r\"s_n\\sim\"),asm)" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAkwAAAGECAYAAADEN3+HAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAPYQAAD2EBqD+naQAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi41LCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvSM8oowAAIABJREFUeJzt3XFQnPWB//HPZrPANiEYS9yAgcBkbCRCoyEILNZKW0kxwRCtF7wxTbwzd7mLNyJ1enIGy6UaZpIJ2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F4VFBQECiLjo7W17/+dbW2tk5jz/BF8MYbb+iaa67RV77yFW3cuFF9fX3T3SVcQgQmRIzs7Gw1NTXp4MGDqq+vl8fjkdPp1MDAwHR3DV8QHo9HkuRwOILKHQ5H4DVEpsLCQj3//PP6j//4D+3cuVNvv/22vvGNb8jn801313CJcEsOEeOz0+0ZGRnKzc3VokWL1NjYqLKysmnsGb5oLBZL0L5hGOPKEFnWrl0b+Do9PV3Lly/XwoUL9corrwRu3+LKxgwTItasWbOUkZGhzs7O6e4KviDOPp/yp7NJfX1942adENkSEhK0cOFCfn9EEAITIpbP59Px48eVkJAw3V3BF0Rqaqrmz5+vlpaWQNnw8LB+9atfyel0TmPP8EUzMDCg7u5ufn9EEG7JIWI88sgjKioqUnJysvr6+vTEE0/I6/Vq/fr10901XEKffPKJTp48Gdj/4IMPdOTIEV199dVKTk5WaWmptm3bpuuuu07XXXedtm3bpi996Uv68z//82nsNcLtQtfF1VdfrcrKSt19991KSEjQqVOn9A//8A+Kj4/XmjVrprHXuKQMIEKsXbvWSEhIMGw2m5GYmGjcddddxnvvvTfd3cIl9p//+Z+GpHHb+vXrDcMwjLGxMeMHP/iBMX/+fCM6Otq49dZbjXfffXd6O42wu9B1MTQ0ZBQUFBjz5s0zbDabkZycbKxfv95wu93T3W1cQhbDMIzpCmsAAACXA55hAgAAMEFgAgAAMEFgAgAAMEFgAgAAMEFgAgAAMEFgAgAAMEFgAgAAMEFgAgAAMEFgAgAAMEFgAgAAMEFgAgAAMPH/Ad2b9CCp0iGJAAAAAElFTkSuQmCC", "text/plain": [ "Graphics object consisting of 1 graphics primitive" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Plot the ratio of the series coefficients to our asymptotic approximation\n", "# A simple pole implies exponentially decreasing error, and we observe fast convergence\n", "lst = [ser[k]*2*log(2)^(k+1) for k in range(20)]\n", "points([[k,lst[k]] for k in range(1,20)])" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "SageMath 9.2", "language": "sage", "name": "sagemath" }, "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.8.5" } }, "nbformat": 4, "nbformat_minor": 4 }