diff options
| author | Kumar Damani <me@kumardamani.net> | 2026-07-29 17:02:57 +0000 |
|---|---|---|
| committer | Kumar Damani <me@kumardamani.net> | 2026-07-29 17:02:57 +0000 |
| commit | 564ab84af7f69603e3658bce846168f2cfb91249 (patch) | |
| tree | 1d0082161f294dac2eb1f53e91a9470b5ece236c /post/programming-as-art.typ | |
| parent | f2315a58fdaaa20c9e1300399ea8d528c80e2cc6 (diff) | |
normalized, and converted all images to webp
Diffstat (limited to 'post/programming-as-art.typ')
| -rw-r--r-- | post/programming-as-art.typ | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/post/programming-as-art.typ b/post/programming-as-art.typ index ef80e33..e4e2fd6 100644 --- a/post/programming-as-art.typ +++ b/post/programming-as-art.typ @@ -15,7 +15,7 @@ for _ in range(1, 1001): At the time it felt like having the #extlink("https://harry-potter-compendium.fandom.com/wiki/Elder_Wand")[Elder Wand]. -#fig("programming-as-art/wand.png", alt: "Dumbledore with Elder Wand pic") +#fig("programming-as-art/wand.webp", alt: "Dumbledore with Elder Wand pic") But there was more to our lesson. The TA then asks us to put our newly found power to use by computing the sum of 1 to 100. Of course, it was a natural @@ -41,7 +41,7 @@ _linearly_ with the input size. Later we would formalize this to $cal(O)(n)$ The TA hinted that there is a better way, and that we already know of the better way in math. -#fig("programming-as-art/teaching.png", alt: "Teaching meme") +#fig("programming-as-art/teaching.webp", alt: "Teaching meme") $ S_n = sum_(i=1)^n i = 1 + 2 + ... + n = (n (n + 1)) / 2 $ @@ -60,7 +60,7 @@ instructions. Crucially, it does not depend on the size of the input like our previous solution, thus *no matter the input, it always takes 3 instructions to compute!* This is a HUGE win! -#fig("programming-as-art/math.png", alt: "Math meme") +#fig("programming-as-art/math.webp", alt: "Math meme") Later we would formalize this to $cal(O)(1)$, or _constant_ scaling. @@ -89,7 +89,7 @@ When I reflect on moments like this, it reminds me that there is emergent elegance and beauty even in the seemingly arbitrary sequence of symbols that is `code`. -#fig("programming-as-art/code.png", alt: "The Matrix code going by image") +#fig("programming-as-art/code.webp", alt: "The Matrix code going by image") Programming is not quite as _objective_ as people would have you believe. There are trade-offs to each solution, and which solution you prefer relect on the |
