<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><generator uri="https://jekyllrb.com/" version="4.4.1">Jekyll</generator><link href="https://miguelgg.com/feed.xml" rel="self" type="application/atom+xml"/><link href="https://miguelgg.com/" rel="alternate" type="text/html" hreflang="en"/><updated>2026-08-04T10:53:47+00:00</updated><id>https://miguelgg.com/feed.xml</id><title type="html">Miguel González</title><subtitle>This is my personal website. </subtitle><entry><title type="html">All my undergraduate class notes are now available!</title><link href="https://miguelgg.com/posts/apuntex-released" rel="alternate" type="text/html" title="All my undergraduate class notes are now available!"/><published>2022-07-31T00:00:00+00:00</published><updated>2022-07-31T00:00:00+00:00</updated><id>https://miguelgg.com/posts/apuntex-released</id><content type="html" xml:base="https://miguelgg.com/posts/apuntex-released"><![CDATA[<p>I write this short post just to let you know that all my class notes from the undergraduate lectures I attended during my mathematics bachelors degree, typeset in LaTeX, are now available in my <a href="/projects">projects page</a>. They are written in spanish, but I hope some of you can find some use in them!</p> <p>Escribo este pequeño post para anunciar que he publicado todos mis apuntes del grado en matemáticas, escritos en LaTeX, en mi <a href="/projects">sección de proyectos</a>. Espero que puedan ser de utilidad para alguien!</p> <p><a href="/blog">Volver a la página de posts.</a></p>]]></content><author><name></name></author><summary type="html"><![CDATA[I write this short post just to let you know that all my class notes from the undergraduate lectures I attended during my mathematics bachelors degree, typeset in LaTeX, are now available in my projects page. They are written in spanish, but I hope some of you can find some use in them!]]></summary></entry><entry><title type="html">El matemático y el vendedor ambulante</title><link href="https://miguelgg.com/posts/el-matematico-y-el-vendedor-ambulante" rel="alternate" type="text/html" title="El matemático y el vendedor ambulante"/><published>2021-12-08T00:00:00+00:00</published><updated>2021-12-08T00:00:00+00:00</updated><id>https://miguelgg.com/posts/el-matematico-y-el-vendedor-ambulante</id><content type="html" xml:base="https://miguelgg.com/posts/el-matematico-y-el-vendedor-ambulante"><![CDATA[<link rel="stylesheet" href="/assets/css/mycss.css"/> <script src="/assets/js/jquery-3.6.0.min.js" type="text/javascript"></script> <script src="/assets/js/myjs.js" type="text/javascript"></script> <div class="softbox"> <p>Esta entrada participa en la Edición 12.4: <a href="https://verso.mat.uam.es/~qed/carnamat.html">“Quod Erat Demonstrandum”</a> del Carnaval de Matemáticas, organizado en esta ocasión por la Asociación de Estudiantes <a href="https://verso.mat.uam.es/~qed/">QED</a>.</p> </div> <div class="toc"> <p><strong>Table of contents:</strong></p> <ul> <li><a href="#acto-i-el-problema-del-viajante"><strong>Acto I.</strong> El problema del viajante.</a></li> <li><a href="#acto-ii-el-orden-de-los-factores"><strong>Acto II.</strong> El orden de los factores.</a></li> <li><a href="#acto-iii-la-suma-de-las-partes"><strong>Acto III.</strong> La suma de las partes.</a></li> <li><a href="#acto-iv-satisfaciendo-necesidades"><strong>Acto IV.</strong> Satisfaciendo necesidades.</a></li> <li><a href="#acto-v-epílogo"><strong>Acto V.</strong> Epílogo.</a> <ul> <li><a href="#referencias">Referencias.</a></li> </ul> </li> </ul> </div> <h2 id="acto-i-el-problema-del-viajante"><strong>Acto I.</strong> El problema del viajante.</h2> <blockquote> <p>Vendedor ambulante.- ¡Por fin te encuentro, matemático! ¡Tengo un gran problema!</p> <p>Matemático.- ¿Qué ocurre?</p> <p>Vendedor ambulante.- Me gustaría vender mis hortalizas a lo largo de toda la península, pero pierdo mucho tiempo haciéndolo. Necesito que me encuentres un camino eficiente para poder vender todos mis productos lo más rápido posible. Además, ya sé lo que tardo en moverme de una ciudad a otra, así que lo tienes fácil.</p> <p>Matemático.- ¡¿Toda la península?!</p> <p>(Más tarde)</p> <p>Matemático.- Creo que se me puede ocurrir algo…</p> </blockquote> <p>El matemático necesita encontrar un camino que atraviese todas y cada una de las ciudades que le ha indicado su amigo el vendedor ambulante:</p> <figure> <picture> <source class="responsive-img-srcset" srcset="/assets/img/posts/el-matematico-y-el-vendedor-ambulante/sparse_graph-480.webp 480w,/assets/img/posts/el-matematico-y-el-vendedor-ambulante/sparse_graph-800.webp 800w,/assets/img/posts/el-matematico-y-el-vendedor-ambulante/sparse_graph-1400.webp 1400w," sizes="95vw" type="image/webp"/> <img src="/assets/img/posts/el-matematico-y-el-vendedor-ambulante/sparse_graph.png" class="img-fluid rounded z-depth-1" width="100%" height="auto" data-zoomable="" loading="eager" onerror="this.onerror=null; $('.responsive-img-srcset').remove();"/> </picture> </figure> <p>Por supuesto, el vendedor vive en una de las ciudades, de la que saldrá al iniciar su ruta, y a la que volverá tras acabarla. Lo primero que observó el matemático, es que en la ruta no habrá ciudades repetidas, puesto que si el vendedor ambulante ya ha hecho negocios en una de ellas, difícilmente reunirá más clientes si pasa una segunda vez.</p> <p>El matemático se pone manos a la obra, y decide utilizar un <strong>grafo</strong> para representar el problema. Primero, representa cada ciudad con un círculo que llama <strong>vértice</strong>, y después, conecta cada uno de los pares de ciudades con una línea llamada <strong>arista</strong>. En cada arista, asimismo, el matemático escribe cuánto tarda el vendedor en ir entre las dos ciudades. Este es un ejemplo para un menor número de ciudades:</p> <figure> <picture> <source class="responsive-img-srcset" srcset="/assets/img/posts/el-matematico-y-el-vendedor-ambulante/grafo-480.webp 480w,/assets/img/posts/el-matematico-y-el-vendedor-ambulante/grafo-800.webp 800w,/assets/img/posts/el-matematico-y-el-vendedor-ambulante/grafo-1400.webp 1400w," sizes="95vw" type="image/webp"/> <img src="/assets/img/posts/el-matematico-y-el-vendedor-ambulante/grafo.png" class="img-fluid rounded z-depth-1" width="100%" height="auto" data-zoomable="" loading="eager" onerror="this.onerror=null; $('.responsive-img-srcset').remove();"/> </picture> </figure> <p>Como el matemático ha conectado cada par de ciudades, para poder así tener en cuenta todas las posibilidades de movimientos, el grafo resultante es, según él dice, <strong>“completo”</strong>, es decir, existe una conexión entre cada par de vértices.</p> <p>El objetivo del matemático ahora es encontrar un <strong>ciclo</strong> en el grafo, es decir, una sucesión de vértices a partir de uno dado, que además incluya todos los vértices una única vez y vuelva al punto de partida tras ello. Esto se traducirá en la ruta deseada para el vendedor ambulante. Un ciclo así, dice el matemático, se llama <strong>ciclo “Hamiltoniano”</strong>.</p> <p>Encontrar una ruta con esas características es muy fácil: como cada vértice se conecta con todos los demás, se puede empezar en un vértice y elegir cualquiera de los restantes como siguiente destino, repitiendo hasta quedarse sin ciudades por visitar. Finalmente, se volvería al vértice de origen. Por ejemplo, en el grafo anterior, un posible ciclo sería <em>Euleria - Reino de Möbius - Ciudad Gauss - Numerasia - Euleria</em>. No obstante, si sumamos lo que tarda el vendedor ambulante en recorrerlo, llegamos a \(11+5+7+5 = 28\).</p> <p>El matemático rápidamente se da cuenta de que, visitando Ciudad Gauss y Numerasia antes que el Reino de Möbius, en lugar de después, el vendedor ambulante tardaría \(5+7+1+11 = 24\), es decir, menos. El objetivo está claro. El matemático llama <strong>coste</strong> a la suma de los tiempos de cada arista, y enuncia:</p> <p class="emphasizebox"><strong>Problema del viajante.</strong> Dado un grafo completo, encontrar un ciclo Hamiltoniano de coste mínimo.</p> <p>Quizás en el grafo de ejemplo sea fácil de obtener, pero el matemático ve imposible atacar el problema para todas las ciudades de la península. ¡Hay muchísimas combinaciones! Al matemático, sin embargo, se le ocurre una manera inteligente de encontrar un trayecto bastante bueno.</p> <blockquote> <p>Matemático.- El trayecto debería utilizar las aristas más baratas. No es posible que, si entre dos ciudades se tarda en viajar un minuto, no sean visitadas en sucesión.</p> </blockquote> <p>Para ilustrar el ejemplo, el matemático utiliza este grafo un poco más complicado que el anterior:</p> <figure> <picture> <source class="responsive-img-srcset" srcset="/assets/img/posts/el-matematico-y-el-vendedor-ambulante/grafo5-480.webp 480w,/assets/img/posts/el-matematico-y-el-vendedor-ambulante/grafo5-800.webp 800w,/assets/img/posts/el-matematico-y-el-vendedor-ambulante/grafo5-1400.webp 1400w," sizes="95vw" type="image/webp"/> <img src="/assets/img/posts/el-matematico-y-el-vendedor-ambulante/grafo5.png" class="img-fluid rounded z-depth-1" width="100%" height="auto" data-zoomable="" loading="eager" onerror="this.onerror=null; $('.responsive-img-srcset').remove();"/> </picture> </figure> <p>Ahora, el matemático marca las aristas más baratas, para darles prioridad. Esto lo hace en orden, es decir, primero marca la arista que cuesta \(1\), luego la que cuesta \(2\) y así sucesivamente. Al hacerlo, tiene cuidado de no repetir ciudades: si alguna arista le obligase a visitar ciudades repetidas (es decir, si crea un ciclo que no pasa por todas las ciudades), se la salta. Este es el resultado:</p> <figure> <picture> <source class="responsive-img-srcset" srcset="/assets/img/posts/el-matematico-y-el-vendedor-ambulante/kruskal-480.webp 480w,/assets/img/posts/el-matematico-y-el-vendedor-ambulante/kruskal-800.webp 800w,/assets/img/posts/el-matematico-y-el-vendedor-ambulante/kruskal-1400.webp 1400w," sizes="95vw" type="image/webp"/> <img src="/assets/img/posts/el-matematico-y-el-vendedor-ambulante/kruskal.png" class="img-fluid rounded z-depth-1" width="100%" height="auto" data-zoomable="" loading="eager" onerror="this.onerror=null; $('.responsive-img-srcset').remove();"/> </picture> </figure> <p>Como habíamos anticipado, el matemático se ha tenido que saltar la arista de distancia \(4\) entre Numerasia y Hamiltonia, puesto que habría cerrado el ciclo antes de tiempo. De hecho, ya no puede añadir ninguna arista más sin que eso ocurra.</p> <p class="exercisetoggle">(Clic para saber más)</p> <p class="exercisesolution">El matemático ha ejecutado lo que se conoce como el <a href="https://es.wikipedia.org/wiki/Algoritmo_de_Kruskal">algoritmo de Kruskal</a>, que permite obtener un grafo sin ciclos dentro de otro grafo dado, con suma de distancias mínima. Este nuevo grafo se conoce como <strong>árbol recubridor mínimo</strong>.</p> <p>El matemático está convencido de que estaría bien utilizar esas aristas, aunque sabe que no va a poder usar todas, porque necesita que el camino empiece y termine en el mismo vértice. Una buena manera de hacerlo, se le ocurre, es la siguiente. Partimos de las aristas marcadas:</p> <figure> <picture> <source class="responsive-img-srcset" srcset="/assets/img/posts/el-matematico-y-el-vendedor-ambulante/mst-480.webp 480w,/assets/img/posts/el-matematico-y-el-vendedor-ambulante/mst-800.webp 800w,/assets/img/posts/el-matematico-y-el-vendedor-ambulante/mst-1400.webp 1400w," sizes="95vw" type="image/webp"/> <img src="/assets/img/posts/el-matematico-y-el-vendedor-ambulante/mst.png" class="img-fluid rounded z-depth-1" width="100%" height="auto" data-zoomable="" loading="eager" onerror="this.onerror=null; $('.responsive-img-srcset').remove();"/> </picture> </figure> <p>El matemático no sabe muy bien cómo encontrar un ciclo Hamiltoniano añadiendo pocas aristas, pero recuerda de su época de estudiante un <a href="https://es.wikipedia.org/wiki/Ciclo_euleriano">teorema</a> que le permite encontrar un ciclo en el grafo que pase por todas las <strong>aristas</strong> una única vez (aunque podría pasar varias veces por un vértice). Para ello, necesita que el número de aristas conectadas con cada vértice sea par, así que añade algunas más para que así sea:</p> <figure> <picture> <source class="responsive-img-srcset" srcset="/assets/img/posts/el-matematico-y-el-vendedor-ambulante/matching-480.webp 480w,/assets/img/posts/el-matematico-y-el-vendedor-ambulante/matching-800.webp 800w,/assets/img/posts/el-matematico-y-el-vendedor-ambulante/matching-1400.webp 1400w," sizes="95vw" type="image/webp"/> <img src="/assets/img/posts/el-matematico-y-el-vendedor-ambulante/matching.png" class="img-fluid rounded z-depth-1" width="100%" height="auto" data-zoomable="" loading="eager" onerror="this.onerror=null; $('.responsive-img-srcset').remove();"/> </picture> </figure> <p>Ahora ya puede encontrar un ciclo como el descrito anteriormente, y así lo hace: <em>Euleria - Reino de Möbius - Numerasia - Hamiltonia - Reino de Möbius - Ciudad Gauss - Euleria</em>. Como había anticipado, una de las ciudades se repite, pero simplemente se la salta la segunda vez, para evitarlo. Esto da lugar al siguiente trayecto final:</p> <figure> <picture> <source class="responsive-img-srcset" srcset="/assets/img/posts/el-matematico-y-el-vendedor-ambulante/christofides-480.webp 480w,/assets/img/posts/el-matematico-y-el-vendedor-ambulante/christofides-800.webp 800w,/assets/img/posts/el-matematico-y-el-vendedor-ambulante/christofides-1400.webp 1400w," sizes="95vw" type="image/webp"/> <img src="/assets/img/posts/el-matematico-y-el-vendedor-ambulante/christofides.png" class="img-fluid rounded z-depth-1" width="100%" height="auto" data-zoomable="" loading="eager" onerror="this.onerror=null; $('.responsive-img-srcset').remove();"/> </picture> </figure> <p>El coste es de \(2+1+4+9+5 = 21\). El matemático está bastante contento con este resultado, y se dispone a aplicarlo en el mapa del vendedor ambulante. ¡Qué alivio!</p> <p class="exercisetoggle">(Clic para saber más)</p> <p class="exercisesolution">El matemático ha seguido paso a paso el <a href="https://es.wikipedia.org/wiki/Algoritmo_de_Christofides">algoritmo de Christofides</a> para resolver el problema del viajante. Este algoritmo no garantiza que el resultado sea óptimo, dado que esto es extremadamente difícil en general. Sin embargo, garantiza que el coste final no superará en más de un 50% el coste óptimo.</p> <h2 id="acto-ii-el-orden-de-los-factores"><strong>Acto II.</strong> El orden de los factores.</h2> <blockquote> <p>Matemático.- ¡Cuánto tiempo, vendedor! ¿Qué tal va la ruta que calculé para ti? ¿Está siendo beneficiosa?</p> <p>Vendedor ambulante.- Verás…</p> <p>Matemático.- (Espero que no sea otro encargo imposible)</p> <p>Vendedor ambulante.- Ha ocurrido un imprevisto. Cuando yo calculé el tiempo que me costaba ir entre Madrid y Segovia, puse el cronómetro en Madrid y lo paré en Segovia.</p> <p>Matemático.- Es razonable.</p> <p>Vendedor ambulante.- Sin embargo, en tu ruta no voy de Madrid a Segovia, sino de Segovia a Madrid. Por algún motivo que no entiendo, ¡tardo más si voy al revés!</p> <p>Matemático.- ¿Será por el desnivel? ¿O quizás el tráfico? ¿Tienes que pasar peajes solo en una de las direcciones?</p> <p>Vendedor ambulante.- No tengo ni idea, pero estás de enhorabuena. He calculado los tiempos en ambos sentidos para todas las ciudades. Ahora, es tu momento de encontrarme otra ruta mejor.</p> <p>Matemático.- (Creo que esto es lo contrario de estar de enhorabuena…)</p> </blockquote> <p>El matemático se ha encontrado con un nuevo problema, aún más difícil si cabe. Ahora, el coste entre vértices depende del sentido de recorrido. Por tanto, ya no podrá usar su técnica de utilizar un grafo, al menos no como el que usaba antes. Por fortuna, al matemático se le ha ocurrido una posible idea.</p> <p>Primero, va a poner dos aristas entre cada par de vértices, una en cada sentido. Para representar esto, utiliza flechas en vez de líneas. Esto le permite registrar los nuevos costes, en un grafo que él llama <strong>“dirigido”</strong>:</p> <figure> <picture> <source class="responsive-img-srcset" srcset="/assets/img/posts/el-matematico-y-el-vendedor-ambulante/undirected-480.webp 480w,/assets/img/posts/el-matematico-y-el-vendedor-ambulante/undirected-800.webp 800w,/assets/img/posts/el-matematico-y-el-vendedor-ambulante/undirected-1400.webp 1400w," sizes="95vw" type="image/webp"/> <img src="/assets/img/posts/el-matematico-y-el-vendedor-ambulante/undirected.png" class="img-fluid rounded z-depth-1" width="100%" height="auto" data-zoomable="" loading="eager" onerror="this.onerror=null; $('.responsive-img-srcset').remove();"/> </picture> </figure> <p>¡Qué complicado! Ahora tiene muchas más aristas con las que trabajar, no sabe si el procedimiento que siguió antes va a funcionar y cada arista solo puede recorrerse en el sentido de la flecha, y no al revés.</p> <p class="emphasizebox"><strong>Problema del viajante asimétrico.</strong> Dado un grafo completo dirigido, encontrar un ciclo Hamiltoniano de coste mínimo.</p> <blockquote> <p>Matemático.- No tiene ningún sentido que vuelva a partir de cero. Ya he resuelto un problema parecido en el pasado, cuando el grafo no era dirigido. Si consigo convertir este grafo en uno que no sea dirigido, pero que represente el mismo problema, habré terminado. Pero, ¿cómo?</p> </blockquote> <p>De repente, el matemático tiene una idea brillante. Va a ver el problema desde otra perspectiva. Desde una perspectiva en la que se obtiene un grafo no dirigido.</p> <blockquote> <p>Matemático.- Ya lo tengo. Voy a hacer que cada vértice no represente una ciudad, sino <strong>el hecho de entrar en una ciudad</strong>. También voy a añadir otro vértice que represente <strong>el hecho de salir de una ciudad</strong>.</p> </blockquote> <p>Lo que quiere decir el matemático, es que va a convertir la ciudad de <em>Euleria</em> en dos vértices: <em>EntrarEuleria</em> y <em>SalirEuleria</em>. Aunque esto pueda parecer que no tiene sentido, la idea está clara con un ejemplo. Supongamos que tenemos este grafo tan sencillo:</p> <figure> <picture> <source class="responsive-img-srcset" srcset="/assets/img/posts/el-matematico-y-el-vendedor-ambulante/asym2-480.webp 480w,/assets/img/posts/el-matematico-y-el-vendedor-ambulante/asym2-800.webp 800w,/assets/img/posts/el-matematico-y-el-vendedor-ambulante/asym2-1400.webp 1400w," sizes="95vw" type="image/webp"/> <img src="/assets/img/posts/el-matematico-y-el-vendedor-ambulante/asym2.png" class="img-fluid rounded z-depth-1" width="100%" height="auto" data-zoomable="" loading="eager" onerror="this.onerror=null; $('.responsive-img-srcset').remove();"/> </picture> </figure> <p>El ciclo óptimo es, evidentemente, <em>Euleria - Numerasia - Euleria</em>. Si ponemos en práctica la idea del matemático, podemos convertirlo en este grafo que representa el mismo problema, pero ahora no es dirigido:</p> <figure> <picture> <source class="responsive-img-srcset" srcset="/assets/img/posts/el-matematico-y-el-vendedor-ambulante/sym-480.webp 480w,/assets/img/posts/el-matematico-y-el-vendedor-ambulante/sym-800.webp 800w,/assets/img/posts/el-matematico-y-el-vendedor-ambulante/sym-1400.webp 1400w," sizes="95vw" type="image/webp"/> <img src="/assets/img/posts/el-matematico-y-el-vendedor-ambulante/sym.png" class="img-fluid rounded z-depth-1" width="100%" height="auto" data-zoomable="" loading="eager" onerror="this.onerror=null; $('.responsive-img-srcset').remove();"/> </picture> </figure> <p>Por supuesto, si salimos de <em>Euleria</em> para entrar a <em>Numerasia</em>, el coste es \(2\), y si salimos de <em>Numerasia</em> para entrar en <em>Euleria</em>, el coste es \(5\). El coste entre entrar y salir de una misma ciudad es \(0\), porque no estamos recorriendo camino en el proceso. Por otro lado, el coste de conexiones imposibles, como salir de <em>Euleria</em> y después salir de <em>Numerasia</em> (sin haber entrado), será de infinito, y así no aparecerá en la solución mínima.</p> <p>Vemos también que el ciclo Hamiltoniano óptimo es ahora <em>EntrarEuleria - SalirEuleria - EntrarNumerasia - SalirNumerasia</em>. Esto se traduce fácilmente a <em>Euleria - Numerasia</em>, en cuanto al orden de ciudades se refiere. El coste sigue siendo \(5+0+2+0 = 7\).</p> <p>Este procedimiento aplicado a cada par de nodos permite transformar el problema del viajante asimétrico en el problema del Acto I.</p> <blockquote> <p>Matemático.- Ahora ya puedo aplicar lo que hice el otro día, cuando el grafo no era dirigido, y darle al vendedor la ruta que necesita. No hay problema que un matemático no pueda resolver…</p> </blockquote> <h2 id="acto-iii-la-suma-de-las-partes"><strong>Acto III.</strong> La suma de las partes.</h2> <blockquote> <p>Vendedor ambulante.- Ese es… ¡Sí! ¡Oye, matemático! ¡Soy yo!</p> <p>Matemático.- No es posible, me ha visto…</p> <p>Vendedor ambulante.- Quería darte las gracias por la ruta que calculaste. ¡Estoy ganando dinero de manera desorbitada!</p> <p>Matemático.- ¡Me alegro! ¿Cuánto me toca?</p> <p>Vendedor ambulante.- No venía a verte por eso. Quería decirte que he contratado a dos empleados más. ¡Así puedo vender la mercancía mucho más rápido!</p> <p>Matemático.- Oh, no…</p> <p>Vendedor ambulante.- ¿Qué te parece si me encuentras tres rutas, una para cada uno de nosotros, que nos permitan visitar entre los tres todas las ciudades de manera eficiente?</p> <p>Matemático.- Veré lo que puedo hacer.</p> </blockquote> <p>Una vez más, es hora de codificar este problema mediante un grafo. Ahora que hay tres empleados, una solución ingenua sería coger el trayecto que ya conocíamos, para una persona, y dividirlo entre tres. Pero esto no es posible: los empleados del vendedor ambulante viven en la misma ciudad que él. Es decir, los tres deben comenzar y acabar en la misma ciudad. Por supuesto, tampoco tiene sentido que dos empleados pasen por la misma ciudad. Como ya sabemos del Acto II, podemos resolver el problema en un grafo no dirigido, sin preocuparnos por los distintos sentidos.</p> <p class="emphasizebox"><strong>Problema del viajante múltiple.</strong> Dado un grafo completo, encontrar \(N\) (en nuestro caso, \(3\)) ciclos, que comiencen en el mismo vértice de origen, y visiten todas las demás ciudades una única vez entre todos. La suma de los costes de los tres ciclos debe ser mínima.</p> <p>El matemático ya se está quedando sin ideas.</p> <blockquote> <p>Matemático.- El problema ya era complicadísimo con un viajante, y ahora resulta que tengo que poner más. Esto tiene que ser imposible, a no ser…</p> </blockquote> <p>Al matemático se le ha ocurrido una sencilla idea para convertir el problema en el tradicional que vimos en el Acto I. Supongamos que comenzamos, por ejemplo, en este grafo:</p> <figure> <picture> <source class="responsive-img-srcset" srcset="/assets/img/posts/el-matematico-y-el-vendedor-ambulante/mtsp-480.webp 480w,/assets/img/posts/el-matematico-y-el-vendedor-ambulante/mtsp-800.webp 800w,/assets/img/posts/el-matematico-y-el-vendedor-ambulante/mtsp-1400.webp 1400w," sizes="95vw" type="image/webp"/> <img src="/assets/img/posts/el-matematico-y-el-vendedor-ambulante/mtsp.png" class="img-fluid rounded z-depth-1" width="100%" height="auto" data-zoomable="" loading="eager" onerror="this.onerror=null; $('.responsive-img-srcset').remove();"/> </picture> </figure> <p>También supondremos que la ciudad donde habitan los tres viajantes es <em>Euleria</em>. Hemos dicho anteriormente que no podemos trocear un trayecto óptimo en tres, porque todos ellos deberían empezar y acabar en <em>Euleria</em>, y esta ciudad solo aparece una vez en cualquier solución. La idea del matemático es sencilla: habrá tres <em>“copias”</em> de <em>Euleria</em>:</p> <figure> <picture> <source class="responsive-img-srcset" srcset="/assets/img/posts/el-matematico-y-el-vendedor-ambulante/triple-480.webp 480w,/assets/img/posts/el-matematico-y-el-vendedor-ambulante/triple-800.webp 800w,/assets/img/posts/el-matematico-y-el-vendedor-ambulante/triple-1400.webp 1400w," sizes="95vw" type="image/webp"/> <img src="/assets/img/posts/el-matematico-y-el-vendedor-ambulante/triple.png" class="img-fluid rounded z-depth-1" width="100%" height="auto" data-zoomable="" loading="eager" onerror="this.onerror=null; $('.responsive-img-srcset').remove();"/> </picture> </figure> <p>¡Qué bonito! Fijémonos además que la distancia entre las copias es infinita: así, no podrá haber dos seguidas en un camino óptimo. Ahora, resolvemos el ciclo hamiltoniano óptimo para todo el grafo:</p> <figure> <picture> <source class="responsive-img-srcset" srcset="/assets/img/posts/el-matematico-y-el-vendedor-ambulante/mtsp_sol-480.webp 480w,/assets/img/posts/el-matematico-y-el-vendedor-ambulante/mtsp_sol-800.webp 800w,/assets/img/posts/el-matematico-y-el-vendedor-ambulante/mtsp_sol-1400.webp 1400w," sizes="95vw" type="image/webp"/> <img src="/assets/img/posts/el-matematico-y-el-vendedor-ambulante/mtsp_sol.png" class="img-fluid rounded z-depth-1" width="100%" height="auto" data-zoomable="" loading="eager" onerror="this.onerror=null; $('.responsive-img-srcset').remove();"/> </picture> </figure> <p>Ha salido <em>Euleria - Numerasia - Euleria2 - Ciudad Gauss - Euleria3 - Hamiltonia</em>, con coste total \(5+5+5+5+8+8 = 36\). Ahora, lo único que hay que hacer es que cada viajante recorra uno de los tramos que quedan separados por las distintas copias. Es decir, ¡ahora sí podemos dividir en tres el camino!. Uno de los viajantes hará <em>Euleria - Numerasia - Euleria</em>, el otro <em>Euleria - Ciudad Gauss - Euleria</em>, y el último <em>Euleria - Hamiltonia - Euleria</em>. La suma de los costes es la que habíamos obtenido, \(36\).</p> <blockquote> <p>Matemático.- Creo que con este mecanismo lo he conseguido. Ya tengo la solución para el vendedor, y lo bueno es que solo he tenido que reducirlo al problema original, de nuevo. Es imposible que este problema pueda complicarse aún más. Bueno, podría buscar que la ruta más larga de las tres fuese de distancia mínima, y no la suma de todas ellas, pero creo que por ahora voy a pasar del tema.</p> </blockquote> <h2 id="acto-iv-satisfaciendo-necesidades"><strong>Acto IV.</strong> Satisfaciendo necesidades.</h2> <blockquote> <p>(De noche. Llaman a la puerta.)</p> <p>Matemático.- Zzz…</p> <p>Vendedor ambulante.- ¡Matemático! ¡Oye! ¿Estás en casa?</p> <p>Matemático.- Ya voy.</p> <p>(Abre la puerta)</p> <p>Matemático.- ¿Tú otra vez? ¿Qué le pasa ahora a la ruta? ¿Quieres que vaya solo entre ciudades que empiecen y acaben por la misma letra? ¿Que haya una estación de tu gasolinera favorita cada exactamente cinco ciudades? ¿O acaso minimizar el coste de los peajes?</p> <p>Vendedor ambulante.- Lo último no me importaría, pero no es eso. Verás, a uno de mis empleados le encanta esta ciudad…</p> <p>(Señala una ciudad en el mapa. Solo la ve el matemático, para evitar controversias).</p> <p>Matemático.- Bueno, pues dale a él la ruta que pasa por esa ciudad, ¿no crees?</p> <p>Vendedor ambulante.- Es que, verás… A mí también me gustaría pasar por esta otra ciudad…</p> <p>(Señala otra ciudad)</p> <p>Vendedor ambulante.- De hecho, no es solo eso, sino que ahí necesitan las hortalizas más caras, que son las que llevo yo.</p> <p>Matemático.- Pues elige tú la ruta que pasa por esa ciudad.</p> <p>Vendedor ambulante.- Es la misma que la que atraviesa la ciudad favorita de mi empleado.</p> <p>Matemático.- Ya es mala suerte.</p> <p>Vendedor ambulante.- No te preocupes. Al lado de cada ciudad he puesto el nombre del empleado que prefiere pasar por ella, si se da el caso. No son muchas, pero…</p> <p>Matemático.- Me vuelvo a la cama.</p> <p>Vendedor ambulante.- ¡Espera! Por favor, encuéntrame rutas optimizadas que resuelvan nuestras preferencias. Te pagaré bien.</p> </blockquote> <p>Como es habitual, el matemático tiene que modificar el problema para que se ajuste a las necesidades del vendedor. Es fácil hacerlo mediante colores. El matemático asigna a cada empleado un color. Después, cada vértice es coloreado con el color del empleado que lo prefiere, si es que hay alguno. Por los vértices coloreados deberá pasar el empleado correspondiente. El problema se convierte en:</p> <p class="emphasizebox"><strong>Problema del viajante coloreado.</strong> Dado un grafo completo, donde cada vértice puede (o no) estar coloreado con uno de \(N\) colores distintos (en nuestro caso, \(3\)), encontrar \(N\) ciclos (en nuestro caso, \(3\)), que comiencen en el mismo vértice de origen, no coloreado, y visiten todas las demás ciudades una única vez entre todos. La suma de los costes de los tres ciclos debe ser mínima. Cada ciclo tendrá asociado uno de los \(N\) colores. Por los vértices coloreados solo podrá pasar el ciclo del mismo color. Por los vértices sin colorear, podrá pasar cualquier ciclo.</p> <blockquote> <p>Matemático.- Es muy difícil resolver este problema. Se me ocurre una manera de hacerlo cuando todos los vértices están coloreados con alguno de los colores. Os la contaré a continuación.</p> </blockquote> <p>Para explicarlo, el matemático parte del siguiente grafo de ejemplo:</p> <figure> <picture> <source class="responsive-img-srcset" srcset="/assets/img/posts/el-matematico-y-el-vendedor-ambulante/ctsp-480.webp 480w,/assets/img/posts/el-matematico-y-el-vendedor-ambulante/ctsp-800.webp 800w,/assets/img/posts/el-matematico-y-el-vendedor-ambulante/ctsp-1400.webp 1400w," sizes="95vw" type="image/webp"/> <img src="/assets/img/posts/el-matematico-y-el-vendedor-ambulante/ctsp.png" class="img-fluid rounded z-depth-1" width="100%" height="auto" data-zoomable="" loading="eager" onerror="this.onerror=null; $('.responsive-img-srcset').remove();"/> </picture> </figure> <p>Como ha mencionado, todos los vértices están coloreados de alguno de los tres colores, a excepción del punto de partida, <em>Euleria</em>, que no puede estar coloreado porque todos deben empezar allí. Ahora, hace el truco habitual de triplicar el punto de partida, y como cada una de las copias representa un empleado, las colorea cada una con un color (el correspondiente al empleado):</p> <figure> <picture> <source class="responsive-img-srcset" srcset="/assets/img/posts/el-matematico-y-el-vendedor-ambulante/ctsp2-480.webp 480w,/assets/img/posts/el-matematico-y-el-vendedor-ambulante/ctsp2-800.webp 800w,/assets/img/posts/el-matematico-y-el-vendedor-ambulante/ctsp2-1400.webp 1400w," sizes="95vw" type="image/webp"/> <img src="/assets/img/posts/el-matematico-y-el-vendedor-ambulante/ctsp2.png" class="img-fluid rounded z-depth-1" width="100%" height="auto" data-zoomable="" loading="eager" onerror="this.onerror=null; $('.responsive-img-srcset').remove();"/> </picture> </figure> <p>Así, el empleado que empieza desde <em>Euleria</em> es el rojo, el de <em>Euleria2</em> es el azul y el de <em>Euleria3</em> es el amarillo.</p> <blockquote> <p>Matemático.- El truco es el siguiente. Voy a eliminar todas las aristas que conectan nodos de distinto color. Así, cada empleado solo podrá quedarse en su color, evitando que cambie al color equivocado.</p> </blockquote> <p>Como ha explicado el matemático:</p> <figure> <picture> <source class="responsive-img-srcset" srcset="/assets/img/posts/el-matematico-y-el-vendedor-ambulante/ctsp3-480.webp 480w,/assets/img/posts/el-matematico-y-el-vendedor-ambulante/ctsp3-800.webp 800w,/assets/img/posts/el-matematico-y-el-vendedor-ambulante/ctsp3-1400.webp 1400w," sizes="95vw" type="image/webp"/> <img src="/assets/img/posts/el-matematico-y-el-vendedor-ambulante/ctsp3.png" class="img-fluid rounded z-depth-1" width="100%" height="auto" data-zoomable="" loading="eager" onerror="this.onerror=null; $('.responsive-img-srcset').remove();"/> </picture> </figure> <p>Ahora, el problema es fácil, puesto que se obtienen tres grafos distintos, y se puede resolver el problema original del Acto I en cada uno de ellos. En estos grafos concretos es muy fácil, al solo haber dos vértices en cada uno. Se obtienen así las tres rutas deseadas <em>Euleria - Hamiltonia - Euleria</em>, <em>Euleria - Ciudad Gauss - Euleria</em> y <em>Euleria - Numerasia - Euleria</em>. El coste es, si tenemos en cuenta volver a <em>Euleria</em>, \(5+5+5+5+8+8 = 36\).</p> <h2 id="acto-v-epílogo"><strong>Acto V.</strong> Epílogo.</h2> <blockquote> <p>Matemático.- Gracias por pagarme por mis esfuerzos. Creía que no tendrías tiempo, con todo lo que viajas.</p> <p>Vendedor ambulante.- Es lo menos que puedo hacer. Aunque, tengo una última pregunta…</p> <p>Matemático.- (Palidece).</p> <p>Vendedor ambulante.- ¿Cómo haces para resolver todas las locuras que se me ocurren?</p> <p>FIN.</p> </blockquote> <p><a name="acto-6"></a></p> <h3 id="referencias">Referencias.</h3> <ol> <li><a href="https://es.wikipedia.org/wiki/Algoritmo_de_Christofides">Algoritmo de Christofides</a></li> <li><a href="http://home.eng.iastate.edu/~rkumar/PUBS/atsp.pdf">R. Kumar, H. Li. Transformation to Symmetric TSP and Performance Bound</a></li> <li><a href="http://pdf.xuebalib.com:1262/xuebalib.com.13149.pdf">T. Bektas. The multiple travelling salesman problem: an overview of formulations and solution procedures.</a></li> <li><a href="https://arxiv.org/pdf/2007.05254.pdf">Y. Lu, J. Hao, Q. Wu. Solving the Clustered Travelling Salesman Problem via TSP methods.</a></li> <li><a href="https://fylux.github.io/2017/07/05/Sparse_TSP/">Grafo inicial de la Península Ibérica.</a></li> <li><a href="https://graphonline.ru/en/#">Editor interactivo de grafos</a></li> </ol> <p><a href="/blog">Volver a la página de posts.</a></p>]]></content><author><name></name></author></entry><entry><title type="html">Squaring the circle</title><link href="https://miguelgg.com/posts/squaring-the-circle" rel="alternate" type="text/html" title="Squaring the circle"/><published>2021-09-24T00:00:00+00:00</published><updated>2021-09-24T00:00:00+00:00</updated><id>https://miguelgg.com/posts/squaring-the-circle</id><content type="html" xml:base="https://miguelgg.com/posts/squaring-the-circle"><![CDATA[<link rel="stylesheet" href="/assets/css/mycss.css"/> <script src="/assets/js/jquery-3.6.0.min.js" type="text/javascript"></script> <script src="/assets/js/myjs.js" type="text/javascript"></script> <div class="softbox"> <p>This post is based on an undergraduate project which was done together with my colleagues:</p> <ul> <li>Guillermo García (<a href="https://www.linkedin.com/in/guillermogarciacobo/">Linkedin</a>)</li> <li>Antonio García (<a href="https://www.linkedin.com/in/antonio-garcia-naranjo-46bb70202/">Linkedin</a>)</li> <li>Álvaro Zaera (<a href="https://www.linkedin.com/in/%C3%A1lvaro-zaera-de-la-fuente-3ba121208/">Linkedin</a>)</li> </ul> </div> <div class="toc"> <p><strong>Table of contents:</strong></p> <ul> <li><a href="#the-problem">The problem</a></li> <li><a href="#the-rules">The rules</a></li> <li><a href="#building-constructible">Building the constructible points</a></li> <li><a href="#parallelizing">“Parallelizing”</a></li> <li><a href="#field-constructible">The field of constructible numbers</a></li> <li><a href="#algebraic-extensions">Algebraic field extensions</a></li> <li><a href="#towering-extensions">Towering extensions</a></li> <li><a href="#final-proof">The final proof</a></li> <li><a href="#parting-words">Parting words</a></li> </ul> </div> <p class="exercisetoggledummy" style="margin-bottom:30px;">Mathematics is an active discipline! Whenever you see a question written in this style, I encourage that you attempt to solve it! Clicking the question will reveal the answer.</p> <p>When someone tries to <em>square the circle</em>, it means that they are trying to accomplish a seemingly impossible feat. But what is this circle squaring all about, and is it really that difficult? In this blog post we’re going to explore this beautiful math problem that stumbled the ancient greeks, and we will show how the concept of <em>field extensions</em> provides a beautiful answer.</p> <p><a name="the-problem"></a></p> <h3 id="the-problem">The problem</h3> <p>We start with a given circle of area \(A\), and the goal is to obtain a square with the same area \(A\).</p> <figure> <picture> <source class="responsive-img-srcset" srcset="/assets/img/posts/squaring-the-circle/problem-480.webp 480w,/assets/img/posts/squaring-the-circle/problem-800.webp 800w,/assets/img/posts/squaring-the-circle/problem-1400.webp 1400w," sizes="95vw" type="image/webp"/> <img src="/assets/img/posts/squaring-the-circle/problem.png" class="img-fluid rounded z-depth-1" width="100%" height="auto" data-zoomable="" loading="eager" onerror="this.onerror=null; $('.responsive-img-srcset').remove();"/> </picture> </figure> <p>But this should be easy! If the first circle has radius \(r\), then the area is \(A = \pi r^2\), and so we just need a square with side length \(l = \sqrt{\pi}r\), so that \(l^2 = A\), right? It turns out the problem is not so simple, as there are some rules on what lengths are we allowed to construct.</p> <p><a name="the-rules"></a></p> <h3 id="the-rules">The rules</h3> <p>Ancient greeks wondered if one could obtain the desired square by <em>only using ruler and compass</em>. This means that, from a given set of points (in this case, the center of the circle and a point on the circle itself, so that their distance is the radius), we can only construct some of the remaining points in the plane (hopefully, the desired square vertices). So, what exactly are we allowed to do? Let’s suppose we start with just these two points in the plane:</p> <figure> <picture> <source class="responsive-img-srcset" srcset="/assets/img/posts/squaring-the-circle/starting_points-480.webp 480w,/assets/img/posts/squaring-the-circle/starting_points-800.webp 800w,/assets/img/posts/squaring-the-circle/starting_points-1400.webp 1400w," sizes="95vw" type="image/webp"/> <img src="/assets/img/posts/squaring-the-circle/starting_points.png" class="img-fluid rounded z-depth-1" width="100%" height="auto" data-zoomable="" loading="eager" onerror="this.onerror=null; $('.responsive-img-srcset').remove();"/> </picture> </figure> <p>One of the two points has been assigned the role of the <em>origin point</em>, and identified with \((0,0)\), and the other one serves as a way of defining a <em>unit length</em>, which is the distance between the two points. We then are allowed to perform the following operations:</p> <ul> <li><strong>Ruler operation</strong>: Given two points, trace the straight line that passes through them.</li> <li><strong>Compass operation</strong>: Given three points, \(P\), \(Q\) and \(R\), trace the circumference centered at \(P\) with radius the distance between \(Q\) and \(R\).</li> </ul> <p>With these two operations, <strong>any intersection point of straight lines and/or circumferences we can trace becomes part of our working point collection.</strong> If we start with the two aforementioned points, what other points can we reach? Can we get the vertices of the desired square? We’ll dive into the answer step by step.</p> <p><a name="building-constructible"></a></p> <h3 id="building-the-constructible-points">Building the constructible points</h3> <p>The first points that we can secure are those on the \(X\) axis that have an integer coordinate. That is, points of the form \((n,0)\) where \(n \in \mathbb{Z}\). All we need to do is trace the \(X\) axis by using our ruler with the starting points, and then, construct a circumference of unit radius centered at \((1,0)\). This circumference will produce \((2,0)\), and we can keep iterating this process to get every point:</p> <figure> <picture> <source class="responsive-img-srcset" srcset="/assets/img/posts/squaring-the-circle/buildingz-480.webp 480w,/assets/img/posts/squaring-the-circle/buildingz-800.webp 800w,/assets/img/posts/squaring-the-circle/buildingz-1400.webp 1400w," sizes="95vw" type="image/webp"/> <img src="/assets/img/posts/squaring-the-circle/buildingz.png" class="img-fluid rounded z-depth-1" width="100%" height="auto" data-zoomable="" loading="eager" onerror="this.onerror=null; $('.responsive-img-srcset').remove();"/> </picture> </figure> <p>As such, we obtain any integer distance \(z \in \mathbb{Z}\), between points \((0,0)\) and \((z,0)\). However, we still face two major problems: for the desired square, we’d want a non-integer distance to appear (remember, the side length needs to be \(l = \sqrt{\pi}r\)), and we’ve yet to obtain a point that’s not snapped to the X-axis. This second problem is actually easy to solve:</p> <figure> <picture> <source class="responsive-img-srcset" srcset="/assets/img/posts/squaring-the-circle/first2dpoint-480.webp 480w,/assets/img/posts/squaring-the-circle/first2dpoint-800.webp 800w,/assets/img/posts/squaring-the-circle/first2dpoint-1400.webp 1400w," sizes="95vw" type="image/webp"/> <img src="/assets/img/posts/squaring-the-circle/first2dpoint.png" class="img-fluid rounded z-depth-1" width="100%" height="auto" data-zoomable="" loading="eager" onerror="this.onerror=null; $('.responsive-img-srcset').remove();"/> </picture> </figure> <p>As you can see, by tracing a unit circle centered at \((0,0)\), and another at \((1,0)\), they intersect at two new points which don’t lie on the \(X\)-axis.</p> <p class="exercisetoggle">Notice that the three marked points in the previous figure form an equilateral triangle. Can you figure out the coordinates of our new point? What is its distance to the origin?</p> <p class="exercisesolution">The points form a unit-sided equilateral triangle. Hence, the coordinates for the new point need to be \((\cos \frac{\pi}{3}, \sin \frac{\pi}{3}) = (\frac{1}{2}, \frac{\sqrt 3}{2})\). Another way of solving this is to realize that the point will have the form \((\frac{1}{2},y)\), since it lies in the perpendicular bisector of the segment formed by the other two, and then forcing the distance from this point to the origin to be \(1\). Obviously, this new point is at distance \(1\) from the origin, since it lies on the unit circumference centered at \((0,0)\).</p> <p><a name="parallelizing"></a></p> <h3 id="parallelizing">“Parallelizing”</h3> <p>Our quest to reach the largest possible amount of points has to take a quick detour to gather the necessary tools that will allow the search to continue. We’re going to see how to obtain parallel and perpendicular lines. Firstly, given two points \(Q_1\) and \(Q_2\) that form a line \(l\), and a third point \(P\), we want the parallel to \(l\) through \(P\), that is, a second point \(P'\) such that the line connecting \(P\) and \(P'\) is parallel to \(l\). We start by tracing a circumference of radius \(\overline{Q_1Q_2}\) centered at \(P\):</p> <figure> <picture> <source class="responsive-img-srcset" srcset="/assets/img/posts/squaring-the-circle/parallelstep1-480.webp 480w,/assets/img/posts/squaring-the-circle/parallelstep1-800.webp 800w,/assets/img/posts/squaring-the-circle/parallelstep1-1400.webp 1400w," sizes="95vw" type="image/webp"/> <img src="/assets/img/posts/squaring-the-circle/parallelstep1.png" class="img-fluid rounded z-depth-1" width="100%" height="auto" data-zoomable="" loading="eager" onerror="this.onerror=null; $('.responsive-img-srcset').remove();"/> </picture> </figure> <p>Now, we trace a circumference of radius \(\overline{PQ_1}\) centered at \(Q_2\):</p> <figure> <picture> <source class="responsive-img-srcset" srcset="/assets/img/posts/squaring-the-circle/parallelstep2-480.webp 480w,/assets/img/posts/squaring-the-circle/parallelstep2-800.webp 800w,/assets/img/posts/squaring-the-circle/parallelstep2-1400.webp 1400w," sizes="95vw" type="image/webp"/> <img src="/assets/img/posts/squaring-the-circle/parallelstep2.png" class="img-fluid rounded z-depth-1" width="100%" height="auto" data-zoomable="" loading="eager" onerror="this.onerror=null; $('.responsive-img-srcset').remove();"/> </picture> </figure> <p>They intersect at \(P'\) with the desired properties!</p> <figure> <picture> <source class="responsive-img-srcset" srcset="/assets/img/posts/squaring-the-circle/parallelstep3-480.webp 480w,/assets/img/posts/squaring-the-circle/parallelstep3-800.webp 800w,/assets/img/posts/squaring-the-circle/parallelstep3-1400.webp 1400w," sizes="95vw" type="image/webp"/> <img src="/assets/img/posts/squaring-the-circle/parallelstep3.png" class="img-fluid rounded z-depth-1" width="100%" height="auto" data-zoomable="" loading="eager" onerror="this.onerror=null; $('.responsive-img-srcset').remove();"/> </picture> </figure> <p class="exercisetoggle">Visually, it is clear that the new line is parallel to the previous one. Will this always be true?</p> <p class="exercisesolution">Yes! Notice that, since \(P'\) lies on the circumference centered at \(P\) and with radius \(\overline{Q_1Q_2}\), then \(\overline{PP'} = \overline{Q_1Q_2}\). But also, since it lies on the circumference centered at \(Q_2\) with radius \(\overline{PQ_1}\), then \(\overline{PQ_1}\) = \(\overline{P'Q_2}\), so opposite side lenghts are equal and then \(P, P', Q_1, Q_2\) form a parallelogram, whose sides are parallel.</p> <p>The perpendicular to \(l\) through \(P\) is actually very easy. We just need the typical construction of the perpendicular bisector:</p> <figure> <picture> <source class="responsive-img-srcset" srcset="/assets/img/posts/squaring-the-circle/perpendicular-480.webp 480w,/assets/img/posts/squaring-the-circle/perpendicular-800.webp 800w,/assets/img/posts/squaring-the-circle/perpendicular-1400.webp 1400w," sizes="95vw" type="image/webp"/> <img src="/assets/img/posts/squaring-the-circle/perpendicular.png" class="img-fluid rounded z-depth-1" width="100%" height="auto" data-zoomable="" loading="eager" onerror="this.onerror=null; $('.responsive-img-srcset').remove();"/> </picture> </figure> <p>If \(P\) doesn’t lie on the perpendicular bisector, then just use the previously explained parallel procedure to shift it!</p> <p><a name="field-constructible"></a></p> <h3 id="the-field-of-constructible-numbers">The field of constructible numbers</h3> <p>So far, we’ve been talking about constructible <em>points</em>, which were those that could be obtained from the origin and the unit point. However, thanks to the results derived in the previous section, it doesn’t really matter if we consider <em>points</em> or <em>numbers</em>. For example if you can reach point \(P = (x,y)\), then you can obtain \(x\) itself (that is, the point \((x,0)\)) by tracing a parallel to the \(Y\) axis through \(P\) and letting it intersect the \(X\) axis.</p> <p>Similarly, given points \(x\) and \(y\) which are constructible (again, this means one can obtain the points \((x,0)\) and \((y,0)\)), you can trace a circumference with radius \(y\) centered at the origin and let it intersect the \(Y\) axis to get \((0,y)\). With the appropriate usage of parallel lines, the point \((x,y)\) is then retrieved:</p> <figure> <picture> <source class="responsive-img-srcset" srcset="/assets/img/posts/squaring-the-circle/lifting-480.webp 480w,/assets/img/posts/squaring-the-circle/lifting-800.webp 800w,/assets/img/posts/squaring-the-circle/lifting-1400.webp 1400w," sizes="95vw" type="image/webp"/> <img src="/assets/img/posts/squaring-the-circle/lifting.png" class="img-fluid rounded z-depth-1" width="100%" height="auto" data-zoomable="" loading="eager" onerror="this.onerror=null; $('.responsive-img-srcset').remove();"/> </picture> </figure> <p class="exercisetoggle">But wait! So far we had just constructed points in the \(X\) axis. It would be illegal to use the \(Y\) axis like we just did, since we didn’t get any point from said axis in the first place. Can you explain a way of constructing such a point, so that we can use it?</p> <p class="exercisesolution">Since we already have the horizontal axis, and we know taking perpendiculars can be done, simply trace a perpendicular to the \(X\) axis through the origin. There are, of course, many other valid explanations.</p> <p>This means that we can make our life easier by establishing the following definition: a number is <strong>constructible</strong> if and only if it’s any component of a constructible point (starting from \((0,0)\) and \((1,0)\)). We’ll denote this set of numbers as \(\mathcal C\). Constructible numbers and points are essentially the same, but it will be easier to work in one dimension. Note that \(\mathcal C \subset \mathbb R\), although we don’t know yet whether they are the same.</p> <p>In order to use the powerful tools of algebra with our problem, we’re going to show some key properties of \(\mathcal C\). This set, along with the usual sum (\(+\)) and product (\(\cdot\)) operations, has a <strong>field</strong> structure. This means that certain operations are preserved. Let’s take a look at them with visual proofs.</p> <p>Firstly, there are neutral elements for both operations, that is, elements such that, when summed or multiplied with another number, leave said number unmodified. They are, of course \(0\) (for the sum) and \(1\) (for the product), and them being constructible is the very first thing we established.</p> <p>Secondly, the sum of constructible numbers is again constructible, and the same goes for the difference:</p> <figure> <picture> <source class="responsive-img-srcset" srcset="/assets/img/posts/squaring-the-circle/sumdiff-480.webp 480w,/assets/img/posts/squaring-the-circle/sumdiff-800.webp 800w,/assets/img/posts/squaring-the-circle/sumdiff-1400.webp 1400w," sizes="95vw" type="image/webp"/> <img src="/assets/img/posts/squaring-the-circle/sumdiff.png" class="img-fluid rounded z-depth-1" width="100%" height="auto" data-zoomable="" loading="eager" onerror="this.onerror=null; $('.responsive-img-srcset').remove();"/> </picture> </figure> <p>Same goes for the product. Here we show the construction, which cleverly uses <a href="https://en.wikipedia.org/wiki/Thales%27s_theorem">Thales’s Theorem</a>:</p> <figure> <picture> <source class="responsive-img-srcset" srcset="/assets/img/posts/squaring-the-circle/prod-480.webp 480w,/assets/img/posts/squaring-the-circle/prod-800.webp 800w,/assets/img/posts/squaring-the-circle/prod-1400.webp 1400w," sizes="95vw" type="image/webp"/> <img src="/assets/img/posts/squaring-the-circle/prod.png" class="img-fluid rounded z-depth-1" width="100%" height="auto" data-zoomable="" loading="eager" onerror="this.onerror=null; $('.responsive-img-srcset').remove();"/> </picture> </figure> <p>This same construction with a minor modification yields the multiplicative inverse:</p> <figure> <picture> <source class="responsive-img-srcset" srcset="/assets/img/posts/squaring-the-circle/inverse-480.webp 480w,/assets/img/posts/squaring-the-circle/inverse-800.webp 800w,/assets/img/posts/squaring-the-circle/inverse-1400.webp 1400w," sizes="95vw" type="image/webp"/> <img src="/assets/img/posts/squaring-the-circle/inverse.png" class="img-fluid rounded z-depth-1" width="100%" height="auto" data-zoomable="" loading="eager" onerror="this.onerror=null; $('.responsive-img-srcset').remove();"/> </picture> </figure> <p>With all these properties, as well as <em>associativity</em> and <em>distributivity</em>, which are automatically inherited from operations in \(\mathbb R\), we can conclude that \(\mathcal C\) is a <a href="https://en.wikipedia.org/wiki/Field_(mathematics)">field</a>, as desired.</p> <p class="exercisetoggle">If you pay close attention to the last two figures, you’ll see that in order to apply Thales’s Theorem, we need the involved numbers to be positive (\(a,b &gt; 0\)). Can you explain why multiplication and inverse work in general, even if the values are not both positive? You should be able to do this without any crazy construction, only with everything discussed so far.</p> <p class="exercisesolution">Suppose, for example, that \(a &lt; 0\) and \(b &gt; 0\). Then, using Thales’s Theorem we can get \((-a)b\), but this is the same as \(-ab\). Then, you can do \(0 - (-ab) = ab\) to finish it off, since the case of the difference has already been proven in general. The case where both are negative is even easier, and the same goes for the inverse. Finally, if any of the numbers is \(0\), the product is \(0\) which is in \(\mathcal C\).</p> <p>In previous sections we saw that every integer could be constructed, that is, \(\mathbb Z \subset \mathcal C\). It turns out that the smallest field that contains the integers is the rationals (can you see why with the properties discussed?), which automatically gives \(\mathbb Q \subset \mathcal C\). In other words, any point of <em>rational</em> coordinates can be constructed. That’s a lot!</p> <p>Let’s wrap up this section with one last crucial property of \(\mathcal C\). Given the <em>compass rule</em>, it makes sense that if a point \((a,b)\) can be constructed, then so can its distance to the origin (the number \(\sqrt{a^2+b^2}\)). The way to do this is the obvious one (with a circumference centered at \((0,0)\) and intersecting the \(X\) axis). This allows non-rational numbers to be constructible: for example, \(\sqrt{2}\) is the distance of \((1,1)\) to the origin. It turns out that <strong>the square root of any positive, constructible number is also constructible</strong>, and the classical construction for this is the following:</p> <figure> <picture> <source class="responsive-img-srcset" srcset="/assets/img/posts/squaring-the-circle/sqrt-480.webp 480w,/assets/img/posts/squaring-the-circle/sqrt-800.webp 800w,/assets/img/posts/squaring-the-circle/sqrt-1400.webp 1400w," sizes="95vw" type="image/webp"/> <img src="/assets/img/posts/squaring-the-circle/sqrt.png" class="img-fluid rounded z-depth-1" width="100%" height="auto" data-zoomable="" loading="eager" onerror="this.onerror=null; $('.responsive-img-srcset').remove();"/> </picture> </figure> <p>Equipped with the knowledge that \(\mathcal C\) is a field where taking the square root is preserved, we are ready to prove that squaring the circle is impossible!</p> <p><a name="algebraic-extensions"></a></p> <h3 id="algebraic-field-extensions">Algebraic field extensions</h3> <p>The key observation to prove the impossiblity of squaring the circle lies on <strong>algebraic field extensions</strong>. Suppose that, starting from \(\mathbb Q\), we have already constructed some of the constructible numbers \(\mathcal B \subset \mathcal C\). We can assume \(\mathcal B\) to be a field.</p> <p class="exercisetoggle">Why can we assume that \(\mathcal B\) is a field?</p> <p class="exercisesolution">We know from the previous section that the constructible numbers, \(\mathcal C\), are a field. Hence, if we consider the smallest field containing \(\mathcal B\), that is, any number obtained from adding, subtracting, multiplying and inverting elements from \(\mathcal B\), this field has to consist only of constructible numbers, hence we can take this as our \(\mathcal B\).</p> <p>Then, we further construct another point \(P = (x_0,y_0)\), hence reaching both \(x_0\) and \(y_0\). How do these two values relate to those in \(\mathcal B\)? It actually depends on how they’re constructed.</p> <p><strong>First case.</strong> If they were obtained intersecting two lines through points in \(\mathcal B\), since these lines have equations \(ax+by = c\) and \(dx+ey=f\), with \(a,b,c,d,e,f \in \mathcal B\) (you can check this by explicitly taking two points with coordinates in \(\mathcal B\), writing the line equation, and using that \(\mathcal B\) is a field), it follows that their intersection is: \((x_0,y_0) = (\frac{ce-fb}{ae-bd}, \frac{af-cd}{ae-bd})\). Since \(\mathcal B\) was a field, then actually \(x_0,y_0 \in \mathcal B\) so we didn’t construct anything new.</p> <p><strong>Second case.</strong> If they were obtained intersecting the line \(ax+by=c\) and the circle \((x-d)^2+(y-e)^2 = f^2\), where once again \(a,b,c,d,e,f \in \mathcal B\), we can compute the intersection similarly. For example, if \(b \neq 0\), we write \(y = \frac{c-ax}{b}\) and this gives that \((x_0-d)^2 +(\frac{c-ax_0}{b}-e)^2 = f^2\). This is, \(x_0\) <strong>satisfies a polynomial equation of degree</strong> \(2\), <strong>whose coefficients are in</strong> \(\mathcal B\). In other words, \(x_0\) is the root for a degree \(2\) polynomial in \(\mathcal B\). The same goes for \(y_0\) in the event that \(a \neq 0\).</p> <p class="exercisetoggle">What relation do we obtain if \(b = 0\) (similarly for \(a=0\))?</p> <p class="exercisesolution">In this case, simply looking at the line yields \(x_0 = \frac{c}{a}\) so \(x_0 \in \mathcal B\).</p> <p><strong>Third case.</strong> As you might have already guessed, the third case involves intersecting two circles:</p> \[(x-a)^2+(y-b)^2 = c^2\] <p>and</p> \[(x-d)^2+(y-e)^2 = f^2,\] <p>with \(a,b,c,d,e,f \in \mathcal B\). One can subtract the two equations to obtain a new equation</p> \[2(a-d)x + 2(b-e)y = f^2-c^2+a^2+b^2-d^2-e^2,\] <p>which is that of a line, and intersecting this line with any of the two circles gives the point \(P\), so we’re back to case \(2\).</p> <p>The key thing we’ve checked is that <strong>if the new element wasn’t already in \(\mathcal B\), then it satisfies a degree \(2\) polynomial with coefficients in \(\mathcal B\)</strong>. In mathematical terms, this means that the new element <strong>is algebraic over the field \(\mathcal B\)</strong>. If we denote by \(\mathcal B (x_0,y_0)\) the new field that arises upon adding the new points (and building a field as explained before, by adding, subtracting, multiplying and inverting the elements), this means that \(\mathcal B (x_0,y_0)\) is an <strong>algebraic extension</strong> of the field \(\mathcal B\) (because it was obtained by adding algebraic elements). A result from field theory establishes that every element of an algebraic field extension is algebraic (not only the ones we <em>manually added</em>), but we won’t need this for our argument.</p> <p><a name="towering-extensions"></a></p> <h3 id="towering-extensions">Towering extensions</h3> <p>Let’s imagine how the previous section fits into our construction process. We first obtained that \(\mathbb Q\) was constructible. Now we further construct another point \(P_0 = (x_0,y_0)\), which gives us an extension \(\mathbb Q \subset \mathbb Q(x_0,y_0)\) which is algebraic, so that \(x_0\) and \(y_0\) both satisfy a polynomial with coefficients in \(\mathbb Q\) (whose degree is at most \(2\)). Now, from these points, we further construct \(P_1 = (x_1,y_1)\). The previous analysis tells us that \(x_1\) and \(y_1\) will satisfy a polynomial with coefficients in \(\mathbb Q(x_0,y_0)\). In other words, we have the following <em>extension tower</em>: \(\mathbb Q \subset \mathbb Q(x_0,y_0) \subset \mathbb Q(x_0,y_0,x_1,y_1)\), where any pair of consecutive extensions is algebraic. For these situations, there is a key result from field theory:</p> <p class="emphasizebox"><strong>Theorem 1.</strong> If \(K \subset L \subset M\) is a tower of field extensions, where every two consecutive extensions are algebraic, then \(K \subset M\) is also algebraic. In other words, if elements in \(L\) satisfy polynomial equations with coefficients in \(K\), and elements in \(M\) satisfy polynomial equations with coefficients in \(L\), then elements in \(M\) will satisfy a polynomial equation with coefficients in \(K\).</p> <p>The <a href="https://proofwiki.org/wiki/Transitivity_of_Algebraic_Extensions">proof</a> needs a decent amount of theory that doesn’t fit here.</p> <p class="emphasizebox"><strong>Theorem 2.</strong> Any constructible number \(c \in \mathcal C\) satisfies a polynomial equation with coefficients in \(\mathbb Q\).</p> <p>Let’s recap why:</p> <ul> <li>We started from \(0\) and \(1\) and constructed the whole of \(\mathbb Q\) by realizing that the constructible numbers are a field.</li> <li>We construct a new point \(P_0 = (x_0,y_0)\), which gives a whole new field of constructible elements, \(\mathbb Q(x_0,y_0)\), and \(x_0\) and \(y_0\) satisfy polynomial equations with coefficients in \(\mathbb Q\).</li> <li>On each step, we construct a new point \(P_i = (x_i,y_i)\) which gives a new field, and \(x_i\), \(y_i\) satisfy polynomial equations with coefficients in the previous field. By Theorem 1, this means that \(x_i\) and \(y_i\) actually satisfy equations with coefficients in \(\mathbb Q\), as desired.</li> </ul> <p><a name="final-proof"></a></p> <h3 id="the-final-proof">The final proof</h3> <p class="emphasizebox"><strong>Theorem 3.</strong> It is impossible to square the circle. That is, starting from a circle which can be assumed centered at \((0,0)\) and of unit radius, it is impossible to obtain, using ruler and compass, (the vertices of) a square with the same area \((A = \pi)\).</p> <p>Proof. Since we start from the circle centered at \((0,0)\) and of unit radius, this can be rephrased as starting from \((0,0)\) and \((1,0)\) as we’ve been doing. If squaring the circle were possible, the side lengths of the square would also be constructible (why?). This would imply that \(\sqrt{\pi} \in \mathcal C\), and, in turn, that \(\pi \in \mathcal C\). However, \(\pi\) is a <strong>transcendental number</strong>, that is, it cannot satisfy a polynomial with coefficients in \(\mathbb Q\), contradicting Theorem 2. \(\tag*{$\blacksquare$}\)</p> <p>The fact that \(\pi\) is transcendental is not easy to show, and can be deduced from <a href="https://en.wikipedia.org/wiki/Lindemann%E2%80%93Weierstrass_theorem">a theorem due to Lindemann and Weierstrass</a>.</p> <p><a name="parting-words"></a></p> <h3 id="parting-words">Parting words</h3> <p>Congratulations for making it here! This was quite a dense post, but I hope you could learn something along the way! There are other marvelous results that can be proven using all this theory, which closely relates to <a href="https://en.wikipedia.org/wiki/Galois_theory">Galois Theory</a>. Here I leave you some more questions that will allow you to further explore this topic if you want to.</p> <p class="exercisetoggle">Observe <strong>Theorem 1</strong> carefully. There’s a relationship between the degrees of the polynomials involved. Suppose we have a tower of the kind \(\mathbb Q \subset \mathbb Q(x_0) \subset \mathbb Q(x_0, x_1)\), as before. If \(x_0\) satisfies a polynomial of degree \(d_1\) with coefficients in \(\mathbb Q\), and \(x_1\) satisfies a polynomial of degree \(d_2\) with coefficients in \(\mathbb Q(x_0)\), then the degree of the polynomial satisfied by \(x_1\) with coefficients in \(\mathbb Q\) (as per Theorem 1) turns out to be \(d_1 \cdot d_2\). Using this, given a constructible number \(c \in \mathcal C\), what can you say about the degree of the polynomial in \(\mathbb Q\) it satisfies?</p> <p class="exercisesolution">Since, from every field to the next one, a polynomial of degree \(1\) or \(2\) was involved, using the previous question we deduce that the degree has to be <strong>a power of \(2\)</strong>. For example, \(2\) or \(4\) would be obtained with this procedure, but not \(3\).</p> <p class="exercisetoggle">Is it possible that \(c \in \mathcal C\) satisfies a polynomial with a different degree from the one obtained in the previous question?</p> <p class="exercisesolution">Yes, because if \(P(c) = 0\), then \(c^kP(c) = 0\) for any \(k \in \mathbb N\), so you could obtain any degree which is greater than the one obtained in the previous question via considering the polynomial \(X^kP(X)\).</p> <p class="emphasizebox"><strong>Theorem 4.</strong> If we restrict every polynomial discussed so far to be <strong>irreducible</strong>, then the answer to the previous question is no. In other words, if \(c \in \mathcal C\) is constructible, and \(P(X)\) is an irreducible polynomial with coefficients in \(\mathbb Q\) so that \(P(c) = 0\), its degree is necessarily the one obtained in the first question of this section.</p> <p class="exercisetoggle"><strong>(Hard question)</strong> Use these facts to show that <strong>it is impossible to duplicate a cube</strong> with ruler and compass. That is, given a cube with two of its adjacent vertices at \((0,0)\) and \((1,0)\), it is impossible to construct (the vertices of) a cube with double the volume (that is, volume \(V = 2\)). Use the results from this section, as well as the proof for the circle squaring impossibility.</p> <p class="exercisesolution">If you got it, congrats! <a href="mailto:mgonzalez.contacto@gmail.com">Contact me</a> if you want to discuss this question.</p> <p class="exercisetoggle"><strong>(Extra hard question)</strong> Use these facts to show that <strong>it is impossible to trisect the 60º angle</strong> with ruler and compass. That is, given the points \((0,0), (1,0)\) and \((\frac{1}{2}, \frac{\sqrt{3}}{2})\), which form a 60º angle, it is impossible to construct the point \((\cos \frac{\pi}{9}, \sin \frac{\pi}{9})\), which would correspond to a third of the angle. Use the results from this section.</p> <p class="exercisesolution">If you got it, congrats! <a href="mailto:mgonzalez.contacto@gmail.com">Contact me</a> if you want to discuss this question.</p> <p><a href="/blog">Back to the posts page.</a></p>]]></content><author><name></name></author></entry><entry><title type="html">Updated my projects page for the first time</title><link href="https://miguelgg.com/posts/projects-page-created" rel="alternate" type="text/html" title="Updated my projects page for the first time"/><published>2021-04-16T17:00:00+00:00</published><updated>2021-04-16T17:00:00+00:00</updated><id>https://miguelgg.com/posts/projects-page-first-update</id><content type="html" xml:base="https://miguelgg.com/posts/projects-page-created"><![CDATA[<p>I’ve just updated my <a href="/projects">projects</a> page and added the very first batch of <em>ApunTeX</em>. But… what are ApunTex?</p> <p>They are my revised class notes (in Spanish) from lectures I attended as part of my Degree in Mathematics. I revise them individually, adding a cover image, a summary page and short explanatory paragraphs where I felt they were needed, and then publish them here.</p> <p>As I explained in the projects section, these documents <strong>are</strong>:</p> <ul> <li>A direct an ordered collection of the most importat definitions and results from the subject in question, at undergraduate level.</li> <li>A collection of full proofs of said results (except in the most basic cases).</li> <li>A <em>guide</em> to quickly review previously acquired ideas, or to check specific aspects that might have not been fully understood at first.</li> </ul> <p>These documents <strong>are NOT</strong>:</p> <ul> <li>A textbook.</li> <li>A collection of exercises to practice your knowledge.</li> <li>A list of examples to illustrate the ideas presented. Sometimes, particular examples are included when they can be fruitful or interesting, but they’re not the point of these notes and, as such, they’re very sparse, in favor of the first bullet point of the previous list.</li> </ul> <p>If you are studying mathematics at a Spanish college, or might be interested in learning maths and know the language, feel free to download them!</p> <p>As soon as I have some spare time to keep reviewing the remaining documents, I will publish them to the same <a href="/projects">projects</a> page.</p> <p><a href="/blog">Back to the posts page.</a></p>]]></content><author><name></name></author><summary type="html"><![CDATA[I’ve just updated my projects page and added the very first batch of ApunTeX. But… what are ApunTex?]]></summary></entry><entry><title type="html">My first blog post</title><link href="https://miguelgg.com/posts/first_post" rel="alternate" type="text/html" title="My first blog post"/><published>2021-04-15T00:00:00+00:00</published><updated>2021-04-15T00:00:00+00:00</updated><id>https://miguelgg.com/posts/first-post</id><content type="html" xml:base="https://miguelgg.com/posts/first_post"><![CDATA[<p>Hi! My name is Miguel González and I’m currently studying a Double Degree in Mathematics and Computer Science at Universidad Autónoma de Madrid.</p> <p>In this website, I will publish some of my personal projects in the <a href="/projects">projects</a> section. I also intend on writing blog posts, mainly about mathematical ideas that I found interesting during my learning process.</p> <p>You can find more about me in the <a href="/about">about</a> page.</p> <p><a href="/blog">Back to the posts page.</a></p>]]></content><author><name></name></author><summary type="html"><![CDATA[Hi! My name is Miguel González and I’m currently studying a Double Degree in Mathematics and Computer Science at Universidad Autónoma de Madrid.]]></summary></entry></feed>