{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"\n",
"
\n", " | Frobenius Number | \n", "Conductor | \n", "# Not Writable | \n", "
---|---|---|---|
\n", " | \n", " | \n", " | |
\n", " | \n", " | \n", " | |
\n", " | \n", " | None | \n", "|
\n", " | \n", " | \n", " | |
\n", " | \n", " | \n", " | |
\n", " | \n", " | \n", " |
Let us work out by counting the numbers that are not writable. Let's start with $a=2$, $b=3$ and $a=3$, $b=4$.
" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "1" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Recall that we discussed a few facts about integers earlier.
\n", "Fact: If $a$, $b>0$ are integers then we can write $a=qb+r$ with $0\\leq r\n", "
Fact: In this situation, $\\gcd(a,b)=\\gcd(b,r)$.
\n", "Here is another useful fact for our situation. Many of you already know this.
\n", "Fact: For a given $n\\in \\mathbb{Z}$, the equation $ax+by=n$ has a solution in integers if and only if $\\gcd(a,b) \\mid n$.
\n", "That is, you can't even write $ax+by=n$ if the greatest common divisor of $a$ and $b$ doesn't divide $n$. This was studied by the Greeks, known by Aryabhata in the Indian Middle Ages, and rediscovered by Bachet de Méziriac about 1600.
\n", "Implication For Us: If $a$ and $b$ have a common divisor bigger than 1, there cannot be a conductor.
\n", "We already saw an example in class. I want you to think about why this might be.
\n", "I can prove the facts above. But just proving things are true and using them isn't enough. Why is it true, intuitively? I believe the right place to do this is in geometry.
" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "Widget Javascript not detected. It may not be installed or enabled properly. Reconnecting the current kernel may help.\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "9e2e4e89671b4325893804a3fa80e10c" } }, "metadata": {}, "output_type": "display_data" } ], "source": [ "@interact\n", "def _(a = slider(1, 20, 1, 3), \\\n", " b = slider(1, 20, 1, 4), \\\n", " c = slider(1, 30, 1, 6), \\\n", " viewsize = slider(5, 30, 1, 5)):\n", " \n", " # plot the equation of the line y = - (a/b)*x + c/b.\n", " \n", " p = plot(-(a/b) * x + c/b, (x, -1, viewsize), plot_points = 200)\n", " \n", " # integer coordiantes for the lattice \n", " \n", " lattice_pts = [[i,j] for i in [-1..viewsize] for j in [-viewsize..viewsize]]\n", " \n", " # plot integer lattice with pointsize set to 20 and rgbcolor set to (0, 0, 0).\n", " \n", " plot_lattice_pts = points(lattice_pts, rgbcolor = (0, 0, 0), pointsize = 20)\n", " \n", " # Check if gcd(a, b) divides c. \n", " \n", " if mod(c, gcd(a, b)) == 0:\n", " \n", " # Get integers coordinates x and y in lattice_pts that lies on the line y = - (a/b)*x + c/b. \n", " # That is, the integer coordinates that satisfy the equation a * x + b * y = c.\n", " \n", " line_pts = [coords for coords in lattice_pts if a * coords[0] + b * coords[1] == c]\n", " \n", " # Check if line_pts is empty. In other words, there are no integer coordinates x and y in lattice_pts \n", " # that lie on the line y = - (a/b)*x + c/b or satisfies the equation a * x + b * y = c. Note that\n", " # in general, this does not mean that there are no solution since there might exist integer \n", " # coordinates which are not contained in lattice_pts. \n", " \n", " if line_pts == []:\n", " \n", " # Define an empty Graphics object.\n", " \n", " plot_line_pts = Graphics()\n", " \n", " else:\n", " \n", " # plot the integer coordinates x and y in lattice_pts that lie on the line y = - (a/b)*x + c/b or \n", " # satisfies the equation a * x + b * y = c.\n", " \n", " plot_line_pts = points(line_pts, rgbcolor = (0, 0, 1), pointsize = 20)\n", " \n", " # Print sentence indicating the set of solution, (integer coordinates) satisfying the equation\n", " # a * x + b * y = c.\n", " \n", " pretty_print(html(r\"Showing solutions to $%s\\,x + %s\\,y = %s$ in this viewing window\" \\\n", " %(str(a), str(b), str(c))))\n", " \n", " # Combine the three plot objects together. \n", " \n", " show(p + plot_lattice_pts + plot_line_pts, figsize=[5, 5], xmin = -1, xmax = viewsize, \\\n", " ymin = -1, ymax = viewsize)\n", " \n", " # If gcd(a, b) does not divide c.\n", " \n", " else:\n", " \n", " # Print a sentence stating the gcd(a,b) does not divide c.\n", " \n", " pretty_print(html(r\"The gcd of $%s$ and $%s$ is $%s$, which does not divide $%s$,\"\\\n", " %(str(a), str(b), str(gcd(a,b)), str(c))))\n", " \n", " # Print a sentence stating that there are no integer solutions satisfying the equation \n", " \n", " pretty_print(html(r\"so there are no non-negative integer solutions to $%s\\,x + %s\\,y = %s$\"\\\n", " %(str(a), str(b), str(c))))\n", " \n", " # Combine plot objects.\n", " \n", " show(p + plot_lattice_pts, figsize = [5, 5], xmin = -1, xmax = viewsize, ymin = -1, ymax = viewsize)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "(The little gray dots in the graph above are called the integer lattice. You may treat this as a definition. There are many lattices, but only one which is basically all the intersections of $y=m,x=n$ for all integers $m,n$. So for instance $(-2,3)$ is probably visible; however, note that $(-1,1/2)$ is not a little dot, because it doesn't have integer values.)
\n", "Since $ax+by=c$ may be thought of as a line (in fact, the line $$y=-\\frac{a}{b}x+\\frac{c}{b}$$ with slope $-\\frac{a}{b}$), we now have a completely different interpretation of this very basic number theory question (the \"linear Diophantine equation\"). It is simply asking, \"When (for what $a$, $b$, $c$ combinations) does the line hit this lattice? If it does, can you tell me all intersections?\" If you play around with the sliders you will quickly see that things work out just as promised in the theorems.
\n", "Now let's connect this to some of the conductor questions. Given positive integers $a$ and $b$:
\n", "Let's explore this - even in cases where the conductor is not very interesting. How many such points are there in the following cases?
\n", "Again, you should be able to start exploring and experimenting. Naturally, in this case I don't only expect you to use my graphic, which is a big challenge for you to program right now. Try instead to write your own program to explore this question.
" ] } ], "metadata": { "kernelspec": { "display_name": "SageMath 10.4", "language": "sage", "name": "sagemath" }, "language": "python", "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.11.2" }, "varInspector": { "cols": { "lenName": 16, "lenType": 16, "lenVar": 40 }, "kernels_config": { "python": { "delete_cmd_postfix": "", "delete_cmd_prefix": "del ", "library": "var_list.py", "varRefreshCmd": "print(var_dic_list())" }, "r": { "delete_cmd_postfix": ") ", "delete_cmd_prefix": "rm(", "library": "var_list.r", "varRefreshCmd": "cat(var_dic_list()) " } }, "types_to_exclude": [ "module", "function", "builtin_function_or_method", "instance", "_Feature" ], "window_display": false } }, "nbformat": 4, "nbformat_minor": 4 }