
 {
  "version": "https://jsonfeed.org/version/1.1",
  "title": "aadi.ink",
  "home_page_url": "https://aadi.ink/",
  "feed_url": "https://aadi.ink/index.json",
    "authors": [
	{
	"name": "Aadi",
	"url": "https://mathstodon.xyz/@aadi"
	}
	],
  "items": [
    {
      "id": "https://aadi.ink/posts/2026/05/lessons-from-egu26/",
      "url": "https://aadi.ink/posts/2026/05/lessons-from-egu26/",
      "title": "Lessons from EGU 2026 General Assembly",
      "date_published": "2026-05-24T16:08:00Z",
      "content_html": "\u003cp\u003e\u003cimg src=\"IMG_5926.jpeg\" alt=\"An EGU colouring book, crayons, earplugs, and dextrose tablets on a white table\" title=\"Inside a quiet room\"\u003e\u003c/p\u003e\n\u003cp\u003eI was fortunate to be able to attend EGU26 in Vienna.\u003c/p\u003e\n\u003ch3 id=\"this-conference-is-huge\"\u003eThis conference is huge!\u003c/h3\u003e\n\u003cp\u003eThere were about 20,000 attendees for the in-person event. That is a big number. It is hard to comprehend how many people it is.\nIt\u0026rsquo;s a lot. Don\u0026rsquo;t try to memorise faces, names. Treat everyone as new for the first couple of days, then treat nobody as a new face later.\u003c/p\u003e\n\u003ch3 id=\"make-a-plan-before-the-start-of-the-day\"\u003eMake a plan before the start of the day\u003c/h3\u003e\n\u003cp\u003eRead abstracts and not just titles.\u003c/p\u003e\n\u003ch3 id=\"you-are-bound-to-miss-good-sessions\"\u003eYou are bound to miss good sessions\u003c/h3\u003e\n\u003cp\u003eSessions run in parallel. All week. This means there is always going to be something interesting going on somewhere other than where you are right now. Trust your plan.\u003c/p\u003e\n\u003ch3 id=\"carry-snacks-with-you\"\u003eCarry snacks with you\u003c/h3\u003e\n\u003cp\u003eYou can eat during sessions, on the walk between rooms, or just on your break.\u003c/p\u003e\n\u003ch3 id=\"keep-eating-and-hydrating\"\u003eKeep eating and hydrating\u003c/h3\u003e\n\u003cp\u003eIt\u0026rsquo;s easy to get distracted and forget. Nobody is going to ask you whether you have had lunch. So ask yourself!\u003c/p\u003e\n\u003ch3 id=\"dont-try-to-make-the-full-week\"\u003eDon\u0026rsquo;t try to make the full week\u003c/h3\u003e\n\u003cp\u003eIt\u0026rsquo;s intense! There\u0026rsquo;s travel on both sides of the week, so either you choose when to take a break, or it will.\u003c/p\u003e\n\u003ch3 id=\"stay-for-whole-sessions-instead-of-moving-between-10-minute-talks\"\u003eStay for whole sessions instead of moving between 10-minute talks\u003c/h3\u003e\n\u003cp\u003eIt\u0026rsquo;s a lot of time spent travelling for a short talk that may or may not be as interesting to you as you expect.\u003c/p\u003e\n\u003ch3 id=\"note-down-names-and-contact-details-of-people-you-find-interesting\"\u003eNote down names and contact details of people you find interesting\u003c/h3\u003e\n\u003cp\u003eEven if you don\u0026rsquo;t have time to interact with someone immediately, you will appreciate having the information later when you have the motivation. This is what the conference is for.\u003c/p\u003e\n\u003ch3 id=\"pay-attention-to-medal-lectures-and-short-courses\"\u003ePay attention to medal lectures and short courses\u003c/h3\u003e\n\u003cp\u003eThese are on average better than 10-minute talks, but may not be as relevant to your field or project.\u003c/p\u003e\n\u003ch3 id=\"see-all-poster-abstracts-before-entering-the-hall\"\u003eSee all poster abstracts before entering the hall\u003c/h3\u003e\n\u003cp\u003e\u003cimg src=\"IMG_5871.jpeg\" alt=\"A view of a poster hall, high ceiling, lots of people\" title=\"Do your homework\"\u003e\u003c/p\u003e\n\u003cp\u003eThat way you\u0026rsquo;ll already know which ones you want to go see, and what you want to ask. Posters take a long time to go through, and you might miss the important ones.\u003c/p\u003e\n\u003ch3 id=\"sleep-enough\"\u003eSleep enough\u003c/h3\u003e\n\u003cp\u003eAvoid risking the embarrassment of irresistibly nodding to sleep during a presentation.\u003c/p\u003e\n\u003ch3 id=\"go-outside-every-couple-of-hours\"\u003eGo outside every couple of hours\u003c/h3\u003e\n\u003cp\u003eSee the sun, touch grass, get some fresh air, smell the rain, relax eyes. Anything to connect to the outside.\u003c/p\u003e\n\u003cp\u003e\u003cimg src=\"IMG_5929.jpeg\" alt=\"A view of the blue sky with a few scattered clouds, a tower, and trees beyond a compound wall\" title=\"Refreshing\"\u003e\u003c/p\u003e\n\u003ch3 id=\"you-may-feel-lonely\"\u003eYou may feel lonely\u003c/h3\u003e\n\u003cp\u003eFind someone to tag along behind for a while.\u003c/p\u003e\n\u003ch3 id=\"when-struggling-to-pay-attention-try-to-find-a-question-to-ask\"\u003eWhen struggling to pay attention, try to find a question to ask\u003c/h3\u003e\n\u003ch3 id=\"raise-hands-and-ask-questions\"\u003eRaise hands and ask questions!\u003c/h3\u003e\n\u003cp\u003eI tend to be able to remember those talks better in which I have asked a question.\u003c/p\u003e\n\u003ch3 id=\"expect-tough-questions\"\u003eExpect tough questions\u003c/h3\u003e\n\u003cp\u003eThat means people payed attention and understood.\u003c/p\u003e\n"
    }, {
      "id": "https://aadi.ink/research/shallow-gpu-efficiency-accuracy/",
      "url": "https://aadi.ink/research/shallow-gpu-efficiency-accuracy/",
      "title": "Efficiency and Accuracy of First- and Second-order Schemes for Shallow Water Equations on GPUs",
      "date_published": "2025-10-25T20:01:08+02:00",
      "content_html": "\u003ch1 id=\"abstract\"\u003eAbstract\u003c/h1\u003e\n\u003cp\u003eThe overarching goal of numerical simulation is to offer the most accurate solution in the shortest amount of time, and typically also using the least amount of computational resources. Whilst the accuracy and convergence of numerical schemes often is well studied, there is little literature that on how such numerical schemes compare in practice on physical hardware.\u003c/p\u003e\n\u003cp\u003eThe aim of this paper is to compare the accuracy and computational efficiency on GPUs of finite volume schemes for the shallow water equations. At the end of the day, it is time-to-result with a certain accuracy that counts, and it is not given which numerical scheme yields the best results for this metric.\u003c/p\u003e\n\u003cp\u003eWe compare the efficiency and accuracy of several different finite volume schemes on GPUs for one-dimensional and two-dimensional problems, with both shock and smooth solutions. The selected schemes include Lax\u0026ndash;Friedrichs, FORCE, Harten\u0026ndash;Lax\u0026ndash;van Leer (HLL), Kurganov\u0026ndash;Petrova, and Weighted Average Flux.\u003c/p\u003e\n\u003cp\u003eWe compare the computing time for each scheme with a predetermined accuracy requirement, and vice versa how accurate a numerical scheme is given a set computing time.\u003c/p\u003e\n"
    }, {
      "id": "https://aadi.ink/research/dgf25/",
      "url": "https://aadi.ink/research/dgf25/",
      "title": "Poster for Conference on Dense Granular Flows 2025",
      "date_published": "2025-06-23T11:29:43+02:00",
      "content_html": "\u003cfigure\u003e\n\u003ca href=\"DGF25Poster_AadiBhure_3k.png\"\u003e\n\t\u003cimg src='DGF25Poster_AadiBhure_1k.png' \n\t\t srcset=\"DGF25Poster_AadiBhure_0.5k.png 0.5x, DGF25Poster_AadiBhure_1k.png 1x, DGF25Poster_AadiBhure_2k.png 2x, DGF25Poster_AadiBhure_3k.png 3x\"\n\t\t alt=\"A poster with text and images.\" \n\t\t class=\"figure\" \n\t\t width=\"648\" height=\"916\" \n\t\t /\u003e\n\u003c/a\u003e\n\t\u003cdiv class=\"caption-figure\"\u003eClick the image to download a higher resolution PNG.\u003c/div\u003e\n\u003c/figure\u003e\n\n\u003cp\u003e\nThis is the full animation of the simulation from our solver.\nThis is not presented as a \u003ci\u003eresult\u003c/i\u003e, but just an illustration to support the poster.\nThe \u003cb\u003eparameters are not realistic.\u003c/b\u003e\n\u003c/p\u003e\n\u003cbr\u003e\n\u003c!-- MATPLOTLIB ANIMATE.HTML --\u003e\n\u003clink rel=\"stylesheet\"\nhref=\"https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css\"\u003e\n\u003cscript language=\"javascript\"\u003e\n  function isInternetExplorer() {\n    ua = navigator.userAgent;\n    /* MSIE used to detect old browsers and Trident used to newer ones*/\n    return ua.indexOf(\"MSIE \") \u003e -1 || ua.indexOf(\"Trident/\") \u003e -1;\n  }\n\n  /* Define the Animation class */\n  function Animation(frames, img_id, slider_id, interval, loop_select_id){\n    this.img_id = img_id;\n    this.slider_id = slider_id;\n    this.loop_select_id = loop_select_id;\n    this.interval = interval;\n    this.current_frame = 0;\n    this.direction = 0;\n    this.timer = null;\n    this.frames = new Array(frames.length);\n\n    for (var i=0; i\u003cframes.length; i++)\n    {\n     this.frames[i] = new Image();\n     this.frames[i].src = frames[i];\n    }\n    var slider = document.getElementById(this.slider_id);\n    slider.max = this.frames.length - 1;\n    if (isInternetExplorer()) {\n        // switch from oninput to onchange because IE \u003c= 11 does not conform\n        // with W3C specification. It ignores oninput and onchange behaves\n        // like oninput. In contrast, Microsoft Edge behaves correctly.\n        slider.setAttribute('onchange', slider.getAttribute('oninput'));\n        slider.setAttribute('oninput', null);\n    }\n    this.set_frame(this.current_frame);\n  }\n\n  Animation.prototype.get_loop_state = function(){\n    var button_group = document[this.loop_select_id].state;\n    for (var i = 0; i \u003c button_group.length; i++) {\n        var button = button_group[i];\n        if (button.checked) {\n            return button.value;\n        }\n    }\n    return undefined;\n  }\n\n  Animation.prototype.set_frame = function(frame){\n    this.current_frame = frame;\n    document.getElementById(this.img_id).src =\n            this.frames[this.current_frame].src;\n    document.getElementById(this.slider_id).value = this.current_frame;\n  }\n\n  Animation.prototype.next_frame = function()\n  {\n    this.set_frame(Math.min(this.frames.length - 1, this.current_frame + 1));\n  }\n\n  Animation.prototype.previous_frame = function()\n  {\n    this.set_frame(Math.max(0, this.current_frame - 1));\n  }\n\n  Animation.prototype.first_frame = function()\n  {\n    this.set_frame(0);\n  }\n\n  Animation.prototype.last_frame = function()\n  {\n    this.set_frame(this.frames.length - 1);\n  }\n\n  Animation.prototype.slower = function()\n  {\n    this.interval /= 0.7;\n    if(this.direction \u003e 0){this.play_animation();}\n    else if(this.direction \u003c 0){this.reverse_animation();}\n  }\n\n  Animation.prototype.faster = function()\n  {\n    this.interval *= 0.7;\n    if(this.direction \u003e 0){this.play_animation();}\n    else if(this.direction \u003c 0){this.reverse_animation();}\n  }\n\n  Animation.prototype.anim_step_forward = function()\n  {\n    this.current_frame += 1;\n    if(this.current_frame \u003c this.frames.length){\n      this.set_frame(this.current_frame);\n    }else{\n      var loop_state = this.get_loop_state();\n      if(loop_state == \"loop\"){\n        this.first_frame();\n      }else if(loop_state == \"reflect\"){\n        this.last_frame();\n        this.reverse_animation();\n      }else{\n        this.pause_animation();\n        this.last_frame();\n      }\n    }\n  }\n\n  Animation.prototype.anim_step_reverse = function()\n  {\n    this.current_frame -= 1;\n    if(this.current_frame \u003e= 0){\n      this.set_frame(this.current_frame);\n    }else{\n      var loop_state = this.get_loop_state();\n      if(loop_state == \"loop\"){\n        this.last_frame();\n      }else if(loop_state == \"reflect\"){\n        this.first_frame();\n        this.play_animation();\n      }else{\n        this.pause_animation();\n        this.first_frame();\n      }\n    }\n  }\n\n  Animation.prototype.pause_animation = function()\n  {\n    this.direction = 0;\n    if (this.timer){\n      clearInterval(this.timer);\n      this.timer = null;\n    }\n  }\n\n  Animation.prototype.play_animation = function()\n  {\n    this.pause_animation();\n    this.direction = 1;\n    var t = this;\n    if (!this.timer) this.timer = setInterval(function() {\n        t.anim_step_forward();\n    }, this.interval);\n  }\n\n  Animation.prototype.reverse_animation = function()\n  {\n    this.pause_animation();\n    this.direction = -1;\n    var t = this;\n    if (!this.timer) this.timer = setInterval(function() {\n        t.anim_step_reverse();\n    }, this.interval);\n  }\n\u003c/script\u003e\n\n\u003cstyle\u003e\n.animation {\n    display: inline-block;\n    text-align: center;\n}\ninput[type=range].anim-slider {\n    width: 374px;\n    margin-left: auto;\n    margin-right: auto;\n}\n.anim-buttons {\n    margin: 8px 0px;\n}\n.anim-buttons button {\n    padding: 0;\n    width: 36px;\n}\n.anim-state label {\n    margin-right: 8px;\n}\n.anim-state input {\n    margin: 0;\n    vertical-align: middle;\n}\n\u003c/style\u003e\n\n\u003cdiv class=\"animation\"\u003e\n  \u003cimg id=\"_anim_img4907090669a8447b953c7f1fa9fef5a8\"\u003e\n  \u003cdiv class=\"anim-controls\"\u003e\n    \u003cinput id=\"_anim_slider4907090669a8447b953c7f1fa9fef5a8\" type=\"range\" class=\"anim-slider\"\n           name=\"points\" min=\"0\" max=\"1\" step=\"1\" value=\"0\"\n           oninput=\"anim4907090669a8447b953c7f1fa9fef5a8.set_frame(parseInt(this.value));\"\u003e\n    \u003cdiv class=\"anim-buttons\"\u003e\n      \u003cbutton title=\"Decrease speed\" aria-label=\"Decrease speed\" onclick=\"anim4907090669a8447b953c7f1fa9fef5a8.slower()\"\u003e\n          \u003ci class=\"fa fa-minus\"\u003e\u003c/i\u003e\u003c/button\u003e\n      \u003cbutton title=\"First frame\" aria-label=\"First frame\" onclick=\"anim4907090669a8447b953c7f1fa9fef5a8.first_frame()\"\u003e\n        \u003ci class=\"fa fa-fast-backward\"\u003e\u003c/i\u003e\u003c/button\u003e\n      \u003cbutton title=\"Previous frame\" aria-label=\"Previous frame\" onclick=\"anim4907090669a8447b953c7f1fa9fef5a8.previous_frame()\"\u003e\n          \u003ci class=\"fa fa-step-backward\"\u003e\u003c/i\u003e\u003c/button\u003e\n      \u003cbutton title=\"Play backwards\" aria-label=\"Play backwards\" onclick=\"anim4907090669a8447b953c7f1fa9fef5a8.reverse_animation()\"\u003e\n          \u003ci class=\"fa fa-play fa-flip-horizontal\"\u003e\u003c/i\u003e\u003c/button\u003e\n      \u003cbutton title=\"Pause\" aria-label=\"Pause\" onclick=\"anim4907090669a8447b953c7f1fa9fef5a8.pause_animation()\"\u003e\n          \u003ci class=\"fa fa-pause\"\u003e\u003c/i\u003e\u003c/button\u003e\n      \u003cbutton title=\"Play\" aria-label=\"Play\" onclick=\"anim4907090669a8447b953c7f1fa9fef5a8.play_animation()\"\u003e\n          \u003ci class=\"fa fa-play\"\u003e\u003c/i\u003e\u003c/button\u003e\n      \u003cbutton title=\"Next frame\" aria-label=\"Next frame\" onclick=\"anim4907090669a8447b953c7f1fa9fef5a8.next_frame()\"\u003e\n          \u003ci class=\"fa fa-step-forward\"\u003e\u003c/i\u003e\u003c/button\u003e\n      \u003cbutton title=\"Last frame\" aria-label=\"Last frame\" onclick=\"anim4907090669a8447b953c7f1fa9fef5a8.last_frame()\"\u003e\n          \u003ci class=\"fa fa-fast-forward\"\u003e\u003c/i\u003e\u003c/button\u003e\n      \u003cbutton title=\"Increase speed\" aria-label=\"Increase speed\" onclick=\"anim4907090669a8447b953c7f1fa9fef5a8.faster()\"\u003e\n          \u003ci class=\"fa fa-plus\"\u003e\u003c/i\u003e\u003c/button\u003e\n    \u003c/div\u003e\n    \u003cform title=\"Repetition mode\" aria-label=\"Repetition mode\" action=\"#n\" name=\"_anim_loop_select4907090669a8447b953c7f1fa9fef5a8\"\n          class=\"anim-state\"\u003e\n      \u003cinput type=\"radio\" name=\"state\" value=\"once\" id=\"_anim_radio1_4907090669a8447b953c7f1fa9fef5a8\"\n             \u003e\n      \u003clabel for=\"_anim_radio1_4907090669a8447b953c7f1fa9fef5a8\"\u003eOnce\u003c/label\u003e\n      \u003cinput type=\"radio\" name=\"state\" value=\"loop\" id=\"_anim_radio2_4907090669a8447b953c7f1fa9fef5a8\"\n             checked\u003e\n      \u003clabel for=\"_anim_radio2_4907090669a8447b953c7f1fa9fef5a8\"\u003eLoop\u003c/label\u003e\n      \u003cinput type=\"radio\" name=\"state\" value=\"reflect\" id=\"_anim_radio3_4907090669a8447b953c7f1fa9fef5a8\"\n             \u003e\n      \u003clabel for=\"_anim_radio3_4907090669a8447b953c7f1fa9fef5a8\"\u003eReflect\u003c/label\u003e\n    \u003c/form\u003e\n  \u003c/div\u003e\n\u003c/div\u003e\n\n\n\u003cscript language=\"javascript\"\u003e\n  /* Instantiate the Animation class. */\n  /* The IDs given should match those used in the template above. */\n  (function() {\n    var img_id = \"_anim_img4907090669a8447b953c7f1fa9fef5a8\";\n    var slider_id = \"_anim_slider4907090669a8447b953c7f1fa9fef5a8\";\n    var loop_select_id = \"_anim_loop_select4907090669a8447b953c7f1fa9fef5a8\";\n    var frames = new Array(60);\n    \n  for (var i=0; i\u003c60; i++){\n    frames[i] = \"animate_frames/frame\" + (\"0000000\" + i).slice(-7) +\n                \".png\";\n  }\n\n\n    /* set a timeout to make sure all the above elements are created before\n       the object is initialized. */\n    setTimeout(function() {\n        anim4907090669a8447b953c7f1fa9fef5a8 = new Animation(frames, img_id, slider_id, 50,\n                                 loop_select_id);\n    }, 0);\n  })()\n\u003c/script\u003e\n\u003c!-- END animate.html --\u003e\n\nIn case the HTML animation won't load, you can \u003ca href=\"animate.mp4\"\u003esee it as a video\u003c/a\u003e.\n"
    }, {
      "id": "https://aadi.ink/posts/2025/03/zeroth-march/",
      "url": "https://aadi.ink/posts/2025/03/zeroth-march/",
      "title": "The Zeroth of March",
      "date_published": "2025-03-01T04:48:27+01:00",
      "content_html": "\u003cp\u003eIf I referred to a date as \u0026ldquo;zeroth of March\u0026rdquo;, I bet it would make perfect sense for some but no sense for others.\nDates are just arbitrary numbers assigned to each day.\nThat\u0026rsquo;s not to say that there is no logic within them.\nMonths are sometimes 30 days long, sometimes 31, and 28 once, except 29 every so often.\nHowever, \u003cstrong\u003ewithin a particular month,\u003c/strong\u003e adding one to today\u0026rsquo;s date is still, thankfully, tomorrow\u0026rsquo;s date.\u003c/p\u003e\n\u003cp\u003eNow that\u0026rsquo;s a simple, straightforward, mathematically sound statement.\nIt makes logical sense, and we can try to stretch it (which is another way of saying \u003cem\u003egeneralise\u003c/em\u003e.)\nDo we need the clause \u003cem\u003ewithin a particular month\u003c/em\u003e?\nWhat if we got rid of it and just said\u003c/p\u003e\n\u003cblockquote\u003e\n\u003cp\u003eIf today\u0026rsquo;s date is \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003ed\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003ed\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e, then \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003ed\u003c/mi\u003e\u003cmo\u003e+\u003c/mo\u003e\u003cmn\u003e1\u003c/mn\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003ed+1\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e is tomorrow\u0026rsquo;s date.\u003c/p\u003e\n\u003c/blockquote\u003e\n\u003cp\u003eThink about how one would describe a 24-hour clock in a world where only 12-hour clocks exist.\nWe know that adding one to the current hour tells us the next hour.\nWe stick to that rule even for 12pm and make 1pm the 13th hour.\nWhat if we did that for dates too?\nThe 31st of June \u003cdel\u003ewould be\u003c/del\u003e is the day after the 30th of June.\n\u003clabel for=\"sn-d41d8cd98f00b204e9800998ecf8427e\" class=\"sidenote-toggle sidenote-number\"\n\t\u003e\u003cinput type=\"checkbox\" id=\"sn-d41d8cd98f00b204e9800998ecf8427e\" class=\"sidenote-toggle\" /\u003e\u003cspan\n\t\tclass=\"sidenote\"\u003eIf you think this doesn\u0026#39;t make sense, I will argue that it makes at least as much sense as February having only 28 days, while July and August both getting 31.\u003c/span\n\t\u003e\u003c/label\n\u003e\nIf you are happy with that, maybe I can convince you that:\u003c/p\u003e\n\u003cblockquote\u003e\n\u003cp\u003eIf today\u0026rsquo;s date is \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003ed\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003ed\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e, then \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003ed\u003c/mi\u003e\u003cmo\u003e−\u003c/mo\u003e\u003cmn\u003e1\u003c/mn\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003ed-1\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e is yesterday\u0026rsquo;s date.\u003c/p\u003e\n\u003c/blockquote\u003e\n\u003cp\u003eThe two statements are not equivalent.\nThe former helps us makes sense of the 32nd of March, but the latter does not.\nIt instead helps us make sense of the 0th of March!\u003c/p\u003e\n\u003cp\u003eBut why are we trying to faff around with dates that everyone already understands?\nIn this case, calling something the \u0026ldquo;zeroth of March\u0026rdquo; is really convenient instead of saying \u0026ldquo;the last day of February\u0026rdquo; or \u0026ldquo;28th February in non-leap years but 29th February in a leap year\u0026rdquo;.\nCalculations also become simple and consistent.\nIt is especially handy when the result we\u0026rsquo;re after is only a duration and not a date.\u003c/p\u003e\n\u003cp\u003eAs an example consider this scenario:\u003c/p\u003e\n\u003cblockquote\u003e\n\u003cp\u003eI know I will run out of coffee in 10 days, but I cannot buy more before the 26th (which is when I will receive my allowance).\nHow many days do I have in which I must do my shopping?\nHow many days can I afford to procrastinate?\u003c/p\u003e\n\u003c/blockquote\u003e\n\u003cul\u003e\n\u003cli\u003eIf today is the 18th, then I will run out on \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmn\u003e18\u003c/mn\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e18\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003eth \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmo\u003e+\u003c/mo\u003e\u003cmn\u003e10\u003c/mn\u003e\u003cmo\u003e=\u003c/mo\u003e\u003cmn\u003e28\u003c/mn\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e+10 = 28\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003eth and \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmn\u003e28\u003c/mn\u003e\u003cmo\u003e−\u003c/mo\u003e\u003cmn\u003e26\u003c/mn\u003e\u003cmo\u003e=\u003c/mo\u003e\u003cmn\u003e2\u003c/mn\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e28 - 26 = 2\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e. I can only procrastinate for two days.\u003c/li\u003e\n\u003cli\u003eBut if today is the 22nd then I would run out on \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmn\u003e22\u003c/mn\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e22\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003end \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmo\u003e+\u003c/mo\u003e\u003cmn\u003e10\u003c/mn\u003e\u003cmo\u003e=\u003c/mo\u003e\u003cmn\u003e32\u003c/mn\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e+ 10 = 32\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003end and \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmn\u003e32\u003c/mn\u003e\u003cmo\u003e−\u003c/mo\u003e\u003cmn\u003e26\u003c/mn\u003e\u003cmo\u003e=\u003c/mo\u003e\u003cmn\u003e6\u003c/mn\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e32 - 26 = 6\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e.\u003c/li\u003e\n\u003cli\u003eIf we aren\u0026rsquo;t allowed the notion of the 32nd day of a month, this calculation becomes complicated.\nWhat dates are allowed?\nThat depends on the current month.\nWe did not require that information to come to the answer earlier (because it doesn\u0026rsquo;t affect the answer).\nSay it is February.\nTo add 10 days to the 22nd of February, we first add 7 to make reach the 1st of March, then 3.\nThat\u0026rsquo;s the 4th of March.\nThen to find the duration between the 26th of February and 4th of March, we again must split it into 2 days of February and 4 days of March so a total of 6 days.\nEach addition and subtraction can become two if we\u0026rsquo;re crossing months.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003eThe zeroth of March is also a useful \u003cem\u003eanchor day\u003c/em\u003e for making date calculations.\nFor more an that, I am happy to point you to Rudy Limeback\u0026rsquo;s excellent \u003ca href=\"https://rudy.ca/doomsday.html\"\u003eillustrative explanation\u003c/a\u003e of John Conway\u0026rsquo;s \u003ca href=\"https://en.wikipedia.org/wiki/Doomsday_rule\"\u003eDoomsday rule\u003c/a\u003e.\u003c/p\u003e\n"
    }, {
      "id": "https://aadi.ink/posts/2024/12/tiny-discount-calculation/",
      "url": "https://aadi.ink/posts/2024/12/tiny-discount-calculation/",
      "title": "A Tiny Discount Calculation",
      "date_published": "2024-12-23T20:35:58+05:30",
      "content_html": "\u003cp\u003eSuppose there are tiered discount rates: say \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmn\u003e10\u003c/mn\u003e\u003cmi mathvariant=\"normal\"\u003e%\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e10\\%\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e up to \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmn\u003e5000\u003c/mn\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e5000\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e, \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmn\u003e15\u003c/mn\u003e\u003cmi mathvariant=\"normal\"\u003e%\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e15\\%\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e above \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmn\u003e5000.\u003c/mn\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e5000.\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e\nNow suppose I need things that cost \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003eb\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003eb\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e before any discount is applied.\nAssuming \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003eb\u003c/mi\u003e\u003cmo\u003e\u0026lt;\u003c/mo\u003e\u003cmn\u003e5000\u003c/mn\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003eb \u0026lt; 5000\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e, I get the 10% discount, having to pay \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmn\u003e90\u003c/mn\u003e\u003cmi mathvariant=\"normal\"\u003e%\u003c/mi\u003e\u003cmo\u003e×\u003c/mo\u003e\u003cmi\u003eb\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e90\\% \\times b\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e.\nCould I perhaps add some more items to be eligible for the 15% discount and \u003cem\u003estill\u003c/em\u003e end up paying less than \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmn\u003e90\u003c/mn\u003e\u003cmi mathvariant=\"normal\"\u003e%\u003c/mi\u003e\u003cmo\u003e×\u003c/mo\u003e\u003cmi\u003eb\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e90\\% \\times b\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e?\u003c/p\u003e\n\u003cp\u003eIf I add an item worth \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003ex\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003ex\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e \u003cem\u003esuch that\u003c/em\u003e \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003eb\u003c/mi\u003e\u003cmo\u003e+\u003c/mo\u003e\u003cmi\u003ex\u003c/mi\u003e\u003cmo\u003e=\u003c/mo\u003e\u003cmn\u003e5000\u003c/mn\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003eb+x = 5000\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e then the discounted amount will be \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmn\u003e85\u003c/mn\u003e\u003cmi mathvariant=\"normal\"\u003e%\u003c/mi\u003e\u003cmo\u003e×\u003c/mo\u003e\u003cmn\u003e5000\u003c/mn\u003e\u003cmo\u003e=\u003c/mo\u003e\u003cmn\u003e4250\u003c/mn\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e85\\%\\times 5000 = 4250\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e.\nI will save money if this is less than the original \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmn\u003e90\u003c/mn\u003e\u003cmi mathvariant=\"normal\"\u003e%\u003c/mi\u003e\u003cmo\u003e×\u003c/mo\u003e\u003cmi\u003eb\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e90\\%\\times b\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e.\n\u003c/p\u003e\n\u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\" display=\"block\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmn\u003e4250\u003c/mn\u003e\u003cmo\u003e\u0026lt;\u003c/mo\u003e\u003cmn\u003e90\u003c/mn\u003e\u003cmi mathvariant=\"normal\"\u003e%\u003c/mi\u003e\u003cmo\u003e×\u003c/mo\u003e\u003cmi\u003eb\u003c/mi\u003e\u003cmtext\u003e  \u003c/mtext\u003e\u003cmo\u003e⟺\u003c/mo\u003e\u003cmtext\u003e  \u003c/mtext\u003e\u003cmi\u003eb\u003c/mi\u003e\u003cmo\u003e\u0026gt;\u003c/mo\u003e\u003cmfrac\u003e\u003cmn\u003e4250\u003c/mn\u003e\u003cmn\u003e0.9\u003c/mn\u003e\u003c/mfrac\u003e\u003cmo\u003e=\u003c/mo\u003e\u003cmn\u003e4722.\u003c/mn\u003e\u003cmover accent=\"true\"\u003e\u003cmn\u003e2\u003c/mn\u003e\u003cmo\u003eˉ\u003c/mo\u003e\u003c/mover\u003e\u003cmtext\u003e \u003c/mtext\u003e\u003cmi mathvariant=\"normal\"\u003e.\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e 4250 \u0026lt; 90\\%\\times b \\iff b \u0026gt; \\frac{4250}{0.9} = 4722.\\bar{2}\\ .\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e\u003cp\u003e\nThis inequality means that for initial (undiscounted) amounts of \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmn\u003e4722.22\u003c/mn\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e4722.22\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e or higher, adding \u003cem\u003eexactly\u003c/em\u003e enough to reach 5000 will give me \u003cem\u003emore stuff\u003c/em\u003e while \u003cem\u003ecosting less\u003c/em\u003e than the original.\u003c/p\u003e\n\u003cp\u003eGreat! But there\u0026rsquo;s a slight issue.\nProducts aren\u0026rsquo;t that flexible in price, so we may not be able to add something (or things) that cost exactly\n\u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003ex\u003c/mi\u003e\u003cmo\u003e=\u003c/mo\u003e\u003cmn\u003e5000\u003c/mn\u003e\u003cmo\u003e−\u003c/mo\u003e\u003cmi\u003eb\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003ex=5000-b\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e.\nIf I go too much over 5000, then I might cancel out the additional discount by increasing the total.\nLet\u0026rsquo;s modify the previous calculation by putting that value in instead of 4250.\nAssume \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003eb\u003c/mi\u003e\u003cmo\u003e+\u003c/mo\u003e\u003cmi\u003ex\u003c/mi\u003e\u003cmo\u003e\u0026gt;\u003c/mo\u003e\u003cmn\u003e5000\u003c/mn\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003eb+x \u0026gt; 5000\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e.\n\u003c/p\u003e\n\u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\" display=\"block\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmn\u003e85\u003c/mn\u003e\u003cmi mathvariant=\"normal\"\u003e%\u003c/mi\u003e\u003cmo\u003e×\u003c/mo\u003e\u003cmo stretchy=\"false\"\u003e(\u003c/mo\u003e\u003cmi\u003eb\u003c/mi\u003e\u003cmo\u003e+\u003c/mo\u003e\u003cmi\u003ex\u003c/mi\u003e\u003cmo stretchy=\"false\"\u003e)\u003c/mo\u003e\u003cmo\u003e\u0026lt;\u003c/mo\u003e\u003cmn\u003e90\u003c/mn\u003e\u003cmi mathvariant=\"normal\"\u003e%\u003c/mi\u003e\u003cmo\u003e×\u003c/mo\u003e\u003cmi\u003eb\u003c/mi\u003e\u003cmtext\u003e  \u003c/mtext\u003e\u003cmo\u003e⟺\u003c/mo\u003e\u003cmtext\u003e  \u003c/mtext\u003e\u003cmn\u003e85\u003c/mn\u003e\u003cmi mathvariant=\"normal\"\u003e%\u003c/mi\u003e\u003cmo\u003e×\u003c/mo\u003e\u003cmi\u003ex\u003c/mi\u003e\u003cmo\u003e\u0026lt;\u003c/mo\u003e\u003cmn\u003e5\u003c/mn\u003e\u003cmi mathvariant=\"normal\"\u003e%\u003c/mi\u003e\u003cmo\u003e×\u003c/mo\u003e\u003cmi\u003eb\u003c/mi\u003e\u003cmtext\u003e  \u003c/mtext\u003e\u003cmo\u003e⟺\u003c/mo\u003e\u003cmtext\u003e  \u003c/mtext\u003e\u003cmi\u003ex\u003c/mi\u003e\u003cmo\u003e\u0026lt;\u003c/mo\u003e\u003cmfrac\u003e\u003cmi\u003eb\u003c/mi\u003e\u003cmn\u003e17\u003c/mn\u003e\u003c/mfrac\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e 85\\% \\times (b+x) \u0026lt; 90\\% \\times b \\iff 85\\%\\times x \u0026lt; 5\\% \\times b \\iff x \u0026lt; \\frac b{17}\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e\u003cp\u003e\nAn upper bound for \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003ex\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003ex\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e. But our assumption puts in a lower bound for \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003ex\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003ex\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e too:\n\u003c/p\u003e\n\u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\" display=\"block\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmn\u003e5000\u003c/mn\u003e\u003cmo\u003e−\u003c/mo\u003e\u003cmi\u003eb\u003c/mi\u003e\u003cmo\u003e\u0026lt;\u003c/mo\u003e\u003cmi\u003ex\u003c/mi\u003e\u003cmo\u003e\u0026lt;\u003c/mo\u003e\u003cmfrac\u003e\u003cmi\u003eb\u003c/mi\u003e\u003cmn\u003e17\u003c/mn\u003e\u003c/mfrac\u003e\u003cmi mathvariant=\"normal\"\u003e.\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e 5000 - b \u0026lt; x \u0026lt; \\frac{b}{17}.\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e\u003cp\u003e\nThis makes sense: \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003ex\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003ex\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e needs to be large enough to get to \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmn\u003e5000\u003c/mn\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e5000\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e, but not so much it cancels out the excess discount.\u003c/p\u003e\n\u003cp\u003eGreat! But there\u0026rsquo;s a slight issue.\nNot all discounts are exactly 10% below 5000 and 15% above.\nHow do I decide next time when there\u0026rsquo;s something else I want and the store is throwing a similar puzzle at me?\nLet\u0026rsquo;s generalise more!\nLet \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmsub\u003e\u003cmi\u003er\u003c/mi\u003e\u003cmn\u003e1\u003c/mn\u003e\u003c/msub\u003e\u003cmo\u003e\u0026lt;\u003c/mo\u003e\u003cmsub\u003e\u003cmi\u003er\u003c/mi\u003e\u003cmn\u003e2\u003c/mn\u003e\u003c/msub\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003er_1 \u0026lt; r_2\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e be the discount rates, \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003et\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003et\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e be the threshold between them.\nRepeating the previous calculations:\u003c/p\u003e\n\u003cp\u003eWe assume \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003eb\u003c/mi\u003e\u003cmo\u003e≤\u003c/mo\u003e\u003cmi\u003et\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003eb \\le t\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e and \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003eb\u003c/mi\u003e\u003cmo\u003e+\u003c/mo\u003e\u003cmi\u003ex\u003c/mi\u003e\u003cmo\u003e\u0026gt;\u003c/mo\u003e\u003cmi\u003et\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003eb+x \u0026gt; t\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e.\nThe \u003cem\u003esaving money condition\u003c/em\u003e is \u003c/p\u003e\n\u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\" display=\"block\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmo stretchy=\"false\"\u003e(\u003c/mo\u003e\u003cmn\u003e1\u003c/mn\u003e\u003cmo\u003e−\u003c/mo\u003e\u003cmsub\u003e\u003cmi\u003er\u003c/mi\u003e\u003cmn\u003e1\u003c/mn\u003e\u003c/msub\u003e\u003cmo stretchy=\"false\"\u003e)\u003c/mo\u003e\u003cmi\u003eb\u003c/mi\u003e\u003cmo\u003e\u0026gt;\u003c/mo\u003e\u003cmo stretchy=\"false\"\u003e(\u003c/mo\u003e\u003cmn\u003e1\u003c/mn\u003e\u003cmo\u003e−\u003c/mo\u003e\u003cmsub\u003e\u003cmi\u003er\u003c/mi\u003e\u003cmn\u003e2\u003c/mn\u003e\u003c/msub\u003e\u003cmo stretchy=\"false\"\u003e)\u003c/mo\u003e\u003cmo stretchy=\"false\"\u003e(\u003c/mo\u003e\u003cmi\u003eb\u003c/mi\u003e\u003cmo\u003e+\u003c/mo\u003e\u003cmi\u003ex\u003c/mi\u003e\u003cmo stretchy=\"false\"\u003e)\u003c/mo\u003e\u003cmtext\u003e  \u003c/mtext\u003e\u003cmo\u003e⟺\u003c/mo\u003e\u003cmtext\u003e  \u003c/mtext\u003e\u003cmo stretchy=\"false\"\u003e(\u003c/mo\u003e\u003cmsub\u003e\u003cmi\u003er\u003c/mi\u003e\u003cmn\u003e2\u003c/mn\u003e\u003c/msub\u003e\u003cmo\u003e−\u003c/mo\u003e\u003cmsub\u003e\u003cmi\u003er\u003c/mi\u003e\u003cmn\u003e1\u003c/mn\u003e\u003c/msub\u003e\u003cmo stretchy=\"false\"\u003e)\u003c/mo\u003e\u003cmi\u003eb\u003c/mi\u003e\u003cmo\u003e\u0026gt;\u003c/mo\u003e\u003cmo stretchy=\"false\"\u003e(\u003c/mo\u003e\u003cmn\u003e1\u003c/mn\u003e\u003cmo\u003e−\u003c/mo\u003e\u003cmsub\u003e\u003cmi\u003er\u003c/mi\u003e\u003cmn\u003e2\u003c/mn\u003e\u003c/msub\u003e\u003cmo stretchy=\"false\"\u003e)\u003c/mo\u003e\u003cmi\u003ex\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e(1-r_1)b \u0026gt; (1-r_2)(b+x) \\iff (r_2-r_1) b \u0026gt; (1-r_2)x\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e\u003cp\u003e\n\u003c/p\u003e\n\u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\" display=\"block\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmtext\u003e  \u003c/mtext\u003e\u003cmo\u003e⟺\u003c/mo\u003e\u003cmtext\u003e  \u003c/mtext\u003e\u003cmi\u003ex\u003c/mi\u003e\u003cmo\u003e\u0026lt;\u003c/mo\u003e\u003cmi\u003eb\u003c/mi\u003e\u003cmo\u003e×\u003c/mo\u003e\u003cmfrac\u003e\u003cmrow\u003e\u003cmsub\u003e\u003cmi\u003er\u003c/mi\u003e\u003cmn\u003e2\u003c/mn\u003e\u003c/msub\u003e\u003cmo\u003e−\u003c/mo\u003e\u003cmsub\u003e\u003cmi\u003er\u003c/mi\u003e\u003cmn\u003e1\u003c/mn\u003e\u003c/msub\u003e\u003c/mrow\u003e\u003cmrow\u003e\u003cmn\u003e1\u003c/mn\u003e\u003cmo\u003e−\u003c/mo\u003e\u003cmsub\u003e\u003cmi\u003er\u003c/mi\u003e\u003cmn\u003e2\u003c/mn\u003e\u003c/msub\u003e\u003c/mrow\u003e\u003c/mfrac\u003e\u003cmi mathvariant=\"normal\"\u003e.\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e \\iff x \u0026lt; b\\times\\frac{r_2-r_1}{1-r_2}.\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e\u003cp\u003e\nPerhaps the earlier form was better \u003c/p\u003e\n\u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\" display=\"block\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmo stretchy=\"false\"\u003e(\u003c/mo\u003e\u003cmsub\u003e\u003cmi\u003er\u003c/mi\u003e\u003cmn\u003e2\u003c/mn\u003e\u003c/msub\u003e\u003cmo\u003e−\u003c/mo\u003e\u003cmsub\u003e\u003cmi\u003er\u003c/mi\u003e\u003cmn\u003e1\u003c/mn\u003e\u003c/msub\u003e\u003cmo stretchy=\"false\"\u003e)\u003c/mo\u003e\u003cmi\u003eb\u003c/mi\u003e\u003cmo\u003e\u0026gt;\u003c/mo\u003e\u003cmo stretchy=\"false\"\u003e(\u003c/mo\u003e\u003cmn\u003e1\u003c/mn\u003e\u003cmo\u003e−\u003c/mo\u003e\u003cmsub\u003e\u003cmi\u003er\u003c/mi\u003e\u003cmn\u003e2\u003c/mn\u003e\u003c/msub\u003e\u003cmo stretchy=\"false\"\u003e)\u003c/mo\u003e\u003cmi\u003ex\u003c/mi\u003e\u003cmi mathvariant=\"normal\"\u003e.\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e(r_2-r_1)b \u0026gt; (1-r_2)x.\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e\u003cp\u003e\n\u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmo stretchy=\"false\"\u003e(\u003c/mo\u003e\u003cmsub\u003e\u003cmi\u003er\u003c/mi\u003e\u003cmn\u003e2\u003c/mn\u003e\u003c/msub\u003e\u003cmo\u003e−\u003c/mo\u003e\u003cmsub\u003e\u003cmi\u003er\u003c/mi\u003e\u003cmn\u003e1\u003c/mn\u003e\u003c/msub\u003e\u003cmo stretchy=\"false\"\u003e)\u003c/mo\u003e\u003cmi\u003eb\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e(r_2-r_1)b\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e is the extra savings on the original amount by getting the higher discount rate.\nThat should be more than the amount we end up paying for the extra discount which is \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmo stretchy=\"false\"\u003e(\u003c/mo\u003e\u003cmn\u003e1\u003c/mn\u003e\u003cmo\u003e−\u003c/mo\u003e\u003cmsub\u003e\u003cmi\u003er\u003c/mi\u003e\u003cmn\u003e2\u003c/mn\u003e\u003c/msub\u003e\u003cmo stretchy=\"false\"\u003e)\u003c/mo\u003e\u003cmi\u003ex\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e(1-r_2)x\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e!\nI find it beautiful that all we did was start with a condition we want and then manipulate\nit to get a different but equivalent condition.\nThis new condition somehow says more than the original.\nSeems so obvious now but somehow it wasn\u0026rsquo;t so obvious in the beginning \u0026ndash; at least to me.\u003c/p\u003e\n\u003cp\u003eJust for completeness, the full condition becomes\n\u003c/p\u003e\n\u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\" display=\"block\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003et\u003c/mi\u003e\u003cmo\u003e−\u003c/mo\u003e\u003cmi\u003eb\u003c/mi\u003e\u003cmo\u003e\u0026lt;\u003c/mo\u003e\u003cmi\u003ex\u003c/mi\u003e\u003cmo\u003e\u0026lt;\u003c/mo\u003e\u003cmi\u003eb\u003c/mi\u003e\u003cmo\u003e×\u003c/mo\u003e\u003cmfrac\u003e\u003cmrow\u003e\u003cmsub\u003e\u003cmi\u003er\u003c/mi\u003e\u003cmn\u003e2\u003c/mn\u003e\u003c/msub\u003e\u003cmo\u003e−\u003c/mo\u003e\u003cmsub\u003e\u003cmi\u003er\u003c/mi\u003e\u003cmn\u003e1\u003c/mn\u003e\u003c/msub\u003e\u003c/mrow\u003e\u003cmrow\u003e\u003cmn\u003e1\u003c/mn\u003e\u003cmo\u003e−\u003c/mo\u003e\u003cmsub\u003e\u003cmi\u003er\u003c/mi\u003e\u003cmn\u003e2\u003c/mn\u003e\u003c/msub\u003e\u003c/mrow\u003e\u003c/mfrac\u003e\u003cmtext\u003e  \u003c/mtext\u003e\u003cmo\u003e⟺\u003c/mo\u003e\u003cmtext\u003e  \u003c/mtext\u003e\u003cmi\u003et\u003c/mi\u003e\u003cmo\u003e\u0026lt;\u003c/mo\u003e\u003cmi\u003ex\u003c/mi\u003e\u003cmo\u003e+\u003c/mo\u003e\u003cmi\u003eb\u003c/mi\u003e\u003cmo\u003e\u0026lt;\u003c/mo\u003e\u003cmi\u003eb\u003c/mi\u003e\u003cmo\u003e×\u003c/mo\u003e\u003cmfrac\u003e\u003cmrow\u003e\u003cmn\u003e1\u003c/mn\u003e\u003cmo\u003e−\u003c/mo\u003e\u003cmsub\u003e\u003cmi\u003er\u003c/mi\u003e\u003cmn\u003e1\u003c/mn\u003e\u003c/msub\u003e\u003c/mrow\u003e\u003cmrow\u003e\u003cmn\u003e1\u003c/mn\u003e\u003cmo\u003e−\u003c/mo\u003e\u003cmsub\u003e\u003cmi\u003er\u003c/mi\u003e\u003cmn\u003e2\u003c/mn\u003e\u003c/msub\u003e\u003c/mrow\u003e\u003c/mfrac\u003e\u003cmi mathvariant=\"normal\"\u003e.\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e t-b \u0026lt; x \u0026lt; b \\times \\frac{r_2-r_1}{1-r_2}\\iff t \u0026lt; x + b \u0026lt; b\\times\\frac{1-r_1}{1-r_2}.\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e\u003ch3 id=\"flipping-sides\"\u003eFlipping sides\u003c/h3\u003e\n\u003cp\u003eWhat if I am a corporate salesperson and I don\u0026rsquo;t want the discounts\nto be such that people get more stuff and still for literally less money.\nCan I still have a tiered discount rate but make this impossible?\u003c/p\u003e\n\u003cp\u003ePutting this in terms of our earlier notation, we want \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmo stretchy=\"false\"\u003e(\u003c/mo\u003e\u003cmsub\u003e\u003cmi\u003er\u003c/mi\u003e\u003cmn\u003e2\u003c/mn\u003e\u003c/msub\u003e\u003cmo\u003e−\u003c/mo\u003e\u003cmsub\u003e\u003cmi\u003er\u003c/mi\u003e\u003cmn\u003e1\u003c/mn\u003e\u003c/msub\u003e\u003cmo stretchy=\"false\"\u003e)\u003c/mo\u003e\u003cmi\u003eb\u003c/mi\u003e\u003cmo\u003e≤\u003c/mo\u003e\u003cmo stretchy=\"false\"\u003e(\u003c/mo\u003e\u003cmn\u003e1\u003c/mn\u003e\u003cmo\u003e−\u003c/mo\u003e\u003cmsub\u003e\u003cmi\u003er\u003c/mi\u003e\u003cmn\u003e2\u003c/mn\u003e\u003c/msub\u003e\u003cmo stretchy=\"false\"\u003e)\u003c/mo\u003e\u003cmi\u003ex\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e(r_2-r_1) b \\le (1-r_2)x\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e for all \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003ex\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003ex\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e and all \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003eb\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003eb\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e \u003cem\u003esuch that\u003c/em\u003e \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003ex\u003c/mi\u003e\u003cmo\u003e+\u003c/mo\u003e\u003cmi\u003eb\u003c/mi\u003e\u003cmo\u003e\u0026gt;\u003c/mo\u003e\u003cmi\u003et\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003ex+b\u0026gt; t\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e.\nBut we have variables on both sides of this inequality (\u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003eb\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003eb\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e on the left, \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003ex\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003ex\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e on the right)\nand hence no matter what \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmsub\u003e\u003cmi\u003er\u003c/mi\u003e\u003cmn\u003e1\u003c/mn\u003e\u003c/msub\u003e\u003cmo separator=\"true\"\u003e,\u003c/mo\u003e\u003cmsub\u003e\u003cmi\u003er\u003c/mi\u003e\u003cmn\u003e2\u003c/mn\u003e\u003c/msub\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003er_1, r_2\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e are, we can make \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003ex\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003ex\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e really small, and \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003eb\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003eb\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e really large to be able to\nsatisfy this inequality.\nThis is assuming \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmn\u003e1\u003c/mn\u003e\u003cmo\u003e−\u003c/mo\u003e\u003cmsub\u003e\u003cmi\u003er\u003c/mi\u003e\u003cmn\u003e2\u003c/mn\u003e\u003c/msub\u003e\u003cmo\u003e\u0026gt;\u003c/mo\u003e\u003cmn\u003e0\u003c/mn\u003e\u003cmo separator=\"true\"\u003e,\u003c/mo\u003e\u003cmsub\u003e\u003cmi\u003er\u003c/mi\u003e\u003cmn\u003e2\u003c/mn\u003e\u003c/msub\u003e\u003cmo\u003e\u0026gt;\u003c/mo\u003e\u003cmsub\u003e\u003cmi\u003er\u003c/mi\u003e\u003cmn\u003e1\u003c/mn\u003e\u003c/msub\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e1-r_2 \u0026gt; 0, r_2 \u0026gt; r_1\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e.\nIf we make \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmsub\u003e\u003cmi\u003er\u003c/mi\u003e\u003cmn\u003e2\u003c/mn\u003e\u003c/msub\u003e\u003cmo\u003e\u0026lt;\u003c/mo\u003e\u003cmsub\u003e\u003cmi\u003er\u003c/mi\u003e\u003cmn\u003e1\u003c/mn\u003e\u003c/msub\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003er_2 \u0026lt; r_1\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e then the left side is always negative so this inequality always fails.\nBy the way, that\u0026rsquo;s one way to do what we want: reduce the discount offered for higher amounts spent.\nBut that\u0026rsquo;s ridiculous, right? As a salesperson we want to encourage more expenditure.\nThe next assumption to break is \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmsub\u003e\u003cmi\u003er\u003c/mi\u003e\u003cmn\u003e2\u003c/mn\u003e\u003c/msub\u003e\u003cmo\u003e\u0026gt;\u003c/mo\u003e\u003cmn\u003e1\u003c/mn\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003er_2 \u0026gt; 1\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e but that\u0026rsquo;s a discount rate of more than 100%. Paying customers for buying stuff will surely not help the profit margin.\u003c/p\u003e\n\u003cp\u003eWhat else could I do?\nRemember the last condition that was there \u003cem\u003ejust for completeness\u003c/em\u003e?\nWell, if that inequality exists, but no product (or combination of products) can actually cost enough to add up to a value between those two bounds (\u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003et\u003c/mi\u003e\u003cmo\u003e−\u003c/mo\u003e\u003cmi\u003eb\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003et-b\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e and \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003eb\u003c/mi\u003e\u003cmo\u003e×\u003c/mo\u003e\u003cmfrac\u003e\u003cmrow\u003e\u003cmsub\u003e\u003cmi\u003er\u003c/mi\u003e\u003cmn\u003e2\u003c/mn\u003e\u003c/msub\u003e\u003cmo\u003e−\u003c/mo\u003e\u003cmsub\u003e\u003cmi\u003er\u003c/mi\u003e\u003cmn\u003e1\u003c/mn\u003e\u003c/msub\u003e\u003c/mrow\u003e\u003cmrow\u003e\u003cmn\u003e1\u003c/mn\u003e\u003cmo\u003e−\u003c/mo\u003e\u003cmsub\u003e\u003cmi\u003er\u003c/mi\u003e\u003cmn\u003e2\u003c/mn\u003e\u003c/msub\u003e\u003c/mrow\u003e\u003c/mfrac\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003eb\\times \\frac{r_2-r_1}{1-r_2}\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e) then we can still\nadvertise a sensible tiered discount but ensure that \u003cem\u003eevery\u003c/em\u003e upsell actually makes the company more money\ninstead of less.\nThe most straightforward way to go about this would be to restrict the discount \u003cem\u003esuch that\u003c/em\u003e it applies only to products above a certain price point, or only for certain combinations.\u003c/p\u003e\n\u003cp\u003eLet me try to make an example.\nKeeping numbers simple: \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmsub\u003e\u003cmi\u003er\u003c/mi\u003e\u003cmn\u003e1\u003c/mn\u003e\u003c/msub\u003e\u003cmo\u003e=\u003c/mo\u003e\u003cmn\u003e0\u003c/mn\u003e\u003cmo separator=\"true\"\u003e,\u003c/mo\u003e\u003cmsub\u003e\u003cmi\u003er\u003c/mi\u003e\u003cmn\u003e2\u003c/mn\u003e\u003c/msub\u003e\u003cmo\u003e=\u003c/mo\u003e\u003cmn\u003e0.25\u003c/mn\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003er_1 = 0, r_2 = 0.25\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e.\nThis reduces the condition to \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmtext\u003e \u003c/mtext\u003e\u003cmi\u003et\u003c/mi\u003e\u003cmo\u003e−\u003c/mo\u003e\u003cmi\u003eb\u003c/mi\u003e\u003cmo\u003e\u0026lt;\u003c/mo\u003e\u003cmi\u003ex\u003c/mi\u003e\u003cmo\u003e\u0026lt;\u003c/mo\u003e\u003cmfrac\u003e\u003cmi\u003eb\u003c/mi\u003e\u003cmn\u003e3\u003c/mn\u003e\u003c/mfrac\u003e\u003cmi mathvariant=\"normal\"\u003e.\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e\\ t-b \u0026lt; x \u0026lt; \\frac{b}{3}.\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e\nSuppose all products cost 499 (or multiples of 499 like 999, 1499, etc.) but the threshold is \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003et\u003c/mi\u003e\u003cmo\u003e=\u003c/mo\u003e\u003cmn\u003e1000.\u003c/mn\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003et=1000.\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e\n\u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003eb\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003eb\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e can only be \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmn\u003e0\u003c/mn\u003e\u003cmo separator=\"true\"\u003e,\u003c/mo\u003e\u003cmn\u003e499\u003c/mn\u003e\u003cmo separator=\"true\"\u003e,\u003c/mo\u003e\u003cmn\u003e998\u003c/mn\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e0, 499, 998\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e or \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmn\u003e999\u003c/mn\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e999\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e before crossing the threshold.\nSo \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003eb\u003c/mi\u003e\u003cmi mathvariant=\"normal\"\u003e/\u003c/mi\u003e\u003cmn\u003e3\u003c/mn\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003eb/3\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e can be \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmn\u003e0\u003c/mn\u003e\u003cmo separator=\"true\"\u003e,\u003c/mo\u003e\u003cmtext\u003e \u003c/mtext\u003e\u003cmn\u003e166\u003c/mn\u003e\u003cmo separator=\"true\"\u003e,\u003c/mo\u003e\u003cmtext\u003e \u003c/mtext\u003e\u003cmn\u003e333\u003c/mn\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e0, ~166, ~333\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e.\nNone of these are above the minimum \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmn\u003e499\u003c/mn\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e499\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e, so \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003ex\u003c/mi\u003e\u003cmo\u003e\u0026lt;\u003c/mo\u003e\u003cmi\u003eb\u003c/mi\u003e\u003cmi mathvariant=\"normal\"\u003e/\u003c/mi\u003e\u003cmn\u003e3\u003c/mn\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003ex\u0026lt; b/3 \u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e is impossible!\nThe only way to cross the threshold is to buy three things worth \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmn\u003e499\u003c/mn\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e499\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e each, but then the 25% discount cuts  down the price by 1/4, not 1/3.\nThat verifies the example!\u003c/p\u003e\n"
    }, {
      "id": "https://aadi.ink/posts/2024/11/lessons-from-applying-phd-positions/",
      "url": "https://aadi.ink/posts/2024/11/lessons-from-applying-phd-positions/",
      "title": "Lessons from applying for PhD positions",
      "date_published": "2024-11-24T00:00:00Z",
      "content_html": "\u003c!--\n\u003cfigure\u003e\n\t\u003cimg src='' alt=\"\" class=\"figure dynamic-bg\" \n\twidth=\"80%\" \n\talt=\"\" \n\ttitle=\"\" \n\tclass=\"dynamic-background figure\"\u003e \n\t\u003cdiv class=\"caption-figure\"\u003e\u003c/div\u003e\n\u003c/figure\u003e\n--\u003e\n\u003cp\u003eI applied to a number of universities in the US and a couple in Europe, apart from emailing professors that I was interested in working with.\nHere are some lessons I learned that I would pass on as advice to my past self:\u003c/p\u003e\n\u003col\u003e\n\u003cli\u003e\n\u003ch3 id=\"practise-writing-down-thoughts-ideas-and-reasoning\"\u003e\u003cstrong\u003ePractise writing down thoughts, ideas, and reasoning\u003c/strong\u003e\u003c/h3\u003e\n\u003cp\u003eMost, if not all, applications need you to express yourself through words \u0026ndash; big things like the \u003cem\u003estatement of purpose\u003c/em\u003e or a \u003cem\u003ediversity statement\u003c/em\u003e to small things like cold emails and scheduling interviews.\nThis makes it extremely important to have a good grasp of words so that you are able to put down what you think instead of trying to fit thoughts into the words you already have.\nI wish I had more practice so that the first couple of applications did not become the effective warm-up for the rest.\nIt felt like I didn\u0026rsquo;t do justice to the initial ones, and I could feel the steep improvement I was making as I wrote more and more applications.\nSo get used to writing down what you think, what you feel, and why.\nYou need not have the perfect language, vocabulary, or grammar (there are people and software to help with that);\nyou just need to get used to making points and stringing them together across paragraphs so that your ideas, passion, motivation, and personality survive the long journey from your mind till the  reader\u0026rsquo;s.\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003ch3 id=\"don\"\u003e\u003cstrong\u003eDon\u0026rsquo;t be intimidated\u003c/strong\u003e\u003c/h3\u003e\n\u003cp\u003ePhD applications require a lot of interaction with strangers.\nDon\u0026rsquo;t be afraid to be yourself while doing so \u0026ndash; people are not so judgy, they just want a good student at the end of the day and they are usually not turned off by too many questions or clarifications.\nMake sure you are respectful, polite, and keep to deadlines and show up on time.\nOther than that, don\u0026rsquo;t be afraid to ask silly questions, don\u0026rsquo;t be afraid to ask whether you qualify even if you think you probably don\u0026rsquo;t, don\u0026rsquo;t be afraid to admit that you don\u0026rsquo;t know or haven\u0026rsquo;t thought about something.\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003ch3 id=\"introspect\"\u003e\u003cstrong\u003eIntrospect\u003c/strong\u003e\u003c/h3\u003e\n\u003cp\u003eThe application process showed me what a PhD is going to be like.\nBefore that, I was not sure that was the right choice.\nSo I encourage you to take the time to think about what \u003cem\u003eyou\u003c/em\u003e want, and how what you are doing will help you towards that goal.\nIf at any point during the process you think that what you are applying for or where you are applying to is not what you want, then wait and think.\nIs this your choice or someone else\u0026rsquo;s?\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003ch3 id=\"keep-track-of-your-and-your-recommender\"\u003e\u003cstrong\u003eKeep track of your and your recommender\u0026rsquo;s deadlines\u003c/strong\u003e\u003c/h3\u003e\n\u003cp\u003eThis is obvious, but still worth talking about.\nThere are lots of deadlines, and if you are like me, they get overwhelming unless I make a system.\nFor me that system was a spreadsheet.\nSo schedule reminders for yourself, and don\u0026rsquo;t be afraid to remind those who have agreed to write recommendations for you.\nOf course, there\u0026rsquo;s no need to nag them about it, but they have lots of commitments and it\u0026rsquo;s easy to forget so choose times appropriately and try to make their job as easy as possible (make a list of pending recommendations ordered by the deadlines, provide links, etc.)\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003ch3 id=\"talk-to-people\"\u003e\u003cstrong\u003eTalk to people\u003c/strong\u003e\u003c/h3\u003e\n\u003cp\u003eThis is similar to the point about not being intimidated.\nAsking actual students, professors, alumni, and anybody with information to share their advice, opinions, and experiences about whatever you feel doubtful or uninformed about is extremely valuable in knowing what to value, potential pitfalls, and department- or university- (or even professor-) specific details that will never be available outside of one-on-one conversations.\nMost people I got in touch with were ready to spend an hour or so to answer my questions, and never hesitated to share their thoughts.\nI assume the same will be true with most people, and having a bunch of unrelated people each give their opinion made blurry notions or hazy pictures so clear to me.\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003ch3 id=\"find-other-people-who-are-also-applying-for-positions\"\u003e\u003cstrong\u003eFind other people who are also applying for positions\u003c/strong\u003e\u003c/h3\u003e\n\u003cp\u003eThis is just a morale booster when sometimes the mood is low because of a certain application (maybe the website is too finicky, or the questions are complicated to answer, or the instructions are not clear).\nMore importantly, they also serve as a safety net \u0026ndash; people you can cross-reference deadlines with, share clarifications so that you don\u0026rsquo;t have to write the same email and wait a day or more for a response.\nThe application process is quite demanding because they force you to think about yourself, and that made me question myself all the time.\nSeeing other people going through the same helped.\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003ch3 id=\"the-people-matter-most\"\u003e\u003cstrong\u003eThe people matter most\u003c/strong\u003e\u003c/h3\u003e\n\u003cp\u003eThis is just my opinion (just like the rest of the points) that your PhD depends a lot on your guide.\nSo ensure that the people you are going to be working with and around are good, caring, and well-intentioned.\nOtherwise, one can end up in a position where the student is struggling on their own without anybody to show them the way.\nThis is more important for applying to European PhDs, since they usually require you to contact professors for particular project positions.\nThat said, it\u0026rsquo;s useful to find someone whose work you like and get in touch with them anyway \u0026ndash; university application or direct.\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003ch3 id=\"be-patient\"\u003e\u003cstrong\u003eBe patient\u003c/strong\u003e\u003c/h3\u003e\n\u003cp\u003eYou will be spending a lot of time (and money) with very little to show for it.\nAll of that builds up to the last round of applications until we either give up or accept an offer.\nThe journey teaches us about ourselves, the way we work, and forces us to think about our dreams, our ideals, our future.\nI don\u0026rsquo;t think I would have spent so much time doing that if I wasn\u0026rsquo;t forced to, and in hindsight, I appreciate the opportunity.\nSo I hope with patience you too will find something rewarding from the process even if it doesn\u0026rsquo;t stick to your expectations.\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003ch3 id=\"keep-emails-concise-and-to-the-point\"\u003e\u003cstrong\u003eKeep emails concise and to the point\u003c/strong\u003e\u003c/h3\u003e\n\u003cp\u003eProfessors receive tons of emails, so the fewer words you use, the easier it will be for them to understand what the email is about and whether they should spend time to read and reply.\nKeep the pleasantries short, there\u0026rsquo;s no need to say \u0026ldquo;Hope you are well\u0026rdquo; or the like.\nIf you are not sure whether your email sounds okay or not, ask someone around to read it.\nAsk direct questions, don\u0026rsquo;t use too many words, and be as clear as possible.\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003ch3 id=\"it\"\u003e\u003cstrong\u003eIt\u0026rsquo;s never too late\u003c/strong\u003e\u003c/h3\u003e\n\u003cp\u003ePositions keep opening up, and professors are always on the lookout for good students.\nEven if a particular professor has no positions to offer, if they find a good student, they make note of it.\nSo keep trying, keep reaching out, show them your motivation, your passion, your love for the subject, and they will not only see it, but try to help you out.\nI have seen this happen more than once.\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003ch3 id=\"start-early\"\u003e\u003cstrong\u003eStart early\u003c/strong\u003e\u003c/h3\u003e\n\u003cp\u003eThere is nothing to lose, but a lot of risks to mitigate by starting and hence finishing early.\nTo name a few:\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003eGo through the whole application at least one or two months before the deadline. There\u0026rsquo;s no reason to leave surprises till the end.\u003c/li\u003e\n\u003cli\u003eA sudden requirement for a document you don\u0026rsquo;t have on hand\u003c/li\u003e\n\u003cli\u003eAn optional question you choose to now answer\u003c/li\u003e\n\u003cli\u003eA new position comes up, with a deadline on or sooner as this one\u003c/li\u003e\n\u003cli\u003eStraightforward mistakes in reading or noting down dates\u003c/li\u003e\n\u003cli\u003eTechnical issues\u003c/li\u003e\n\u003cli\u003eA bad day/week\u003c/li\u003e\n\u003cli\u003eExtra lectures, homework, or other emergencies\u003c/li\u003e\n\u003cli\u003eRecommenders may need longer. It\u0026rsquo;s important to give them enough time, so that they don\u0026rsquo;t have to rush.\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/li\u003e\n\u003c/ol\u003e\n\u003cp\u003eHope this helps! Good luck!\u003c/p\u003e\n"
    }, {
      "id": "https://aadi.ink/posts/2023/11/spectral4hyp/",
      "url": "https://aadi.ink/posts/2023/11/spectral4hyp/",
      "title": "Spectral Methods for Hyperbolic Problems",
      "date_published": "2023-11-28T15:03:26+05:30",
      "content_html": "\u003ch2 id=\"introduction\"\u003eIntroduction\u003c/h2\u003e\n\u003ch3 id=\"what-are-spectral-and-pseudospectral-methods\"\u003eWhat are Spectral and Pseudospectral Methods?\u003c/h3\u003e\n\u003cp\u003eInstead of discretising the domain, we express functions in terms of a truncated expansion over a particular basis.\nThe choice of basis leads to advantages.\nFor example, the Fourier basis, \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmsub\u003e\u003cmi\u003eϕ\u003c/mi\u003e\u003cmi\u003en\u003c/mi\u003e\u003c/msub\u003e\u003cmo stretchy=\"false\"\u003e(\u003c/mo\u003e\u003cmi\u003ex\u003c/mi\u003e\u003cmo stretchy=\"false\"\u003e)\u003c/mo\u003e\u003cmo\u003e=\u003c/mo\u003e\u003cmi\u003eexp\u003c/mi\u003e\u003cmo\u003e⁡\u003c/mo\u003e\u003cmo stretchy=\"false\"\u003e(\u003c/mo\u003e\u003cmi\u003ei\u003c/mi\u003e\u003cmi\u003en\u003c/mi\u003e\u003cmi\u003eξ\u003c/mi\u003e\u003cmo stretchy=\"false\"\u003e)\u003c/mo\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e\\phi_n(x) = \\exp(in\\xi)\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e are eigenvectors of the differential operator.\nOther commonly chosen bases are Chebyshev polynmials and Legendre polynomials.\u003c/p\u003e\n\u003cp\u003eDomain discretisation approximates a function up to first, or at most polynomial.\nIn comparison, the spectral approximation of analytic functions as well as their derivatives converge exponentially.\u003c/p\u003e\n\u003cp\u003eSince multiplication in the spectral space is more expensive than the transform itself, \u003cem\u003epseudospectral methods\u003c/em\u003e perform multiplication in the original space.\u003c/p\u003e\n\u003ch3 id=\"what-are-hyperbolic-problems\"\u003eWhat are Hyperbolic Problems?\u003c/h3\u003e\n\u003cp\u003eEuler equations, shallow water equations, wave equations are some examples of hyperbolic systems of partial differential equations.\nUnlike parabolic/elliptic PDEs, which have inherent regularity, hyperbolic problems exhibit a finite speed of propogation and wave-like solutions.\nThese solutions tend to develop discontinuities even when the initial condition is smooth.\nIn the context of hyperbolic problems, discontinuities are often called \u003cem\u003eshocks\u003c/em\u003e.\u003c/p\u003e\n\u003cp\u003eThis report focuses on two simple, one-dimensional, hyperbolic problems to test the methods on:\u003c/p\u003e\n\u003ctable\u003e\n  \u003cthead\u003e\n      \u003ctr\u003e\n          \u003cth\u003e\u003c/th\u003e\n          \u003cth\u003eLinear Advection Equation\u003c/th\u003e\n          \u003cth\u003eInviscid Burgers\u0026rsquo; Equation\u003c/th\u003e\n      \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctbody\u003e\n      \u003ctr\u003e\n          \u003ctd\u003ePDE\u003c/td\u003e\n          \u003ctd\u003e\u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmsub\u003e\u003cmi mathvariant=\"normal\"\u003e∂\u003c/mi\u003e\u003cmi\u003et\u003c/mi\u003e\u003c/msub\u003e\u003cmi\u003eu\u003c/mi\u003e\u003cmo\u003e+\u003c/mo\u003e\u003cmn\u003e2\u003c/mn\u003e\u003cmi\u003eπ\u003c/mi\u003e\u003cmsub\u003e\u003cmi\u003eu\u003c/mi\u003e\u003cmi\u003ex\u003c/mi\u003e\u003c/msub\u003e\u003cmo\u003e=\u003c/mo\u003e\u003cmn\u003e0\u003c/mn\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e\\partial_t u + 2\\pi u_x = 0\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e\u003c/td\u003e\n          \u003ctd\u003e\u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmsub\u003e\u003cmi mathvariant=\"normal\"\u003e∂\u003c/mi\u003e\u003cmi\u003et\u003c/mi\u003e\u003c/msub\u003e\u003cmi\u003eu\u003c/mi\u003e\u003cmo\u003e+\u003c/mo\u003e\u003cmsub\u003e\u003cmrow\u003e\u003cmo fence=\"true\"\u003e(\u003c/mo\u003e\u003cmfrac\u003e\u003cmsup\u003e\u003cmi\u003eu\u003c/mi\u003e\u003cmn\u003e2\u003c/mn\u003e\u003c/msup\u003e\u003cmn\u003e2\u003c/mn\u003e\u003c/mfrac\u003e\u003cmo fence=\"true\"\u003e)\u003c/mo\u003e\u003c/mrow\u003e\u003cmi\u003ex\u003c/mi\u003e\u003c/msub\u003e\u003cmo\u003e=\u003c/mo\u003e\u003cmn\u003e0\u003c/mn\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e\\partial_t u + \\left(\\frac{u^2}2\\right)_x = 0\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e\u003c/td\u003e\n      \u003c/tr\u003e\n      \u003ctr\u003e\n          \u003ctd\u003e\u003c/td\u003e\n          \u003ctd\u003eLinear\u003c/td\u003e\n          \u003ctd\u003eQuasilinear\u003c/td\u003e\n      \u003c/tr\u003e\n      \u003ctr\u003e\n          \u003ctd\u003eRegularity\u003c/td\u003e\n          \u003ctd\u003ePreserves regularity\u003c/td\u003e\n          \u003ctd\u003eLoses regularity\u003c/td\u003e\n      \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\u003cp\u003eBoth are defined on the domain \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmo stretchy=\"false\"\u003e[\u003c/mo\u003e\u003cmn\u003e0\u003c/mn\u003e\u003cmo separator=\"true\"\u003e,\u003c/mo\u003e\u003cmn\u003e2\u003c/mn\u003e\u003cmi\u003eπ\u003c/mi\u003e\u003cmo stretchy=\"false\"\u003e]\u003c/mo\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e[0,2\\pi]\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e and assumed to have periodic boundary conditions.\u003c/p\u003e\n\u003cp\u003eThe solution to the linear advection equation is a simple translation of the\ninitial condition in the positive \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003ex\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003ex\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e direction.\nThus the solution at \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003et\u003c/mi\u003e\u003cmo\u003e=\u003c/mo\u003e\u003cmn\u003e1\u003c/mn\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003et=1\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e matches perfectly with the initial condition.\u003c/p\u003e\n\u003cp\u003eBurgers\u0026rsquo; equation, on the other hand, has a complicated solution.\nOne can think of particles at \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003ex\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003ex\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e travelling with the speed of \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003eu\u003c/mi\u003e\u003cmo stretchy=\"false\"\u003e(\u003c/mo\u003e\u003cmi\u003ex\u003c/mi\u003e\u003cmo stretchy=\"false\"\u003e)\u003c/mo\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003eu(x)\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e\ntoward the positive \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003ex\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003ex\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e direction.\u003c/p\u003e\n\u003ch3 id=\"implementation\"\u003eImplementation\u003c/h3\u003e\n\u003cp\u003eThe code implementing the techniques and generating the plots is available\nat \u003ca href=\"https://github.com/aadi-bh/spectral4hyp\"\u003e\u003ccode\u003egithub.com/aadi-bh/spectral4hyp\u003c/code\u003e\u003c/a\u003e.\nIt uses the Fourier pseudospectral method with RK4 time stepping and dealiasing to solve both these PDES.\u003c/p\u003e\n\u003cp\u003eExact solutions are computed using a Lax-Friedrichs scheme on a fine mesh.\u003c/p\u003e\n\u003ch3 id=\"a-note-about-plots\"\u003eA Note About Plots\u003c/h3\u003e\n\u003cp\u003eUnless specified, every plot shows the initial condition, computed/processed solution, and exact solution on the left,\nwith the pointwise error on the right.\u003c/p\u003e\n\u003ch3 id=\"aliasing-errors\"\u003eAliasing Errors\u003c/h3\u003e\n\u003cp\u003eWhen sampling a function at only finitely many points, our coefficients are bound to\nsuffer from aliasing errors.\n\n\u003cfigure \u003e\n  \n  \n        \u003ch4\u003eAliasing\u003c/h4\u003e\n      \u003ca href=https://aadi-bh.github.io/spectral4hyp/plots/aliasing.svg class=\"imglink\"\u003e\n    \u003cimg src=\"https://aadi-bh.github.io/spectral4hyp/plots/aliasing.svg\" alt=\"Both these modes agree at the sample points, so there is no way to distinguish between them.\" /\u003e\n    \u003c/a\u003e\n    \n    \n      \u003cfigcaption\u003e\n        \u003cp\u003e\n        Both these modes agree at the sample points, so there is no way to distinguish between them.\n        \n          \n        \n        \u003c/p\u003e \n      \u003c/figcaption\u003e\n  \n\u003c/figure\u003e\n\n\nThus the higher coefficients get added to the lower ones:\n\\[\n\\tilde c_n \\tilde u_n = \\hat u_n + \\sum_{m=-\\infty;\\ m\\neq 0}^{m=\\infty} \\hat u_{n+2Nm}(x)\n\\]\nwhere \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmsub\u003e\u003cmover accent=\"true\"\u003e\u003cmi\u003eu\u003c/mi\u003e\u003cmo\u003e^\u003c/mo\u003e\u003c/mover\u003e\u003cmi\u003en\u003c/mi\u003e\u003c/msub\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e\\hat u_n\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e are the continuous Fourier coefficients while \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmsub\u003e\u003cmover accent=\"true\"\u003e\u003cmi\u003eu\u003c/mi\u003e\u003cmo\u003e~\u003c/mo\u003e\u003c/mover\u003e\u003cmi\u003en\u003c/mi\u003e\u003c/msub\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e\\tilde u_n\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e are the discrete ones.\u003c/p\u003e\n\u003cp\u003eThese aliasing errors and their nonlinear mixing contributes to error.\u003c/p\u003e\n\u003ch3 id=\"gibbs-phenomenon\"\u003eGibbs Phenomenon\u003c/h3\u003e\n\u003cp\u003eSuppose \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmsub\u003e\u003cmi\u003eu\u003c/mi\u003e\u003cmi\u003eN\u003c/mi\u003e\u003c/msub\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003eu_N\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e is the truncated Fourier expansion of \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003eu\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003eu\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e. Then\n\\[\n||u - u_N ||_{L^2[0, 2\\pi]} =\n2\\pi\\sum_{{|n|\u0026gt; N}} |\\hat u_n|^2 .\n\\]\nThus it\u0026rsquo;s clear that the rate of convergence in \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmsup\u003e\u003cmi\u003eL\u003c/mi\u003e\u003cmn\u003e2\u003c/mn\u003e\u003c/msup\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003eL^2\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e is dependent on the decay of the Fourier coefficients.\u003c/p\u003e\n\u003chr\u003e\n\u003cp\u003e       \n\u003cp title=\"Theorem\" class=\"theorem\"\u003e\u003c/p\u003e\n If \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003eu\u003c/mi\u003e\u003cmo\u003e∈\u003c/mo\u003e\u003cmsup\u003e\u003cmi\u003eC\u003c/mi\u003e\u003cmrow\u003e\u003cmi\u003eq\u003c/mi\u003e\u003cmo\u003e−\u003c/mo\u003e\u003cmn\u003e1\u003c/mn\u003e\u003c/mrow\u003e\u003c/msup\u003e\u003cmo stretchy=\"false\"\u003e[\u003c/mo\u003e\u003cmn\u003e0\u003c/mn\u003e\u003cmo separator=\"true\"\u003e,\u003c/mo\u003e\u003cmn\u003e2\u003c/mn\u003e\u003cmi\u003eπ\u003c/mi\u003e\u003cmo stretchy=\"false\"\u003e]\u003c/mo\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003eu\\in C^{q-1}[0, 2\\pi]\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e and \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmsup\u003e\u003cmi\u003eu\u003c/mi\u003e\u003cmrow\u003e\u003cmo stretchy=\"false\"\u003e(\u003c/mo\u003e\u003cmi\u003eq\u003c/mi\u003e\u003cmo stretchy=\"false\"\u003e)\u003c/mo\u003e\u003c/mrow\u003e\u003c/msup\u003e\u003cmo\u003e∈\u003c/mo\u003e\u003cmsup\u003e\u003cmi\u003eL\u003c/mi\u003e\u003cmn\u003e2\u003c/mn\u003e\u003c/msup\u003e\u003cmo stretchy=\"false\"\u003e[\u003c/mo\u003e\u003cmn\u003e0\u003c/mn\u003e\u003cmo separator=\"true\"\u003e,\u003c/mo\u003e\u003cmn\u003e2\u003c/mn\u003e\u003cmi\u003eπ\u003c/mi\u003e\u003cmo stretchy=\"false\"\u003e]\u003c/mo\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003eu^{(q)}\\in L^2[0, 2\\pi]\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e with the first \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003eq\u003c/mi\u003e\u003cmo\u003e−\u003c/mo\u003e\u003cmn\u003e1\u003c/mn\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003eq-1\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e derivatives periodic, then \\[\n||u - u_N ||_{L^2[0, 2\\pi]} \\le C(q)N^{-q}| u^{(q)}|_{L^2[0, 2\\pi]}\n\\sim C\\frac{q!}{N^q}||u||_{L^2[0,2\\pi]}\n\\sim Ce^{-cN}||u||_{L^2[0,2\\pi]}.\n\\]\nThus the Fourier expansion converges exponentially fast to smooth functions.\u003c/p\u003e\n\u003chr\u003e\n\u003cp\u003eIf \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003eu\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003eu\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e is only piecewise smooth, then\n\\[\nu_N\\left(x_0 + \\frac{2z}{2N+1}\\right) \\sim \\frac12[u(x_0^+) + u(x_0^-)]) + \\frac{1}{\\pi}[u(x_0^+) - u(x_0^-)]\\textrm{Si}(z)\n\\]\ntells us that there is only \u003cstrong\u003elinear pointwise convergence at points away from\nthe discontinuity\u003c/strong\u003e.\u003cbr\u003e\n\u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmtext\u003eSi\u003c/mtext\u003e\u003cmo stretchy=\"false\"\u003e(\u003c/mo\u003e\u003cmi\u003ez\u003c/mi\u003e\u003cmo stretchy=\"false\"\u003e)\u003c/mo\u003e\u003cmo\u003e→\u003c/mo\u003e\u003cmfrac\u003e\u003cmi\u003eπ\u003c/mi\u003e\u003cmn\u003e2\u003c/mn\u003e\u003c/mfrac\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e\\textrm{Si}(z)\\to \\frac\\pi 2\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e as \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003ez\u003c/mi\u003e\u003cmo\u003e→\u003c/mo\u003e\u003cmi mathvariant=\"normal\"\u003e∞\u003c/mi\u003e\u003cmtext\u003e  \u003c/mtext\u003e\u003cmo\u003e⟹\u003c/mo\u003e\u003cmtext\u003e  \u003c/mtext\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003ez\\to\\infty\\implies\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e\na complete \u003cstrong\u003eloss of convergence as \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi mathvariant=\"bold-italic\"\u003ex\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e\\bm x\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e  approaches the discontinuity.\u003c/strong\u003e\u003c/p\u003e\n\n\u003cfigure \u003e\n  \n  \n        \u003ch4\u003eSmooth case\u003c/h4\u003e\n      \u003ca href=https://aadi-bh.github.io/spectral4hyp/plots/linadv-0-bump-no_filter-gFalse.svg class=\"imglink\"\u003e\n    \u003cimg src=\"https://aadi-bh.github.io/spectral4hyp/plots/linadv-0-bump-no_filter-gFalse.svg\" alt=\"The convergence is exponential!\" /\u003e\n    \u003c/a\u003e\n    \n    \n      \u003cfigcaption\u003e\n        \u003cp\u003e\n        The convergence is exponential!\n        \n          \n        \n        \u003c/p\u003e \n      \u003c/figcaption\u003e\n  \n\u003c/figure\u003e\n\n\n\n\u003cfigure \u003e\n  \n  \n        \u003ch4\u003eContinuous case\u003c/h4\u003e\n      \u003ca href=https://aadi-bh.github.io/spectral4hyp/plots/linadv-0-triangle-no_filter-gFalse.svg class=\"imglink\"\u003e\n    \u003cimg src=\"https://aadi-bh.github.io/spectral4hyp/plots/linadv-0-triangle-no_filter-gFalse.svg\" alt=\"Polynomial convergence.\" /\u003e\n    \u003c/a\u003e\n    \n    \n      \u003cfigcaption\u003e\n        \u003cp\u003e\n        Polynomial convergence.\n        \n          \n        \n        \u003c/p\u003e \n      \u003c/figcaption\u003e\n  \n\u003c/figure\u003e\n\n\n\u003cp\u003e\n\u003cfigure \u003e\n  \n  \n        \u003ch4\u003eDiscontinuous case\u003c/h4\u003e\n      \u003ca href=https://aadi-bh.github.io/spectral4hyp/plots/linadv-0-saw_tooth-no_filter-gFalse.svg class=\"imglink\"\u003e\n    \u003cimg src=\"https://aadi-bh.github.io/spectral4hyp/plots/linadv-0-saw_tooth-no_filter-gFalse.svg\" alt=\"No/extremely slow convergence near the discontinuity.\" /\u003e\n    \u003c/a\u003e\n    \n    \n      \u003cfigcaption\u003e\n        \u003cp\u003e\n        No/extremely slow convergence near the discontinuity.\n        \n          \n        \n        \u003c/p\u003e \n      \u003c/figcaption\u003e\n  \n\u003c/figure\u003e\n\n\nThis global breakdown of convergence is known as the Gibbs phenomenon.\u003c/p\u003e\n\u003ch3 id=\"implications-of-the-gibbs-phenomenon\"\u003eImplications of the Gibbs Phenomenon\u003c/h3\u003e\n\u003cp\u003eThe lack of regularity/dissipation in hyperbolic problems makes tbe formation of discontinuities inevitable.\nSuch discontinuities are not captured well by spectral/pseudospectral methods.\nThis is a source of concern, and hence these methods have traditionally not been applied to such problems.\u003c/p\u003e\n\u003cblockquote\u003e\n\u003cp\u003e\u0026ldquo;With the situation being even more complex and the details partially\nunresolved for the discrete expansions, the Gibbs phenomenon and the loss\nof fast global convergence is often perceived as an argument against\nthe use of spectral expansions for the representation of piecewise smooth\nfunctions and, ultimately, \u003cstrong\u003eagainst the use of spectral methods for the\nsolution of problems with discontinuous solutions.\u003c/strong\u003e\u0026rdquo;\u003c/p\u003e\n\u003c/blockquote\u003e\n\u003ch2 id=\"filters\"\u003eFilters\u003c/h2\u003e\n\u003cp\u003eOscillations are an indication of high-order modes.\nThe Gibbs oscillations can be seen to be the cause of\nthe slow decay of the Fourier coefficients, leading to slow convergence.\nFilters essentially force better convergence by reducing the amplitude\nof high-order modes.\u003c/p\u003e\n\u003chr\u003e\n\u003cp\u003e       \n\u003cp title=\"Definition\" class=\"theorem\"\u003e\u003c/p\u003e\n A filter of order \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003eq\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003eq\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e is a real and even function \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003eσ\u003c/mi\u003e\u003cmo stretchy=\"false\"\u003e(\u003c/mo\u003e\u003cmi\u003eη\u003c/mi\u003e\u003cmo stretchy=\"false\"\u003e)\u003c/mo\u003e\u003cmo\u003e∈\u003c/mo\u003e\u003cmsup\u003e\u003cmi\u003eC\u003c/mi\u003e\u003cmrow\u003e\u003cmi\u003eq\u003c/mi\u003e\u003cmo\u003e−\u003c/mo\u003e\u003cmn\u003e1\u003c/mn\u003e\u003c/mrow\u003e\u003c/msup\u003e\u003cmo stretchy=\"false\"\u003e[\u003c/mo\u003e\u003cmo\u003e−\u003c/mo\u003e\u003cmi mathvariant=\"normal\"\u003e∞\u003c/mi\u003e\u003cmo separator=\"true\"\u003e,\u003c/mo\u003e\u003cmi mathvariant=\"normal\"\u003e∞\u003c/mi\u003e\u003cmo stretchy=\"false\"\u003e]\u003c/mo\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e\\sigma(\\eta)\\in C^{q-1}[-\\infty, \\infty]\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e with the following properties:\u003c/p\u003e\n\u003col\u003e\n\u003cli\u003e\u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003eσ\u003c/mi\u003e\u003cmo stretchy=\"false\"\u003e(\u003c/mo\u003e\u003cmi\u003eη\u003c/mi\u003e\u003cmo stretchy=\"false\"\u003e)\u003c/mo\u003e\u003cmo\u003e=\u003c/mo\u003e\u003cmn\u003e0\u003c/mn\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e\\sigma(\\eta) = 0\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e for \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi mathvariant=\"normal\"\u003e∣\u003c/mi\u003e\u003cmi\u003eη\u003c/mi\u003e\u003cmi mathvariant=\"normal\"\u003e∣\u003c/mi\u003e\u003cmo\u003e≥\u003c/mo\u003e\u003cmn\u003e1\u003c/mn\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e|\\eta| \\ge 1\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e.\u003c/li\u003e\n\u003cli\u003e\u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003eσ\u003c/mi\u003e\u003cmo stretchy=\"false\"\u003e(\u003c/mo\u003e\u003cmn\u003e0\u003c/mn\u003e\u003cmo stretchy=\"false\"\u003e)\u003c/mo\u003e\u003cmo\u003e=\u003c/mo\u003e\u003cmn\u003e1\u003c/mn\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e\\sigma(0) = 1\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e.\u003c/li\u003e\n\u003cli\u003e\u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmsup\u003e\u003cmi\u003eσ\u003c/mi\u003e\u003cmrow\u003e\u003cmo stretchy=\"false\"\u003e(\u003c/mo\u003e\u003cmi\u003em\u003c/mi\u003e\u003cmo stretchy=\"false\"\u003e)\u003c/mo\u003e\u003c/mrow\u003e\u003c/msup\u003e\u003cmo stretchy=\"false\"\u003e(\u003c/mo\u003e\u003cmn\u003e0\u003c/mn\u003e\u003cmo stretchy=\"false\"\u003e)\u003c/mo\u003e\u003cmo\u003e=\u003c/mo\u003e\u003cmsup\u003e\u003cmi\u003eσ\u003c/mi\u003e\u003cmrow\u003e\u003cmo stretchy=\"false\"\u003e(\u003c/mo\u003e\u003cmi\u003em\u003c/mi\u003e\u003cmo stretchy=\"false\"\u003e)\u003c/mo\u003e\u003c/mrow\u003e\u003c/msup\u003e\u003cmo stretchy=\"false\"\u003e(\u003c/mo\u003e\u003cmn\u003e1\u003c/mn\u003e\u003cmo stretchy=\"false\"\u003e)\u003c/mo\u003e\u003cmo\u003e=\u003c/mo\u003e\u003cmn\u003e0\u003c/mn\u003e\u003cmspace width=\"1em\"/\u003e\u003cmi mathvariant=\"normal\"\u003e∀\u003c/mi\u003e\u003cmi\u003em\u003c/mi\u003e\u003cmo\u003e∈\u003c/mo\u003e\u003cmo stretchy=\"false\"\u003e[\u003c/mo\u003e\u003cmn\u003e1\u003c/mn\u003e\u003cmo separator=\"true\"\u003e,\u003c/mo\u003e\u003cmo\u003e…\u003c/mo\u003e\u003cmo separator=\"true\"\u003e,\u003c/mo\u003e\u003cmi\u003eq\u003c/mi\u003e\u003cmo\u003e−\u003c/mo\u003e\u003cmn\u003e1\u003c/mn\u003e\u003cmo stretchy=\"false\"\u003e]\u003c/mo\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e\\sigma^{(m)}(0) = \\sigma^{(m)}(1) = 0 \\quad\\forall m\\in [1, \\ldots, q-1]\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e.\u003c/li\u003e\n\u003c/ol\u003e\n\u003chr\u003e\n\u003cp\u003eTo apply the filter, we simply process the Fourier coefficients as follows: \\[\n\\mathcal P_N u_N(x) = u_N^\\sigma(x) = \\sum_{n=0}^N \\sigma\\left(\\frac nN\\right)\\ \\hat u_n\\ \\phi_n(x),\n\\]\nwhere \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmsub\u003e\u003cmi\u003eϕ\u003c/mi\u003e\u003cmi\u003en\u003c/mi\u003e\u003c/msub\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e\\phi_n\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e are the Fourier basis functions, \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmsub\u003e\u003cmover accent=\"true\"\u003e\u003cmi\u003eu\u003c/mi\u003e\u003cmo\u003e^\u003c/mo\u003e\u003c/mover\u003e\u003cmi\u003en\u003c/mi\u003e\u003c/msub\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e\\hat u_n\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e are the Fourier coefficients, and \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003eσ\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e\\sigma\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e is the chosen filter.\u003c/p\u003e\n\n\u003cfigure \u003e\n  \n  \n        \u003ch4\u003eSome common filters\u003c/h4\u003e\n      \u003ca href=https://aadi-bh.github.io/spectral4hyp/plots/filters.svg class=\"imglink\"\u003e\n    \u003cimg src=\"https://aadi-bh.github.io/spectral4hyp/plots/filters.svg\" alt=\"Image showing plots of four filters: Cesàro, Lanczos, Raised cosine, and the second order exponential. (Click or tap to enlarge the image.)\" /\u003e\n    \u003c/a\u003e\n    \n    \n      \u003cfigcaption\u003e\n        \u003cp\u003e\n        Every filter is a continuous and smooth function, which is necessary to obtain convergence, as we shall see.\n        \n          \n        \n        \u003c/p\u003e \n      \u003c/figcaption\u003e\n  \n\u003c/figure\u003e\n\n\n\u003ch3 id=\"filtration-results\"\u003eFiltration Results\u003c/h3\u003e\n\u003cp\u003eSuppose that \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003eu\u003c/mi\u003e\u003cmo stretchy=\"false\"\u003e(\u003c/mo\u003e\u003cmi\u003ex\u003c/mi\u003e\u003cmo stretchy=\"false\"\u003e)\u003c/mo\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003eu(x)\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e is piece-wise \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmsup\u003e\u003cmi\u003eC\u003c/mi\u003e\u003cmrow\u003e\u003cmn\u003e2\u003c/mn\u003e\u003cmi\u003ep\u003c/mi\u003e\u003c/mrow\u003e\u003c/msup\u003e\u003cmo stretchy=\"false\"\u003e[\u003c/mo\u003e\u003cmn\u003e0\u003c/mn\u003e\u003cmo separator=\"true\"\u003e,\u003c/mo\u003e\u003cmn\u003e2\u003c/mn\u003e\u003cmi\u003eπ\u003c/mi\u003e\u003cmo stretchy=\"false\"\u003e]\u003c/mo\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003eC^{2p}[0, 2\\pi]\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e with a single discontinuity at \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003ex\u003c/mi\u003e\u003cmtext\u003e \u003c/mtext\u003e\u003cmo\u003e=\u003c/mo\u003e\u003cmtext\u003e \u003c/mtext\u003e\u003cmi\u003eξ\u003c/mi\u003e\u003cmi mathvariant=\"normal\"\u003e.\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003ex~=~\\xi.\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e\u003cbr\u003e\nIf \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmsub\u003e\u003cmi mathvariant=\"script\"\u003eP\u003c/mi\u003e\u003cmi\u003eN\u003c/mi\u003e\u003c/msub\u003e\u003cmsub\u003e\u003cmi\u003eu\u003c/mi\u003e\u003cmi\u003eN\u003c/mi\u003e\u003c/msub\u003e\u003cmo stretchy=\"false\"\u003e(\u003c/mo\u003e\u003cmi\u003ex\u003c/mi\u003e\u003cmo stretchy=\"false\"\u003e)\u003c/mo\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e\\mathcal P_N  u_N(x)\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e is the filtered approximation of the true solution \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003eu\u003c/mi\u003e\u003cmo stretchy=\"false\"\u003e(\u003c/mo\u003e\u003cmi\u003ex\u003c/mi\u003e\u003cmo stretchy=\"false\"\u003e)\u003c/mo\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003eu(x)\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e then\nwe have\n\\[\n|u(x) - \\mathcal P_Nu_N(x)| \\le C\\frac{1}{N^{p-1}d(x, \\xi)^{p-1}}K(u) + C\\frac{\\sqrt{N}}{N^{2p}}||u^{(p)}||_{L^2}\n\\]\nwhere \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003ed\u003c/mi\u003e\u003cmo stretchy=\"false\"\u003e(\u003c/mo\u003e\u003cmi\u003ex\u003c/mi\u003e\u003cmo separator=\"true\"\u003e,\u003c/mo\u003e\u003cmi\u003eξ\u003c/mi\u003e\u003cmo stretchy=\"false\"\u003e)\u003c/mo\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003ed(x,\\xi)\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e measures the distance of \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003ex\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003ex\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e from \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003eξ\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e\\xi\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e.\nThus, we can recover \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmo stretchy=\"false\"\u003e(\u003c/mo\u003e\u003cmi\u003ep\u003c/mi\u003e\u003cmo\u003e−\u003c/mo\u003e\u003cmn\u003e1\u003c/mn\u003e\u003cmo stretchy=\"false\"\u003e)\u003c/mo\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e(p-1)\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e-order convergence if\u003c/p\u003e\n\u003col\u003e\n\u003cli\u003e\u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003ex\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003ex\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e is away from the discontinuity \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003eξ\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e\\xi\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e.\u003c/li\u003e\n\u003cli\u003eThe piecewise continuous function \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003eu\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003eu\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e is regular enough.\u003c/li\u003e\n\u003cli\u003eOrder (regularity) of the filter \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003eσ\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e\\sigma\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e is sufficiently large.\u003c/li\u003e\n\u003c/ol\u003e\n\u003cp\u003eIf \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003eu\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003eu\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e is piecewise analytic then we can increase \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003ep\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003ep\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e with \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003eN\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003eN\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e.\u003c/p\u003e\n\u003cp\u003eWe first plot solutions of the linear advection equation at \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003et\u003c/mi\u003e\u003cmo\u003e=\u003c/mo\u003e\u003cmn\u003e1\u003c/mn\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003et=1\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e, with the initial condition having a discontinuity at \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003ex\u003c/mi\u003e\u003cmo\u003e=\u003c/mo\u003e\u003cmi\u003eπ\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003ex=\\pi\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e.\u003c/p\u003e\n\n\u003cfigure \u003e\n  \n  \n        \u003ch4\u003eNo filter: $\\sigma \\equiv 1$\u003c/h4\u003e\n      \u003ca href=https://aadi-bh.github.io/spectral4hyp/plots/linadv-1.0-saw_tooth-no_filter-gFalse.svg class=\"imglink\"\u003e\n    \u003cimg src=\"https://aadi-bh.github.io/spectral4hyp/plots/linadv-1.0-saw_tooth-no_filter-gFalse.svg\" alt=\"Solutions without any processing.\" /\u003e\n    \u003c/a\u003e\n    \n    \n      \u003cfigcaption\u003e\n        \u003cp\u003e\n        Solutions without any processing.\n        \n          \n        \n        \u003c/p\u003e \n      \u003c/figcaption\u003e\n  \n\u003c/figure\u003e\n\n\n\u003cp\u003e\n\u003cfigure \u003e\n  \n  \n        \u003ch4\u003eStep Cut-off: $\\sigma(\\eta) = \\mathbb 1_{[-0.5, 0.5]}$.\u003c/h4\u003e\n      \u003ca href=https://aadi-bh.github.io/spectral4hyp/plots/linadv-1.0-saw_tooth-cutoff-gFalse.svg class=\"imglink\"\u003e\n    \u003cimg src=\"https://aadi-bh.github.io/spectral4hyp/plots/linadv-1.0-saw_tooth-cutoff-gFalse.svg\" alt=\"The oscillations are still very much present, and the convergence is not enhanced.\" /\u003e\n    \u003c/a\u003e\n    \n    \n      \u003cfigcaption\u003e\n        \u003cp\u003e\n        The oscillations are still very much present, and the convergence is not enhanced.\n        \n          \n        \n        \u003c/p\u003e \n      \u003c/figcaption\u003e\n  \n\u003c/figure\u003e\n\n\nThus the regularity of \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003eσ\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e\\sigma\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e plays an important role in the working of the filter.\u003c/p\u003e\n\n\u003cfigure \u003e\n  \n  \n        \u003ch4\u003eCesáro filter: $\\sigma(\\eta) = 1 - \\eta$\u003c/h4\u003e\n      \u003ca href=https://aadi-bh.github.io/spectral4hyp/plots/linadv-1.0-saw_tooth-cesaro-gFalse.svg class=\"imglink\"\u003e\n    \u003cimg src=\"https://aadi-bh.github.io/spectral4hyp/plots/linadv-1.0-saw_tooth-cesaro-gFalse.svg\" alt=\"Eliminates the overshoot and smears out the shock. Being only first order, gains in accuracy over no filtering. We do get uniform convergence but the smearing is so bad that information is lost.\" /\u003e\n    \u003c/a\u003e\n    \n    \n      \u003cfigcaption\u003e\n        \u003cp\u003e\n        Eliminates the overshoot and smears out the shock. Being only first order, gains in accuracy over no filtering. We do get uniform convergence but the smearing is so bad that information is lost.\n        \n          \n        \n        \u003c/p\u003e \n      \u003c/figcaption\u003e\n  \n\u003c/figure\u003e\n\n\n\n\u003cfigure \u003e\n  \n  \n        \u003ch4\u003eRaised Cosine Filter: $\\sigma(\\eta) = \\frac12\\left(1\u0026#43;\\cos(\\pi \\eta)\\right)$\u003c/h4\u003e\n      \u003ca href=https://aadi-bh.github.io/spectral4hyp/plots/linadv-1.0-saw_tooth-raisedcos-gFalse.svg class=\"imglink\"\u003e\n    \u003cimg src=\"https://aadi-bh.github.io/spectral4hyp/plots/linadv-1.0-saw_tooth-raisedcos-gFalse.svg\" alt=\"This is second order.\" /\u003e\n    \u003c/a\u003e\n    \n    \n      \u003cfigcaption\u003e\n        \u003cp\u003e\n        This is second order.\n        \n          \n        \n        \u003c/p\u003e \n      \u003c/figcaption\u003e\n  \n\u003c/figure\u003e\n\n\n\n\u003cfigure \u003e\n  \n  \n        \u003ch4\u003eLanczos filter: $\\sigma(\\eta) = \\frac{\\sin(\\pi \\eta)}{\\pi \\eta}$\u003c/h4\u003e\n      \u003ca href=https://aadi-bh.github.io/spectral4hyp/plots/linadv-1.0-saw_tooth-lanczos-gFalse.svg class=\"imglink\"\u003e\n    \u003cimg src=\"https://aadi-bh.github.io/spectral4hyp/plots/linadv-1.0-saw_tooth-lanczos-gFalse.svg\" alt=\"Also second order. Lanczos eliminates the oscillations away from the discontinuity, but not the overshoot at the discontinuity.\" /\u003e\n    \u003c/a\u003e\n    \n    \n      \u003cfigcaption\u003e\n        \u003cp\u003e\n        Also second order. Lanczos eliminates the oscillations away from the discontinuity, but not the overshoot at the discontinuity.\n        \n          \n        \n        \u003c/p\u003e \n      \u003c/figcaption\u003e\n  \n\u003c/figure\u003e\n\n\n\n\u003cfigure \u003e\n  \n  \n        \u003ch4\u003eExponential filter: $\\sigma(\\eta) = \\exp(-\\alpha \\eta^{2p})$\u003c/h4\u003e\n      \u003ca href=https://aadi-bh.github.io/spectral4hyp/plots/linadv-1.0-saw_tooth-exponential2-gFalse.svg class=\"imglink\"\u003e\n    \u003cimg src=\"https://aadi-bh.github.io/spectral4hyp/plots/linadv-1.0-saw_tooth-exponential2-gFalse.svg\" alt=\"This plot shows the filter with order $2p=4$.\" /\u003e\n    \u003c/a\u003e\n    \n    \n      \u003cfigcaption\u003e\n        \u003cp\u003e\n        This plot shows the filter with order $2p=4$.\n        \n          \n        \n        \u003c/p\u003e \n      \u003c/figcaption\u003e\n  \n\u003c/figure\u003e\n\n\n\u003cp\u003eWe now apply a filter to Burgers\u0026rsquo; equation and plot the solution along with the exact at \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003et\u003c/mi\u003e\u003cmo\u003e=\u003c/mo\u003e\u003cmn\u003e1.3\u003c/mn\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003et=1.3\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e.\u003c/p\u003e\n\n\u003cfigure \u003e\n  \n  \n        \u003ch4\u003eBurgers\u0026#39; equation, no filter\u003c/h4\u003e\n      \u003ca href=https://aadi-bh.github.io/spectral4hyp/plots/burgers-1.3-sin-no_filter-gFalse.svg class=\"imglink\"\u003e\n    \u003cimg src=\"https://aadi-bh.github.io/spectral4hyp/plots/burgers-1.3-sin-no_filter-gFalse.svg\"  /\u003e\n    \u003c/a\u003e\n    \n    \n      \u003cfigcaption\u003e\n        \n      \u003c/figcaption\u003e\n  \n\u003c/figure\u003e\n\n\n\n\u003cfigure \u003e\n  \n  \n        \u003ch4\u003eBurgers\u0026#39; equation, exponential filter ($2p=4$)\u003c/h4\u003e\n      \u003ca href=https://aadi-bh.github.io/spectral4hyp/plots/burgers-1.3-sin-exponential-gFalse.svg class=\"imglink\"\u003e\n    \u003cimg src=\"https://aadi-bh.github.io/spectral4hyp/plots/burgers-1.3-sin-exponential-gFalse.svg\"  /\u003e\n    \u003c/a\u003e\n    \n    \n      \u003cfigcaption\u003e\n        \n      \u003c/figcaption\u003e\n  \n\u003c/figure\u003e\n\n\n\u003ch2 id=\"post-processing\"\u003ePost Processing\u003c/h2\u003e\n\u003cp\u003eThe reader should take note that the techniques discussed are only \u003cem\u003epost processing\u003c/em\u003e the solution that is computed with purely spectral or pseudospectral methods.\nThis makes sense because altering how one solves for the solution is not as straightforward as merely altering the interpretation of the solution.\u003cbr\u003e\n\u003clabel for=\"sn-d41d8cd98f00b204e9800998ecf8427e\" class=\"sidenote-toggle sidenote-number\"\n\t\u003e\u003cinput type=\"checkbox\" id=\"sn-d41d8cd98f00b204e9800998ecf8427e\" class=\"sidenote-toggle\" /\u003e\u003cspan\n\t\tclass=\"sidenote\"\u003eThat said, the action of filters is similar to that of artificial viscosity. Hence they can stabilise numerical methods like viscosity can, but without introducing stiffness.\u003c/span\n\t\u003e\u003c/label\n\u003e\u003c/p\u003e\n\u003chr\u003e\n\u003cp\u003eWith the right choice of a filter for the problem at hand, we are able to\nremove the effects of the Gibbs phenomenon at points away from the discontinuity.\nThe accuracy of filtered approximations decreases as we approach the point of\ndiscontinuity, as is apparent in the plots above.\nUnsurprisingly, the bound on the pointwise error blows up as \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003ex\u003c/mi\u003e\u003cmo\u003e→\u003c/mo\u003e\u003cmi\u003eξ\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003ex\\to\\xi\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e.\u003c/p\u003e\n\u003cblockquote\u003e\n\u003cp\u003e\u0026ldquo;We assume that we know the first \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmn\u003e2\u003c/mn\u003e\u003cmi\u003eN\u003c/mi\u003e\u003cmo\u003e+\u003c/mo\u003e\u003cmn\u003e1\u003c/mn\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e2N+1\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e expansion coefficients of a piecewise analytic function and that the function is known to have a discontinuity at \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003ex\u003c/mi\u003e\u003cmo\u003e=\u003c/mo\u003e\u003cmi\u003eξ\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003ex=\\xi\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e. The aim is to recover the value of \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003eu\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003eu\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e at any point in the interval \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmo stretchy=\"false\"\u003e[\u003c/mo\u003e\u003cmn\u003e0\u003c/mn\u003e\u003cmo separator=\"true\"\u003e,\u003c/mo\u003e\u003cmn\u003e2\u003c/mn\u003e\u003cmi\u003eπ\u003c/mi\u003e\u003cmo stretchy=\"false\"\u003e]\u003c/mo\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e[0,2\\pi]\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e.\u0026rdquo;\u003c/p\u003e\n\u003c/blockquote\u003e\n\u003ch2 id=\"gibbs-complimentary-basis\"\u003eGibbs Complimentary Basis\u003c/h2\u003e\n\u003cp\u003eFiltering essentially treats Gibbs oscillations as noise,\nreducing them in a nice manner.\nIt turns out that rather than destroying the information present within the Fourier coefficients, if it is \u003cem\u003eredistributed\u003c/em\u003e,\none actually recovers an exponentially convergent series to a piecewise analytic function.\nThe convergence holds even at points \u003cem\u003earbitrarily close\u003c/em\u003e to the discontinuity.\u003c/p\u003e\n\u003cp\u003eThe trick is finding a new basis with certain properties.\nThen the truncated global expansion is re-expanded in this new basis.\nThe catch is that this method relies on knowing the location of the discontinuity.\u003c/p\u003e\n\u003chr\u003e\n\u003cp\u003e       \n\u003cp title=\"Definition\" class=\"theorem\"\u003e\u003c/p\u003e\n The family \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmo stretchy=\"false\"\u003e{\u003c/mo\u003e\u003cmsubsup\u003e\u003cmi mathvariant=\"normal\"\u003eΦ\u003c/mi\u003e\u003cmi\u003ek\u003c/mi\u003e\u003cmi\u003eλ\u003c/mi\u003e\u003c/msubsup\u003e\u003cmo stretchy=\"false\"\u003e}\u003c/mo\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e\\{\\Phi_k^\\lambda\\}\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e is \u003cstrong\u003eGibbs complimentary\u003c/strong\u003e to the family \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmo stretchy=\"false\"\u003e{\u003c/mo\u003e\u003cmsub\u003e\u003cmi mathvariant=\"normal\"\u003eΨ\u003c/mi\u003e\u003cmi\u003ek\u003c/mi\u003e\u003c/msub\u003e\u003cmo stretchy=\"false\"\u003e(\u003c/mo\u003e\u003cmi\u003ex\u003c/mi\u003e\u003cmo stretchy=\"false\"\u003e)\u003c/mo\u003e\u003cmo stretchy=\"false\"\u003e}\u003c/mo\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e\\{\\Psi_k(x)\\}\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e if the following three conditions hold:\u003c/p\u003e\n\u003col\u003e\n\u003cli\u003e\u003cstrong\u003eOrthonormality\u003c/strong\u003e: \\[\n\\left\\langle\\Phi_k^\\lambda, \\Phi_l^\\lambda\\right\\rangle_\\lambda = \\delta_{kl}\\quad\\forall k,l.\n\\]\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003eSpectral convergence\u003c/strong\u003e: The expansion of a function \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003eg\u003c/mi\u003e\u003cmo stretchy=\"false\"\u003e(\u003c/mo\u003e\u003cmi\u003eξ\u003c/mi\u003e\u003cmo stretchy=\"false\"\u003e)\u003c/mo\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003eg(\\xi)\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e which is analytic in \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmo stretchy=\"false\"\u003e[\u003c/mo\u003e\u003cmo\u003e−\u003c/mo\u003e\u003cmn\u003e1\u003c/mn\u003e\u003cmo separator=\"true\"\u003e,\u003c/mo\u003e\u003cmn\u003e1\u003c/mn\u003e\u003cmo stretchy=\"false\"\u003e]\u003c/mo\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e[-1, 1]\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e, in the basis \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmsub\u003e\u003cmi mathvariant=\"normal\"\u003eΦ\u003c/mi\u003e\u003cmi\u003ek\u003c/mi\u003e\u003c/msub\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e\\Phi_k\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e converges exponentially fast with \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003eλ\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e\\lambda\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e: \\[\n\\max_{\\xi\\in[-1, 1]}\\left|g(\\xi) - \\sum_{k=0}^\\lambda\\langle g, \\Phi_k^\\lambda\\rangle_\\lambda \\Phi_k^\\lambda(\\xi)\\right| \\le \\exp(-q_1\\lambda),\\quad q_1 \u0026gt; 0.\n\\]\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003eThe Gibbs condition\u003c/strong\u003e: There exists a number \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003eβ\u003c/mi\u003e\u003cmo\u003e\u0026lt;\u003c/mo\u003e\u003cmn\u003e1\u003c/mn\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e\\beta \u0026lt; 1\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e such that if\n\u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003eλ\u003c/mi\u003e\u003cmtext\u003e \u003c/mtext\u003e\u003cmo\u003e=\u003c/mo\u003e\u003cmtext\u003e \u003c/mtext\u003e\u003cmi\u003eβ\u003c/mi\u003e\u003cmi\u003eN\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e\\lambda~=~\\beta N\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e then \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi mathvariant=\"normal\"\u003e∃\u003c/mi\u003e\u003cmi\u003eα\u003c/mi\u003e\u003cmo\u003e\u0026lt;\u003c/mo\u003e\u003cmn\u003e1\u003c/mn\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e\\exists\\alpha \u0026lt; 1\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e\n\u003ca href=\"/suchthat\"\u003esuchthat\u003c/a\u003e for \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003ek\u003c/mi\u003e\u003cmo\u003e\u0026gt;\u003c/mo\u003e\u003cmi\u003eN\u003c/mi\u003e\u003cmo separator=\"true\"\u003e,\u003c/mo\u003e\u003cmi\u003el\u003c/mi\u003e\u003cmo\u003e≤\u003c/mo\u003e\u003cmi\u003eλ\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003ek\u0026gt;N, l\\le\\lambda\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e:\n\\[\n\\left|\\left\\langle\n\\Phi_l^\\lambda(\\xi), \\Psi_k(x_\\xi)\n\\right\\rangle_\\lambda\\right|\\\n\\max_{\\xi\\in[-1, 1]} |\\Phi_l^\\lambda(\\xi)| \\le \\left(\\frac{\\alpha N}{k}\\right)^\\lambda.\n\\]\nThis means that high modes (large \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003ek\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003ek\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e) of the Fourier basis \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmsub\u003e\u003cmi mathvariant=\"normal\"\u003eΨ\u003c/mi\u003e\u003cmi\u003ek\u003c/mi\u003e\u003c/msub\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e\\Psi_k\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e\non the lower modes (small \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003el\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003el\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e) in the basis \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmsubsup\u003e\u003cmi mathvariant=\"normal\"\u003eΦ\u003c/mi\u003e\u003cmi\u003el\u003c/mi\u003e\u003cmi\u003eλ\u003c/mi\u003e\u003c/msubsup\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e\\Phi_l^\\lambda\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e is\nexponentially small in the interval \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmo\u003e−\u003c/mo\u003e\u003cmn\u003e1\u003c/mn\u003e\u003cmo\u003e≤\u003c/mo\u003e\u003cmi\u003eξ\u003c/mi\u003e\u003cmo\u003e≤\u003c/mo\u003e\u003cmn\u003e1\u003c/mn\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e-1\\le \\xi \\le 1\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e for \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003eλ\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e\\lambda\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e\nproportional to \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003eN\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003eN\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e.\u003c/li\u003e\n\u003c/ol\u003e\n\u003chr\u003e\n\u003ch2 id=\"resolving-the-gibbs-phenomenon\"\u003eResolving the Gibbs Phenomenon\u003c/h2\u003e\n\u003cp\u003eLet \\[\\xi(x) = -1 + 2\\left(\\frac{x-a}{b-a}\\right)\\]\nbe a map from \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003ex\u003c/mi\u003e\u003cmo\u003e∈\u003c/mo\u003e\u003cmo stretchy=\"false\"\u003e[\u003c/mo\u003e\u003cmi\u003ea\u003c/mi\u003e\u003cmo separator=\"true\"\u003e,\u003c/mo\u003e\u003cmi\u003eb\u003c/mi\u003e\u003cmo stretchy=\"false\"\u003e]\u003c/mo\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003ex\\in[a,b]\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e to \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003eξ\u003c/mi\u003e\u003cmo\u003e∈\u003c/mo\u003e\u003cmo stretchy=\"false\"\u003e[\u003c/mo\u003e\u003cmo\u003e−\u003c/mo\u003e\u003cmn\u003e1\u003c/mn\u003e\u003cmo separator=\"true\"\u003e,\u003c/mo\u003e\u003cmn\u003e1\u003c/mn\u003e\u003cmo stretchy=\"false\"\u003e]\u003c/mo\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e\\xi\\in[-1,1]\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e.\u003c/p\u003e\n\u003chr\u003e\n\u003cp\u003e       \n\u003cp title=\"Theorem\" class=\"theorem\"\u003e\u003c/p\u003e\n Let \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003ef\u003c/mi\u003e\u003cmo stretchy=\"false\"\u003e(\u003c/mo\u003e\u003cmi\u003ex\u003c/mi\u003e\u003cmo stretchy=\"false\"\u003e)\u003c/mo\u003e\u003cmo\u003e∈\u003c/mo\u003e\u003cmsup\u003e\u003cmi\u003eL\u003c/mi\u003e\u003cmn\u003e2\u003c/mn\u003e\u003c/msup\u003e\u003cmo stretchy=\"false\"\u003e[\u003c/mo\u003e\u003cmo\u003e−\u003c/mo\u003e\u003cmn\u003e1\u003c/mn\u003e\u003cmo separator=\"true\"\u003e,\u003c/mo\u003e\u003cmn\u003e1\u003c/mn\u003e\u003cmo stretchy=\"false\"\u003e]\u003c/mo\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003ef(x)\\in L^2[-1,1]\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e be analytic in\n\u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmo stretchy=\"false\"\u003e[\u003c/mo\u003e\u003cmi\u003ea\u003c/mi\u003e\u003cmo separator=\"true\"\u003e,\u003c/mo\u003e\u003cmi\u003eb\u003c/mi\u003e\u003cmo stretchy=\"false\"\u003e]\u003c/mo\u003e\u003cmo\u003e⊂\u003c/mo\u003e\u003cmo stretchy=\"false\"\u003e[\u003c/mo\u003e\u003cmo\u003e−\u003c/mo\u003e\u003cmn\u003e1\u003c/mn\u003e\u003cmo separator=\"true\"\u003e,\u003c/mo\u003e\u003cmn\u003e1\u003c/mn\u003e\u003cmo stretchy=\"false\"\u003e]\u003c/mo\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e[a,b] \\subset [-1,1]\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e.\nSuppose that\u003c/p\u003e\n\u003col\u003e\n\u003cli\u003e\u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi mathvariant=\"normal\"\u003e∣\u003c/mi\u003e\u003cmo stretchy=\"false\"\u003e(\u003c/mo\u003e\u003cmi\u003ef\u003c/mi\u003e\u003cmo separator=\"true\"\u003e,\u003c/mo\u003e\u003cmsub\u003e\u003cmi mathvariant=\"normal\"\u003eΨ\u003c/mi\u003e\u003cmi\u003ek\u003c/mi\u003e\u003c/msub\u003e\u003cmo stretchy=\"false\"\u003e)\u003c/mo\u003e\u003cmi mathvariant=\"normal\"\u003e∣\u003c/mi\u003e\u003cmo\u003e≤\u003c/mo\u003e\u003cmi\u003eC\u003c/mi\u003e\u003cmspace width=\"1em\"/\u003e\u003cmi mathvariant=\"normal\"\u003e∀\u003c/mi\u003e\u003cmi\u003ek\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e|(f, \\Psi_k)| \\le C\\quad\\forall k\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e and\u003c/li\u003e\n\u003cli\u003e\u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmsub\u003e\u003cmrow\u003e\u003cmi\u003elim\u003c/mi\u003e\u003cmo\u003e⁡\u003c/mo\u003e\u003c/mrow\u003e\u003cmrow\u003e\u003cmi\u003eN\u003c/mi\u003e\u003cmo\u003e→\u003c/mo\u003e\u003cmi mathvariant=\"normal\"\u003e∞\u003c/mi\u003e\u003c/mrow\u003e\u003c/msub\u003e\u003cmi mathvariant=\"normal\"\u003e∣\u003c/mi\u003e\u003cmi\u003ef\u003c/mi\u003e\u003cmo stretchy=\"false\"\u003e(\u003c/mo\u003e\u003cmi\u003ex\u003c/mi\u003e\u003cmo stretchy=\"false\"\u003e)\u003c/mo\u003e\u003cmo\u003e−\u003c/mo\u003e\u003cmsub\u003e\u003cmi\u003ef\u003c/mi\u003e\u003cmi\u003eN\u003c/mi\u003e\u003c/msub\u003e\u003cmo stretchy=\"false\"\u003e(\u003c/mo\u003e\u003cmi\u003ex\u003c/mi\u003e\u003cmo stretchy=\"false\"\u003e)\u003c/mo\u003e\u003cmi mathvariant=\"normal\"\u003e∣\u003c/mi\u003e\u003cmo\u003e=\u003c/mo\u003e\u003cmn\u003e0.\u003c/mn\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e\\lim_{N\\to\\infty} |f(x) - f_N(x)| = 0.\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e\u003c/li\u003e\n\u003c/ol\u003e\n\u003cp\u003eLet \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmo stretchy=\"false\"\u003e{\u003c/mo\u003e\u003cmsubsup\u003e\u003cmi mathvariant=\"normal\"\u003eΦ\u003c/mi\u003e\u003cmi\u003ek\u003c/mi\u003e\u003cmi\u003eλ\u003c/mi\u003e\u003c/msubsup\u003e\u003cmo stretchy=\"false\"\u003e(\u003c/mo\u003e\u003cmi\u003eξ\u003c/mi\u003e\u003cmo stretchy=\"false\"\u003e)\u003c/mo\u003e\u003cmo stretchy=\"false\"\u003e}\u003c/mo\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e\\{\\Phi_k^\\lambda(\\xi)\\}\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e be a Gibbs complimentary basis to the family\n\u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmo stretchy=\"false\"\u003e{\u003c/mo\u003e\u003cmsub\u003e\u003cmi mathvariant=\"normal\"\u003eΨ\u003c/mi\u003e\u003cmi\u003ek\u003c/mi\u003e\u003c/msub\u003e\u003cmo stretchy=\"false\"\u003e(\u003c/mo\u003e\u003cmi\u003ex\u003c/mi\u003e\u003cmo stretchy=\"false\"\u003e)\u003c/mo\u003e\u003cmo stretchy=\"false\"\u003e}\u003c/mo\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e\\{\\Psi_k(x)\\}\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e, with \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003eλ\u003c/mi\u003e\u003cmo\u003e=\u003c/mo\u003e\u003cmi\u003eβ\u003c/mi\u003e\u003cmi\u003eN\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e\\lambda = \\beta N\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e.\nFurthermore, assume \\[\n\\langle f - f_N, \\Phi_l^\\lambda\\rangle_\\lambda =\n\\sum_{k=N+1}^\\infty (f, \\Phi_l^\\lambda)\\\n\\langle\\Phi_l^\\lambda, \\Psi_k\\rangle_\\lambda.\n\\]\nThen\n\\[\n\\max_{x\\in[a,b]}\\left|\nf(x) - \\sum_{l=0}^\\lambda\\langle f_N, \\Phi_l^\\lambda\\rangle\\\n\\Phi_l^\\lambda(\\xi(x))\n\\right| \\le \\exp(-qN), \\quad q \u0026gt; 0.\n\\]\u003c/p\u003e\n\u003chr\u003e\n\u003cp\u003eThe knowledge of the interval of analyticity of the true solution\nis enough to construct an exponentially converging approximation to it,\nfrom just the knowledge of the original Fourier coefficients.\u003c/p\u003e\n\u003ch2 id=\"gegenbauer-polynomials\"\u003eGegenbauer Polynomials\u003c/h2\u003e\n\u003cp\u003eImplicit in the earlier statement is the assumption that there not only\nexists a Gibbs complimentary basis for the Fourier basis, but also an explicit expression for it is available.\nThankfully, \u003ca href=\"https://en.wikipedia.org/wiki/Gegenbauer_polynomials\"\u003eGegenbauer polynomials\u003c/a\u003e exist and they do the job.\u003c/p\u003e\n\u003cp\u003e\n\u003cfigure \u003e\n  \n  \n        \u003ch4\u003eGegenbauer polynomials for $\\lambda=3$\u003c/h4\u003e\n      \u003ca href=https://aadi-bh.github.io/spectral4hyp/plots/ggbs.svg class=\"imglink\"\u003e\n    \u003cimg src=\"https://aadi-bh.github.io/spectral4hyp/plots/ggbs.svg\"  /\u003e\n    \u003c/a\u003e\n    \n    \n      \u003cfigcaption\u003e\n        \n      \u003c/figcaption\u003e\n  \n\u003c/figure\u003e\n\n\nFor the Fourier basis, \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003eβ\u003c/mi\u003e\u003cmo\u003e=\u003c/mo\u003e\u003cmfrac\u003e\u003cmrow\u003e\u003cmn\u003e2\u003c/mn\u003e\u003cmi\u003eπ\u003c/mi\u003e\u003cmo stretchy=\"false\"\u003e(\u003c/mo\u003e\u003cmi\u003eb\u003c/mi\u003e\u003cmo\u003e−\u003c/mo\u003e\u003cmi\u003ea\u003c/mi\u003e\u003cmo stretchy=\"false\"\u003e)\u003c/mo\u003e\u003c/mrow\u003e\u003cmn\u003e27\u003c/mn\u003e\u003c/mfrac\u003e\u003cmo\u003e≈\u003c/mo\u003e\u003cmn\u003e1.46\u003c/mn\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e\\beta = \\frac{2\\pi (b-a)}{27}\\approx 1.46\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e.\nTurns out that Gegenbauer polynomials form \u003cem\u003ea\u003c/em\u003e Gibbs complimentary basis for Legendre polynomials as well.\u003c/p\u003e\n\u003ch3 id=\"results\"\u003eResults\u003c/h3\u003e\n\u003cp\u003eWe present the results of the re-expansions with the linear advection\nequation and the inviscid Burgers\u0026rsquo; equation.\u003c/p\u003e\n\n\u003cfigure \u003e\n  \n  \n        \u003ch4\u003eLinear advection equation with $N=16, \\lambda=3$.\u003c/h4\u003e\n      \u003ca href=https://aadi-bh.github.io/spectral4hyp/plots/linadv-1.0-saw_tooth-no_filter-g3.svg class=\"imglink\"\u003e\n    \u003cimg src=\"https://aadi-bh.github.io/spectral4hyp/plots/linadv-1.0-saw_tooth-no_filter-g3.svg\"  /\u003e\n    \u003c/a\u003e\n    \n    \n      \u003cfigcaption\u003e\n        \n      \u003c/figcaption\u003e\n  \n\u003c/figure\u003e\n\n\n\n\u003cfigure \u003e\n  \n  \n        \u003ch4\u003eLinear advection equation with $N=64, \\lambda=6$.\u003c/h4\u003e\n      \u003ca href=https://aadi-bh.github.io/spectral4hyp/plots/linadv-1.0-saw_tooth-no_filter-g6.svg class=\"imglink\"\u003e\n    \u003cimg src=\"https://aadi-bh.github.io/spectral4hyp/plots/linadv-1.0-saw_tooth-no_filter-g6.svg\"  /\u003e\n    \u003c/a\u003e\n    \n    \n      \u003cfigcaption\u003e\n        \n      \u003c/figcaption\u003e\n  \n\u003c/figure\u003e\n\n\n\n\u003cfigure \u003e\n  \n  \n        \u003ch4\u003eBurgers\u0026#39; equation with $N=32, \\lambda=4$.\u003c/h4\u003e\n      \u003ca href=https://aadi-bh.github.io/spectral4hyp/plots/burgers-1.3-sin-no_filter-g[4].svg class=\"imglink\"\u003e\n    \u003cimg src=\"https://aadi-bh.github.io/spectral4hyp/plots/burgers-1.3-sin-no_filter-g[4].svg\"  /\u003e\n    \u003c/a\u003e\n    \n    \n      \u003cfigcaption\u003e\n        \n      \u003c/figcaption\u003e\n  \n\u003c/figure\u003e\n\n\n\n\u003cfigure \u003e\n  \n  \n        \u003ch4\u003eBurgers\u0026#39; equation with $N=64, \\lambda=6$.\u003c/h4\u003e\n      \u003ca href=https://aadi-bh.github.io/spectral4hyp/plots/burgers-1.3-sin-no_filter-g6.svg class=\"imglink\"\u003e\n    \u003cimg src=\"https://aadi-bh.github.io/spectral4hyp/plots/burgers-1.3-sin-no_filter-g6.svg\"  /\u003e\n    \u003c/a\u003e\n    \n    \n      \u003cfigcaption\u003e\n        \n      \u003c/figcaption\u003e\n  \n\u003c/figure\u003e\n\n\n\n\u003cfigure \u003e\n  \n  \n        \u003ch4\u003eBurgers\u0026#39; equation with $N=64, \\lambda=8$.\u003c/h4\u003e\n      \u003ca href=https://aadi-bh.github.io/spectral4hyp/plots/burgers-1.3-sin-no_filter-g[8].svg class=\"imglink\"\u003e\n    \u003cimg src=\"https://aadi-bh.github.io/spectral4hyp/plots/burgers-1.3-sin-no_filter-g[8].svg\"  /\u003e\n    \u003c/a\u003e\n    \n    \n      \u003cfigcaption\u003e\n        \n      \u003c/figcaption\u003e\n  \n\u003c/figure\u003e\n\n\n\u003cp\u003eThe question of whether high-order accuracy can be recovered in the case of\nnon-linear equations is still open.\nThe numerical results seem to confirm this fact.\u003c/p\u003e\n\n\u003cfigure \u003e\n  \n  \n      \u003ca href=https://aadi-bh.github.io/spectral4hyp/plots/burgers-1.2-sin-no_filter-g[3,%206,%208].svg class=\"imglink\"\u003e\n    \u003cimg src=\"https://aadi-bh.github.io/spectral4hyp/plots/burgers-1.2-sin-no_filter-g[3,%206,%208].svg\" alt=\"Burgers\u0026#39; equation at $t=1.3$ with $N=16, 64, 128$ and $\\lambda=3, 6, 8$ respectively, no filter.\" /\u003e\n    \u003c/a\u003e\n    \n    \n      \u003cfigcaption\u003e\n        \u003cp\u003e\n        Burgers\u0026#39; equation at $t=1.3$ with $N=16, 64, 128$ and $\\lambda=3, 6, 8$ respectively, no filter.\n        \n          \n        \n        \u003c/p\u003e \n      \u003c/figcaption\u003e\n  \n\u003c/figure\u003e\n\n\n\n\u003cfigure \u003e\n  \n  \n      \u003ca href=https://aadi-bh.github.io/spectral4hyp/plots/burgers-1.2-sin-exponential-g[3,%206,%208].svg class=\"imglink\"\u003e\n    \u003cimg src=\"https://aadi-bh.github.io/spectral4hyp/plots/burgers-1.2-sin-exponential-g[3,%206,%208].svg\" alt=\"Burgers\u0026#39; equation at $t=1.3$ with $N=16, 64, 128$ and $\\lambda=3, 6, 8$ respectively, exponential filter.\" /\u003e\n    \u003c/a\u003e\n    \n    \n      \u003cfigcaption\u003e\n        \u003cp\u003e\n        Burgers\u0026#39; equation at $t=1.3$ with $N=16, 64, 128$ and $\\lambda=3, 6, 8$ respectively, exponential filter.\n        \n          \n        \n        \u003c/p\u003e \n      \u003c/figcaption\u003e\n  \n\u003c/figure\u003e\n\n\n\u003ch2 id=\"conclusions\"\u003eConclusions\u003c/h2\u003e\n\u003cp\u003eSpectral methods have numerous advantages over traditional methods for solving partial differential equations.\nThey are highly accurate and have superior phase properties.\nThe above results show us how spectral methods can be combined with\npost processing to retain those properties, even when the traditional\nestimates and results do not apply, such as in the case of hyperbolic problems.\u003c/p\u003e\n\u003ch2 id=\"unanswered-questions\"\u003eUnanswered Questions\u003c/h2\u003e\n\u003col\u003e\n\u003cli\u003eIn practice, how are shock locations computed?\u003c/li\u003e\n\u003cli\u003eConservation and RH condition.\u003c/li\u003e\n\u003c/ol\u003e\n\u003ch2 id=\"references\"\u003eReferences\u003c/h2\u003e\n\u003col\u003e\n\u003cli\u003e\n\u003cp\u003eD. Gottlieb, J.S. Hesthaven,\n\u003ca href=\"https://doi.org/10.1016/S0377-0427(00)00510-0\"\u003eSpectral methods for hyperbolic problems\u003c/a\u003e,\nJournal of Computational and Applied Mathematics,\nVolume 128, Issues 1–2,\n2001,\nPages 83-131,\nISSN 0377-0427,\u003cbr\u003e\n\u003ca href=\"https://doi.org/10.1016/S0377-0427(00)00510-0\"\u003ehttps://doi.org/10.1016/S0377-0427(00)00510-0.\u003c/a\u003e\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp\u003eHesthaven, J., Gottlieb, S., \u0026amp; Gottlieb, D. (2007). \u003ca href=\"https://doi.org/10.1017/CBO9780511618352\"\u003eSpectral Methods for Time-Dependent Problems\u003c/a\u003e (Cambridge Monographs on Applied and Computational Mathematics). Cambridge: Cambridge University Press.\u003c/p\u003e\n\u003c/li\u003e\n\u003c/ol\u003e\n"
    }, {
      "id": "https://aadi.ink/posts/2023/09/lean-into-lean/",
      "url": "https://aadi.ink/posts/2023/09/lean-into-lean/",
      "title": "Lean Into Lean",
      "date_published": "2023-09-16T19:58:45+05:30",
      "content_html": "\u003cp\u003eI had been trying to get into \u003ca href=\"https://leanprover.github.io\"\u003eLean\u003c/a\u003e.\nIt\u0026rsquo;s an interactive theorem prover, and I\u0026rsquo;ve been curious about it since I first heard about it during a talk by Kevin Buzzard himself.\u003c/p\u003e\n\u003cp\u003eWe were fortunate to have an in-person workshop about Lean recently and I have some notes!\nLet the lack of organisation and detail be a reflection of how little experience and knowledge I have of Lean.\nBe sure to keep that in mind while reading.\u003c/p\u003e\n\u003col\u003e\n\u003cli\u003e\n\u003ch3 id=\"its-not-magic\"\u003eIt\u0026rsquo;s not magic.\u003c/h3\u003e\n\u003c/li\u003e\n\u003c/ol\u003e\n\u003cp\u003eLean is not a tool to help prove theorems for us.\nIt\u0026rsquo;s more of a way to get the computer to check your proof.\nHowever, if it knows the goal, there are ways to make it fill in the blanks for us.\nThat\u0026rsquo;s more for convenience than breakthroughs. Don\u0026rsquo;t expect to use Lean to do homework or crack an unsolved problem.\nDo expect it to be useful to verify your solution when you do do your homework or attempt that problem!\u003c/p\u003e\n\u003col start=\"2\"\u003e\n\u003cli\u003e\n\u003ch3 id=\"interactive\"\u003eInteractive?\u003c/h3\u003e\n\u003c/li\u003e\n\u003c/ol\u003e\n\u003cp\u003eLean is an \u003cem\u003einteractive\u003c/em\u003e theroem prover.\nThe way we interact with it is by moving around and editing text on one side of the window, which manipulates the state on the other side of the window.\nMoving the cursor down line by line shows how each line affected the state.\u003c/p\u003e\n\u003col start=\"3\"\u003e\n\u003cli\u003e\n\u003ch3 id=\"if-unsure-go-with-vs-code\"\u003eIf unsure, go with VS Code!\u003c/h3\u003e\n\u003c/li\u003e\n\u003c/ol\u003e\n\u003cp\u003eYou can use it with \u003ca href=\"https://github.com/leanprover/vscode-lean4\"\u003eVS Code\u003c/a\u003e, \u003ca href=\"https://github.com/Julian/lean.nvim\"\u003eNeovim\u003c/a\u003e, or \u003ca href=\"https://github.com/leanprover/lean4-mode\"\u003eEmacs\u003c/a\u003e.\nI have no idea about Emacs, but the VS Code integration is far ahead of the Neovim one.\nThe extension in VS Code provides a lot of helpful tooltips on hovering over text, makes it easy to understand complex statements, and lets you jump to definitions of tactics and types if you want to.\nSince these features are mostly coming from the LSP server implemented by Lean, I\u0026rsquo;m sure all that is possible with the current Nvim plugin, or even any other LSP plugin for Vim, but it takes absolutely no effort to get it working in VS Code.\nSo far I haven\u0026rsquo;t switched to it yet, but I would recommend that you begin in VS Code.\u003c/p\u003e\n\u003col start=\"4\"\u003e\n\u003cli\u003e\n\u003ch3 id=\"syntax-needs-patience\"\u003eSyntax needs patience.\u003c/h3\u003e\n\u003c/li\u003e\n\u003c/ol\u003e\n\u003cp\u003eI find the syntax a little hard to get used to.\nStick to it, and you\u0026rsquo;ll get a hang of it.\u003c/p\u003e\n\u003col start=\"5\"\u003e\n\u003cli\u003e\n\u003ch3 id=\"try-the-natural-number-game\"\u003eTry the Natural Number Game!\u003c/h3\u003e\n\u003c/li\u003e\n\u003c/ol\u003e\n\u003cp\u003eThe \u003ca href=\"https://leanprover-community.github.io/learn.html\"\u003eNatural Number Game\u003c/a\u003e has a version for Lean 3 as well as Lean 4.\nI found it really helpful for practice,\nas well as to understand how to use it.\u003c/p\u003e\n\u003col start=\"6\"\u003e\n\u003cli\u003e\n\u003ch3 id=\"in-fact-all-of-lean-is-like-a-game\"\u003eIn fact all of Lean is like a game!\u003c/h3\u003e\n\u003c/li\u003e\n\u003c/ol\u003e\n\u003cp\u003eOnce we have written our hypothesis and our goal (aka claim)\nlean breaks it down for us on the right hand side.\nEach statement we write will change something there.\nWe might be able to conclude something which will then be populated into the list of assumptions.\nWe can ask it to break a goal into multiple simpler ones, which will add to the list of goals.\nLine-by-line we can either bring the goal closer or push our assumptions farther until they meet and we\u0026rsquo;ve won!\u003c/p\u003e\n\u003col start=\"7\"\u003e\n\u003cli\u003e\n\u003ch3 id=\"aesop-simp-and-apply\"\u003e\u003ccode\u003eaesop?\u003c/code\u003e, \u003ccode\u003esimp?\u003c/code\u003e and \u003ccode\u003eapply?\u003c/code\u003e\u003c/h3\u003e\n\u003c/li\u003e\n\u003c/ol\u003e\n\u003cp\u003eUse these tactics for hints on getting yourself out of a jam.\u003c/p\u003e\n\u003col start=\"8\"\u003e\n\u003cli\u003e\n\u003ch3 id=\"debugging-using-have-\"\u003eDebugging using \u003ccode\u003ehave :=\u003c/code\u003e\u003c/h3\u003e\n\u003c/li\u003e\n\u003c/ol\u003e\n\u003cp\u003eThere\u0026rsquo;s no \u003ccode\u003eprint\u003c/code\u003e in Lean, nor is there a debugger.\nUsually the Infoview pane on the right is enough to tell us what we want to know.\nStill, there are times when it\u0026rsquo;s necessary to know what some syntax means, or just to understand the pieces that make up a complex statement.\nAt such places/times, use the command\u003c/p\u003e\n\u003cpre tabindex=\"0\"\u003e\u003ccode\u003ehave := (foo x).h\n\u003c/code\u003e\u003c/pre\u003e\u003cp\u003eThis will create a new variable called \u003ccode\u003ethis\u003c/code\u003e with the value of \u003ccode\u003e(foo x).h\u003c/code\u003e.\nIf \u003ccode\u003e(foo x).h\u003c/code\u003e is not valid Lean, then of course, this won\u0026rsquo;t work.\u003c/p\u003e\n\u003col start=\"9\"\u003e\n\u003cli\u003e\n\u003ch3 id=\"the-error-messages-make-sense\"\u003eThe error messages make sense.\u003c/h3\u003e\n\u003c/li\u003e\n\u003c/ol\u003e\n\u003cp\u003eWhen read and parsed carefully, they mostly do tell us which direction to move in.\nI wish they could tell me exactly what to do, and maybe they do, and I\u0026rsquo;m not good enough with Lean to understand.\u003c/p\u003e\n\u003col start=\"10\"\u003e\n\u003cli\u003e\n\u003ch3 id=\"dont-get-intimidated-by-the-m456--s-in-the-error-messages\"\u003eDon\u0026rsquo;t get intimidated by the \u003ccode\u003e?m.456\u003c/code\u003e  \u0026rsquo;s in the error messages.\u003c/h3\u003e\n\u003c/li\u003e\n\u003c/ol\u003e\n\u003cp\u003eThere is probably nothing wrong with your installation or the editor. Those are just placeholders for arguments/types (those are the same things, I think).\u003c/p\u003e\n\u003col start=\"11\"\u003e\n\u003cli\u003e\n\u003ch3 id=\"read-the-docs\"\u003eRead the docs!\u003c/h3\u003e\n\u003c/li\u003e\n\u003c/ol\u003e\n\u003cp\u003eLeans has \u003ca href=\"https://lean-lang.org/documentation/\"\u003eits own documentation\u003c/a\u003e, and \u003ca href=\"https://leanprover-community.github.io/mathlib4_docs/\"\u003eso does Mathlib\u003c/a\u003e.\nIt\u0026rsquo;s really helpful to be able to read it.\nTrust me, this always helps in the long run.\u003c/p\u003e\n\u003col start=\"12\"\u003e\n\u003cli\u003e\n\u003ch3 id=\"the-community-is-great\"\u003eThe community is great\u003c/h3\u003e\n\u003c/li\u003e\n\u003c/ol\u003e\n\u003cp\u003eYou can join the \u003ca href=\"https://leanprover-community.github.io/\"\u003eLean community\u003c/a\u003e and Zulip and post questions there!\u003c/p\u003e\n\u003cp\u003eAlthough I think it\u0026rsquo;s a useful skill to have, Lean is fun too, and I hope you enjoy learning and using it!\u003c/p\u003e\n"
    }, {
      "id": "https://aadi.ink/suchthat/chapter0/",
      "url": "https://aadi.ink/suchthat/chapter0/",
      "title": "Making Sense of Division by Zero",
      "date_published": "2023-08-20T17:20:20+05:30",
      "content_html": "\u003cp\u003eHello there!\nThis isn\u0026rsquo;t going to be very long, but make yourself comfortable anyway.\u003c/p\u003e\n\u003cp\u003eWhen I was in school, we used to live in a tiny single-bedroom apartment.\nAs you would expect in such a small apartment, it was quite full of things.\nOne of the games I used to play was to find a way to go from one point to another\nwithout touching the ground.\n\u003clabel for=\"sn-d41d8cd98f00b204e9800998ecf8427e\" class=\"sidenote-toggle sidenote-number\"\n\t\u003e\u003cinput type=\"checkbox\" id=\"sn-d41d8cd98f00b204e9800998ecf8427e\" class=\"sidenote-toggle\" /\u003e\u003cspan\n\t\tclass=\"sidenote\"\u003eSome version of _The Floor is Lava_, but that sounds childish. I would rather go with _Crocodiles!_\u003c/span\n\t\u003e\u003c/label\n\u003e\nIt was fun.\nIf it was too easy, I would add extra constraints \u0026ndash; do it without touching a certain wall,\nor maybe within a fixed time, or whatever other idea came to mind.\nIf it became too difficult, to the degree that it stopped being fun, I would similarly let myself break a rule here or there, or perhaps just change the destination to something more doable.\u003c/p\u003e\n\u003cp\u003eTurns out maths is fundamentally no different from this concept!\nWe make a rules, like the rules that govern how addition takes place.\nGiven numbers \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003ea\u003c/mi\u003e\u003cmo separator=\"true\"\u003e,\u003c/mo\u003e\u003cmi\u003eb\u003c/mi\u003e\u003cmo separator=\"true\"\u003e,\u003c/mo\u003e\u003cmi\u003ec\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003ea,b,c\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e, we specify that \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003ea\u003c/mi\u003e\u003cmo\u003e+\u003c/mo\u003e\u003cmi\u003eb\u003c/mi\u003e\u003cmo\u003e=\u003c/mo\u003e\u003cmi\u003eb\u003c/mi\u003e\u003cmo\u003e+\u003c/mo\u003e\u003cmi\u003ea\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003ea+b = b+a\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e and \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003ea\u003c/mi\u003e\u003cmo\u003e+\u003c/mo\u003e\u003cmn\u003e0\u003c/mn\u003e\u003cmo\u003e=\u003c/mo\u003e\u003cmi\u003ea\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003ea+0 = a\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e, and \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003ea\u003c/mi\u003e\u003cmo\u003e+\u003c/mo\u003e\u003cmo stretchy=\"false\"\u003e(\u003c/mo\u003e\u003cmi\u003eb\u003c/mi\u003e\u003cmo\u003e+\u003c/mo\u003e\u003cmi\u003ec\u003c/mi\u003e\u003cmo stretchy=\"false\"\u003e)\u003c/mo\u003e\u003cmo\u003e=\u003c/mo\u003e\u003cmo stretchy=\"false\"\u003e(\u003c/mo\u003e\u003cmi\u003ea\u003c/mi\u003e\u003cmo\u003e+\u003c/mo\u003e\u003cmi\u003eb\u003c/mi\u003e\u003cmo stretchy=\"false\"\u003e)\u003c/mo\u003e\u003cmo\u003e+\u003c/mo\u003e\u003cmi\u003ec\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003ea+(b+c) = (a+b)+c\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e.\nThose are the rules of addition.\u003cbr\u003e\nIt\u0026rsquo;s arguable that Uno\u0026rsquo;s rules are more complicated than those of group theory.\nTry looking them up!\nIf you do, you\u0026rsquo;ll notice that the rules of a group do not require that\n\u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003ea\u003c/mi\u003e\u003cmo\u003e+\u003c/mo\u003e\u003cmi\u003eb\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003ea+b\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e must be the same as \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003eb\u003c/mi\u003e\u003cmo\u003e+\u003c/mo\u003e\u003cmi\u003ea\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003eb+a\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e.\nIn fact, the groups\nin which \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003ea\u003c/mi\u003e\u003cmo\u003e+\u003c/mo\u003e\u003cmi\u003eb\u003c/mi\u003e\u003cmo\u003e=\u003c/mo\u003e\u003cmi\u003eb\u003c/mi\u003e\u003cmo\u003e+\u003c/mo\u003e\u003cmi\u003ea\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003ea+b = b+a\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e is always true have a special name for themselves: they are called \u003cem\u003eAbelian\u003c/em\u003e groups.\u003c/p\u003e\n\u003cp\u003eBut wait.\nIsn\u0026rsquo;t it a fact that \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003ea\u003c/mi\u003e\u003cmo\u003e+\u003c/mo\u003e\u003cmi\u003eb\u003c/mi\u003e\u003cmo\u003e=\u003c/mo\u003e\u003cmi\u003eb\u003c/mi\u003e\u003cmo\u003e+\u003c/mo\u003e\u003cmi\u003ea\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003ea+b=b+a\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e?\nIsn\u0026rsquo;t that just \u003cem\u003eaddition\u003c/em\u003e?\u003cbr\u003e\nTo that, I say, exactly.\nAddition is just a bunch of rules.\nIn group theory, the plus sign (\u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmo\u003e+\u003c/mo\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e+\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e) is just a symbol\nto denote some operation.\nIt could be multiplication of numbers,\nthe rotation of a square,\nor just plain actual addition.\u003c/p\u003e\n\u003cp\u003eGroup theory doesn\u0026rsquo;t care what the operation is, as long as that operation follows the rules.\nAnd that\u0026rsquo;s what makes things interesting!\u003c/p\u003e\n\u003cp\u003eLook at any sport.\nIt\u0026rsquo;s another bunch of rules.\nI\u0026rsquo;ll take lawn tennis for example, but you can think of any sport familiar to you.\nIf tennis had too many restrictions for the size, shape, and material of the racket,\nthen there would be no room left for exploring new ways to play.\nIf there were too few rules, then it would lead to chaos: the computer-assisted, hydraulic rackets will end up competing against each other, leaving the players\u0026rsquo; aside.\nCool, but not interesting, nothing new, and not tennis.\u003c/p\u003e\n\u003cp\u003eGroup theory, like tennis, has enough rules to be interesting, but not too much to be a dead end.\nThese rules allow us to study a whole class of things, because they all happen to be following the rules of group theory.\u003c/p\u003e\n\u003cp\u003eTake for example, \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi mathvariant=\"double-struck\"\u003eR\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e\\R\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e, the set of all real numbers.\nThis, paired with the \u003cem\u003eaddition operation\u003c/em\u003e, is a group.\nIt also happens to be a vector space!\nBut vector spaces and groups are governed by different rules \u0026ndash; different sports!\u003c/p\u003e\n\u003cp\u003eHere\u0026rsquo;s where the sport analogy ends.\nThere\u0026rsquo;s no question of winning or losing here.\nThe point is that we are the ones who make the rules of mathematics.\nThen we are the same ones that try to see what happens if we stick to them.\u003c/p\u003e\n\u003cp\u003eThat brings me to the title.\nAccording to the rules of real numbers, division by zero is undefined. \u003clabel for=\"sn-d41d8cd98f00b204e9800998ecf8427e\" class=\"sidenote-toggle sidenote-number\"\n\t\u003e\u003cinput type=\"checkbox\" id=\"sn-d41d8cd98f00b204e9800998ecf8427e\" class=\"sidenote-toggle\" /\u003e\u003cspan\n\t\tclass=\"sidenote\"\u003eReals are not the only numbers, by the way, there\u0026#39;s other sets of numbers that have more, less, or different rules! $\\R$ doesn\u0026#39;t allow square roots of negative numbers, but $\\mathbb C$ does\u003c/span\n\t\u003e\u003c/label\n\u003e\nI used to wonder why we didn\u0026rsquo;t just define it then.\nUnfortunately, there is no way to define division by zero without breaking our own rules.\nWe can associate any physical intuition, or set it to something based on the context, but in the pure mathematical setting, there\u0026rsquo;s no answer that fits.\u003c/p\u003e\n\u003cp\u003eDividing a real by a real must be a real.\nSo which real number should \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmn\u003e1\u003c/mn\u003e\u003cmo\u003e÷\u003c/mo\u003e\u003cmn\u003e0\u003c/mn\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e1\\div0\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e be?\nThere is no such real number as infinity.\nDon\u0026rsquo;t get me wrong, there are ways to treat infinity like a number, but that will involve breaking rules too.\u003cbr\u003e\nCan \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmn\u003e1\u003c/mn\u003e\u003cmo\u003e÷\u003c/mo\u003e\u003cmn\u003e0\u003c/mn\u003e\u003cmo\u003e=\u003c/mo\u003e\u003cmn\u003e0\u003c/mn\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e1\\div0=0\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e? That would then mean that \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmfrac\u003e\u003cmn\u003e1\u003c/mn\u003e\u003cmn\u003e0\u003c/mn\u003e\u003c/mfrac\u003e\u003cmo\u003e\u0026lt;\u003c/mo\u003e\u003cmfrac\u003e\u003cmn\u003e1\u003c/mn\u003e\u003cmn\u003e2\u003c/mn\u003e\u003c/mfrac\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e\\frac10\u0026lt; \\frac12\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e, and then following rules of real numbers, we would have \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmn\u003e0\u003c/mn\u003e\u003cmo\u003e\u0026gt;\u003c/mo\u003e\u003cmn\u003e2\u003c/mn\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e0\u0026gt;2\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e.\nThis is a problem if we also want real numbers to follow our usual notions of numbers and counting.\u003c/p\u003e\n\u003cp\u003eSo then the answer can\u0026rsquo;t be \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmn\u003e0\u003c/mn\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e0\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e.\u003c/p\u003e\n\u003cp\u003eTrying to set \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmn\u003e1\u003c/mn\u003e\u003cmo\u003e÷\u003c/mo\u003e\u003cmn\u003e0\u003c/mn\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e1\\div 0\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e equal to any other real leads to roadblocks just like this one.\u003c/p\u003e\n\u003cp\u003eAnd so we leave it undefined, that is, \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmn\u003e1\u003c/mn\u003e\u003cmo\u003e÷\u003c/mo\u003e\u003cmn\u003e0\u003c/mn\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e1\\div0\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e is not a real number.\u003c/p\u003e\n\u003cp\u003eWhat next?\nReal numbers have rules that make them useful to real world?\nSometimes we need to make sense of situations when we reach a division by zero.\nWhat do we do then\u003c/p\u003e\n\u003cp\u003eWell, let\u0026rsquo;s see what happens when we divide by numbers that are very small, but not zero.\u003c/p\u003e\n\u003ctable\u003e\n  \u003cthead\u003e\n      \u003ctr\u003e\n          \u003cth\u003eNumber \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003ex\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003ex\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e\u003c/th\u003e\n          \u003cth\u003e\u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmn\u003e1\u003c/mn\u003e\u003cmo\u003e÷\u003c/mo\u003e\u003cmi\u003ex\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e1\\div x\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e\u003c/th\u003e\n      \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctbody\u003e\n      \u003ctr\u003e\n          \u003ctd\u003e\u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmfrac\u003e\u003cmn\u003e1\u003c/mn\u003e\u003cmn\u003e2\u003c/mn\u003e\u003c/mfrac\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e\\frac12\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e\u003c/td\u003e\n          \u003ctd\u003e\u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmn\u003e2\u003c/mn\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e2\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e\u003c/td\u003e\n      \u003c/tr\u003e\n      \u003ctr\u003e\n          \u003ctd\u003e\u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmfrac\u003e\u003cmn\u003e1\u003c/mn\u003e\u003cmn\u003e5\u003c/mn\u003e\u003c/mfrac\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e{\\frac15}\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e\u003c/td\u003e\n          \u003ctd\u003e\u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmn\u003e5\u003c/mn\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e5\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e\u003c/td\u003e\n      \u003c/tr\u003e\n      \u003ctr\u003e\n          \u003ctd\u003e\u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmfrac\u003e\u003cmn\u003e1\u003c/mn\u003e\u003cmn\u003e50\u003c/mn\u003e\u003c/mfrac\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e{\\frac1{50}}\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e\u003c/td\u003e\n          \u003ctd\u003e\u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmn\u003e50\u003c/mn\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e50\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e\u003c/td\u003e\n      \u003c/tr\u003e\n      \u003ctr\u003e\n          \u003ctd\u003e\u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmfrac\u003e\u003cmn\u003e1\u003c/mn\u003e\u003cmn\u003e1000\u003c/mn\u003e\u003c/mfrac\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e{\\frac1{1000}}\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e\u003c/td\u003e\n          \u003ctd\u003e\u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmn\u003e1000\u003c/mn\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e1000\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e\u003c/td\u003e\n      \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\u003cp\u003eBefore anybody has a chance to jump to conclusions,\nI want to show this:\u003c/p\u003e\n\u003ctable\u003e\n  \u003cthead\u003e\n      \u003ctr\u003e\n          \u003cth\u003eNumber \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmi\u003ex\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003ex\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e\u003c/th\u003e\n          \u003cth\u003e\u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmn\u003e1\u003c/mn\u003e\u003cmo\u003e÷\u003c/mo\u003e\u003cmi\u003ex\u003c/mi\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e1\\div x\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e\u003c/th\u003e\n      \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctbody\u003e\n      \u003ctr\u003e\n          \u003ctd\u003e\u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmo\u003e−\u003c/mo\u003e\u003cmfrac\u003e\u003cmn\u003e1\u003c/mn\u003e\u003cmn\u003e2\u003c/mn\u003e\u003c/mfrac\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e-\\frac12\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e\u003c/td\u003e\n          \u003ctd\u003e\u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmo\u003e−\u003c/mo\u003e\u003cmn\u003e2\u003c/mn\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e-2\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e\u003c/td\u003e\n      \u003c/tr\u003e\n      \u003ctr\u003e\n          \u003ctd\u003e\u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmo\u003e−\u003c/mo\u003e\u003cmfrac\u003e\u003cmn\u003e1\u003c/mn\u003e\u003cmn\u003e5\u003c/mn\u003e\u003c/mfrac\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e{-\\frac15}\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e\u003c/td\u003e\n          \u003ctd\u003e\u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmo\u003e−\u003c/mo\u003e\u003cmn\u003e5\u003c/mn\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e-5\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e\u003c/td\u003e\n      \u003c/tr\u003e\n      \u003ctr\u003e\n          \u003ctd\u003e\u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmo\u003e−\u003c/mo\u003e\u003cmfrac\u003e\u003cmn\u003e1\u003c/mn\u003e\u003cmn\u003e50\u003c/mn\u003e\u003c/mfrac\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e{-\\frac1{50}}\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e\u003c/td\u003e\n          \u003ctd\u003e\u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmo\u003e−\u003c/mo\u003e\u003cmn\u003e50\u003c/mn\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e-50\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e\u003c/td\u003e\n      \u003c/tr\u003e\n      \u003ctr\u003e\n          \u003ctd\u003e\u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmo\u003e−\u003c/mo\u003e\u003cmfrac\u003e\u003cmn\u003e1\u003c/mn\u003e\u003cmn\u003e1000\u003c/mn\u003e\u003c/mfrac\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e{-\\frac1{1000}}\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e\u003c/td\u003e\n          \u003ctd\u003e\u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmo\u003e−\u003c/mo\u003e\u003cmn\u003e1000\u003c/mn\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e-1000\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e\u003c/td\u003e\n      \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\u003cp\u003eWe seem to have some pattern here!\nWe can actually build some more rules to make sense of such patterns, which we shall do in the next chapter called limits!\u003c/p\u003e\n"
    }, {
      "id": "https://aadi.ink/posts/2023/03/free-product-of-z4-and-z3/",
      "url": "https://aadi.ink/posts/2023/03/free-product-of-z4-and-z3/",
      "title": "Free Product of $\\mathbb Z_3$ and $\\mathbb Z_4$",
      "date_published": "2023-03-08T05:22:55+05:30",
      "content_html": "\u003cp\u003eI was recently tasked to draw the Cayley diagram of\nthe free product of \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmspace linebreak=\"newline\"\u003e\u003c/mspace\u003e\u003cmsub\u003e\u003cmi\u003eZ\u003c/mi\u003e\u003cmn\u003e3\u003c/mn\u003e\u003c/msub\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e\\\\Z_3\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e and \u003cspan class=\"katex\"\u003e\u003cmath xmlns=\"http://www.w3.org/1998/Math/MathML\"\u003e\u003csemantics\u003e\u003cmrow\u003e\u003cmspace linebreak=\"newline\"\u003e\u003c/mspace\u003e\u003cmsub\u003e\u003cmi\u003eZ\u003c/mi\u003e\u003cmn\u003e4\u003c/mn\u003e\u003c/msub\u003e\u003c/mrow\u003e\u003cannotation encoding=\"application/x-tex\"\u003e\\\\Z_4\u003c/annotation\u003e\u003c/semantics\u003e\u003c/math\u003e\u003c/span\u003e.\nIt looks quite nice and interesting (to me anyway),\nso why not put it up here?\u003c/p\u003e\n\u003cp\u003eI don\u0026rsquo;t understand free products well enough\nto be able to explain them in any manner,\nbut that doesn\u0026rsquo;t prevent me from sharing the diagram with you!\nHere you go:\u003c/p\u003e\n\u003cfigure\u003e\n\t\u003cimg src='free-product-z3-z4.png' alt=\"\" class=\"figure dynamic-bg\" \n\twidth=\"80%\" \n\talt=\"Cayley diagram showing squares with triangles on each corner, each triangle having a square on its corners, and so on.\" \n\ttitle=\"Free product of the cyclic groups of order 3 and 4.\" \n\tclass=\"dynamic-background figure\"\u003e \n\t\u003cdiv class=\"caption-figure\"\u003eA small portion of $\\Z_3\\star\\Z_4$\u003c/div\u003e\n\u003c/figure\u003e\nThis pattern carries on and on.\nI haven't labelled every element (denoted by a circle)\nbecause that would make it messy.\n"
    }
  ]
}

