{ "cells": [ { "cell_type": "markdown", "id": "4f0ef1f2-0c73-4ef5-b430-48fe4ce450c0", "metadata": {}, "source": [ "
Peter Norvig, December 2024
\n", "\n", "# Advent of Code 2024\n", "\n", "I enjoy doing the [**Advent of Code**](https://adventofcode.com/) (AoC) programming puzzles, so here we go for 2024! This is the 10th year, so congratulations to puzzle creator [**Eric Wastl**](https://adventofcode.com/2024/about). Our old friend [**Gary Grady**](https://find.sciences.social/search/accounts/@garygrady@mastodon.social) is here to provide illustrations:\n", "\n", "\"GaryJGrady\n", "\n", "Even before December 1st I can start by loading up my [**AdventUtils.ipynb**](AdventUtils.ipynb) notebook (same as last time except for the `current_year`):" ] }, { "cell_type": "code", "execution_count": 2, "id": "ed82ed5b-a42d-468b-8f6e-288d3c2de20b", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "3.12.7 | packaged by Anaconda, Inc. | (main, Oct 4 2024, 08:22:19) [Clang 14.0.6 ]\n" ] } ], "source": [ "%run AdventUtils.ipynb\n", "current_year = 2024\n", "\n", "print(sys.version)" ] }, { "cell_type": "markdown", "id": "dfecffd7-6955-45ba-9dc2-1ec805baba85", "metadata": {}, "source": [ "Each day's solution consists of three parts, making use of my `parse` and `answer` utilities:\n", "- **Reading the input**. Parse the input file with, e.g. `pairs = parse(1, ints)`. \n", "- **Solving Part One**. Find the solution and record it with, e.g., `answer(1.1, 4, lambda: 2 + 2)`.\n", "- **Solving Part Two**. Find the solution and record it with, e.g., `answer(1.2, 9, lambda: 3 * 3)`.\n", "\n", "The function `parse` assumes that the input is a sequence of sections (default one per line), each of which should be parsed in some way and then returned as a tuple. The parsing method `ints` says to treat each section as a tuple of integers. The function `answer` checks that the correct answer is computed (useful for regression testing), and records the run time (that's why a `lambda:` is used). You can read the [**AdventUtils.ipynb**](AdventUtils.ipynb) notebook for more on these functions (and the other utilities used throughout this notebook, such as the `Grid` class).\n", "\n", "To fully understand each day's puzzle, and to follow along the drama involving Santa, the elves, the reindeer, some elephants, the Chief Historian, and all the rest, you need to read the puzzle descriptions on the [**AoC**](https://adventofcode.com/) site, as linked in the header for each day's solutions (e.g. [**Day 1**](https://adventofcode.com/2023/day/1) below). " ] }, { "cell_type": "markdown", "id": "4c6120a1-3129-44ff-935c-30c1d81ae028", "metadata": {}, "source": [ "# [Day 1](https://adventofcode.com/2024/day/1) Historian Hysteria\n", "\n", "According to the narrative, North Pole Historians created two lists of **location IDs**. We can parse them as a sequence of pairs of integers, and then use the transpose function, `T`, from my [AdventUtils](AdventUtils.ipynb) to get two lists of ID numbers:" ] }, { "cell_type": "code", "execution_count": 5, "id": "22e5d621-a152-4712-866f-f8b962b5dd14", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "Puzzle input ➜ 1000 strs:\n", "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "38665 13337\n", "84587 21418\n", "93374 50722\n", "68298 57474\n", "54771 18244\n", "49242 83955\n", "66490 44116\n", "65908 51323\n", "...\n", "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "Parsed representation ➜ 1000 tuples:\n", "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "(38665, 13337)\n", "(84587, 21418)\n", "(93374, 50722)\n", "(68298, 57474)\n", "(54771, 18244)\n", "(49242, 83955)\n", "(66490, 44116)\n", "(65908, 51323)\n", "...\n" ] } ], "source": [ "left, right = location_ids = T(parse(1, ints))" ] }, { "cell_type": "markdown", "id": "63cf2940-e251-49e4-8bc9-f1bcd599f8f4", "metadata": {}, "source": [ "\n", "\n", "### Part 1: What is the total distance between your lists?\n", "\n", "The **distance** between two numbers is defined as the absolute value of their difference, and the **total distance** between two lists is the sum of the distances between respective pairs, where \"respective\" means to sort each list and then take the distance between the first element of each list, plus the distance between the second element of each list, and so on. (I use the transpose utility function, `T`, to turn the input sequence of 1000 pairs into two lists, each of 1000 integers.)" ] }, { "cell_type": "code", "execution_count": 7, "id": "8d6bc9f5-5fa1-4dad-bd43-d957833d8ea9", "metadata": {}, "outputs": [], "source": [ "def total_distance(left: Ints, right: Ints) -> int:\n", " \"\"\"Total distance between respective list elements, after sorting.\"\"\"\n", " return sum(abs(a - b) for a, b in zip(sorted(left), sorted(right)))" ] }, { "cell_type": "code", "execution_count": 8, "id": "6ada5e5b-2fb7-4198-a5bb-7b2af4b9270a", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Puzzle 1.1: .000 seconds, answer 1830467 ok" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "answer(1.1, 1830467, lambda:\n", " total_distance(left, right))" ] }, { "cell_type": "markdown", "id": "88e26234-f1d2-4a62-86b0-2ad9251215eb", "metadata": {}, "source": [ "### Part 2: What is their similarity score?\n", "\n", "The **similarity score** is defined as the sum of each element of the left list times the number of times that value appears in the right list." ] }, { "cell_type": "code", "execution_count": 10, "id": "0131e096-38d1-4c13-9e9c-b0d09839a5cf", "metadata": {}, "outputs": [], "source": [ "def similarity_score(left: Ints, right: Ints) -> int:\n", " \"\"\"The sum of each x in `left` times the number of times x appears in `right`.\"\"\"\n", " counts = Counter(right)\n", " return sum(x * counts[x] for x in left)" ] }, { "cell_type": "code", "execution_count": 11, "id": "6f6c298a-53a1-4d80-8747-7dd713d4d4f0", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Puzzle 1.2: .000 seconds, answer 26674158 ok" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "answer(1.2, 26674158, lambda:\n", " similarity_score(left, right))" ] }, { "cell_type": "markdown", "id": "b9fa4fe0-4194-47d7-b815-b571af98caee", "metadata": {}, "source": [ "# [Day 2](https://adventofcode.com/2024/day/2): Red-Nosed Reports\n", "\n", "Today's input is a sequence of **reports**, each of which is a sequence of integers:" ] }, { "cell_type": "code", "execution_count": 13, "id": "10e1ab83-a6ec-4143-ad9a-eaae220adcde", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "Puzzle input ➜ 1000 strs:\n", "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "74 76 78 79 76\n", "38 40 43 44 44\n", "1 2 4 6 8 9 13\n", "65 68 70 72 75 76 81\n", "89 91 92 95 93 94\n", "15 17 16 18 19 17\n", "46 47 45 48 51 52 52\n", "77 78 79 82 79 83\n", "...\n", "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "Parsed representation ➜ 1000 tuples:\n", "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "(74, 76, 78, 79, 76)\n", "(38, 40, 43, 44, 44)\n", "(1, 2, 4, 6, 8, 9, 13)\n", "(65, 68, 70, 72, 75, 76, 81)\n", "(89, 91, 92, 95, 93, 94)\n", "(15, 17, 16, 18, 19, 17)\n", "(46, 47, 45, 48, 51, 52, 52)\n", "(77, 78, 79, 82, 79, 83)\n", "...\n" ] } ], "source": [ "reports = parse(2, ints)" ] }, { "cell_type": "markdown", "id": "5dfd72c2-06c6-4c71-ae37-0c2c84074091", "metadata": {}, "source": [ "### Part 1: How many reports are safe?\n", "\n", "A report is **safe** if it is monotonically strictly increasing or strictly decreasing, and if no difference between adjacent numbers is greater than 3 in absolute value." ] }, { "cell_type": "code", "execution_count": 15, "id": "0f6b6744-e93d-47cf-accd-daab9f3650d0", "metadata": {}, "outputs": [], "source": [ "def is_safe(report: Ints) -> bool:\n", " \"\"\"A report is safe if all adjacent-number-differences are either in {1, 2, 3} or in {-1, -2, -3}.\"\"\"\n", " deltas = diffs(report)\n", " return deltas.issubset({1, 2, 3}) or deltas.issubset({-1, -2, -3})\n", " \n", "def diffs(report: Ints) -> Set[int]:\n", " \"\"\"The set of differences between adjacent numbers in the report.\"\"\"\n", " return {report[i] - report[i - 1] for i in range(1, len(report))}" ] }, { "cell_type": "markdown", "id": "5625ad98-f571-4451-ad19-8614833dfb10", "metadata": {}, "source": [ "Here are examples of how these functions work:" ] }, { "cell_type": "code", "execution_count": 17, "id": "c0cc052b-e9ef-4757-a860-4cd34dd00fb8", "metadata": {}, "outputs": [], "source": [ "assert diffs((7, 6, 4, 2, 1)) == {-1, -2}\n", "assert is_safe((7, 6, 4, 2, 1)) == True" ] }, { "cell_type": "markdown", "id": "051c71b7-4375-4812-b7cc-0c50adf20a09", "metadata": {}, "source": [ "And here is the answer to the puzzle:" ] }, { "cell_type": "code", "execution_count": 19, "id": "e662bf10-4d6a-40f1-95ce-dfc39f5b3fc2", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Puzzle 2.1: .000 seconds, answer 257 ok" ] }, "execution_count": 19, "metadata": {}, "output_type": "execute_result" } ], "source": [ "answer(2.1, 257, lambda:\n", " quantify(reports, is_safe))" ] }, { "cell_type": "markdown", "id": "ee48bf63-8a67-407b-9a73-df097811eabc", "metadata": {}, "source": [ "Note: I used my [AdventUtils](AdventUtils.ipynb) function `quantify`, where `quantify(reports, is_safe)` means the number of items in `reports` for which `is_safe` is true.\n", "\n", "### Part 2: How many reports are safe using the Problem Dampener?\n", "\n", "The **problem dampener** says that a report is safe if there is some way to drop one element and get a safe report." ] }, { "cell_type": "code", "execution_count": 21, "id": "67ba1d53-95b7-4811-b225-2ff15d6bdc5c", "metadata": {}, "outputs": [], "source": [ "def is_safe_with_dampener(report: Ints) -> bool:\n", " \"\"\"Is there any way to drop one element of `report` to get a safe report?\"\"\"\n", " return any(map(is_safe, drop_one(report)))\n", "\n", "def drop_one(seq: Sequence) -> Iterable:\n", " \"\"\"All ways of dropping one element of the input sequence.\"\"\"\n", " return (seq[:i] + seq[i + 1:] for i in range(len(seq)))\n", "\n", "assert set(drop_one('1234')) == {'234', '134', '124', '123'}" ] }, { "cell_type": "code", "execution_count": 22, "id": "d1b9ffb5-af7a-465f-a063-c31df2d0605c", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Puzzle 2.2: .002 seconds, answer 328 ok" ] }, "execution_count": 22, "metadata": {}, "output_type": "execute_result" } ], "source": [ "answer(2.2, 328, lambda:\n", " quantify(reports, is_safe_with_dampener))" ] }, { "cell_type": "markdown", "id": "54d6a0c2-a8ed-404d-abc0-72aa28a49f5d", "metadata": {}, "source": [ "# [Day 3](https://adventofcode.com/2024/day/3): Mull It Over\n", "\n", "Today's input is a computer program with some corrupted characters. The program has multiple lines, but newlines don't matter in this programming language, so I will concatenate them into one big string:" ] }, { "cell_type": "code", "execution_count": 24, "id": "78080200-0f9f-4492-9bee-c936737ee96f", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "Puzzle input ➜ 6 strs:\n", "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "where(536,162)~'what()what()how(220,399){ mul(5,253);mul(757,101)$where()@why()who()&when()from( ...\n", "}?~who()select()-mul(316,505)&%*how()mul(363,589)>?%-:)where()~{{mul(38,452)select()%>[{]%>%mul( ...\n", "?>where(911,272)'mul(894,309)~+%@#}@#why()mul(330,296)what()mul(707,884)mul;&}<{>where()$why()]m ...\n", "> (when()[where()/#!/usr/bin/perl,@;mul(794,217)select():'])select()mul(801,192)why()&]why()/:]* ...\n", ",+who():mul(327,845)/ >@[>@}}mul(86,371)!~&&~how(79,334)mul(637,103)why()mul(358,845)-#~?why(243 ...\n", "where()#{*,!?:$mul(204,279)what()!{ what()mul(117,94)!select()>:mul(665,432)#don't()!!\"GaryJGrady\n", "\n", "\n", "### Part 1: What do you get if you add up all of the results of the multiplications?\n", "\n", "For Part 1, just look for instructions of the form \"mul(*digits*,*digits*)\", using a regular expression and `re.findall`. Perform each of these multiplications and add them up, and ignore all other characters/instructions:" ] }, { "cell_type": "code", "execution_count": 26, "id": "bf6366b1-6952-47d8-8b3c-09f8d05ec093", "metadata": {}, "outputs": [], "source": [ "def execute(program: str) -> int:\n", " \"\"\"The sum of the results of the multiply instructions.\"\"\"\n", " return sum(prod(ints(m)) for m in all_multiplications(program))\n", "\n", "all_multiplications = re.compile(r'mul\\(\\d+,\\d+\\)').findall" ] }, { "cell_type": "code", "execution_count": 27, "id": "2032c903-5f23-4c16-ba68-410b6c1750e1", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Puzzle 3.1: .001 seconds, answer 156388521 ok" ] }, "execution_count": 27, "metadata": {}, "output_type": "execute_result" } ], "source": [ "answer(3.1, 156388521, lambda: \n", " execute(program))" ] }, { "cell_type": "markdown", "id": "d39477c7-5c81-41a9-83a3-5b1bfdef273a", "metadata": {}, "source": [ "Here's an example of `all_multiplications`:" ] }, { "cell_type": "code", "execution_count": 29, "id": "85844f51-1396-4299-ba5b-c61064ee02b6", "metadata": {}, "outputs": [], "source": [ "assert all_multiplications(\"mul(1,2) + mul(34,5) - mul(67,89] / mul(x,15)\") == ['mul(1,2)', 'mul(34,5)']" ] }, { "cell_type": "markdown", "id": "622d7010-145e-422a-a592-d4b446afcc0f", "metadata": {}, "source": [ "### Part 2: What do you get if you add up all of the results of just the enabled multiplications?\n", "\n", "For Part 2, the instruction \"`don't()`\" says to **disable** (ignore) following multiply instructions until a \"`do()`\" instruction **enables** them again. I will define the function `enabled`, which returns the part of the program that is enabled, by susbstituting a space for the \"`don't()...do()`\" sequence (or a \"`don't()...`\" sequence that goes to the end of the file)." ] }, { "cell_type": "code", "execution_count": 31, "id": "4525d01a-bac0-41c2-92b8-baf0fd395e88", "metadata": {}, "outputs": [], "source": [ "def enabled_part(program: str) -> str:\n", " \"\"\"Just the part of the program that is enabled; remove \"don't()...do()\" text.\"\"\"\n", " return re.sub(r\"don't\\(\\).*?(do\\(\\)|$)\", \" \", program)" ] }, { "cell_type": "code", "execution_count": 32, "id": "ce40f258-ca76-48c3-9965-27a6979a4243", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Puzzle 3.2: .000 seconds, answer 75920122 ok" ] }, "execution_count": 32, "metadata": {}, "output_type": "execute_result" } ], "source": [ "answer(3.2, 75920122, lambda:\n", " execute(enabled_part(program)))" ] }, { "cell_type": "markdown", "id": "e1448343-6488-45ad-b03d-d7928feb75cd", "metadata": {}, "source": [ "# [Day 4](https://adventofcode.com/2024/day/4): Ceres Search\n", "\n", "Today's puzzle is a 2D word-search puzzle:" ] }, { "cell_type": "code", "execution_count": 34, "id": "a0d903b9-018e-4861-9314-cafed59055fd", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "Puzzle input ➜ 140 strs:\n", "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "MASAMXMSSXXMAMXXMXMASXMASXMMSMSMMMAXMASASMMSSMSXAXMASMMSMMMSSMSASMSSSSMSMSMXXMXMAXAMXMSMSSXSAMXM ...\n", "MASMMXMASAXASMSMMMSAMXSMSAMXAAAAAXAMXASXAMAAAAMMSMMMMMASXAAAAMMAMAMMASAAAAXMXMSSSSSSMMSAMAXAXXSM ...\n", "MMXAXMMMSXMAMAAXAAXAAAXXSMMSMSMSMXAXMXSMMMMSSMXAMXAAXMAMMMMSSMMAMAMMAMMMMMXSAAXAAMMAXXSAMXMSMAXM ...\n", "SXSAMASASMSXMSMSMSSMMMMMMXAMXMMXMASMMMMAXXAAAMMMSSSSSMASXXAAXASMSXXMXSXSXSASMSMMSMSAMMMAMXAAMASX ...\n", "AAAXXXMASASXMXMAXXMMASAASMXSASASXAAAAMSSMMMSXMAAMMMMMXAXMMMMSAMXAMASAMXSAMASXXAXAAMAMXSAMXSXSMMA ...\n", "MSMMXXMMMAMAMMMMMMXSAXXAMMMMXSAXMMXXAMXAAMMXMASXMAAASMMXAAMXAXAMMMAMAMAMAMXMASXMMXMAAXMAXMAMXMSA ...\n", "MXAXAMXXMMMMSAMAASMMMSMMASASAMAMAXMSXMSMMXAMXAXMMSSXSASXSSSMAMSMXMXSAMSSSMAMXMXAMAXXMMSAXAXMMXMA ...\n", "ASXMMXSAMXAASXXMXSAAAXASAMMMASMSSSMAAMMXMMSSMASAMAMMMAMMAXMAXMASXMAXMSAAASASAMXSSMXSAAXSSMXAAXXA ...\n", "...\n" ] } ], "source": [ "xmas_grid = Grid(parse(4))" ] }, { "cell_type": "markdown", "id": "16d56872-be2c-4e9d-8821-a0fe9f66970b", "metadata": {}, "source": [ "### Part 1: How many times does XMAS appear?\n", "\n", "We just have to find how many times the word \"XMAS\" appears in the grid, horizontally, vertically, or diagonally, forwards or backwards. The variable `directions8` contains those eight directions (as (delta-x, delta-y) pairs). So examine each square of the grid and if it contains \"X\", see in how many of the directions it spells \"XMAS\". (Note that locations in the grid are denoted by `(x, y)` coordinates, as are directions (e.g., `(1, 0)` is the `East` direction. (The functions `add` and `mul` do addition and scalar multiplication on these 2D vectors.)" ] }, { "cell_type": "code", "execution_count": 36, "id": "72d48abb-7a82-452f-b91d-838b3836a90f", "metadata": {}, "outputs": [], "source": [ "def word_search(grid: Grid, word='XMAS') -> int:\n", " \"\"\"How many times does the given word appear in the grid?\"\"\"\n", " return quantify(grid_can_spell(grid, start, dir, word) \n", " for start in grid \n", " if grid[start] == word[0]\n", " for dir in directions8)\n", "\n", "def grid_can_spell(grid, start, dir, word):\n", " \"\"\"Does `word` appear in grid starting at `start` and going in direction `dir`?\"\"\"\n", " return all(grid[add(start, mul(dir, i))] == word[i] \n", " for i in range(len(word)))" ] }, { "cell_type": "code", "execution_count": 37, "id": "6175362b-d8b4-45d1-b70c-d8575a0fe188", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Puzzle 4.1: .020 seconds, answer 2401 ok" ] }, "execution_count": 37, "metadata": {}, "output_type": "execute_result" } ], "source": [ "answer(4.1, 2401, lambda:\n", " word_search(xmas_grid))" ] }, { "cell_type": "markdown", "id": "eabe90c4-b668-4d9e-a345-b09f4b8ee42b", "metadata": {}, "source": [ "### Part 2: How many times does an X-MAS appear?\n", "\n", "Upon further review, the goal is not to find \"XMAS\" byt rather X-\"MAS\"; that is, two \"MAS\" words in an X pattern. The pattern can be any of these four:\n", "\n", " M.S S.M M.M S.S\n", " .A. .A. .A. .A.\n", " M.S S.M S.S M.M\n", "\n", "I decided to find these by first looking for each the middle letter (\"A\") in the grid, and then, for each \"A\" and for each of the four pairs of diagonal directions, see if the target word (\"MAS\") can be spelled in both directions:" ] }, { "cell_type": "code", "execution_count": 39, "id": "3d8a051f-cf7b-4e8c-b0fb-78c3f089989d", "metadata": {}, "outputs": [], "source": [ "diagonal_pairs = ([SE, NE], [SW, NW], [SE, SW], [NE, NW])\n", "\n", "def x_search(grid: Grid, word='MAS') -> int:\n", " \"\"\"How many times does an X-MAS appear in the grid?\"\"\"\n", " A = word[1] # The letter in the middle of the cross\n", " return quantify((grid_can_spell(grid, sub(mid_pos, dir1), dir1, word) and\n", " grid_can_spell(grid, sub(mid_pos, dir2), dir2, word))\n", " for mid_pos in grid.findall(A) # All positions where A appears\n", " for dir1, dir2 in diagonal_pairs)" ] }, { "cell_type": "code", "execution_count": 40, "id": "64cde1d9-f58c-4633-b5da-87908a02f76d", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Puzzle 4.2: .016 seconds, answer 1822 ok" ] }, "execution_count": 40, "metadata": {}, "output_type": "execute_result" } ], "source": [ "answer(4.2, 1822, lambda:\n", " x_search(xmas_grid))" ] }, { "cell_type": "markdown", "id": "0249ce80-e649-44b3-8c02-613fc7652110", "metadata": {}, "source": [ "# [Day 5](https://adventofcode.com/2024/day/5): Print Queue\n", "\n", "Today's puzzle involves some **sleigh launch safety manuals** that need to be updated with new printings. The day's input is in two sections: the first a set of **rules** such as \"47|53\", which means that if an update prints both page 47 and page 53, then it must print 47 sometime before 53. The second section is a list of **updates** of the form \"75,47,61,53,29\", meaning that for one version of the safety manual, those are the pages that need to be printed, and that is the suggested order of printing.\n", "\n", "\n", "\n", "I mostly like my `parse` function: it is easy to tell it how to break the input into sections and how to parse every section. But I admit my `parse` is not ideal when an input file has sections with two different formats. I'll parse the two sections as paragraphs, and then call `parse` again on each paragraph:" ] }, { "cell_type": "code", "execution_count": 42, "id": "b77a5a1f-a43b-4ce8-a60c-94d69a595505", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "Puzzle input ➜ 1366 strs:\n", "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "48|39\n", "39|84\n", "39|23\n", "95|51\n", "95|76\n", "95|61\n", "14|52\n", "14|49\n", "...\n", "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "Parsed representation ➜ 2 strs:\n", "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "48|39\n", "39|84\n", "39|23\n", "95|51\n", "95|76\n", "95|61\n", "14|52\n", "14|49\n", "14|39\n", "14|53\n", "85|19\n", "85|25\n", "85|61\n", "85|35\n", "85|58\n", "74|86\n", " ...\n", "61,58,51,32,12,14,71\n", "58,25,54,14,12,94,32,76,39\n", "35,53,26,77,14,71,25,76,85,55,51,49,95\n", "32,91,76, ...\n" ] } ], "source": [ "manual = parse(5, sections=paragraphs)\n", "rules = set(parse(manual[0], ints))\n", "updates = parse(manual[1], ints)" ] }, { "cell_type": "markdown", "id": "c6e4d0b6-c69e-4284-9757-cf3ce51b196c", "metadata": {}, "source": [ "Here I show what the rules and updates look like:" ] }, { "cell_type": "code", "execution_count": 44, "id": "4c85a23e-686a-4129-a14c-ff6f6a88b9ac", "metadata": {}, "outputs": [], "source": [ "assert (48, 39) in rules # `rules` is a set of (earlier, later) page number pairs\n", "assert updates[0] == (61, 58, 51, 32, 12, 14, 71) # `updates` is a sequence of page number tuples" ] }, { "cell_type": "markdown", "id": "d6b6d374-cbe9-4b84-a1dd-d9df927c7182", "metadata": {}, "source": [ "### Part 1: What do you get if you add up the middle page number from the correctly-ordered updates?\n", "\n", "An update is correct if no combination of two pages in the update violates any of the rules. I'll define `is_correct` to implement this check, and `sum_of_correct_middles` to add up the middle numbers of the correct updates:" ] }, { "cell_type": "code", "execution_count": 46, "id": "78898d37-46ff-4367-9d89-b2a107a90aa1", "metadata": {}, "outputs": [], "source": [ "def sum_of_correct_middles(rules: Set[Ints], updates: Tuple[Ints]) -> int:\n", " \"\"\"The sum of the middle elements of each update that is correct.\"\"\"\n", " return sum(middle(update) for update in updates if is_correct(update, rules))\n", "\n", "def is_correct(update: Ints, rules: Set[Ints]) -> bool:\n", " \"\"\"An update is correct if no pair of pages violates a rule in the rules set.\"\"\"\n", " return not any((second, first) in rules for (first, second) in combinations(update, 2))\n", "\n", "def middle(seq: Sequence) -> object: return seq[len(seq) // 2]" ] }, { "cell_type": "code", "execution_count": 47, "id": "b1c87359-1d2d-4a90-8305-9d152ce5d547", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Puzzle 5.1: .001 seconds, answer 5762 ok" ] }, "execution_count": 47, "metadata": {}, "output_type": "execute_result" } ], "source": [ "answer(5.1, 5762, lambda:\n", " sum_of_correct_middles(rules, updates))" ] }, { "cell_type": "markdown", "id": "80da4fd9-b11e-4dbb-8d22-2071d1a89827", "metadata": {}, "source": [ "### Part 2: What do you get if you add up the middle page numbers of the correction of each incorrect update?\n", "\n", "In Part 2 we have to find the incorrect updates, re-order them into a correct order, and sum the middle page numbers of just these corrected updates.\n", "Since I have already defined `is_correct`, I could just generate all permutations of each update and find one that `is_correct`. That would work great if the longest update consists of only 5 pages, as it does in the example input. But what is the longest update in *my* input?" ] }, { "cell_type": "code", "execution_count": 49, "id": "d8718c3e-0b3b-49ce-8cca-abd82aa788d7", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "23" ] }, "execution_count": 49, "metadata": {}, "output_type": "execute_result" } ], "source": [ "max(map(len, updates))" ] }, { "cell_type": "markdown", "id": "4449200f-dd19-48f1-94b2-7304daa9fa00", "metadata": {}, "source": [ "That's not great. With 23 page numbers there are 23! permutations, which is over 25 sextillion. So instead, here's my strategy:\n", "\n", "- Instead of generating all permutations, `correction` will **sort** an update, returning a corrected reordering that obeys all the rules. This is a [topological sort](https://en.wikipedia.org/wiki/Topological_sorting) and is guaranteed to give a correct reordering (unless the rules contain a contradiction like \"2 must be before 3 and 3 must be before 2\"). There may be multiple correct orderings (for example, if there are no rules involving the pages in the update, then any ordering is correct). It used to be that Python's `sort` method allowed a `cmp` keyword to compare two values; there is vestigial support for this with the `functools.cmp_to_key` function. I will sort each update so that page *m* comes before page *n* if (*m*, *n*) is in the rules, and *m* comes after *n* if (*n*, *m*) is in the rules. Sorting will be about a sextillion times faster than enumerating permutations.\n", "- `corrected` will find all the incorrect updates and correct them." ] }, { "cell_type": "code", "execution_count": 51, "id": "7222dc1c-067f-4bb5-84e1-3c2fc72fd53a", "metadata": {}, "outputs": [], "source": [ "def correction(update: Ints, rules) -> Ints:\n", " \"\"\"Reorder the update to make it correctly obey all the rules.\"\"\"\n", " def rule_lookup(m, n): return +1 if (m, n) in rules else -1 if (n, m) in rules else 0\n", " return sorted(update, key=functools.cmp_to_key(rule_lookup))\n", "\n", "def corrected(updates, rules) -> List[Ints]:\n", " \"\"\"Returns a list of corrected versions of all the incorrect rules.\"\"\"\n", " return [correction(update, rules) for update in updates if not is_correct(update, rules)]" ] }, { "cell_type": "code", "execution_count": 52, "id": "494cda6e-6b07-4054-9b03-45f61bd4f973", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Puzzle 5.2: .001 seconds, answer 4130 ok" ] }, "execution_count": 52, "metadata": {}, "output_type": "execute_result" } ], "source": [ "answer(5.2, 4130, lambda:\n", " sum_of_correct_middles([], corrected(updates, rules)))" ] }, { "cell_type": "markdown", "id": "53b1ccbc-01ae-43d0-a75f-3f9389fdd3c9", "metadata": {}, "source": [ "I have to say, I'm pleased that this day I got both parts right with no errors (and in fact, the same for the previous days). I was worried I might have my `+1` and `-1` backwards in `cmp_to_key`, but so far, everything has gone smoothly. (However, even if I started solving the moment that the puzzles are released, I wouldn't show up on the leaderboard; I'm still *way* slower than the skilled contest programmers." ] }, { "cell_type": "markdown", "id": "38258423-e3b8-4bae-8aeb-28f07f0d5a35", "metadata": {}, "source": [ "# [Day 6](https://adventofcode.com/2024/day/6): Guard Gallivant\n", "\n", "Today's input is a 2D map of the manufacturing lab, with \"`.`\" indicating an empty space, \"`#`\" indicating an obstruction, and \"`^`\" indicating the position of the security guard." ] }, { "cell_type": "code", "execution_count": 55, "id": "6ec71cf8-c43d-457e-8e14-0e9eb99b956a", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "Puzzle input ➜ 130 strs:\n", "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "........#........................................#......#........#.............................. ...\n", "....................................#......#.....#............#.............#..........#........ ...\n", "......................#.......................................................#................. ...\n", ".......#..#..#....#...#...#....#..............#......#.......#...#................#.......#..... ...\n", "......................#....##...#.......#....#.......................................#.......... ...\n", "...#............................#........................................#...................... ...\n", "....................#............#...............#......#.........#...........#................. ...\n", "............................#......#...#................#.............#......................... ...\n", "...\n" ] } ], "source": [ "lab_grid = Grid(parse(6))" ] }, { "cell_type": "markdown", "id": "4ba233f4-90aa-4249-9569-10288c34940d", "metadata": {}, "source": [ "### Part 1: How many distinct positions will the guard visit before leaving the mapped area?\n", "\n", "The guard follows this protocol: \n", "- If there is something directly in front of you, turn right 90 degrees.\n", "- Otherwise, take a step forward.\n", "\n", "I'll define `follow_path` to output a list of all the positions the guard occupies. I realize the puzzle is only asking for a *count* of the positions, but the path might be useful for Part 2, or for debugging, so I'll return it. I worried that it is also possible for a path to become a loop, but the puzzle statement specifically says that can't happen (the guard will always march off the grid), so I won't test for it." ] }, { "cell_type": "code", "execution_count": 57, "id": "95f0b409-a6d6-47bc-8ce5-1c2df80f2b18", "metadata": {}, "outputs": [], "source": [ "def follow_path(grid: Grid, guard='^', facing=North) -> List[Point]:\n", " \"\"\"A list of all points in the path followed by the guard.\n", " The guard turns right when there is an obstacle ahead, otherwise goes forward.\"\"\"\n", " path = grid.findall(guard) # A one-element list of positions, e.g. [(3, 4)]\n", " while (ahead := add(path[-1], facing)) in grid:\n", " if grid[ahead] == '#':\n", " facing = make_turn(facing, 'R')\n", " else:\n", " path.append(ahead)\n", " return path" ] }, { "cell_type": "code", "execution_count": 58, "id": "f4be3d1f-7f24-4d55-8221-df0026178e1e", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Puzzle 6.1: .001 seconds, answer 5329 ok" ] }, "execution_count": 58, "metadata": {}, "output_type": "execute_result" } ], "source": [ "answer(6.1, 5329, lambda: \n", " len(set(follow_path(lab_grid))))" ] }, { "cell_type": "markdown", "id": "eaf72ac3-ade0-4479-a090-1d0f292ecc27", "metadata": {}, "source": [ "I initially had a **bug**; I returned for the length of the **path**, not the length of the **set** of positions in the path. Since the path crosses itself these two numbers are different.\n", " \n", "### Part 2: How many different positions could you choose for an obstruction to put the guard in a loop?\n", "\n", "The historians would like to place a single obstacle so that the guard *will* get stuck in a loop, rather than exiting the grid. They want to know all possible positions for the obstacle. What do we know about such positions?\n", "- An obstacle position must be somewhere on the guard's path, otherwise it would have no effect.\n", "- The instructions say it can't be the guard's initial position.\n", "- A loop is when the guard's path returns to the same position with the same facing. This means my Part 1 solution, which returns the list of visited positions, is not helpful: it is not a loop if the guard is in position *p* facing East and then later returns to position *p* facing South. \n", "- Thus, I can detect a loop by keeping a set of previously visited position/facing pairs.\n", "- I can make slightly less work by only storing the *corners* of the path: the places where the guard turns. \n", "- The simplest approach for finding obstacle positions is to temporarily place an obstacle on each point on the path, one at a time, and see if it leads to a loop.\n", "- There are 5,329 positions on the path, so the runtime should be about 5,000 times longer than Part 1; on the order of 10 seconds or so. I'll try it, and if it seems too slow, I'll try to think of something better." ] }, { "cell_type": "code", "execution_count": 60, "id": "1718fecb-aa3e-4162-9948-1c06d4ec5e8a", "metadata": {}, "outputs": [], "source": [ "def is_loopy_path(grid: Grid, guard_pos, facing=North) -> bool:\n", " \"\"\"Does the path followed by the guard form a loop?\"\"\"\n", " path = {(guard_pos, facing)}\n", " while (ahead := add(guard_pos, facing)) in grid:\n", " if grid[ahead] == '#':\n", " facing = make_turn(facing, 'R')\n", " if (guard_pos, facing) in path:\n", " return True\n", " path.add((guard_pos, facing))\n", " else:\n", " guard_pos = ahead\n", " return False\n", " \n", "def find_loopy_obstacles(grid: Grid) -> Iterable[Point]:\n", " \"\"\"All positions in which placing an obstacle would result in a loopy path for the guard.\"\"\"\n", " guard_pos = the(grid.findall('^'))\n", " for pos in set(follow_path(grid)) - {guard_pos}:\n", " grid[pos] = '#' # Temporarily place an obstacle \n", " if is_loopy_path(grid, guard_pos):\n", " yield pos\n", " grid[pos] = '.' # Remove the temporarily-placed obstacle" ] }, { "cell_type": "code", "execution_count": 61, "id": "36196264-eb33-4fc0-95d5-06c985105ebf", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Puzzle 6.2: 1.998 seconds, answer 2162 ok" ] }, "execution_count": 61, "metadata": {}, "output_type": "execute_result" } ], "source": [ "answer(6.2, 2162, lambda:\n", " quantify(find_loopy_obstacles(lab_grid)))" ] }, { "cell_type": "markdown", "id": "9f3ee6f9-7ec7-4248-ae52-1804fdc81dbd", "metadata": {}, "source": [ "That was my first run time over a second, but still faster than I thought it would be. I guess many of the obstacles force the guard into a small, fast loop, or an early exit from the grid. Note that in `the(grid.findall('^'))`, `findall` is a method from my `Grid` class that finds all locations where a `'^'` character resides, and `the` is my utility function that returns the first element of a one-element list (and raises an error if there is not exactly one element).\n", "\n", "I had a **bug** initially, and never figured out what it was; it went away when I refactored to make the program nicer." ] }, { "cell_type": "markdown", "id": "9eae8cf2-8c97-418e-b00b-3ea0187da526", "metadata": {}, "source": [ "# [Day 7](https://adventofcode.com/2024/day/7): Bridge Repair\n", "\n", "The narrative for today involves fixing a bridge, and each line of our input represents a **calibration equation** for the bridge. Unfortunately, some nearby elephants stole all the operators from the equations, so all that is left are the integers:" ] }, { "cell_type": "code", "execution_count": 64, "id": "c1c6cee8-122c-43c9-8c7d-ed8980ea2b76", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "Puzzle input ➜ 850 strs:\n", "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "202998336: 686 9 7 62 2 673\n", "19275222: 361 3 7 170 65 5 223\n", "23101: 7 694 916 4 6\n", "2042426: 6 34 2 423 3\n", "40369523: 8 880 91 45 23\n", "46629044796: 990 471 4 4 796\n", "1839056: 3 42 2 4 3 258 703 4 8\n", "26205: 2 9 5 9 9 4 3 7 44 5 8 7\n", "...\n", "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "Parsed representation ➜ 850 tuples:\n", "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "(202998336, 686, 9, 7, 62, 2, 673)\n", "(19275222, 361, 3, 7, 170, 65, 5, 223)\n", "(23101, 7, 694, 916, 4, 6)\n", "(2042426, 6, 34, 2, 423, 3)\n", "(40369523, 8, 880, 91, 45, 23)\n", "(46629044796, 990, 471, 4, 4, 796)\n", "(1839056, 3, 42, 2, 4, 3, 258, 703, 4, 8)\n", "(26205, 2, 9, 5, 9, 9, 4, 3, 7, 44, 5, 8, 7)\n", "...\n" ] } ], "source": [ "equations = parse(7, ints)" ] }, { "cell_type": "markdown", "id": "be207b67-a970-4f79-85be-5d62b7cedd9f", "metadata": {}, "source": [ " " ] }, { "cell_type": "markdown", "id": "2e31d28f-97b1-4a3d-a298-18fcad297150", "metadata": {}, "source": [ "### Part 1: What is the total calibration result of possibly true equations?\n", "\n", "Our task is to find operators to balance each equation. The input \"`3267: 81 40 27`\" can be made into the equation \"`3267 = 81 + 40 * 27`\", with the understanding that all evaluations are done left-to-right, so this is \"`3267 = ((81 + 40) * 27)`\". The two allowable operators are addition and multiplication. Our task is to compute the sum of all the equations that can be balanced.\n", "\n", "The straightforward approach is to try both operators on every number. If there are *n* numbers in an equation, then there are *n* - 1 numbers on the right-hand side, and *n* - 2 missing operators, so there will be 2*n*-2 possible equations. Is that going to be a problem?" ] }, { "cell_type": "code", "execution_count": 67, "id": "6fa3907c-0e1a-4d4a-9fc3-f809b9325674", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "13" ] }, "execution_count": 67, "metadata": {}, "output_type": "execute_result" } ], "source": [ "max(map(len, equations))" ] }, { "cell_type": "markdown", "id": "e0d9b0b2-fe1e-434e-b84e-c044da3d3673", "metadata": {}, "source": [ "No problem! With 13 numbers on a line there are just 211 = 2048 equations; a small number. I'll define `can_be_calibrated` to try all possible operator combinations. It goes left-to-right, one number at a time, keeping a list of partial `results` which is updated for each new number in the equation. \n", "\n", "Although the puzzle instructions are a bit vague, it appears that when they say \"numbers\" they mean \"positive integers\". Therefore, neither addition nor multiplication can cause a partal result to decrease, so once a partial result exceeds the target, we can drop it." ] }, { "cell_type": "code", "execution_count": 69, "id": "5dfe0edf-cf29-4623-bb2c-6180f832f4d7", "metadata": {}, "outputs": [], "source": [ "def can_be_calibrated(equation: ints, operators=(operator.add, operator.mul)) -> bool:\n", " \"\"\"Can the equation be balanced using '+' and '*' operators?\"\"\"\n", " target, first, *rest = equation\n", " results = [first] # A list of all possible results of the partial computation\n", " for y in rest:\n", " results = [op(x, y) for x in results if x <= target for op in operators]\n", " return target in results\n", "\n", "def lhs(equation) -> int: \"Left-hand side\"; return equation[0]" ] }, { "cell_type": "code", "execution_count": 70, "id": "3085596d-f5ec-4ba8-b05a-cf70cf276a0c", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Puzzle 7.1: .014 seconds, answer 1985268524462 ok" ] }, "execution_count": 70, "metadata": {}, "output_type": "execute_result" } ], "source": [ "answer(7.1, 1985268524462, lambda:\n", " sum(lhs(equation) for equation in equations if can_be_calibrated(equation)))" ] }, { "cell_type": "markdown", "id": "62a5fe5f-e23f-4420-87a8-47d8be02fbc0", "metadata": {}, "source": [ "### Part 2: What is the total calibration result of possibly true equations, allowing concatenation?\n", "\n", "In Part 2, a third operator is allowed: concatentation. The equation \"`192: 17 8 14`\" can be balanced by concatenated 17 and 8 to get 178, and then adding 14 to get 192: \"`192 = ((17 || 8) + 14)`\". With three operators, the equation with 11 operators now has 311 = 177,147 possibilities, almost 100 times more than Part 1, so this will take longer:" ] }, { "cell_type": "code", "execution_count": 72, "id": "393a50cf-f136-446a-a97e-c501669ce89f", "metadata": {}, "outputs": [], "source": [ "operators3 = (operator.add, operator.mul, lambda x, y: int(str(x) + str(y))) " ] }, { "cell_type": "code", "execution_count": 73, "id": "f8e75ea3-e8ba-4b33-8efe-8bf74357e35d", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Puzzle 7.2: .803 seconds, answer 150077710195188 ok" ] }, "execution_count": 73, "metadata": {}, "output_type": "execute_result" } ], "source": [ "answer(7.2, 150077710195188, lambda:\n", " sum(lhs(equation) for equation in equations if can_be_calibrated(equation, operators3)))" ] }, { "cell_type": "markdown", "id": "128b4857-ed3e-49f5-97f5-9d9afd46408d", "metadata": {}, "source": [ "That was easy, but it is the second-slowest runtime so far. I can make it faster by implementing concatenation by multiplying and adding rather than by string operations." ] }, { "cell_type": "code", "execution_count": 75, "id": "6fe6adad-a3a6-49b8-b49e-6098b27e3a44", "metadata": {}, "outputs": [], "source": [ "operators3 = (operator.add, operator.mul, lambda x, y: (x * 10 ** num_digits(y)) + y)\n", "\n", "def num_digits(n: int) -> int:\n", " \"\"\"The number of digits in a positive integer.\"\"\"\n", " if n < 10: return 1 ## Three special cases cover most calls\n", " elif n < 100: return 2\n", " elif n < 1000: return 3\n", " result = 1\n", " while n >= 10:\n", " result += 1\n", " n /= 10\n", " return result" ] }, { "cell_type": "code", "execution_count": 76, "id": "ffb673f1-af9d-4d15-8f8d-92e29489dd78", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Puzzle 7.2: .606 seconds, answer 150077710195188 ok" ] }, "execution_count": 76, "metadata": {}, "output_type": "execute_result" } ], "source": [ "answer(7.2, 150077710195188, lambda:\n", " sum(numbers[0] for numbers in equations if can_be_calibrated(numbers, operators3)))" ] }, { "cell_type": "markdown", "id": "ecb4bdf5-89ef-4625-8d7b-acbaeb86a18a", "metadata": {}, "source": [ "Now that we're done with the first week, I'm going to clean up by deleting some of the big data structures that are hanging around." ] }, { "cell_type": "code", "execution_count": 78, "id": "ed4d4095-d417-4328-9c22-42c22606c482", "metadata": {}, "outputs": [], "source": [ "reports = xmas_grid = manual = rules = updates = lab_grid = equations = None" ] }, { "cell_type": "markdown", "id": "2e5693b7-dab8-4f89-a000-c69ee75a11c9", "metadata": {}, "source": [ "# [Day 8](https://adventofcode.com/2024/day/8): Resonant Collinearity\n", "\n", "Another grid input, this one a map of antenna locations. Each different non-\"`.`\" character denotes an antenna of a given frequency." ] }, { "cell_type": "code", "execution_count": 80, "id": "cf6361a7-e3bc-42ec-ae16-f9eec166055e", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "Puzzle input ➜ 50 strs:\n", "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "..................................................\n", ".................................C................\n", ".e..........7O....................................\n", ".....................................z............\n", "......................t.........C.......k.........\n", "............h................................9....\n", ".............5.7....O.............9C..............\n", ".......5.O................T.......................\n", "...\n" ] } ], "source": [ "antennas = Grid(parse(8))" ] }, { "cell_type": "markdown", "id": "c8e1006d-37bc-432e-bf1f-7a639287382a", "metadata": {}, "source": [ "### Part 1: How many unique locations within the bounds of the map contain an antinode?\n", "\n", "An **antinode** is defined as a point that is perfectly in line with two antennas of the same frequency, but only when one of the antennas is twice as far away as the other.\n", "\n", "That means that if two antennas are at points *A* and *B*, then the two antinodal points are at 2*A* - *B* and 2*B* - A. If there are three or more antennas with the same frequency then we consider each pair of them in turn. So all we have to do is group the antennas by frequency, compute the antinodes for each pair with the same frequency, and determine which of those antinodal points are on the grid." ] }, { "cell_type": "code", "execution_count": 82, "id": "22180ce8-5d03-4aee-8c73-62f2afbddf71", "metadata": {}, "outputs": [], "source": [ "def antinodes(antennas: Grid) -> Set[Point]:\n", " \"\"\"The set of all antinodal points in the grid.\n", " (That is, points that are of distance d and 2d from same frequency antennas.)\"\"\"\n", " groups = [antennas.findall(f) for f in set(antennas.values()) if f != '.']\n", " return union(antinodes2(A, B, antennas)\n", " for points in groups\n", " for A, B in combinations(points, 2))\n", "\n", "def antinodes2(A: Point, B: Point, antennas: Grid) -> Set[Point]:\n", " \"\"\"The set of antinodal points for two antenna points, A and B.\"\"\"\n", " return {P for P in {sub(mul(A, 2), B), sub(mul(B, 2), A)}\n", " if P in antennas}" ] }, { "cell_type": "code", "execution_count": 83, "id": "dd173ce9-cbbb-4282-b43f-c7cff662bd90", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Puzzle 8.1: .003 seconds, answer 220 ok" ] }, "execution_count": 83, "metadata": {}, "output_type": "execute_result" } ], "source": [ "answer(8.1, 220, lambda:\n", " len(antinodes(antennas)))" ] }, { "cell_type": "markdown", "id": "ff79d605-813a-46ac-8473-a1198be0e99f", "metadata": {}, "source": [ "### Part 2: How many unique locations within the bounds of the map contain an updated antinode?\n", "\n", "For Part 2, an **updated antinode** can now occur at *any* point that is exactly on line with two antennas of the same frequency, regardless of distance. So if the two antennas are *A* and *B* then the antinodal points can be found by starting at *A* and going step by step in the direction of the vector *A* - *B* and also in the direction *B* - *A*, going as far as you can while staying on the grid. The `Grid.follow_line` method facilitates that.\n", "\n", "I'll refactor `antinodes` to take an `antinodes2` parameter so it can handle both parts:" ] }, { "cell_type": "code", "execution_count": 85, "id": "d30f8ce9-f186-46a0-a2e7-f74eceae6905", "metadata": {}, "outputs": [], "source": [ "def antinodes(antennas: Grid, antinodes2=antinodes2) -> Set[Point]:\n", " \"\"\"The set of all antinodal points in the grid, according to the `antinode2` function.\"\"\"\n", " groups = [antennas.findall(f) for f in set(antennas.values()) if f != '.']\n", " return union(antinodes2(A, B, antennas)\n", " for points in groups\n", " for A, B in combinations(points, 2))\n", "\n", "def updated_antinodes2(A: Point, B: Point, antennas: Grid) -> Set[Point]:\n", " \"\"\"The set of updated antinodal points for two antenna points, A and B.\"\"\"\n", " return (set(antennas.follow_line(A, sub(A, B))) | \n", " set(antennas.follow_line(A, sub(B, A))))" ] }, { "cell_type": "code", "execution_count": 86, "id": "6bf85b57-8b8f-4196-9903-6d5fe082f404", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Puzzle 8.1: .002 seconds, answer 220 ok" ] }, "execution_count": 86, "metadata": {}, "output_type": "execute_result" } ], "source": [ "answer(8.1, 220, lambda:\n", " len(antinodes(antennas)))" ] }, { "cell_type": "code", "execution_count": 87, "id": "f232952c-5fc6-4696-a8b1-d0b54137ac02", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Puzzle 8.2: .003 seconds, answer 813 ok" ] }, "execution_count": 87, "metadata": {}, "output_type": "execute_result" } ], "source": [ "answer(8.2, 813, lambda:\n", " len(antinodes(antennas, updated_antinodes2)))" ] }, { "cell_type": "markdown", "id": "9696a986-b6a2-4530-b55b-9db959ef7485", "metadata": {}, "source": [ "I got both of these right the first time (except for some simple typos: a misplaced paren and typing `grid` when I meant the grid called `antennas`)." ] }, { "cell_type": "markdown", "id": "d4835cad-7777-4636-b9af-52cc9782b2b8", "metadata": {}, "source": [ "# [Day 9](https://adventofcode.com/2024/day/9): Disk Fragmenter\n", "\n", "Today we're confronted with a computer disk that needs to be compressed to gain some contiguous free space. The contents of the disk is represented in the **disk map** format: a string of digits, where the digits alternate between the number of blocks of a file, followed by the number of blocks of free space. We'll parse that as a tuple of digits:" ] }, { "cell_type": "code", "execution_count": 90, "id": "0e944f9e-5c16-440c-b12e-178058a87048", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "Puzzle input ➜ 1 str:\n", "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "692094513253604282899448234539616972499153261626907217394161512944107098953354935354419233821564 ...\n", "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "Parsed representation ➜ 1 tuple:\n", "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "(6, 9, 2, 0, 9, 4, 5, 1, 3, 2, 5, 3, 6, 0, 4, 2, 8, 2, 8, 9, 9, 4, 4, 8, 2, 3, 4, 5, 3, 9, 6, 1, ...\n" ] } ], "source": [ "disk_map = the(parse(9, digits))" ] }, { "cell_type": "markdown", "id": "99d40379-65e1-4872-8c68-17ba4925c24e", "metadata": {}, "source": [ "\n", "\n", "### Part 1: Compress the hard drive. What is the resulting filesystem checksum? \n", "\n", "We will deal with two formats to represent disks. Consider this **disk map** format:\n", "\n", " 1, 2, 3, 4, 5 ## Disk map format\n", "\n", "This means that there is 1 block for the first file (which has ID number 0), followed by 2 empty blocks, then 3 blocks for the second file (with ID number 1), followed by 4 empty blocks, and finally 5 blocks for the third file (with ID number 2). \n", "\n", "It makes sense to convert this into a **disk layout** format: which would be \"`\", where \"`.`\" represents an empty block.\n", "\n", " 0..111....22222 ## Disk layout format\n", "\n", "Here the integers represent file ID numbers, and the `.` indicates an empty block.\n", "\n", "To **compress** a disk layout, move file blocks one at a time starting by taking the rightmost non-empty block and moving it to the leftmost empty position; repeat until no more moves are possible. For the example above, that would give us:\n", "\n", " 022111222...... ## Disk layout format (compressed)\n", "\n", "The final answer to the puzzle is a **checksum** of the compressed disk: the sum of the product of the block position times the file ID number for all non-empty blocks." ] }, { "cell_type": "code", "execution_count": 92, "id": "76e8454d-a2f3-4b6b-92df-182116cf46e0", "metadata": {}, "outputs": [], "source": [ "empty = -1 # An empty block\n", "\n", "def disk_layout(disk_map: Ints) -> list:\n", " \"\"\"Convert a disk map into a disk layout.\"\"\"\n", " def empties(j) -> int: return (disk_map[j] if j < len(disk_map) else 0)\n", " return append(disk_map[i] * [id] + empties(i + 1) * [empty]\n", " for id, i in enumerate(range(0, len(disk_map), 2)))\n", "\n", "def compress_layout(layout: list) -> list:\n", " \"\"\"Mutate layout by moving blocks one at a time from the end to the leftmost free space.\"\"\"\n", " N = len(layout)\n", " free = -1 # Start looking for free space from the left\n", " end = N # Start looking for non-empty blocks from the right\n", " while True:\n", " free = first(i for i in range(free + 1, N) if layout[i] is empty)\n", " end = first(i for i in range(end - 1, 0, -1) if layout[i] is not empty)\n", " if free is None or free >= end:\n", " return layout\n", " layout[free], layout[end] = layout[end], empty\n", "\n", "def checksum(layout: list) -> list:\n", " \"\"\"The sum of the product of the block position times the file ID number for all non-empty blocks.\"\"\"\n", " return sum(i * id for i, id in enumerate(layout) if id is not empty)" ] }, { "cell_type": "code", "execution_count": 93, "id": "2aa7e2b9-844e-49ed-b41b-4a4cecff86b7", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Puzzle 9.1: .020 seconds, answer 6332189866718 ok" ] }, "execution_count": 93, "metadata": {}, "output_type": "execute_result" } ], "source": [ "answer(9.1, 6332189866718, lambda:\n", " checksum(compress_layout(disk_layout(disk_map))))" ] }, { "cell_type": "markdown", "id": "2c05a497-cc66-4698-b88b-25c33eea224a", "metadata": {}, "source": [ "### Part 2: Compress the hard drive with the new method. What is the resulting filesystem checksum? \n", "\n", "In Part 2, there is a new method of compressing the disk, where we move full files rather than a block at a time. Again we start on the right, and try to move a file to the leftmost position where it will fit. If there is no such position, the file doesn't move. `compress_layout2` implements this new method, performing a move by swapping two [**slices**](https://docs.python.org/3/library/functions.html#slice) of the disk layout: \n", "\n", " layout[file], layout[free] = layout[free], layout[file]`\n", "\n", "To find all the slices that indicate files, it is easier to run through the disk map than the disk layout. The function `file_slices` quickly finds all such slices.\n", "\n", "Finding a free space for a file is more difficult, because we need to find one that is big enough. I'll run through the whole layout from left-to-right each time. This will make it *O*(*n*2) rather than *O*(*n*), but hopefully it won't be too slow. (If I wanted to speed it up I could have an array of starting positions for each desired size of free space.)" ] }, { "cell_type": "code", "execution_count": 95, "id": "fcf4d832-3d7d-4987-aa57-e6e0f1df16bf", "metadata": {}, "outputs": [], "source": [ "def compress_layout2(disk_map: Ints) -> list:\n", " \"\"\"Mutate layout by moving files one at a time from the end to the leftmost free space.\"\"\"\n", " layout = disk_layout(disk_map)\n", " for file in file_slices(disk_map):\n", " if free := find_freespace(layout, file):\n", " layout[file], layout[free] = layout[free], layout[file]\n", " return layout\n", "\n", "def file_slices(disk_map: Ints) -> List[slice]:\n", " \"\"\"Given a disk map, find all the slice positions of files in the disk layout (last one first).\"\"\"\n", " slices = []\n", " block = 0\n", " for i, length in enumerate(disk_map):\n", " if i % 2 == 0:\n", " slices.append(slice(block, block + length))\n", " block += length\n", " slices.reverse()\n", " return slices\n", "\n", "def find_freespace(layout, file_slice) -> Optional[slice]:\n", " \"\"\"Find a slice position big enough to fit the given file slice, or return None if there is no position.\"\"\"\n", " length = file_slice.stop - file_slice.start\n", " run = 0\n", " for i in range(layout.index(empty), len(layout)):\n", " if i >= file_slice.start:\n", " return None # We only want to move a file left, not right\n", " elif layout[i] is empty:\n", " run += 1\n", " if run == length:\n", " return slice(i + 1 - length, i + 1)\n", " else:\n", " run = 0\n", " return None" ] }, { "cell_type": "code", "execution_count": 96, "id": "e3036875-88d0-496e-9d2f-facd0e80a5b2", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Puzzle 9.2: 2.428 seconds, answer 6353648390778 ok" ] }, "execution_count": 96, "metadata": {}, "output_type": "execute_result" } ], "source": [ "answer(9.2, 6353648390778, lambda:\n", " checksum(compress_layout2(disk_map)))" ] }, { "cell_type": "markdown", "id": "24c0e7d7-6ac7-4e4b-9557-bd4e215ad0a9", "metadata": {}, "source": [ "I got the right answer, but I confess I had an off-by-one **bug** in `find_freespace` on the first try, and another bug where I was moving a large file to the right (thereby uncompressing the disk) rather than leaving it in place." ] }, { "cell_type": "markdown", "id": "7a900425-fe22-4d2f-8d1d-46c319c109e9", "metadata": {}, "source": [ "# [Day 10](https://adventofcode.com/2024/day/10): Hoof It\n", "\n", "Today's input is a topological map of hiking paths on Lava Island, with digits indicating the elevation of each terrain position." ] }, { "cell_type": "code", "execution_count": 99, "id": "5804fb03-05f3-402f-b6cc-6804c5d22512", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "Puzzle input ➜ 60 strs:\n", "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "432109865210212123765432101234321098543289654320132112121058\n", "045678774324301012892343023445456787650198763013241001034569\n", "187678789465692321001056014896234986456787012894653212123678\n", "296589921056789433217837895687145675323891233765784589238987\n", "345437835434576544786921278761010014210710321212098676521067\n", "032126546323465435695430789760121223121653450303145125430678\n", "123010567810156543212345699859834321056544067654236012321589\n", "543213498987657665401030787348765430187432198765987622345432\n", "...\n", "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "Parsed representation ➜ 60 tuples:\n", "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "(4, 3, 2, 1, 0, 9, 8, 6, 5, 2, 1, 0, 2, 1, 2, 1, 2, 3, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 3, 2, ...\n", "(0, 4, 5, 6, 7, 8, 7, 7, 4, 3, 2, 4, 3, 0, 1, 0, 1, 2, 8, 9, 2, 3, 4, 3, 0, 2, 3, 4, 4, 5, 4, 5, ...\n", "(1, 8, 7, 6, 7, 8, 7, 8, 9, 4, 6, 5, 6, 9, 2, 3, 2, 1, 0, 0, 1, 0, 5, 6, 0, 1, 4, 8, 9, 6, 2, 3, ...\n", "(2, 9, 6, 5, 8, 9, 9, 2, 1, 0, 5, 6, 7, 8, 9, 4, 3, 3, 2, 1, 7, 8, 3, 7, 8, 9, 5, 6, 8, 7, 1, 4, ...\n", "(3, 4, 5, 4, 3, 7, 8, 3, 5, 4, 3, 4, 5, 7, 6, 5, 4, 4, 7, 8, 6, 9, 2, 1, 2, 7, 8, 7, 6, 1, 0, 1, ...\n", "(0, 3, 2, 1, 2, 6, 5, 4, 6, 3, 2, 3, 4, 6, 5, 4, 3, 5, 6, 9, 5, 4, 3, 0, 7, 8, 9, 7, 6, 0, 1, 2, ...\n", "(1, 2, 3, 0, 1, 0, 5, 6, 7, 8, 1, 0, 1, 5, 6, 5, 4, 3, 2, 1, 2, 3, 4, 5, 6, 9, 9, 8, 5, 9, 8, 3, ...\n", "(5, 4, 3, 2, 1, 3, 4, 9, 8, 9, 8, 7, 6, 5, 7, 6, 6, 5, 4, 0, 1, 0, 3, 0, 7, 8, 7, 3, 4, 8, 7, 6, ...\n", "...\n" ] } ], "source": [ "topo = Grid(parse(10, digits))" ] }, { "cell_type": "markdown", "id": "d951807a-3611-445f-84ee-352221a25968", "metadata": {}, "source": [ "### Part 1: What is the sum of the scores of all trailheads on your topographic map?\n", "\n", "A **trailhead** is any position with elevation 0, and a **peak** is any position with elevation 9. The **score** of a trailhead is the number of peaks that can be reached by following a path where each step increases the elevation by exactly 1. All steps are in one of the four cardinal directions (north/south/east/west).\n", "\n", "I'll keep a set of points on the frontier of possible paths, updating this set on each iteratation from 1 to 9, by looking at each point on the frontier and seeing which of the neighboring points `p` have the right elevation:" ] }, { "cell_type": "code", "execution_count": 101, "id": "76b5379e-ee19-4607-91b8-88ec7b38023f", "metadata": {}, "outputs": [], "source": [ "def score(topo: Grid, trailhead: Point) -> int:\n", " \"\"\"How many peaks can be reached from this trailhead?\"\"\"\n", " frontier = {trailhead}\n", " for elevation in range(1, 10):\n", " frontier = {p for p in union(map(topo.neighbors, frontier))\n", " if topo[p] == elevation}\n", " return len(frontier)" ] }, { "cell_type": "code", "execution_count": 102, "id": "97cf05f7-fa56-4a90-b2d8-2cd4d9b81f95", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Puzzle 10.1: .005 seconds, answer 744 ok" ] }, "execution_count": 102, "metadata": {}, "output_type": "execute_result" } ], "source": [ "answer(10.1, 744, lambda:\n", " sum(score(topo, trailhead) for trailhead in topo.findall([0])))" ] }, { "cell_type": "markdown", "id": "4656eb08-b12a-4a02-92b8-ac23f2361387", "metadata": {}, "source": [ "### Part 2: What is the sum of the ratings of all trailheads?\n", "\n", "The **rating** of a trailhead is the number of distinct paths from the trailhead to a peak.\n", "\n", "As in Part 1, I'll keep a frontier and update it on each iteration from 1 to 9, but this time the frontier will be a counter of `{position: count}` where the count indicates the number of paths to that position. On each iteration I'll look at each point `f` on the frontier and see which of the neighboring points `p` have the right elevation, and increment the counts for those points by the count for `f`. This approach is linear in the number of positions, whereas if I followed all possible paths depth-first there could be an exponential number of paths." ] }, { "cell_type": "code", "execution_count": 104, "id": "b763450f-a565-4936-bee4-e531c2eeebdb", "metadata": {}, "outputs": [], "source": [ "def rating(topo: Grid, trailhead: Point) -> int:\n", " \"\"\"How many distinct paths are there from this trailhead to any peak?\"\"\"\n", " frontier = Counter({trailhead: 1})\n", " for elevation in range(1, 10):\n", " frontier = accumulate((p, frontier[f]) \n", " for f in frontier\n", " for p in topo.neighbors(f) \n", " if topo[p] == elevation)\n", " return sum(frontier.values())" ] }, { "cell_type": "markdown", "id": "bfb4ae54-db59-44df-a76d-12e155fd1e5e", "metadata": {}, "source": [ "(Note my [utility function](AdventUtils.ipynb) `accumulate` takes as input an iterable of (key, count) pairs, and returns a Counter of the total count for each key.)\n" ] }, { "cell_type": "code", "execution_count": 106, "id": "f8a87032-6556-4fc9-9bb8-573611aee8dc", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Puzzle 10.2: .006 seconds, answer 1651 ok" ] }, "execution_count": 106, "metadata": {}, "output_type": "execute_result" } ], "source": [ "answer(10.2, 1651, lambda:\n", " sum(rating(topo, trailhead) for trailhead in topo.findall([0])))" ] }, { "cell_type": "markdown", "id": "af410d30-7096-4be6-bb20-904b3c8e2f59", "metadata": {}, "source": [ "Today I went pretty fast (for me); I started a few minutes late and finished in 15 minutes. From the point of view of a competitive coder I did foolish things like write docstrings and use variables of more than one letter, so while this time was fast for me, it placed well out of the top 1000.\n", "\n", "Here's a visualization of the map:" ] }, { "cell_type": "code", "execution_count": 108, "id": "eea7e277-4687-48a9-85b5-a031a9d4b6e1", "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAeQAAAGTCAYAAAD5iWGAAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjkuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8hTgPZAAAACXBIWXMAAA9hAAAPYQGoP6dpAAD4dUlEQVR4nOy9eXheV3nufe95v7NeWZNly3JsZ44DhBBKSEoShgIJpYQyFU5SKGUILQFOUobD1EMgBb6vQA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4zLLrsMn//85zEzM4Pf+I3f2JTyqICspKSkpPQTqbe//e1YXFzEJz/5SRw5cgQXXnghvv71r2N6enpTyqNlWbb9DUCVlJSUlJS2udQ3ZCUlJSUlpS0gFZCVlJSUlJS2gFRAVlJSUlJS2gJSAVlJSUlJSWkLSAVkJSUlJSWlLSAVkJWUlJSUlLaAVEBWUlJSUlLaAlIBWUlJSUlJaQtIBWQlJSUlJaUtIBWQlZSUlJSUtoBUQFZSUlJSUtoC+v8ByEf+wF1DwnsAAAAASUVORK5CYII=", "text/plain": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "def plot_topo(topo: Grid):\n", " \"\"\"Show the map with a colormap from blue to red.\"\"\"\n", " plt.figure()\n", " scatter = plt.scatter(Xs(topo), Ys(topo), c=list(topo.values()), \n", " cmap='coolwarm', marker='s', s=12)\n", " plt.colorbar(scatter, label='Elevation')\n", " plt.axis('square')\n", " plt.axis('off')\n", "\n", "plot_topo(topo)" ] }, { "cell_type": "markdown", "id": "3e01d7f5-d0f0-4e7b-8cab-eef2afc02f6b", "metadata": {}, "source": [ "# [Day 11](https://adventofcode.com/2024/day/11): Plutonian Pebbles\n", "\n", "Today's narrative involves a straight line of stones, each of which has a number enscribed on it. The input is a single line of these numbers:" ] }, { "cell_type": "code", "execution_count": 110, "id": "76b68cef-d8de-4145-b65c-b254fedf1671", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "Puzzle input ➜ 1 str:\n", "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "0 27 5409930 828979 4471 3 68524 170\n", "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "Parsed representation ➜ 1 tuple:\n", "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "(0, 27, 5409930, 828979, 4471, 3, 68524, 170)\n" ] } ], "source": [ "stones = the(parse(11, ints))" ] }, { "attachments": {}, "cell_type": "markdown", "id": "a7302dc5-5163-4f0b-bdcc-8c00e367391c", "metadata": {}, "source": [ "### Part 1: How many stones will you have after blinking 25 times?\n", "\n", "Every time you **blink**, the stones appear to change, according to these rules:\n", "- A stone marked 0 changes to 1.\n", "- Otherwise, a stone with an even number of digits splits into two stones, with the first and second halves of those digits.\n", "- Otherwise, the stone's number is multiplied by 2024.\n", "\n", "\n", "\n", "\n", "I'll define `blink` to simulate the effect of a given number of blinks, and `change_stone` to change a single stone, returning a list of either one or two stones (the two stones computed by `split_stone`):" ] }, { "cell_type": "code", "execution_count": 112, "id": "1513df56-3d6f-42cf-8aec-1bdbeb991d90", "metadata": {}, "outputs": [], "source": [ "def blink(stones: Ints, blinks=25) -> List[int]:\n", " \"\"\"Simulate the changes in the list of stones after blinking `blinks` times.\"\"\"\n", " for _ in range(blinks):\n", " stones = append(map(change_stone, stones))\n", " return stones\n", " \n", "def change_stone(stone: int) -> List[int]:\n", " \"\"\"Change a single stone into one or two, according to the rules.\"\"\"\n", " digits = str(stone)\n", " return ([1] if stone == 0 else\n", " split_stone(digits) if len(digits) % 2 == 0 else\n", " [stone * 2024])\n", "\n", "def split_stone(digits: str) -> List[int]:\n", " \"\"\"Split a stone into two halves.\"\"\"\n", " half = len(digits) // 2\n", " return [int(digits[:half]), int(digits[half:])]" ] }, { "cell_type": "code", "execution_count": 113, "id": "eff17cd0-a2c7-4d69-bc55-c0ef97917915", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Puzzle 11.1: .066 seconds, answer 194482 ok" ] }, "execution_count": 113, "metadata": {}, "output_type": "execute_result" } ], "source": [ "answer(11.1, 194482, lambda:\n", " len(blink(stones, 25)))" ] }, { "cell_type": "markdown", "id": "2f65e94f-43e8-4f08-85df-827928c57e0b", "metadata": {}, "source": [ "### Part 2: How many stones would you have after blinking a total of 75 times?\n", "\n", "It looks like the number of stones is roughly doubling every 1 or 2 blinks, so for 75 blinks we could have trillions of stones. I'd like something more efficient. I note that:\n", "- Although the puzzle makes it clear that the stones are in a line, it turns out their position in the line is irrelevant.\n", "- Because all the even-digit numbers get split in half, it seems like many small numbers will appear multiple times.\n", " - (In the given example, after 6 blinks the number 2 appears 4 times.)\n", "- Therefore, I'll keep a `Counter` of stones rather than a `list` of stones." ] }, { "cell_type": "code", "execution_count": 115, "id": "707b5a97-0296-48df-bdab-e34064cc67c2", "metadata": {}, "outputs": [], "source": [ "def blink2(stones: Ints, blinks=25) -> Counter:\n", " \"\"\"Simulate the changes after blinking `blinks` times and return a Counter of stones.\"\"\"\n", " counts = Counter(stones)\n", " for _ in range(blinks):\n", " counts = accumulate((s, counts[stone]) \n", " for stone in counts \n", " for s in change_stone(stone))\n", " return counts" ] }, { "cell_type": "markdown", "id": "f5bf07ce-b48e-40db-8992-b9b571e66554", "metadata": {}, "source": [ "Now we can re-run Part 1 (it should be slightly faster), and run Part 2 without fear of having trillion-element lists:" ] }, { "cell_type": "code", "execution_count": 117, "id": "efdcdbf8-e8ec-4a85-9d09-90a20e08c66a", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Puzzle 11.1: .001 seconds, answer 194482 ok" ] }, "execution_count": 117, "metadata": {}, "output_type": "execute_result" } ], "source": [ "answer(11.1, 194482, lambda:\n", " total(blink2(stones, 25)))" ] }, { "cell_type": "code", "execution_count": 118, "id": "657b1f13-ffcc-44c6-84f1-398fa2fcdac7", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Puzzle 11.2: .061 seconds, answer 232454623677743 ok" ] }, "execution_count": 118, "metadata": {}, "output_type": "execute_result" } ], "source": [ "answer(11.2, 232454623677743, lambda:\n", " total(blink2(stones, 75)))" ] }, { "cell_type": "markdown", "id": "ce377749-b3e2-4ca4-b50d-e7c3d2e7201a", "metadata": {}, "source": [ "I'm glad I used the `Counter`; it would have taken a petabyte of storage (and a long, long time) to represent that many stones as a list.\n", "\n", "Again, I did pretty well, with no errors, and moving at what I thought was a good pace, but I didn't even crack the top 2000 on the leaderboard. " ] }, { "cell_type": "markdown", "id": "391cec1e-32fe-4e6e-81c2-4e38469b15e3", "metadata": {}, "source": [ "# [Day 12](https://adventofcode.com/2024/day/12): Garden Groups\n", "\n", "Today's input is yet another 2D map. This one depicts different garden plots on a farm, each plot planted with a crop, indicated by a letter. Perhaps \"I\" is iceberg lettuce and \"O\" is okra, and so on." ] }, { "cell_type": "code", "execution_count": 121, "id": "8161ee7e-76e3-499a-abf8-a607991c9602", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "Puzzle input ➜ 140 strs:\n", "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "IIIIIIIIIIIIIIIIIIIIIUUUUUUUUJLLLLAAAAAAMMMAUUUUPPXPZZZZZZZZZZZXXXXXXXXXXXXXXXXXXXXXFFFFFFFFFFZZ ...\n", "IIIIIIIIIIIIIIIIIIIIUUUUUUUUUJALEAAAAAAAAAAAAUUUUPXPPZZZZZHHHHHHXHXXXXXXXXXXXXXXXXXXFXFFFFFFFFZZ ...\n", "IIIIIIIIIIIIIIIIIIIIUUUUUUUUUJAAAAAAAAAAAAAAUUPPPPPPPZZZZZZZHHHHHHHXXXXXXXXXXXXXXXXXXXFFFFFFFFFZ ...\n", "IIIIIIIIIIIAAIIIIIIIIIUUUUUUUJJAAAAAAAAAAAAAAVVPPPPPPPPZHHHHHHHHHHHXXXXXXXXXXXXXXXXXFFFFFFFFFFFZ ...\n", "IOOIIIIIIIIAAIIIIIIIIIIUUUQVUJJAAAAAAAAAAAAAEVVZPPPPPPPHHHHHHHHHHHHXXXXXXXXXXXXXXXXXXXXFFFFFFLLL ...\n", "OOOOOOOOIIAAAAAIIIIIIIIUQQQQVQJAAAAAAAAAAAAAAVVPPPPPIIHHHHHHHHHHHHHXXXXXUXXXXXXUUXXBBBSFFFLLLLLL ...\n", "OOOOOOOOIAAAAAAIIIIIIQQQQQQQQQQQEADDAAAAAAAAHHVVPPPIIIIHHHHHHHHHHHHHXXXUUUUUXXUUUXXBBBSFFFLLELLL ...\n", "OOOOOOOOIIIAAIIIIIQQQQQQQQQQTQJQEEDDDAAAAAAHHVVVVPIIIIIHHHHHHHHHHHHHXUUUUUUUUUUUMMXBBBSSSFFFLLLL ...\n", "...\n" ] } ], "source": [ "farm = Grid(parse(12))" ] }, { "cell_type": "markdown", "id": "bb95a10b-1f83-4940-a68b-b94696c3aab3", "metadata": {}, "source": [ "### Part 1: What is the total price of fencing all regions on your map?\n", "\n", "We are asked to calculate the cost of putting fences around each **region** (a region is a set of garden plots with the same crop that abut each other horizontally or vertically). The price of the fence for a region is defined as the product of the region's area and its perimeter. If we represent a region as a set of (x, y) points, then the area is easy: it is just the number of points. The perimeter length can be computed by, for each plot point in the region, looking at each of the four directions and counting cases where the adjacent plot in that direction is *not* in the region. (Initially I had a **bug** in that I looked at the `farm.neighbors` of each plot. That doesn't work because a plot on the edge of the grid should count as part of the perimeter, so we have to explicitly check all four directions.)" ] }, { "cell_type": "code", "execution_count": 123, "id": "79f91f38-e325-44f2-9e53-b64ce12d9d35", "metadata": {}, "outputs": [], "source": [ "Region = Set[Point]\n", "region_area = len\n", "\n", "def fence_price(farm: Grid) -> int:\n", " \"\"\"Total price of fences for all the regions in the farm.\"\"\"\n", " return sum(map(region_price, all_regions(farm)))\n", "\n", "def region_price(region) -> int: return region_area(region) * perimeter_length(region)\n", "\n", "def perimeter_length(region: Region) -> int:\n", " \"\"\"The number of sides on the perimeter of the region: \n", " ones where the adjacent position in some direction is not in the region.\"\"\"\n", " return quantify(add(plot, d) not in region \n", " for plot in region for d in directions4)" ] }, { "cell_type": "markdown", "id": "9524ee15-c378-4cd4-a79b-14fb99b17cb3", "metadata": {}, "source": [ "To find all the regions I'll start at a point and do a [flood fill](https://en.wikipedia.org/wiki/Flood_fill) to neighboring points with the same region letter, keeping track of points that have already been found so as to not duplicate them. The function `all_regions` iterates over all points to make sure it finds every region, and `flood_fill` recursively expands to all points that neighbor `p` and have the same crop (letter). `flood_fill` mutates the set `already_found` as it goes (and also mutates the `region` it is building up)." ] }, { "cell_type": "code", "execution_count": 125, "id": "1fbabbfb-50c8-4197-8517-e7cee9582765", "metadata": {}, "outputs": [], "source": [ "def all_regions(farm: Grid) -> List[Region]:\n", " \"\"\"Find all the regions in the farm.\"\"\"\n", " already_found = set() # Set of plots already accounted for\n", " return [flood_fill(p, farm, set(), already_found) \n", " for p in farm if p not in already_found]\n", "\n", "def flood_fill(p: Point, grid: Grid, region: set, already_found: set) -> set:\n", " \"\"\"Starting at point p, recursively add all neighboring points to `region`, keeping track of `already_found`.\"\"\"\n", " if p not in already_found:\n", " region.add(p)\n", " already_found.add(p)\n", " for p2 in grid.neighbors(p):\n", " if farm[p2] == farm[p]:\n", " flood_fill(p2, grid, region, already_found)\n", " return region" ] }, { "cell_type": "code", "execution_count": 126, "id": "cdaf655b-d12c-4973-b19b-3132e5e691c6", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Puzzle 12.1: .033 seconds, answer 1402544 ok" ] }, "execution_count": 126, "metadata": {}, "output_type": "execute_result" } ], "source": [ "answer(12.1, 1402544, lambda:\n", " fence_price(farm))" ] }, { "cell_type": "markdown", "id": "b3383560-2bbc-4dfc-b643-feb103876823", "metadata": {}, "source": [ "### Part 2: What is the new total price of fencing all regions on your map, with the bulk discount?\n", "\n", "In Part 2 we get a **bulk discount** on the fencing; we only need to pay for the number of straight line sides on the perimeter, not the total length of the perimeter. For example, a 10 x 10 square has perimeter 40, but has only 4 sides. That's a 90% discount!\n", "\n", "It took me a while to figure out a good approach for this. At first I was reminded of the Convex Hull problem, for which I have [a notebook](https://github.com/norvig/pytudes/blob/main/ipynb/Convex%20Hull.ipynb). But that's not really appropriate here; our regions could be non-convex, and the set of sides in a region are not the same as the vertexes of a polygon (e.g., a region with one point has 4 sides, not 0).\n", "\n", "A better idea is to start with the perimeter length and subtract one for every case in which a points has an edge in one direction (e.g., an edge to the North) and also has a neighbor with the same edge. To be precise, I'll look for four cases:\n", "- A point with an edge to the North whose neighbor to the East also has an edge to the North\n", "- A point with an edge to the East whose neighbor to the South also has an edge to the East\n", "- A point with an edge to the South whose neighbor to the West also has an edge to the South\n", "- A point with an edge to the West whose neighbor to the North also has an edge to the West\n", "\n", "Here are two diagrams of two regions with two kinds of crop, \"`X`\" and \"`W`\", with a \"`-`\" marking each place where a perimeter piece would be subtracted.\n", "\n", " .X-... .-------..\n", " -X-.X- .WWWWWWWW-\n", " -XXXX- -WWWWWWWW-\n", " ..XXX. -WWWWWWWW.\n", " ...--. ..-------.\n", "\n", "I'll refactor `fence_price` to take a `region_price` parameter, and show that the change is backwards compatible to Part 1:" ] }, { "cell_type": "code", "execution_count": 128, "id": "38c30e15-3a33-40c2-b734-163a15af7a8a", "metadata": {}, "outputs": [], "source": [ "def fence_price(farm: Grid, region_price=region_price) -> int:\n", " \"\"\"Total price of fences for all the regions in the farm, given the price function for a region.\"\"\"\n", " return sum(map(region_price, all_regions(farm)))\n", "\n", "def discount_region_price(region) -> int: return region_area(region) * region_sides(region)\n", " \n", "def region_sides(region):\n", " \"\"\"How many straight-line sides does this region have?\"\"\"\n", " def has_edge(p: Point, d: Vector): return p in region and add(p, d) not in region\n", " def neighbor(p: Point, d: Vector): return add(p, make_turn(d, 'R'))\n", " subtract = quantify(has_edge(p, d) and has_edge(neighbor(p, d), d)\n", " for p in region\n", " for d in directions4)\n", " return perimeter_length(region) - subtract" ] }, { "cell_type": "code", "execution_count": 129, "id": "72175812-dcd0-4f1b-9efa-0dceeeafa609", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Puzzle 12.1: .030 seconds, answer 1402544 ok" ] }, "execution_count": 129, "metadata": {}, "output_type": "execute_result" } ], "source": [ "answer(12.1, 1402544, lambda:\n", " fence_price(farm))" ] }, { "cell_type": "code", "execution_count": 130, "id": "9defcd35-91bc-41d4-a16f-bb7a4ede75e7", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Puzzle 12.2: .061 seconds, answer 862486 ok" ] }, "execution_count": 130, "metadata": {}, "output_type": "execute_result" } ], "source": [ "answer(12.2, 862486, lambda: \n", " fence_price(farm, discount_region_price))" ] }, { "cell_type": "markdown", "id": "faa9d750-a619-40dc-965c-a9a8e2543e32", "metadata": {}, "source": [ "# [Day 13](https://adventofcode.com/2024/day/13): Claw Contraption\n", "\n", "Today's puzzle involves arcade claw machines. Each input paragraph describes a machine with two buttons, **A** and **B**; every push of a button moves the claw a specified amount in the X and Y directions. The prize is at a specified location. We can parse the input by defining a `parse_claw` function and a `Claw` datatype to represent a claw machine.\n", "\n", "" ] }, { "cell_type": "code", "execution_count": 132, "id": "e78f45c0-c420-4661-aad2-14e122b4473b", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "Puzzle input ➜ 1279 strs:\n", "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "Button A: X+24, Y+19\n", "Button B: X+32, Y+86\n", "Prize: X=1072, Y=2062\n", "\n", "Button A: X+70, Y+12\n", "Button B: X+11, Y+43\n", "Prize: X=3400, Y=3872\n", "\n", "...\n", "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "Parsed representation ➜ 320 Claws:\n", "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "Claw(A=(24, 19), B=(32, 86), Prize=(1072, 2062))\n", "Claw(A=(70, 12), B=(11, 43), Prize=(3400, 3872))\n", "Claw(A=(48, 77), B=(34, 12), Prize=(6510, 1583))\n", "Claw(A=(76, 60), B=(29, 88), Prize=(5506, 6300))\n", "Claw(A=(16, 75), B=(68, 20), Prize=(17148, 13490))\n", "Claw(A=(46, 13), B=(33, 63), Prize=(15572, 9644))\n", "Claw(A=(21, 79), B=(44, 32), Prize=(2433, 5147))\n", "Claw(A=(13, 45), B=(36, 11), Prize=(4612, 19164))\n", "...\n" ] } ], "source": [ "Claw = namedtuple('Claw', 'A, B, Prize') # A claw machine\n", "\n", "def parse_claw(text: str) -> Claw:\n", " \"\"\"Parse a description into a Claw object.\"\"\"\n", " ax, ay, bx, by, px, py = ints(text)\n", " return Claw((ax, ay), (bx, by), (px, py))\n", " \n", "claws = parse(13, parse_claw, sections=paragraphs)" ] }, { "cell_type": "markdown", "id": "7f6da888-9288-42f1-bc51-2eb2a66d34a1", "metadata": {}, "source": [ "### Part 1: What is the fewest tokens you would have to spend to win all possible prizes?\n", "\n", "We are told that for some machines it is possible to reach the prize and others it is impossible. We are also told that you need to spend 3 tokens to press the **A** button and 1 token to press the **B** button. There is a hint that no button will need to be pushed more than 100 times. It is usually a good idea to accept the hint, so I will do the following:\n", "- Exhaustively try every number from 0 to 100 presses of the **A** button.\n", "- For each number, figure out what the resulting position of the claw would be after those presses.\n", "- Calculate how many presses of the **B** button would be required to get to the prize's X location.\n", "- If the number of presses is an integer, and would also arrive at the prize's Y location, then yield that solution.\n", "- Out of these solutions, the cheapest solution is the one that needs the fewest tokens.\n", "- (If there are no solutions, `cheapest_solution` will return 0, whcih is convenient for adding the results up, but is worrisome because it doesn't distinguish between an impossible-to-reach prize and a prize at the origin. On this puzzle, that's ok, but it is still worrisome.)" ] }, { "cell_type": "code", "execution_count": 134, "id": "c2c4bbc9-42cd-483d-8da2-97cf051e93fe", "metadata": {}, "outputs": [], "source": [ "def solve_claw(claw: Claw, limit=100) -> Iterable[Tuple[int, int]]:\n", " \"\"\"All possible (A-presses, B-presses) solutions to reach the prize on this machine.\"\"\"\n", " A, B, Prize = claw\n", " for Apresses in range(limit + 1):\n", " pos = mul(A, Apresses)\n", " if X_(pos) > X_(Prize) or Y_(pos) > Y_(Prize):\n", " return\n", " diff = sub(Prize, pos)\n", " Bpresses = X_(diff) / X_(B)\n", " if Bpresses.is_integer() and Bpresses * Y_(B) == Y_(diff):\n", " yield (Apresses, int(Bpresses))\n", "\n", "def cheapest_solution(claw: Claw) -> int: \n", " \"\"\"The minimum cost out of every possible solution to this claw machine.\"\"\"\n", " return min((3 * A + B for (A, B) in solve_claw(claw)), default=0)" ] }, { "cell_type": "code", "execution_count": 135, "id": "f5638ed4-1e59-4b9f-b1fc-427d2eb0d036", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Puzzle 13.1: .006 seconds, answer 29598 ok" ] }, "execution_count": 135, "metadata": {}, "output_type": "execute_result" } ], "source": [ "answer(13.1, 29598, lambda:\n", " sum(map(cheapest_solution, claws)))" ] }, { "cell_type": "markdown", "id": "3a36e76c-dd5b-4d80-ae88-9980e7d274ac", "metadata": {}, "source": [ "### Part 2: Using the corrected prize coordinates, what is the fewest tokens you would have to spend to win all possible prizes?\n", "\n", "In Part 2, we discover that \"due to a unit conversion error\" the prize is actually much farther away, by 10,000,000,000,000 (ten trillion) steps in both the X and Y coordinates. Theoretically, we could still use `solve_claw` with a bigger `limit`, but that would take a *long* time.\n", "w\n", "Instead I can solve each claw machine *mathematically* rather than by trial and error. It looks like each claw machine defines two equations; what exactly are the equations? For my first claw machine, \n", "\n", " Button A: X+24, Y+19\n", " Button B: X+32, Y+86\n", " Prize: X=1072, Y=2062\n", "\n", "there are two linear equations to solve simultaneously, over the integers:\n", "\n", " 24 A + 32 B = 1072\n", " 19 A + 86 B = 2062\n", "\n", "I know that an equation over the integers is called a [Diophantine equation](https://en.wikipedia.org/wiki/Diophantine_equation), but I don't remember much about them, and furthermore it seems like it is more important that we are dealing with lines than that they need integer solutions. In general, two linear equations in two unknowns can have zero solutions (if the lines are parallel), an infinite number of solutions (if the lines are the same), or exactly one solution (in the \"normal\" case). We can solve the linear equations, and then discard the answer if *A* and *B* are not integers. \n", "\n", "I defined `solve_claw` to yield multiple solutions, but let's see how many solutions each claw machine yields:" ] }, { "cell_type": "code", "execution_count": 137, "id": "df8da2ae-52f9-409b-a54f-ad7d21b32e45", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Counter({0: 168, 1: 152})" ] }, "execution_count": 137, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Counter(quantify(solve_claw(c)) for c in claws)" ] }, { "cell_type": "markdown", "id": "f0f97d47-5741-4c6e-ae96-5b3161ee2e56", "metadata": {}, "source": [ "This says that 168 claw machines have no solution and 152 have exactly one. None of them have more than one solution.\n", "\n", "So, what is the intersection point of two lines? You could [look it up](https://www.wolframalpha.com/input?i=solve+for+a%2C+b%3A+p+*+a+%2B+q+*+b+%3D+r++and+++s+*+a+%2B+t+*+b+%3D+u) or work it out by hand, or [call a library function](https://numpy.org/doc/2.1/reference/generated/numpy.linalg.solve.html). Given the two equations over the variables *a* and *b*:\n", "\n", " p * a + q * b = r\n", " s * a + t * b = u\n", "\n", "The solution is:\n", "\n", " a = (r * t - q * u) / (p * t - q * s)\n", " b = (r * s - p * u) / (q * s - p * t)\n", "\n", "So we can rewrite `solve_claw` to use this:" ] }, { "cell_type": "code", "execution_count": 139, "id": "6bbd0934-d962-4c93-940b-810651e9e568", "metadata": {}, "outputs": [], "source": [ "def solve_claw(claw: Claw) -> Iterable[Tuple[int, int]]:\n", " \"\"\"All possible (A-presses, B-presses) solutions to reach the prize on this machine.\"\"\"\n", " ((p, s), (q, t), (r, u)) = claw\n", " a = (r * t - q * u) / (p * t - q * s)\n", " b = (r * s - p * u) / (q * s - p * t)\n", " if a.is_integer() and b.is_integer():\n", " yield (int(a), int(b))" ] }, { "cell_type": "markdown", "id": "af52d98e-50e9-4c4d-875f-1ed2b3dc8111", "metadata": {}, "source": [ "This raises an interesting design point: If you have a function that might return zero or one result of type `T`, should you define the return type as `Optional[T]` or as `Iterable[T]`, where it can yield zero or one result? I guess it depends on the expected use cases of the function.\n", "\n", "We'll need a way to move the prizes further away, then we're ready to answer Part 2:" ] }, { "cell_type": "code", "execution_count": 141, "id": "dd38ba4c-44ba-426b-b1c8-0e10adbdd642", "metadata": {}, "outputs": [], "source": [ "def move_prizes(claws, delta=(10**13, 10**13)) -> List[Claw]:\n", " \"\"\"Move each claw's prize by the given displacement, delta.\"\"\"\n", " return [claw._replace(Prize=(add(claw.Prize, delta))) for claw in claws]" ] }, { "cell_type": "code", "execution_count": 142, "id": "9f578b3e-6b6d-4eb0-9228-c98122a84747", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Puzzle 13.2: .000 seconds, answer 93217456941970 ok" ] }, "execution_count": 142, "metadata": {}, "output_type": "execute_result" } ], "source": [ "answer(13.2, 93217456941970, lambda:\n", " sum(map(cheapest_solution, move_prizes(claws))))" ] }, { "cell_type": "markdown", "id": "db917eed-07e5-4409-a92d-b26534a1fcd4", "metadata": {}, "source": [ "The refactored `solve_claw` is compatible with Part 1, and should be faster:" ] }, { "cell_type": "code", "execution_count": 144, "id": "609ed4ce-548c-4af4-8e09-c621aca0124e", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Puzzle 13.1: .000 seconds, answer 29598 ok" ] }, "execution_count": 144, "metadata": {}, "output_type": "execute_result" } ], "source": [ "answer(13.1, 29598, lambda:\n", " sum(map(cheapest_solution, claws)))" ] }, { "cell_type": "markdown", "id": "741bd221-cda4-432b-8ad2-b8c6950c7dc3", "metadata": {}, "source": [ "I could have recognized in Part 1 that we have a system of two linear equations in two unknowns, and implemented the Part 2 solution. But I have no regrets; I took the hint that trial-and-test for 100 trials was a good idea, and I saved the complicated algebra for when I really needed it in Part 2. Having two independent implementations that produce the same answer increases my confidence in both of them." ] }, { "cell_type": "markdown", "id": "2576ce68-3f1e-4887-ab0b-62fa94cbe55a", "metadata": {}, "source": [ "# [Day 14](https://adventofcode.com/2024/day/14 ): Restroom Redoubt\n", "\n", "Today's narratives involve multiple robots roaming around a restroom. Each line of the input describes a robot's position and velocity in two dimensions:" ] }, { "cell_type": "code", "execution_count": 147, "id": "1a5f5875-426d-47ea-a35a-405c39ced5dd", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "Puzzle input ➜ 500 strs:\n", "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "p=62,20 v=85,-14\n", "p=88,18 v=-70,97\n", "p=51,21 v=35,-22\n", "p=19,56 v=2,45\n", "p=93,11 v=-87,26\n", "p=90,67 v=44,-13\n", "p=99,34 v=82,57\n", "p=55,42 v=82,22\n", "...\n", "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "Parsed representation ➜ 500 tuples:\n", "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "(62, 20, 85, -14)\n", "(88, 18, -70, 97)\n", "(51, 21, 35, -22)\n", "(19, 56, 2, 45)\n", "(93, 11, -87, 26)\n", "(90, 67, 44, -13)\n", "(99, 34, 82, 57)\n", "(55, 42, 82, 22)\n", "...\n" ] } ], "source": [ "robots = parse(14, ints) " ] }, { "cell_type": "markdown", "id": "818a939d-2038-4574-a20b-c1194d403f2c", "metadata": {}, "source": [ "### Part 1: What will the safety factor be after exactly 100 seconds have elapsed?\n", "\n", "Each second the robots move according to their velocity, and they wrap around when they reach the edge of their world, which has width 101 and height 103. They never collide; they can pass right through each other. We're asked to figure out where they are after 100 seconds. I can see that it is not necessary to simulate the robots movements time step by time step; we can just multiply their velocity by time, add it to their initial position, and then take the result modulo the width or height. That's done in `robot_dance`. \n", "\n", "We're asked to figure out how many robots end up in each **quadrant**. There are four quadrants, but a robot that is exactly on a middle line, either horizontally or vertically, doesn't count in any quadrant. Finally, the **safety factor** is the product of the four counts of robots in each quadrant." ] }, { "cell_type": "code", "execution_count": 149, "id": "be22ac94-7401-4cf6-ab83-e43775536af7", "metadata": {}, "outputs": [], "source": [ "def robot_dance(robots, steps=100, width=101, height=103) -> List[Point]:\n", " \"\"\"Move each robot for `steps` number of steps.\"\"\"\n", " return [((x + steps * dx) % width, (y + steps * dy) % height)\n", " for (x, y, dx, dy) in robots]\n", "\n", "def quadrant_counts(positions, w=101//2, h=103//2) -> Counter:\n", " \"\"\"How many robots are in each quadrant? Ignore robots exactly in the middle.\"\"\"\n", " return Counter((sign(x - w), sign(y - h)) \n", " for (x, y) in positions if x != w and y != h)\n", "\n", "def safety_factor(robots) -> int:\n", " \"\"\"The product of the four counts of robots in each quadrant.\"\"\"\n", " return prod(quadrant_counts(robot_dance(robots)).values())" ] }, { "cell_type": "code", "execution_count": 150, "id": "69093001-79aa-463a-b801-51cd5b4de4eb", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Puzzle 14.1: .000 seconds, answer 216027840 ok" ] }, "execution_count": 150, "metadata": {}, "output_type": "execute_result" } ], "source": [ "answer(14.1, 216027840, lambda:\n", " safety_factor(robots))" ] }, { "cell_type": "markdown", "id": "06b4e335-9863-40f7-983a-0744884dbc20", "metadata": {}, "source": [ "In case you're curious, here are the quadrant counts after 100 steps:" ] }, { "cell_type": "code", "execution_count": 152, "id": "08661dc5-445c-4908-b0b4-57f3a53e5179", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Counter({(1, 1): 124, (-1, 1): 122, (-1, -1): 120, (1, -1): 119})" ] }, "execution_count": 152, "metadata": {}, "output_type": "execute_result" } ], "source": [ "quadrant_counts(robot_dance(robots))" ] }, { "cell_type": "markdown", "id": "a0cb27ad-82ff-4dcb-85cf-596b16ae9875", "metadata": {}, "source": [ "### Part 2: What is the fewest number of seconds that must elapse for the robots to display a picture of a Christmas Tree?\n", "\n", "I was **so** sure that Part 2 was going to ask for 10 trillion steps, and I was going to be **so** clever for not simulating step-by-step. But I was wrong. \n", "\n", "Instead we have the very vague task of discovering when a picture emerges. There is a hint that \"*very rarely, most of the robots should arrange themselves into a picture of a Christmas tree.*\" Since I don't know exactly how to specify a picture of a Christmas tree, I see three options:\n", "1) I could build an animation, and watch as each frame is displayed, stopping when I see something that looks like a tree.\n", "2) The phrase \"*most of the robots should arrange themselves*\" suggests that most of the robots are in one area. I could check for that.\n", "3) I could generate an image for each time step and send it off to an AI image recognition service. That would be iffy, slow, and probably expensive. \n", "\n", "I'll try the animation approach first. Google and Stack Overflow led me to the `matplotlib.animation.FuncAnimation` function:" ] }, { "cell_type": "code", "execution_count": 154, "id": "664c686e-0c3d-43b8-970f-88c0bf47dbf6", "metadata": {}, "outputs": [], "source": [ "import matplotlib.animation\n", "\n", "def animate_robots(robots, times: Ints):\n", " \"\"\"Animate the robot dance over the given time steps.\"\"\"\n", " plt.rcParams[\"animation.html\"] = \"jshtml\"\n", " plt.rcParams['figure.dpi'] = 100 \n", " plt.ioff()\n", " fig, ax = plt.subplots()\n", " def animate(t: int):\n", " points = robot_dance(robots, t)\n", " plt.cla()\n", " ax.yaxis.set_inverted(True)\n", " plt.plot(*T(points), 'go')\n", " plt.title(f'{t} seconds')\n", " return matplotlib.animation.FuncAnimation(fig, animate, frames=times)" ] }, { "cell_type": "markdown", "id": "92048f28-a6a4-4c12-847f-62884177dec5", "metadata": {}, "source": [ "Here's what it looks like:" ] }, { "cell_type": "code", "execution_count": 156, "id": "87843969-cb37-4fa5-9788-6a1b71c43521", "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "\n", "
\n", " \n", "
\n", " \n", "
\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
\n", "
\n", " \n", " \n", " \n", " \n", " \n", " \n", "
\n", "
\n", "
\n", "\n", "\n", "\n" ], "text/plain": [ "" ] }, "execution_count": 156, "metadata": {}, "output_type": "execute_result" } ], "source": [ "animate_robots(robots, range(3))" ] }, { "cell_type": "markdown", "id": "6f722d21-dc5e-473c-b9d1-c71915cbeb6f", "metadata": {}, "source": [ "The animations take up a lot of space in the stored `.ipynb` file, so I only show 3 frames here. I looked at hundreds of frames, but no Christmas tree emerged. \n", "\n", "So, on to the second idea. If the hint had mentioned \"*all of the robots*\", I would look for an image frame with the minimum bounding box. But for \"*most of the robots*,\" I'll look for a frame that minimizes the mean distance from the centroid. " ] }, { "cell_type": "code", "execution_count": 158, "id": "9563d49c-54a3-439f-a833-f48c2a070609", "metadata": {}, "outputs": [], "source": [ "def mean_distance_to_centroid(points, distance=taxi_distance) -> float:\n", " \"\"\"The mean of each point's distance to the centroid.\"\"\"\n", " centroid = (mean(Xs(points)), mean(Ys(points)))\n", " return mean(distance(p, centroid) for p in points)\n", "\n", "def most_clustered_time(robots, times=range(10_000)) -> int:\n", " \"\"\"Out of all the given time steps, the one that has the robots clustered closest together.\"\"\"\n", " return min(times, key=lambda t: mean_distance_to_centroid(robot_dance(robots, t)))" ] }, { "cell_type": "code", "execution_count": 159, "id": "ab8c7e3b-f400-4976-ad0d-5f92cbadec02", "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", "\n", "
\n", " \n", "
\n", " \n", "
\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
\n", "
\n", " \n", " \n", " \n", " \n", " \n", " \n", "
\n", "
\n", "
\n", "\n", "\n", "\n" ], "text/plain": [ "" ] }, "execution_count": 159, "metadata": {}, "output_type": "execute_result" } ], "source": [ "t = most_clustered_time(robots)\n", "animate_robots(robots, [t])" ] }, { "cell_type": "markdown", "id": "6a4794b4-1d3e-4d82-b886-4416ef5b6453", "metadata": {}, "source": [ "**It worked!** \n", "\n", "(At first I had a **bug**: the Christmas tree was upside down, because my Y-axis was upside down. So I added the `yaxis.set_inverted` call to `animate_robots`.)\n", "\n", "Although there was a human in the loop to verify the output, I can make this official with this call to `answer`:" ] }, { "cell_type": "code", "execution_count": 161, "id": "75434bc8-35ae-4d8b-b747-01d773472541", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Puzzle 14.2: 1.874 seconds, answer 6876 ok" ] }, "execution_count": 161, "metadata": {}, "output_type": "execute_result" } ], "source": [ "answer(14.2, 6876, lambda:\n", " most_clustered_time(robots, range(7000)))" ] }, { "cell_type": "markdown", "id": "08cae29b-9b07-4e8d-b2d1-f3798f6c7cd0", "metadata": {}, "source": [ "# [Day 15](https://adventofcode.com/2024/day/15): Warehouse Woes\n", "\n", "Today's input is in two sections: the first section is a grid map describing a warehouse with walls (`#`) and boxes (`O`) and a single robot (`@`). The second part is a set of instructions for how the robot moves (arrows). I'll parse the two sections as paragraphs, then parse each paragraph:" ] }, { "cell_type": "code", "execution_count": 163, "id": "20be45ec-f6fc-472c-9b49-872b7334528c", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "Puzzle input ➜ 71 strs:\n", "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "##################################################\n", "#..OO..O.O....O...O..O...O.......O...OO##....O.OO#\n", "#O.#..#OOO#..O..OO...O.O.....OO..O#O#.OOO.....#..#\n", "#.....O.......OO.#OO....#O.OO.O..OO.O.O.O..##....#\n", "#.O....O...O#...#...OO..#..O........#O..#..O..O..#\n", "#O....O...O.O..OO..OO..#OO.#OO.O......##..O..O...#\n", "#..O.##..#O...O...#.#.O.O..O.#......O..#.#...O...#\n", "#O.O.........O..O........OO....OO......O.....O#..#\n", "...\n", "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "Parsed representation ➜ 2 strs:\n", "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "##################################################\n", "#..OO..O.O....O...O..O...O.......O...OO##.... ...\n", ">><^v><>^v<vv><<^^>>>>^^><>^<^^vvv>>><><>v^^^^<<^<^><>>>v><>>>^>><>v>v>^v>>v>>>v ...\n" ] } ], "source": [ "warehouse_woes = parse(15, sections=paragraphs)\n", "warehouse = Grid(parse(warehouse_woes[0]))\n", "arrows = cat(parse(warehouse_woes[1]))" ] }, { "cell_type": "markdown", "id": "9a4aed93-5205-4946-b04c-637f3b095e4b", "metadata": {}, "source": [ "### Part 1: What is the sum of all boxes' GPS coordinates after moving?\n", "\n", "The robot attempts to follow each instruction arrow (for example, moving East when the arrow is `>`). The robot is strong enough to push a line of any number of boxes sitting in front of it; that's its job. However, if a push is blocked by a wall, then neither the robot nor any boxes will move.\n", "\n", "The **GPS coordinate** of a box at (*x*, *y*) is defined to be *x* + 100*y*.\n", "\n", "I'll implement `obey_arrows` to make the arrow moves on a copy of the warehouse. For each arrow the function finds all the things that might move (the robot and any boxes) with `moveables`; then `make_movement` checks if they would bump into a wall, and if not, they all move." ] }, { "cell_type": "code", "execution_count": 165, "id": "248d51c0-424e-4bbb-bbf4-37cdc18313e1", "metadata": {}, "outputs": [], "source": [ "def gps_coordinate(box: Point) -> int: return X_(box) + 100 * Y_(box)\n", "\n", "def obey_arrows(warehouse: Grid, arrows: str) -> Grid:\n", " \"\"\"Return a grid in which the robot has followed `arrows`, pushing boxes around.\"\"\"\n", " grid = warehouse.copy()\n", " robot_pos = the(grid.findall('@'))\n", " for arrow in arrows:\n", " dir = arrow_direction[arrow]\n", " robot_and_boxes = moveables(grid, robot_pos, dir)\n", " if make_movement(grid, robot_and_boxes, dir):\n", " robot_pos = add(robot_pos, dir)\n", " return grid\n", "\n", "def all_box_positions(grid) -> List[Point]: return grid.findall('O')\n", "\n", "def moveables(grid, start: Point, dir: Vector) -> List[Point]:\n", " \"\"\"The positions of moveable things (the robot and maybe boxes) going in direction `dir` from the `start`.\"\"\"\n", " def moveable(pos): return grid[pos] in ('@', 'O')\n", " return list(takewhile(moveable, grid.follow_line(start, dir)))\n", "\n", "def make_movement(grid, to_move: List[Point], dir: Vector) -> bool:\n", " \"\"\"Try to move the objects in the `to_move` positions in direction `dir`; return True if they move.\"\"\"\n", " def destination(p): return add(p, dir) # Where we are trying to move `p` to\n", " if grid[destination(to_move[-1])] == '#':\n", " return False\n", " else:\n", " for p in reversed(to_move): # Reverse order so they don't step on each other\n", " grid[destination(p)] = grid[p]\n", " grid[p] = '.'\n", " return True" ] }, { "cell_type": "code", "execution_count": 166, "id": "52e93218-6ac2-4cf7-aced-f4f3a3df77b5", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Puzzle 15.1: .026 seconds, answer 1563092 ok" ] }, "execution_count": 166, "metadata": {}, "output_type": "execute_result" } ], "source": [ "answer(15.1, 1563092, lambda:\n", " sum(map(gps_coordinate, all_box_positions(obey_arrows(warehouse, arrows)))))" ] }, { "cell_type": "markdown", "id": "84dcd7fd-0f4a-4377-b61e-22bd5a0a51a9", "metadata": {}, "source": [ "### Part 2: What is the sum of all boxes' final GPS coordinates on the double-wide grid?\n", "\n", "In Part 2, there is another warehouse that is similar to the first, but twice as wide. Each position in the original warehouse is replaced by *two* copies of the contents, except that the robot is replaced by `@.` and a box, `O`, is replaced by `[]`, indicating the two halves of a double-wide box. The rules for movement and pushing are the same, except that when the robot is moving North or South and is pushing a box, that box, since it is two positions wide, can push *two* boxes if they are lined up right. (Presumably, those two boxes could then push three boxes in the next row, and so on, although the puzzle description did not explicitly specify that). Finally, the GPS coordinates are taken for the `[` part of the box. Here's what it looks like before and after the robot moves \"^\":\n", "\n", " ############## ##############\n", " ##......##..## ##......##..##\n", " ##..........## ##...[][]...##\n", " ##...[][]...## ##....[]....##\n", " ##....[]....## ##.....@....##\n", " ##.....@....## ##..........##\n", " ############## ##############\n", "\n", "So this is mostly the same as Part 1, but the criteria of what to move is different. Here are the changes I'll make:\n", "- I'll need to make the double-wide grid, by applying `doublewide` to the original text to get `warehouse2`.\n", "- I'll redefine `make_movement` to check for a wall in front of *any* of the boxes, not just the last one, and to move them all in one `update`, rather than one at a time.\n", "- I'll redefine `moveables` to deal with either regular or double-wide boxes (but not both in one maze).\n", "\n", "The redefinitions are backwards-comnpatible, which I'll demonstrate by re-running Part 1 before running Part 2:" ] }, { "cell_type": "code", "execution_count": 168, "id": "2d9afbc1-75b2-479d-81fc-fbab69d25753", "metadata": {}, "outputs": [], "source": [ "def doublewide(text: str) -> str:\n", " \"\"\"Make the grid (described in text) twice as wide.\"\"\"\n", " return text.replace('#', '##').replace('O', '[]').replace('.', '..').replace('@', '@.')\n", " \n", "warehouse2 = Grid(parse(doublewide(warehouse_woes[0])))\n", "\n", "def make_movement(grid, to_move: Collection[Point], dir: Vector) -> bool:\n", " \"\"\"Try to move the objects in the `to_move` positions in direction `dir`; return True if they move.\"\"\"\n", " def destination(p): return add(p, dir) # Where we are trying to move `p` to\n", " if any(grid[destination(p)] == '#' for p in to_move):\n", " return False\n", " else:\n", " updates = {destination(p): grid[p] for p in to_move}\n", " grid.update({p: '.' for p in to_move})\n", " grid.update(updates)\n", " return True\n", "\n", "def moveables(grid, start_pos, dir) -> Set[Point]:\n", " \"\"\"The positions of moveable things (robot and maybe boxes) going in direction from the start.\"\"\" \n", " ahead = add(start_pos, dir)\n", " if dir in (East, West) or grid[ahead] == 'O': # Single line push\n", " def moveable(pos): return grid[pos] in ('@', 'O', '[', ']')\n", " return set(takewhile(moveable, grid.follow_line(start_pos, dir)))\n", " else: # Potential non-linear push\n", " results = {start_pos}\n", " if grid[ahead] in ('[', ']'): results |= moveables(grid, ahead, dir) \n", " if grid[ahead] == '[': results |= moveables(grid, add(ahead, East), dir)\n", " if grid[ahead] == ']': results |= moveables(grid, add(ahead, West), dir)\n", " return results" ] }, { "cell_type": "code", "execution_count": 169, "id": "7af49bbf-dd10-4221-9096-6f548dec44c0", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Puzzle 15.1: .029 seconds, answer 1563092 ok" ] }, "execution_count": 169, "metadata": {}, "output_type": "execute_result" } ], "source": [ "answer(15.1, 1563092, lambda:\n", " sum(map(gps_coordinate, obey_arrows(warehouse, arrows).findall('O'))))" ] }, { "cell_type": "code", "execution_count": 170, "id": "99246602-a51e-41aa-a7e9-7cdbc8d449ca", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Puzzle 15.2: .042 seconds, answer 1582688 ok" ] }, "execution_count": 170, "metadata": {}, "output_type": "execute_result" } ], "source": [ "answer(15.2, 1582688, lambda:\n", " sum(map(gps_coordinate, obey_arrows(warehouse2, arrows).findall('['))))" ] }, { "cell_type": "markdown", "id": "4361f8c3-1d15-441e-9a41-b1ea20707651", "metadata": {}, "source": [ "I had a frustrating time **debugging** this one; this was by far my worst performance on this year's puizzles so far. First I had a silly typo in `moveables`; I was able to fix it after looking at the results on the smaller test puzzle:" ] }, { "cell_type": "code", "execution_count": 172, "id": "47c99f0f-ab65-4ae1-a308-42668feacdd5", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "##############\n", "##...[].##..##\n", "##...@.[]...##\n", "##....[]....##\n", "##..........##\n", "##..........##\n", "##############\n" ] } ], "source": [ "xwarehouse = Grid(parse(doublewide(\"\"\"\\\n", "#######\n", "#...#.#\n", "#.....#\n", "#..OO@#\n", "#..O..#\n", "#.....#\n", "#######\"\"\")))\n", "\n", "xarrows = \"\n", "\n", "\n", "\n", "### Part 1: What is the lowest score a Reindeer could possibly get?\n", "\n", "The race through the maze starts at the `S` position and ends at the `E`. A reindeer is allowed to take a step forward (as long as there isn't a `#` wall there) or to turn 90 degrees right or left. The reindeer is initially facing East. The **score** for a path is one point for every forward step and 1000 points for every turn.\n", "\n", "We're asked to find the path with the minimum score. My [AdventUtils](AdventUtils.ipynb) notebook already contains an `A_star_search` function for finding least-cost paths, and a `GridProblem` class. By default, a `GridProblem` counts one point for a move in any direction, so we'll have to create a subclass, `MazeSearchProblem`. This is straightforward but a bit tedious; I had a **bug** where I accepted the default `is_goal` and `h` methods; that doesn't work because they assume the state is just a position; but for this problem the state contains both the position and the facing direction. Another **bug** was that I left out the `goal=end` in the call to `MazeSearchProblem`. I thought I wouldn't need it because I wrote an `is_goal` method, but the `goal` is needed in the `h` (heuristic estimate) method." ] }, { "cell_type": "code", "execution_count": 177, "id": "e6e4bfba-0170-436a-961b-d4749f2cd66e", "metadata": {}, "outputs": [], "source": [ "State = namedtuple('State', 'pos, facing')\n", "\n", "def reindeer_path(maze) -> Node:\n", " \"\"\"The lowest-cost path through the maze.\"\"\"\n", " start, end = the(maze.findall('S')), the(maze.findall('E'))\n", " problem = MazeSearchProblem(grid=maze, initial=State(start, East), goal=end)\n", " return A_star_search(problem)\n", "\n", "class MazeSearchProblem(GridProblem):\n", " \"\"\"A GridProblem where a turn costs 1000 points, a step ahead 1.\"\"\"\n", " \n", " def actions(self, state):\n", " ahead = add(state.pos, state.facing)\n", " return ['L', 'R'] + ([ahead] if self.grid[ahead] != '#' else [])\n", " \n", " def result(self, state, action) -> State:\n", " return (State(state.pos, make_turn(state.facing, action)) if action in ('L', 'R') else\n", " State(add(state.pos, state.facing), state.facing))\n", " \n", " def action_cost(self, s1, action, s2) -> int: return 1000 if action in ('L', 'R') else 1\n", "\n", " def is_goal(self, state) -> bool: return self.grid[state.pos] == 'E'\n", "\n", " def h(self, node) -> int: return taxi_distance(node.state.pos, self.goal)" ] }, { "cell_type": "code", "execution_count": 178, "id": "4974c14c-86da-4b86-a55c-6ae8781df207", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Puzzle 16.1: .146 seconds, answer 103512 ok" ] }, "execution_count": 178, "metadata": {}, "output_type": "execute_result" } ], "source": [ "answer(16.1, 103512, lambda:\n", " reindeer_path(maze).path_cost)" ] }, { "cell_type": "markdown", "id": "030e5786-cd2a-405f-b4d4-460cefab7e32", "metadata": {}, "source": [ "### Part 2: How many tiles are part of at least one of the best paths through the maze?\n", "\n", "In Part 2 we're asked to find the total number of positions that are part of *any* best path from start to end. I'll write a new version of `best_first_search` to return all the paths that have the same cost as the best path. I thought this would be easy, but I had **another bug** where I forgot to change the `<` to a `<=` in the fourth-to-last line of `all_paths_best_first_search`:" ] }, { "cell_type": "code", "execution_count": 180, "id": "692abfea-f9c8-477c-8369-386cdd2a7606", "metadata": {}, "outputs": [], "source": [ "def reindeer_best_positions(maze) -> Node:\n", " \"\"\"All the positions on any best path from start to end.\"\"\"\n", " start, end = the(maze.findall('S')), the(maze.findall('E'))\n", " problem = MazeSearchProblem(grid=maze, initial=State(start, East), goal=end)\n", " paths = list(all_paths_best_first_search(problem, f=lambda n: n.path_cost + problem.h(n)))\n", " return union({state.pos for state in path_states(path)} for path in paths)\n", "\n", "def all_paths_best_first_search(problem, f) -> List[Node]:\n", " \"Search nodes with minimum f(node) value first, return all paths with minimum cost.\"\n", " node = Node(problem.initial)\n", " frontier = PriorityQueue([node], key=f)\n", " reached = {problem.initial: node}\n", " while frontier:\n", " node = frontier.pop()\n", " if problem.is_goal(node.state):\n", " return [node] + [path for (cost, path) in frontier.items\n", " if cost == node.path_cost and problem.is_goal(path.state)]\n", " for child in expand(problem, node):\n", " s = child.state\n", " if s not in reached or child.path_cost <= reached[s].path_cost:\n", " reached[s] = child\n", " frontier.add(child)\n", " return []" ] }, { "cell_type": "code", "execution_count": 181, "id": "ea9bf9f3-0e6b-4949-a641-6b3db2fd9d32", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Puzzle 16.2: .863 seconds, answer 554 ok" ] }, "execution_count": 181, "metadata": {}, "output_type": "execute_result" } ], "source": [ "answer(16.2, 554, lambda:\n", " len(reindeer_best_positions(maze)))" ] }, { "cell_type": "markdown", "id": "479dc79f-44d9-4140-b79d-ebd9132fcfbd", "metadata": {}, "source": [ "Time to do another cleanup:" ] }, { "cell_type": "code", "execution_count": 183, "id": "0300f56c-ed13-4d63-a6d1-8c8bcba558ba", "metadata": {}, "outputs": [], "source": [ "disk_map = topo = farm = claws = robots = warehouse_woes = warehouse = arrows = maze = None" ] }, { "cell_type": "markdown", "id": "91607c18-56c3-4432-8da8-cfe570887bc0", "metadata": {}, "source": [ "# [Day 17](https://adventofcode.com/2024/day/17): Chronospatial Computer\n", "\n", "Today we have to help debug a faulty computer. This particular computer has three registers, A, B, and C, and a program consisting of a sequence of octal digits. The input is a description of the state of the computer; the values in the register and the stored program." ] }, { "cell_type": "code", "execution_count": 185, "id": "50fd3cb8-0a6f-4edd-b5cb-f7b1e6f9d987", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "Puzzle input ➜ 5 strs:\n", "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "Register A: 52042868\n", "Register B: 0\n", "Register C: 0\n", "\n", "Program: 2,4,1,7,7,5,0,3,4,4,1,7,5,5,3,0\n", "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "Parsed representation ➜ 5 tuples:\n", "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "('Register', 'A', 52042868)\n", "('Register', 'B', 0)\n", "('Register', 'C', 0)\n", "()\n", "('Program', 2, 4, 1, 7, 7, 5, 0, 3, 4, 4, 1, 7, 5, 5, 3, 0)\n" ] } ], "source": [ "Computer = namedtuple('Computer', 'A, B, C, prog')\n", " \n", "def initialize_computer(information) -> Computer:\n", " \"\"\"Initialize the computer with the debugging information.\"\"\"\n", " kwds = {}\n", " for info in information:\n", " match info:\n", " case ['Register', L, val]: kwds[L] = val\n", " case ['Program', *vals]: kwds['prog'] = vals\n", " return Computer(**kwds)\n", " \n", "computer = initialize_computer(parse(17, atoms))" ] }, { "cell_type": "code", "execution_count": 186, "id": "c23b8a44-e352-4a30-abe5-3c939ffc743c", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Computer(A=52042868, B=0, C=0, prog=[2, 4, 1, 7, 7, 5, 0, 3, 4, 4, 1, 7, 5, 5, 3, 0])" ] }, "execution_count": 186, "metadata": {}, "output_type": "execute_result" } ], "source": [ "computer" ] }, { "cell_type": "markdown", "id": "031ec910-e249-487b-ae95-b98abae3b9cf", "metadata": {}, "source": [ "### Part 1: Run the Program. What do you get if you use commas to join the output values?\n", "\n", "Now we have to run the program. The computer has eight opcodes; each opcode operates on the following value in memory; some instructions take the operand literally, and some compute a **combo value** from it. The combo value is the same as the literal value, except that values 4, 5, and 6 refer to registers A, B, and C, respectively. Opcode 5 outputs (yields) the last octal digit of the combo value. There is a program counter (pc) that increments by 2 on each instruction (to skip over the operand) unless there is a branch instuction (opcode 3). See the [day's description](https://adventofcode.com/2024/day/17) for details on how the opcodes work." ] }, { "cell_type": "code", "execution_count": 188, "id": "d98f88cc-c435-43fc-bcb5-52e6dd70fdb1", "metadata": {}, "outputs": [], "source": [ "def run_program(computer) -> Iterable[int]:\n", " \"\"\"Run the program on the computer, yielding each output.\"\"\"\n", " A, B, C, prog = computer\n", " pc = 0\n", " while pc < len(prog):\n", " op, val = prog[pc:pc+2]\n", " pc += 2\n", " combo = (A if val == 4 else B if val == 5 else C if val == 6 else val)\n", " match op:\n", " case 0: A = A // (2 ** combo)\n", " case 6: B = A // (2 ** combo)\n", " case 7: C = A // (2 ** combo)\n", " case 1: B = B ^ val\n", " case 4: B = B ^ C\n", " case 2: B = combo % 8\n", " case 5: yield combo % 8\n", " case 3: \n", " if A: pc = val" ] }, { "cell_type": "markdown", "id": "6348d561-9ac9-437c-8bcd-6fbd91d1ebf5", "metadata": {}, "source": [ "With my `run_program` function, the answer for Part 1 is easy:" ] }, { "cell_type": "code", "execution_count": 190, "id": "860f24e5-92ad-4361-8920-102ebc573598", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Puzzle 17.1: .000 seconds, answer 2,1,0,1,7,2,5,0,3 ok" ] }, "execution_count": 190, "metadata": {}, "output_type": "execute_result" } ], "source": [ "answer(17.1, '2,1,0,1,7,2,5,0,3', lambda:\n", " cat(run_program(computer), ','))" ] }, { "cell_type": "markdown", "id": "d3248e42-ab8e-4fdb-8e19-439766275c37", "metadata": {}, "source": [ "### Part 2: What is the lowest positive initial value for register A that causes the program to output a copy of itself?\n", "\n", "In Part 2, we find that register A has been corrupted, and we need to restore it to the value that will make the program output a copy of itself (a [Quine](https://en.wikipedia.org/wiki/Quine_%28computing%29)). I was afraid of this! AoC always has a puzzle where you have to write an interpreter for a program in some obscure language, but then in Part 2 you have to actually *understand* what the program is doing; you can't use brute force. (I tried brute force up to A=10,000,000 with no luck.)\n", "\n", "To try to understand my program, here it is in pseudocode:\n", "\n", " top: B = A % 8 # 2, 4\n", " B = B ^ 7 # 1, 7\n", " C = A / 2 ** B # 7, 5\n", " A = A / 2 ** 3 # 0, 3\n", " B = B ^ C # 4, 4\n", " B = B ^ 7 # 1, 7\n", " output B # 5, 5\n", " if A: goto top # 3, 0\n", "\n", "I can summarize that as:\n", "\n", " top: B and C are defined in terms of the last octal digit of A, and prior value of B\n", " A is shifted to eliminate the last octal digit\n", " output B \n", " if A: goto top \n", "\n", "So I realized that one octal digit of `A` is eliminated on each pass through the loop, and when `A` hits zero, we exit. Each pass outputs one octal digit, so `A` in octal has to be the same number of digits as my program; 16 octal digits is somewhere in the hundred trillion range. Good thing I gave up on brute force. \n", "\n", "I started playing around and came up with this:" ] }, { "cell_type": "code", "execution_count": 192, "id": "bb745303-dd20-486f-bbdd-7ae77f995c2c", "metadata": {}, "outputs": [], "source": [ "def run(computer=computer, **registers) -> List[int]: \n", " \"\"\"Run the program with registers set as keywords.\"\"\"\n", " return list(run_program(computer._replace(**registers)))" ] }, { "cell_type": "code", "execution_count": 193, "id": "54ac9b9c-70d9-4356-91c5-40fb285634b4", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[2, 4, 1, 7, 7, 5, 0, 3, 4, 4, 1, 7, 5, 5, 3, 0]" ] }, "execution_count": 193, "metadata": {}, "output_type": "execute_result" } ], "source": [ "computer.prog" ] }, { "cell_type": "code", "execution_count": 194, "id": "36d89d9a-c8fc-41be-820b-cb13e40793c0", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[0]" ] }, "execution_count": 194, "metadata": {}, "output_type": "execute_result" } ], "source": [ "run(A=0o7) # match the last digit of program" ] }, { "cell_type": "code", "execution_count": 195, "id": "892fef38-5f9b-4370-a242-f7a10df5487b", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[3, 0]" ] }, "execution_count": 195, "metadata": {}, "output_type": "execute_result" } ], "source": [ "run(A=0o72) # match the last two digits of program" ] }, { "cell_type": "code", "execution_count": 196, "id": "b3d11d5e-30c2-419f-bc11-3f26fbdddfbb", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[5, 3, 0]" ] }, "execution_count": 196, "metadata": {}, "output_type": "execute_result" } ], "source": [ "run(A=0o726) # match the last three digits of program" ] }, { "cell_type": "code", "execution_count": 197, "id": "9ffcefa7-714f-416f-b6c7-8a9ad6d65380", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[5, 5, 3, 0]" ] }, "execution_count": 197, "metadata": {}, "output_type": "execute_result" } ], "source": [ "run(A=0o7266) # match the last four digits of program" ] }, { "cell_type": "markdown", "id": "f40f775f-bb9d-459c-80c3-ac09b6b42904", "metadata": {}, "source": [ "That is, I can build up the right value for `A` to generate a Quine program as follows:\n", "\n", "- I'm going to keep a **set** of candidate partial values for `A` as the set `As`.\n", "- The set starts with no digits, so just `{0}`.\n", "- On each iteration I try appending each octal digit to each element of the set `As` (by multplying by 8 and adding the digit).\n", "- I keep the candidate `A` values whose output from the run matches the tail of the program's output.\n", " - On each iteration we insist on matching one more octal digit of the tail of the program \n", "- Iterate this for each digit in the program and return the set of `A` values that reproduce the whole program.\n", "\n", "All of the resulting `A` values will be Quines, but the puzzle asks us to find just the minimum of the set." ] }, { "cell_type": "code", "execution_count": 199, "id": "a49c6de9-4e6b-47e5-bcf0-2972a95c1af3", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Puzzle 17.2: .004 seconds, answer 267265166222235 ok" ] }, "execution_count": 199, "metadata": {}, "output_type": "execute_result" } ], "source": [ "def quine(computer) -> Set[int]:\n", " \"\"\"Find the values of register `A` that cause the output of the run to match the program.\"\"\"\n", " As = {0}\n", " for place in reversed(range(len(computer.prog))):\n", " tail = computer.prog[place:]\n", " candidates = {(A * 8) + d for A in As for d in range(8)}\n", " As = {A for A in candidates if run(A=A) == tail}\n", " return As\n", "\n", "answer(17.2, 267265166222235, \n", " lambda: min(quine(computer)))" ] }, { "cell_type": "markdown", "id": "c7f9e900-45be-401f-a6f2-a1d7b751fae6", "metadata": {}, "source": [ "# [Day 18](https://adventofcode.com/2024/day/18): RAM Run\n", "\n", "In today's narrative, we're inside a computer, on a 2D memory board, and bytes are falling down, at specified (x, y) positions, as given in our input:" ] }, { "cell_type": "code", "execution_count": 201, "id": "d14e1966-2feb-4553-9a0a-12595ef4f7d7", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "Puzzle input ➜ 3450 strs:\n", "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "40,65\n", "17,1\n", "34,45\n", "31,51\n", "29,43\n", "25,9\n", "14,27\n", "5,29\n", "...\n", "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "Parsed representation ➜ 3450 tuples:\n", "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "(40, 65)\n", "(17, 1)\n", "(34, 45)\n", "(31, 51)\n", "(29, 43)\n", "(25, 9)\n", "(14, 27)\n", "(5, 29)\n", "...\n" ] } ], "source": [ "falling_bytes = parse(18, ints)" ] }, { "cell_type": "markdown", "id": "1229cec7-a456-4dd6-a668-8a00591c63f7", "metadata": {}, "source": [ "\n", "\n", "### Part 1: What is the minimum number of steps needed to reach the exit?\n", "\n", "When a byte falls it creates a barrier. Our task is to find a path that avoids the barriers, from the start in the upper left to the exit in the lower right of a 71 x 71 grid that is the memory board. \n", "\n", "This is another search puzzle, like the maze in Day 16, but without the complications (e.g. costs for turning right or left), so I can use my `GridProblem` class from [AdventUtils](AdventUtils.ipynb) without alteration. The puzzle description for today says that we should first consider just the first kilobyte (1024 falling bytes), and I was worried that if I just hand those points to my `Grid` class, it wouldn't cover the whole 71 x 71 grid. Therefore, I created a grid with empty spaces, and then updated with the falling bytes. The function `memory_path` returns a path, and we can then ask for its length to get the answer." ] }, { "cell_type": "code", "execution_count": 203, "id": "83af4751-38c9-4830-a2fa-78515b59bc97", "metadata": {}, "outputs": [], "source": [ "def memory_path(falling_bytes: Tuple[Point], width=71, height=71) -> Grid:\n", " \"\"\"Make a Grid of the given size with the points as obstacles, and find a path.\"\"\"\n", " grid = Grid(['.' * width] * height)\n", " grid.update({p: '#' for p in falling_bytes})\n", " problem = GridProblem(grid=grid, initial=(0, 0), goal=(width - 1, height - 1))\n", " return A_star_search(problem)" ] }, { "cell_type": "code", "execution_count": 204, "id": "29da25e2-f3c2-43e3-8769-1d4fcecb807b", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Puzzle 18.1: .014 seconds, answer 344 ok" ] }, "execution_count": 204, "metadata": {}, "output_type": "execute_result" } ], "source": [ "answer(18.1, 344, lambda:\n", " len(memory_path(falling_bytes[:1024])))" ] }, { "cell_type": "markdown", "id": "792bc31e-964d-47fe-a09b-6a95724e641e", "metadata": {}, "source": [ "### Part 2: What are the coordinates of the first byte that will prevent the exit from being reachable from your starting position?\n", "\n", "After 1024 bytes fall there is a path from start to exit, but as more bytes fall we might have to switch to a different path, and eventually there will be no path. We're asked for the `(x,y)` position of the first falling byte that blocks off all paths. I can think of two ways to handle this:\n", "1) Add falling bytes one at a time and repeat the A-star search each time. **Slow!**\n", "2) Add falling bytes in **binary search** fashion: We know adding no bytes is **good** for getting a path and adding all of them is **bad**; try half way and then update **good** or **bad** depending on whether we found a path. Repeat until **good** is one more than **bad**; that's the answer. **Fast!**" ] }, { "cell_type": "code", "execution_count": 206, "id": "4c0a8dcb-c3af-45e7-9273-8776e8c3ea1d", "metadata": {}, "outputs": [], "source": [ "def memory_blocker(falling_bytes, good=1024) -> Point:\n", " \"\"\"Which falling byte is the first to block a path to the exit? Do binary search.\"\"\"\n", " # Here `good` and `bad` are the stop values of a slice, not an index,\n", " # so the final answer is falling_bytes[bad - 1], not falling_bytes[bad]\n", " bad = len(falling_bytes) \n", " while bad != good + 1:\n", " mid = (good + bad) // 2\n", " if memory_path(falling_bytes[:mid]) == search_failure:\n", " bad = mid\n", " else:\n", " good = mid\n", " return falling_bytes[bad - 1]" ] }, { "cell_type": "code", "execution_count": 207, "id": "22371144-5d51-440a-918f-a63de73b13ad", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Puzzle 18.2: .033 seconds, answer 46,18 ok" ] }, "execution_count": 207, "metadata": {}, "output_type": "execute_result" } ], "source": [ "answer(18.2, '46,18', lambda:\n", " cat(memory_blocker(falling_bytes), ','))" ] }, { "cell_type": "markdown", "id": "552f1c6e-052e-43d0-b13f-e8f66f274d63", "metadata": {}, "source": [ "I admit I initially had an off-by-one **bug** here. I was inconsistent on whether `bad` should be an index into the falling bytes, or the stop of a slice.\n", "\n", "I realize that for Part 1 I should have had separate functions for making the grid and solving it; then in Part 2 I could have incrementally modified the grid each time rather than creating a whole new Grid (and Problem). But it runs in under 1/10 second, so it is not worth changing it." ] }, { "cell_type": "markdown", "id": "702d6ea3-bcb1-4c90-8d67-9e686cd0155f", "metadata": {}, "source": [ "# [Day 19](https://adventofcode.com/2024/day/19): Linen Layout\n", "\n", "Today's input is in two sections, the first a list of towel patterns (with each letter of a word specifying a color), and the second a list of desired designs to be made by adjoining towel patterns. For example, if the patterns include\n", "\n", " a, dub, rub, ...\n", "\n", "and the desired design is\n", "\n", " rubadubdub\n", "\n", "then it can be made from the patterns with\n", "\n", " rub + a + dub + dub" ] }, { "cell_type": "code", "execution_count": 210, "id": "689df92b-92d7-44e6-8b4e-d67bf3f153df", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "Puzzle input ➜ 402 strs:\n", "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "rub, wugrr, gww, wgurb, urur, ggb, bw, uubbu, uw, uggru, gwwgrgb, wbbb, rgb, wuuur, bgruggug, ru ...\n", "\n", "rurgggubugbuwugbwgggwbwwwrbrbgwwwwuwuugrwbrbwgguwr\n", "ruurbrwgrurubwrurugubgurgruurwgugwgrwuwbrww\n", "gwbrwwruwubrwgubggggubwwrurugbbuuugwwburbw\n", "wwgwugrrrbwbgwburguwgbrgrwurugbbgubuuugbguur\n", "ubgbbrruwbgbrrgwwwwwrwgggggrwbgwuwgrwrbwbrg\n", "rurbbgrbwbggugrbwwbwrwuwuwbwwbwugwrubbww\n", "...\n", "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "Parsed representation ➜ 2 tuples:\n", "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "('rub', 'wugrr', 'gww', 'wgurb', 'urur', 'ggb', 'bw', 'uubbu', 'uw', 'uggru', 'gwwgrgb', 'wbbb', ...\n", "('rurgggubugbuwugbwgggwbwwwrbrbgwwwwuwuugrwbrbwgguwr', 'ruurbrwgrurubwrurugubgurgruurwgugwgrwuwb ...\n" ] } ], "source": [ "patterns, designs = parse(19, atoms, sections=paragraphs)" ] }, { "cell_type": "markdown", "id": "581ff31b-ec09-4ae5-84c7-3b3ffbbd9362", "metadata": {}, "source": [ "### Part 1: How many of the desired designs are possible?\n", "\n", "The task is to see how many of the desired designs can posibly be made by concatenating one or more of the patterns (with repetitions allowed). I can do this by checking if some pattern starts the design and recursively checking if the rest of the design is possible." ] }, { "cell_type": "code", "execution_count": 212, "id": "e0b96545-5f60-4c8e-9a0f-c77608c19128", "metadata": {}, "outputs": [], "source": [ "def is_possible_design(design, patterns=patterns) -> bool:\n", " \"\"\"Is it possible to make `design` by concatenating some of the `patterns`?\"\"\"\n", " return (design == '' \n", " or any(design.startswith(p) and is_possible_design(design[len(p):], patterns) \n", " for p in patterns))" ] }, { "cell_type": "code", "execution_count": 213, "id": "3c3fba1b-d3e5-494e-aad0-42ca0566ae1f", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Puzzle 19.1: .040 seconds, answer 242 ok" ] }, "execution_count": 213, "metadata": {}, "output_type": "execute_result" } ], "source": [ "answer(19.1, 242, lambda:\n", " quantify(designs, is_possible_design))" ] }, { "cell_type": "markdown", "id": "c7a03f27-c1af-4561-a887-ff4f9b7b0b51", "metadata": {}, "source": [ "### Part 2: What do you get if you add up the number of different ways you could make each design?\n", "\n", "For Part 2 we need to count all the ways that each design can be made. Since there can be an exponential number of ways for each design, I'm going to `cache` intermediate results. The number of ways is computed by considering each pattern that starts the design and recursively summing up the count of the number of ways for the rest of the design." ] }, { "cell_type": "code", "execution_count": 215, "id": "77d4fae1-d506-4733-9bb2-467619012f97", "metadata": {}, "outputs": [], "source": [ "@cache\n", "def count_ways(design, patterns=patterns) -> int:\n", " \"\"\"How many ways can the design be made from the patterns?\"\"\"\n", " return (1 if design == '' else\n", " sum(count_ways(design[len(p):], patterns)\n", " for p in patterns if design.startswith(p)))" ] }, { "cell_type": "code", "execution_count": 216, "id": "14116eca-0b0f-484a-a169-9726e4ac7fbf", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Puzzle 19.2: .189 seconds, answer 595975512785325 ok" ] }, "execution_count": 216, "metadata": {}, "output_type": "execute_result" } ], "source": [ "answer(19.2, 595975512785325, lambda:\n", " sum(map(count_ways, designs)))" ] }, { "cell_type": "markdown", "id": "b1199e79-bb09-4d68-89e6-b235c5f987c5", "metadata": {}, "source": [ "That was so easy that there is time to explore a bit more. First, here's a check that says a design is possible if and only if there is at least one way to make it: " ] }, { "cell_type": "code", "execution_count": 218, "id": "f992b197-be14-47dc-8678-10cc63a1afd7", "metadata": {}, "outputs": [], "source": [ "for d in designs:\n", " assert is_possible_design(d) == (count_ways(d) >= 1)" ] }, { "cell_type": "markdown", "id": "a003849a-ae35-4c86-8d48-b954908d636b", "metadata": {}, "source": [ "Here is an alternative approach to Part 1 that turns out to be faster. It uses one big regular expression to match repetitions of the designs. We then check for a full-line match against each of the desired designs. (Unfortunately, this approach cannot be applied directly to Part 2.)" ] }, { "cell_type": "code", "execution_count": 220, "id": "2437ae06-27e4-4840-ad51-65454ef0bf60", "metadata": {}, "outputs": [], "source": [ "def count_possible_designs(designs, patterns) -> int:\n", " \"\"\"A count of all the `designs` that can be made by concatenating `patterns`.\"\"\"\n", " fullmatch = re.compile(\"(\" + \"|\".join(patterns) + \")+\").fullmatch\n", " return quantify(designs, fullmatch)" ] }, { "cell_type": "code", "execution_count": 221, "id": "88e45604-ce45-478e-a1b8-66ead1d0e72e", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Puzzle 19.1: .004 seconds, answer 242 ok" ] }, "execution_count": 221, "metadata": {}, "output_type": "execute_result" } ], "source": [ "answer(19.1, 242, lambda: \n", " count_possible_designs(designs, patterns))" ] }, { "cell_type": "markdown", "id": "efc9dc54-cdcc-40d5-85d5-b8ed8da61ba2", "metadata": {}, "source": [ "# [Day 20](https://adventofcode.com/2024/day/20): Race Condition\n", "\n", "Yet another puzzle with a grid, this one depicting a racetrack:" ] }, { "cell_type": "code", "execution_count": 223, "id": "156dcbf7-79ec-41a7-a9f2-397a827b9856", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "Puzzle input ➜ 141 strs:\n", "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "################################################################################################ ...\n", "#...#...#...........#...#...#...#...#.....#...###...#...###.........#...#...#.......#...#...#... ...\n", "#.#.#.#.#.#########.#.#.#.#.#.#.#.#.#.###.#.#.###.#.#.#.###.#######.#.#.#.#.#.#####.#.#.#.#.#.#. ...\n", "#.#...#.#...#.....#...#...#...#.#.#.#...#...#...#.#...#...#.......#...#...#.#.....#.#.#...#.#.#. ...\n", "#.#####.###.#.###.#############.#.#.###.#######.#.#######.#######.#########.#####.#.#.#####.#.#. ...\n", "#.#.....###...###.......#.......#.#.....#.......#.......#...#.....#...#.....#...#.#.#.....#...#. ...\n", "#.#.###################.#.#######.#######.#############.###.#.#####.#.#.#####.#.#.#.#####.#####. ...\n", "#.#.#...###...#...#.....#.......#.......#.###...#...###...#.#...#...#...###...#.#.#...###.....#. ...\n", "...\n" ] } ], "source": [ "racetrack = Grid(parse(20))" ] }, { "cell_type": "markdown", "id": "57918fd0-bb72-4c5e-8e1f-3bcf164a1d72", "metadata": {}, "source": [ "### Part 1: How many cheats would save you at least 100 picoseconds?\n", "\n", "We are told that the grid depicts a single path from start (`S`) to end (`E`). Each step (in one of the four cardinal directions) takes one picosecond. But you are allowed to **cheat** once during the race by going through a wall: you can take two steps where the first step is into a wall and the second is back on the track. We are asked how many such cheats would save 100 picoseconds or more.\n", "\n", "This is an all-paths-to-the-goal puzzle, which should make you think [**Dijkstra's algorithm**](https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm). My function `dijkstra` will return a dict of `{(x, y): distance_to_end}`. It works by maintaining a queue, `Q` of points to be considered, and one at a time popping a point off the queue, and for each neighbor that is not a wall, add the neighbor to the queue and record the distance to the neighbor as being one more than the distance to the point in the dict `D`. Since we are told the grid is single-path, we don't have to worry about updating entries in `D` for a second path to a point.\n", "\n", "Then my function `cheats` yields all `(start_position, end_position, time_saved)` tuples where the time saved is at least the given lower bound." ] }, { "cell_type": "code", "execution_count": 225, "id": "4c4ef05c-b548-49f9-b092-847e9752e745", "metadata": {}, "outputs": [], "source": [ "def dijkstra(grid, end_char='E') -> Dict[Point, int]:\n", " \"\"\"All-paths distances from each point to the end square on the grid: {(x, y): distance}.\"\"\"\n", " end = the(grid.findall(end_char))\n", " D = {end: 0}\n", " Q = [end]\n", " while Q:\n", " p = Q.pop()\n", " for p2 in grid.neighbors(p):\n", " if grid[p2] != '#' and p2 not in D:\n", " Q.append(p2)\n", " D[p2] = D[p] + 1\n", " return D\n", "\n", "def cheats(racetrack, minimum_savings=1) -> Iterable[Tuple[Point, Point, int]]:\n", " \"\"\"All ways of cheating by taking one step onto a wall (at p2) and a second step back on track (at p3),\n", " as long as they save at lease `minimum_savings` picoseconds\"\"\"\n", " D = dijkstra(racetrack, 'E') # A dict of {start_position: distance_to_E}\n", " return ((p1, p3, t)\n", " for p1 in D\n", " for p2 in racetrack.neighbors(p1) if racetrack[p2] == '#'\n", " for p3 in racetrack.neighbors(p2)\n", " if p3 in D and (t := D[p1] - D[p3] - 2) >= minimum_savings)" ] }, { "cell_type": "code", "execution_count": 226, "id": "1bbd8b72-c503-4384-aaea-a5bed45a4491", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Puzzle 20.1: .028 seconds, answer 1343 ok" ] }, "execution_count": 226, "metadata": {}, "output_type": "execute_result" } ], "source": [ "answer(20.1, 1343, lambda:\n", " quantify(cheats(racetrack, 100)))" ] }, { "cell_type": "markdown", "id": "0f86c3a4-47e7-4731-8acf-9133b3e41838", "metadata": {}, "source": [ "At first I had a puzzling **bug**. I had a lot of confidence in my code, but AoC said I had the wrong answer. I addressed it by carefully re-reading the puzzle description. Then I realized my mistake: I didn't count the 2 picoseconds of cheating as part of the total time. I fixed that by inserting the \"`-2`\" in the last line of `cheats`. In the process of carefully re-reading, I realized that the path through the grid is a single path; I didn't need a queue of points in `dijkstra`; the queue will always be just one point. But changing it wouldn't have a big effect on efficiency, so I'll keep it as is.\n", "\n", "\n", "\n", "\n", "### Part 2: How many big cheats would save you at least 100 picoseconds?\n", "\n", "In Part 2 you can use a much **bigger cheat**, of up to 20 steps (and thus 20 picoseconds). But you can still only use one cheat. I'll tackle this by looking at all points in a neighborhood of radius 20 from each starting point on the path." ] }, { "cell_type": "code", "execution_count": 228, "id": "d370e24c-9b82-4415-82a5-7afe2be17654", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Puzzle 20.2: .773 seconds, answer 982891 ok" ] }, "execution_count": 228, "metadata": {}, "output_type": "execute_result" } ], "source": [ "def big_cheats(racetrack, minimum_savings=1, radius=20) -> Iterable[Tuple[Point, Point, int]]:\n", " \"\"\"All ways of cheating by taking up to `radius` steps through walls and back to the track,\n", " as long as they save at lease `minimum_savings` picoseconds\"\"\"\n", " D = dijkstra(racetrack, 'E') # A dict of {start_position: distance_to_E}\n", " return ((p1, p2, t)\n", " for p1 in D\n", " for p2 in neighborhood(p1, radius)\n", " if p2 in D and (t := D[p1] - D[p2] - taxi_distance(p1, p2)) >= minimum_savings)\n", "\n", "def neighborhood(point, radius) -> List[Point]:\n", " \"\"\"All points within `radius` of `point` (using taxi distance).\"\"\"\n", " (x, y) = point\n", " return [(x + dx, y + dy) \n", " for dx in range(-radius, radius + 1)\n", " for dy in range(-(radius - abs(dx)), radius - abs(dx) + 1)]\n", "\n", "answer(20.2, 982891, lambda:\n", " quantify(big_cheats(racetrack, 100, 20)))" ] }, { "cell_type": "markdown", "id": "0022ec12-5359-455f-ace8-c8615d7cd1d2", "metadata": {}, "source": [ "This solution is backwards-compatible with Part 1:" ] }, { "cell_type": "code", "execution_count": 230, "id": "332e9c72-db9a-4b90-a649-45f7bf955e84", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Puzzle 20.1: .023 seconds, answer 1343 ok" ] }, "execution_count": 230, "metadata": {}, "output_type": "execute_result" } ], "source": [ "answer(20.1, 1343, lambda:\n", " quantify(big_cheats(racetrack, 100, 2)))" ] }, { "cell_type": "markdown", "id": "6f136dce-d68b-47b1-9b2e-31293f73ed6c", "metadata": {}, "source": [ "# [Day 21](https://adventofcode.com/2024/day/21): Keypad Conundrum\n", "\n", "Today's puzzle is simple: unlock the door to Santa's starship by entering some lock codes on a **numeric keypad**. Here are the lock codes:" ] }, { "cell_type": "code", "execution_count": 232, "id": "9d0eea9f-9d8f-4410-97ec-13d8b136925b", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "Puzzle input ➜ 5 strs:\n", "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "839A\n", "169A\n", "579A\n", "670A\n", "638A\n" ] } ], "source": [ "codes = parse(21)" ] }, { "cell_type": "markdown", "id": "adeabd3b-f534-4457-ab7e-3f057c34600f", "metadata": {}, "source": [ "### Part 1: What is the sum of the complexities of the five codes on your list?\n", "\n", "We know the codes, so what is the difficulty? It turns out the numeric keypad is inaccessible, so we have to get a **robot** to press the buttons, and we have to command the robot's arm by pressing some buttons on a **remote control directional keypad**: arrow keys to move the arm, and the \"`A`\" (activate) button to make the arm press the button it is currently pointing at. Here are the two keypads:\n", "\n", " +---+---+---+ +---+---+\n", " | 7 | 8 | 9 | | ^ | A |\n", " +---+---+---+ +---+---+---+\n", " | 4 | 5 | 6 | | < | v | > |\n", " +---+---+---+ +---+---+---+\n", " | 1 | 2 | 3 |\n", " +---+---+---+\n", " | 0 | A |\n", " +---+---+\n", " \n", "Long story short: it turns out the robot's remote keypad is *also* inaccessible, and we end up needing **three robots**, each pressing buttons on the next keypad, so there are **four levels** of button pressing all together:\n", "\n", "- You press some buttons on Robot 3's remote keypad (e.g. \">\"...)\n", "- Robot 2 presses some buttons on Robot 1's remote keypad (e.g. \"\" or \"v\" button, because that's just wasteful.)\n", "- Each of these paths have the same length, so if we were directly pressing Robot 1's remote control, any path would do.\n", "- However, it might take the robot at the next level a different number of presses to command each of these paths.\n", "- To command \"^^^\" the next robot has to command this robot to the \"^\" key and then press \"AAA\". If the \"^\" and \"<\" keys are interspersed, the commands will take more buttons, because there will be navigation between each \"A\". Therefore, I will consider at most two paths: all the horizontal arrows first, then all the veertical, or vice versa.\n", "- Fortunately, whenever there is a button press on the numeric keypad, we know that *all* the robots are on \"A\", because each one must have activated a button press to make the chain of presses happen.\n", "- Therefore, the parts of the problem are *decomposible*: we can optimize the command [get the robot arm from the \"^\" to the \"A\"] and that will not depend on the solutions to other subparts of the problem.\n", "\n", "\n", "I'm guessing that in Part 2 the button sequences will be ridiculously long, so I'll look for an efficient representations.\n", "- If Part 2 needs to know something about the actual presses, we could represent it as a `Counter` of start+destination subtasks. For example, if the task is to press \"0909A\", and we always start at \"A\", then we can decompose that into \"A-to-0, 0-to-9, 9-to-0, 0-to-9, 9-to-A\" and represent this as `{'A0': 1, '09: 2, '90': 2, '9A': 1}`. There are only 5 keys on the numeric keypad, so only 20 different movements, so even if a button sequence has trillions of presses, we can represent it as a Counter with no more than 20 items.\n", "- If Part 2 only needs to know the total number of button presses, then we don't need to explicitly represent the button presses, we just need to count them. I'm going to guess that that will be the case; we're likely to get many more robots and/or keyboards.\n", "\n", "I could represent a keypad with my `Grid` class, but I don't need what the Grid provides, all I need is a way to look up the (x, y) location of each key. I'll also explicitly save the (x, y) position of the forbidden empty position as `keypad.avoid`." ] }, { "cell_type": "code", "execution_count": 234, "id": "779c6b4c-ceb0-49ac-96f2-4700835c70ea", "metadata": {}, "outputs": [], "source": [ "class Keypad(dict):\n", " \"\"\"A representation of the key positions in a keypad.\"\"\"\n", " def __init__(self, rows):\n", " self.update({char: (x, y) for (y, row) in enumerate(rows) for (x, char) in enumerate(row)})\n", " self.avoid = self['_']\n", " del self['_']\n", "\n", "numeric_keypad = Keypad(['789', '456', '123', '_0A'])\n", "remote_keypad = Keypad(['_^A', ''])" ] }, { "cell_type": "markdown", "id": "486ae303-36cf-4750-965b-3402eec2b625", "metadata": {}, "source": [ "Now I can compute the remote keypad presses that are required to command a robot to move from `key1` to `key2` and press `key2`. There will be either one or two possible paths, depending on whether one of them hits the `avoid` spot." ] }, { "cell_type": "code", "execution_count": 236, "id": "c915ada2-9dfe-42fe-bd08-855ff5d0e837", "metadata": {}, "outputs": [], "source": [ "def possible_paths(key1, key2, keypad) -> Iterable[str]:\n", " \"\"\"Should we try, e.g. \">>^^A\" or \"^^>>A\", or both, to start at key1 and press key2 on keypad?\"\"\"\n", " pos1, pos2 = keypad[key1], keypad[key2]\n", " (dx, dy) = sub(pos2, pos1)\n", " horizontal = abs(dx) * ('>' if dx > 0 else '<')\n", " vertical = abs(dy) * ('v' if dy > 0 else '^')\n", " if add(pos1, (dx, 0)) != keypad.avoid:\n", " yield horizontal + vertical + 'A'\n", " if add(pos1, (0, dy)) != keypad.avoid: \n", " yield vertical + horizontal + 'A'" ] }, { "cell_type": "markdown", "id": "e9243a77-8466-4aea-bbc9-b10af141e2fb", "metadata": {}, "source": [ "My first **bug** on today's puzzle was multiplying the arrow character by `dx` instead of `abs(dx)`. Did you know that `-2 * '>'` is the empty string, and not an error? \n", "\n", "Here are some examples of usage:" ] }, { "cell_type": "code", "execution_count": 238, "id": "391f6120-6373-43f2-b697-585c90e45e54", "metadata": {}, "outputs": [], "source": [ "assert list(possible_paths('A', '7', numeric_keypad)) == ['^^^<vvvA', 'vvv>A']\n", "assert list(possible_paths('v', 'A', remote_keypad)) == ['>^A', '^>A']" ] }, { "cell_type": "markdown", "id": "74f1f872-5c0c-4baa-a941-d910dc9c1048", "metadata": {}, "source": [ "We will need to compute the **complexity** of a code for our final answer:" ] }, { "cell_type": "code", "execution_count": 240, "id": "1e2e8c59-744f-4f36-9251-c8ea5fd60aed", "metadata": {}, "outputs": [], "source": [ "def complexity(code, levels=4): \n", " \"\"\"The integer part of the code times the niminimum number of key presses.\"\"\"\n", " return int(cat(digits(code))) * min_keypresses(code, levels)" ] }, { "cell_type": "markdown", "id": "975b5719-9afc-4b0a-9e07-c1c2b38059f7", "metadata": {}, "source": [ "And here's how we compute the minimum number of keypresses. " ] }, { "cell_type": "code", "execution_count": 242, "id": "980572de-2589-4ada-a2a1-6c17cc627353", "metadata": {}, "outputs": [], "source": [ "def min_keypresses(code: str, levels: int) -> int:\n", " \"\"\"The smallest possible number of keypresses to type `code`, if there are `levels`\n", " of button-pressers (one of them you, the rest robots).\"\"\"\n", " \n", " def total_presses(keysequence: str, level: int) -> int:\n", " \"\"\"Total presses required to command `keysequence` from this level.\"\"\"\n", " return sum(one_button_min_keypresses(level, key1, key2)\n", " for key1, key2 in sliding_window('A' + keysequence, 2))\n", " \n", " @cache\n", " def one_button_min_keypresses(level, key1, key2) -> int:\n", " \"\"\"The minimum number of presses to command a press of key2, starting from key1.\"\"\"\n", " if level == 1: # Just press it!\n", " return 1 \n", " else: # Command it!\n", " target_keypad = numeric_keypad if level == levels else remote_keypad\n", " return min(total_presses(path, level - 1) \n", " for path in possible_paths(key1, key2, target_keypad))\n", "\n", " return total_presses(code, levels)" ] }, { "cell_type": "markdown", "id": "696ad2eb-244a-4ed1-ac0b-d40a0556090f", "metadata": {}, "source": [ "Here is the answer, which turns out to be a fairly small number:" ] }, { "cell_type": "code", "execution_count": 244, "id": "393a8c6b-6a1c-4495-aad5-92f48711fbf1", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Puzzle 21.1: .000 seconds, answer 205160 ok" ] }, "execution_count": 244, "metadata": {}, "output_type": "execute_result" } ], "source": [ "answer(21.1, 205160, lambda:\n", " sum(map(complexity, codes)))" ] }, { "cell_type": "markdown", "id": "89a0f647-3c3d-4476-a434-1ab36de65831", "metadata": {}, "source": [ "This is what `sliding_window` does: gives (start-key + destination-key) pairs. And here are some small examples." ] }, { "cell_type": "code", "execution_count": 246, "id": "4d8c8659-52d3-4349-8465-7003e880502f", "metadata": {}, "outputs": [], "source": [ "assert list(sliding_window('A029A', 2)) == ['A0', '02', '29', '9A']\n", "\n", "assert min_keypresses('029A', 1) == 4 # \"029A\"\n", "assert min_keypresses('029A', 2) == 12 # \"^^AvvvA\"\n", "assert min_keypresses('029A', 3) == 28 # \"v<>^AAvA<^AA>A^A\"" ] }, { "cell_type": "markdown", "id": "08d46094-0ebf-4c84-8ec4-b563630b2458", "metadata": {}, "source": [ "I was encountering other **bugs** (off-by-one errors, maybe?), so I wrote some code that explicitly built a cache of path lengths. Once I did that I understood the puzzle better and was able to easily write the code above with the cache handled by the decorator, which is a little cleaner." ] }, { "cell_type": "markdown", "id": "2a16c8f8-e1e5-47f8-b6c6-4a7500a457e6", "metadata": {}, "source": [ "### Part 2: With 27 levels, what is the sum of the complexities of the five codes on your list?\n", "\n", "As I suspected, Part 2 gets us into a [ludicrous](https://www.youtube.com/watch?v=oApAdwuqtn8) number of button presses. The problem is the same, but now there are **27** levels, not **4**. No new code, just sum the complexity again:" ] }, { "cell_type": "code", "execution_count": 249, "id": "563c5959-692d-4368-8c0b-469fa0142678", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Puzzle 21.2: .004 seconds, answer 252473394928452 ok" ] }, "execution_count": 249, "metadata": {}, "output_type": "execute_result" } ], "source": [ "answer(21.2, 252473394928452, lambda:\n", " sum(complexity(code, levels=27) for code in codes))" ] }, { "cell_type": "markdown", "id": "56db891e-56c4-4f0a-bab8-545c2ccdbb2c", "metadata": {}, "source": [ "That's the sum of the complexities, but how many button presses are there?" ] }, { "cell_type": "code", "execution_count": 251, "id": "f2d29a66-5420-4fc1-8586-1570ed5ac0a8", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "439646398242" ] }, "execution_count": 251, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sum(min_keypresses(code, levels=27) for code in codes)" ] }, { "cell_type": "markdown", "id": "1cf2d848-2f43-48dc-8862-493cebd94558", "metadata": {}, "source": [ "If we could press one button per millisecond, it would take [**14 years**](https://www.google.com/search?q=439646398242+milliseconds+in+years) to do this number of button presses." ] }, { "cell_type": "markdown", "id": "ab5218d4-3c0c-47d8-a105-d0dbced92cd4", "metadata": {}, "source": [ "# [Day 22](https://adventofcode.com/2024/day/22): Monkey Market\n", "\n", "Today we are introduced to the monkey exchange market. The monkeys are **buyers** of hiding spots, offering **bananas** as payment. We need bananas, and fortunately we have many hiding spots to sell. Each monkey has a **secret number** (today's input):" ] }, { "cell_type": "code", "execution_count": 254, "id": "2c1e7612-4ec5-4ce1-b591-5c3a14f8ea61", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "Puzzle input ➜ 1685 strs:\n", "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "9524047\n", "7448470\n", "4573369\n", "4782321\n", "14221799\n", "5609429\n", "16652319\n", "2515459\n", "...\n", "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "Parsed representation ➜ 1685 ints:\n", "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "9524047\n", "7448470\n", "4573369\n", "4782321\n", "14221799\n", "5609429\n", "16652319\n", "2515459\n", "...\n" ] } ], "source": [ "secrets = parse(22, int)" ] }, { "cell_type": "markdown", "id": "b7f4cf5f-0e07-4e61-88ce-c3dfd6e3f0c8", "metadata": {}, "source": [ "### Part 1: What is the sum of the 2000th secret number generated by each buyer?\n", "\n", "Each buyer's secret number changes on each time step. There is a detailed process for generating the next secret number from the previous secret number, involving dividing, multiplying, XOR-ing, and taking modulos. We are asked for the sum of each buyer's 2000th next secret number. Easy enough:" ] }, { "cell_type": "code", "execution_count": 256, "id": "3807adbc-261a-4108-88ba-6e2b061526b5", "metadata": {}, "outputs": [], "source": [ "def nth_secret(secret: int, n=2000) -> int:\n", " \"\"\"Compute the `n`th next secret number after this secret number.\"\"\"\n", " for _ in range(n):\n", " secret ^= (secret * 64) % 16777216\n", " secret ^= (secret // 32) % 16777216\n", " secret ^= (secret * 2048) % 16777216\n", " return secret" ] }, { "cell_type": "code", "execution_count": 257, "id": "fce754cd-f6da-4e7d-b406-3314c9c28ca8", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Puzzle 22.1: .325 seconds, answer 14273043166 ok" ] }, "execution_count": 257, "metadata": {}, "output_type": "execute_result" } ], "source": [ "answer(22.1, 14273043166, lambda:\n", " sum(map(nth_secret, secrets)))" ] }, { "cell_type": "markdown", "id": "80fea986-b9f3-4184-94b5-5fda551ce115", "metadata": {}, "source": [ "I note that all the the integer constants in `nth_secret` are powers of 2, so they could be replaced by bit operations. I wonder if I will have to analyze exactly what is going on with these bit operations for Part 2. \n", "\n", "### Part 2: What is the most bananas you can get?\n", "\n", "Knowing the timeline of secret numbers is not the whole story. Each buyer monkey has a **price** in bananas that they are offering at each time step. The price is the ones digit of their secret number (e.g., for secret number 9524047 the price is 7 bananas). Each monkey wants to buy exactly one hiding spot. We would like to wait for the highest price offering from each monkey, but we don't speak monkeese. We do have a translator who speaks a few words, but unfortunately, the translator doesn't know enough to help us sell as soon as the price hits 9 (or 8, or whatever). The translator has only the ability to help as follows:\n", "- We tell the translator to watch for a specific sequence of four deltas in price from one time step to the next for the first monkey.\n", " - For example, watch for the deltas (**+1, -2, 0, +3**) in the price timeline.\n", "- As soon as that sequence of 4 deltas appears in a monkey's price timeline, we sell that monkey a hiding spot for the current price.\n", " - For example, if the prices are (3, 3, 3, 5, 6, 4, 4, 7, ...) then the deltas are (0, 0, +2, **+1, -2, 0, +3**, ...) and we sell for 7 bananas.\n", " - That monkey is now done and won't buy again.\n", "- The translator simultaneously monitors all the monkeys.\n", "\n", "Our task is to get the most possible bananas under these constraints. \n", "\n", "Can we brute-force it? Each delta is between -9 and +9, so the number of possible 4-tuples of deltas is 194 or about 100,000; a small number. However, if for each possible 4-tuple of deltas I looked at all 2000 steps of all 1685 monkeys, then 194 ✖️ 2000 ✖️ 1685 is more than 400 billion, which is a medium-large number. So instead I'll do this:\n", "\n", " For each monkey:\n", " For each 4-tuple of price deltas in the monkey's price timeline:\n", " If this is the first time this 4-tuple appeared in this monkey's timeline:\n", " then increment the total number of bananas for this 4-tuple by the current price\n", " Finally, take the maximum of the numbers of bananas, across all the recorded 4-tuples\n", "\n", "Some details:\n", "- A `defaultdict(int)` is a great data structure for the 4-tuple to bananas mapping (a `Counter` is also good).\n", "- A `deque` with `maxlen=4` is a good data structure for keeping the evolving 4-tuple; just append to the deque and it drops old deltas.\n", "- I now call `nth_secret(secret, 1)`, so I wish I had made a separate `next_secret` function in Part 1; it would probably speed things up by a percent or two.\n", "- `price_timeline` returns a dict of `{delta-4-tuple: price}` for all the first appearances of a 4-tuple in a given monkey's timeline.\n", "- `total_bananas` returns a dict of `{delta-4-tuple: total_price}`, computing the total across all monkeys.\n", "- Then we just take the `max` of the `values` of the result of `total_bananas`." ] }, { "cell_type": "code", "execution_count": 259, "id": "cbbb4793-b13d-4a95-ba03-673b3ebaa229", "metadata": {}, "outputs": [], "source": [ "Deltas = Tuple[int, int, int, int]\n", "\n", "def total_bananas(secrets: Ints, n=2000) -> Dict[Deltas, int]:\n", " \"\"\"Pairs of {delta-4-tuple: total_bananas_gained} over all secret numbers,\n", " for the first `n` 4-tuples of deltas.\"\"\"\n", " bananas = defaultdict(int) # {deltas: total_bananas}\n", " for secret in secrets: # For each monkey ...\n", " for deltas, price in price_timeline(secret, n).items():\n", " bananas[deltas] += price\n", " return bananas\n", " \n", "def price_timeline(secret, n=2000) -> Dict[Deltas, int]:\n", " \"\"\"Each {delta-4-tuple: price} in the timeline of this secret number for `n` steps.\"\"\"\n", " timeline = {} # {delta-4-tuple: price} pairs\n", " deltas = deque(maxlen=4) # The 4 most recent price deltas \n", " price = secret % 10 # Initial price\n", " for _ in range(n):\n", " secret = nth_secret(secret, 1)\n", " price, previous_price = secret % 10, price\n", " deltas.append(price - previous_price)\n", " D = tuple(deltas)\n", " if len(D) == 4 and D not in timeline:\n", " timeline[D] = price\n", " return timeline" ] }, { "cell_type": "code", "execution_count": 260, "id": "34eaf7fe-fe9b-4858-b1e8-e4c3713ea093", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Puzzle 22.2: 1.285 seconds, answer 1667 ok" ] }, "execution_count": 260, "metadata": {}, "output_type": "execute_result" } ], "source": [ "answer(22.2, 1667, lambda:\n", " max(total_bananas(secrets).values()))" ] }, { "cell_type": "markdown", "id": "bfc067a9-e6de-4390-bf78-3da283d68465", "metadata": {}, "source": [ "I'm surprised the answer is so low; less than one banana per monkey. And yet it is the correct answer. Let's investigate. First, what is the best 4-tuple of deltas?" ] }, { "cell_type": "code", "execution_count": 262, "id": "a2da8c78-d240-4c52-a83a-f3599f4f69a4", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(-3, 2, -1, 2)" ] }, "execution_count": 262, "metadata": {}, "output_type": "execute_result" } ], "source": [ "bananas = total_bananas(secrets)\n", "best = max(bananas, key=bananas.get) \n", "best" ] }, { "cell_type": "markdown", "id": "1e1c48b3-bfff-4e5d-8f6f-9c9fff5f6baa", "metadata": {}, "source": [ "Now, how many monkeys had this 4-tuple in their timeline, and what prices did each buy at? What was the mean price?" ] }, { "cell_type": "code", "execution_count": 264, "id": "9de3f365-c546-494a-a18c-2ae58d88792b", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "271 monkeys (16%), price 6.2 mean: {0: 0, 1: 0, 2: 0, 3: 43, 4: 34, 5: 33, 6: 32, 7: 37, 8: 42, 9: 50}\n" ] } ], "source": [ "prices = [p for secret in secrets for d, p in price_timeline(secret).items() if d == best]\n", "histo = {p: prices.count(p) for p in range(10)}\n", "print(f'{len(prices)} monkeys ({len(prices)/len(secrets):.0%}), price {mean(prices):3.1f} mean: {histo}')" ] }, { "cell_type": "markdown", "id": "7fac136e-b676-49c9-91f1-a209b9ef53fa", "metadata": {}, "source": [ "We do pretty well on prices, getting a lot of 8 and 9 prices, and nothing less than 3, but only 16% of monkeys every get this sequence of price deltas.\n", "\n", "Do any 4-tuples show up in more timelines?" ] }, { "cell_type": "code", "execution_count": 266, "id": "4fc191f9-62d8-47ef-a571-8c0541e25f4d", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[((0, -1, 1, -1), 322),\n", " ((-1, 0, 0, 0), 315),\n", " ((0, -1, 0, 0), 315),\n", " ((-1, 0, 1, 0), 312),\n", " ((1, -2, 1, 0), 303),\n", " ((0, 1, -1, 0), 302),\n", " ((0, 0, 0, 0), 297),\n", " ((0, 1, 0, 0), 295),\n", " ((0, 1, 0, -1), 295),\n", " ((1, -1, 0, 0), 292)]" ] }, "execution_count": 266, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Counter(append(map(price_timeline, secrets))).most_common(10)" ] }, { "cell_type": "markdown", "id": "1fa741c6-ecf7-4459-a017-ffa574352d7e", "metadata": {}, "source": [ "Yes, but not by that much: 322 monkeys is 19% more than the 271 monkeys for the best 4-tuple, but the total number of bananas is less:" ] }, { "cell_type": "code", "execution_count": 268, "id": "bbd329a0-309c-4c81-a780-6bd97a95f652", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "1341" ] }, "execution_count": 268, "metadata": {}, "output_type": "execute_result" } ], "source": [ "bananas[(0, -1, 1, -1)]" ] }, { "cell_type": "code", "execution_count": 269, "id": "4a6a5116-2e01-46af-adf2-96ebd0a53e5f", "metadata": {}, "outputs": [], "source": [ "del bananas # clean up" ] }, { "cell_type": "markdown", "id": "bd6330b8-9ddd-4d58-9314-83b47cb2fb78", "metadata": {}, "source": [ "# [Day 23](https://adventofcode.com/2024/day/23): LAN Party\n", "\n", "We see that there is a LAN party scheduled for today. Our input is a network map of bidirectional connections between computers:" ] }, { "cell_type": "code", "execution_count": 271, "id": "85f5b145-8c5e-448c-8b45-ad5750252ff2", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "Puzzle input ➜ 3380 strs:\n", "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "ht-nz\n", "pt-uj\n", "nr-me\n", "qq-up\n", "zr-pa\n", "ly-wv\n", "ei-ry\n", "sm-md\n", "...\n", "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "Parsed representation ➜ 3380 tuples:\n", "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "('ht', 'nz')\n", "('pt', 'uj')\n", "('nr', 'me')\n", "('qq', 'up')\n", "('zr', 'pa')\n", "('ly', 'wv')\n", "('ei', 'ry')\n", "('sm', 'md')\n", "...\n" ] } ], "source": [ "network = parse(23, atoms)" ] }, { "cell_type": "markdown", "id": "a22e4214-736c-477a-810c-e77fcd68f1b4", "metadata": {}, "source": [ "### Part 1: Find all the sets of three inter-connected computers. How many contain at least one computer with a name that starts with t?\n", "\n", "We're asked to find three inter-connected computers, e.g., three computers A, B, C, such that A-B, B-C, and C-A are all in the list of connections (but connections are bidirectional, so either A-B or B-A could be in the input). A set where every node is connected to every other is called a **clique**. I'll represent the network **graph** as a dict of the form `{A: {B, C}}` to denote that node `A` is connected to `B` and `C`. The function `bidrected_graph` forms a graph from an iterable of (A, B) connections. Then `triples_starting_with` finds all cliques of size 3, where at least one of them starts with the given letter. The answer for Part 1 is then the number of triples that start with `t`." ] }, { "cell_type": "code", "execution_count": 273, "id": "289d2325-1e58-41f5-b4b2-b90ae26e7887", "metadata": {}, "outputs": [], "source": [ "Clique = set\n", "\n", "def bidirected_graph(connections) -> dict:\n", " \"\"\"A graph where, e.g., {A: {B, C}} means A is connected to B and C.\"\"\"\n", " graph = defaultdict(set)\n", " for (A, B) in connections:\n", " graph[A].add(B)\n", " graph[B].add(A)\n", " return graph\n", "\n", "def triples_starting_with(graph, start='') -> Set[Clique]:\n", " \"\"\"All cliques of 3 nodes, where one starts with `start`.\"\"\"\n", " return {frozenset((A, B, C)) \n", " for A in graph if A.startswith(start)\n", " for B in graph[A]\n", " for C in graph[B] if C in graph[A]}" ] }, { "cell_type": "code", "execution_count": 274, "id": "6425577d-4ca9-45de-9698-cd9b026f7ce6", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Puzzle 23.1: .001 seconds, answer 1170 ok" ] }, "execution_count": 274, "metadata": {}, "output_type": "execute_result" } ], "source": [ "answer(23.1, 1170, lambda:\n", " len(triples_starting_with(bidirected_graph(network), 't')))" ] }, { "cell_type": "markdown", "id": "af420aeb-314b-4750-a424-7daad0ffdd62", "metadata": {}, "source": [ "### Part 2: What is the password to get into the LAN party?\n", "\n", "In Part 2 we are asked to figure out the password for the LAN party. We learn two important facts. First, the LAN party is the largest **clique** in the graph. Second, the **password** is formed by listing the names of all the computers in the LAN party in alphabetical order, separatied by commas. The function `maximum_clique` finds the largest clique; and `password` creates the password. The function `expand_clique` takes a node, a graph, and a partially-formed clique. It adds the node to the clique, and recursively looks for and adds any other nodes that should be added, finally returning the clique." ] }, { "cell_type": "code", "execution_count": 276, "id": "88811073-22b2-4378-afa5-9d38462c63b5", "metadata": {}, "outputs": [], "source": [ "def maximum_clique(graph) -> Clique: \n", " \"\"\"The clique in `graph` with the most members.\"\"\"\n", " return max((expand_clique(A, graph, clique=set()) for A in graph), key=len)\n", "\n", "def password(names) -> str: return ','.join(sorted(names))\n", " \n", "def expand_clique(A, graph, clique) -> Clique:\n", " \"\"\"Expand out from A, adding nodes to `clique` as long as they form a clique.\"\"\"\n", " clique.add(A)\n", " for B in graph[A]:\n", " if B not in clique and clique.issubset(graph[B]):\n", " expand_clique(B, graph, clique)\n", " return clique" ] }, { "cell_type": "code", "execution_count": 277, "id": "0b5f08ac-18e2-4933-9737-cdbc842c5809", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Puzzle 23.2: .003 seconds, answer bo,dd,eq,ik,lo,lu,ph,ro,rr,rw,uo,wx,yg ok" ] }, "execution_count": 277, "metadata": {}, "output_type": "execute_result" } ], "source": [ "answer(23.2, 'bo,dd,eq,ik,lo,lu,ph,ro,rr,rw,uo,wx,yg', lambda:\n", " password(maximum_clique(bidirected_graph(network))))" ] }, { "cell_type": "markdown", "id": "afa122bf-4459-49c8-98bf-ddc3667fa50c", "metadata": {}, "source": [ "*Terminology note:* A **maximum clique** is a largest clique in the graph. A **maximal clique** is a clique to which no other node can be added to form a larger clique. Say there are 3 nodes that form a triangle. That's a clique. But if there is a fourth node that is connected to all three noddes in the triangle, then that too is a clique, and it means the triangle is not a maximal clique.\n", "\n", "*Second thoughts:* I got the right answer, and I coded it up quickly (for me) without errors, but now I'm not sure it handles all possible inputs. Consider the following network, where `{BCD}` means the three nodes form a (non-maximal) clique, and a dashed line means all nodes on each side are connected.\n", "\n", " {BCD}--{A}--{EF}\n", "\n", "The call to `expand_cliqe(A, ...)` might return either `{ABCD}` or `{AEF}`, so it might miss the maximum clique. For this example, if we missed on `A`, we would still get `{ABCD}` from `B` or `C` or `D`. But I'm not quite sure there can't be some more complex configuration where my algorithm fails." ] }, { "cell_type": "markdown", "id": "88d8883e-922a-4d08-bbec-a01d5bf225ef", "metadata": {}, "source": [ "# [Day 24](https://adventofcode.com/2024/day/24): Crossed Wire\n", "\n", "Today we are trying to help the historian to debug a malfunctioning **monitoring device**, which consistes of some wires and logic gates. Some of the wires have been misrouted. The day's input described the connections in the device. There are two types of inputs: an input wire is described with its name and its bit value: `x00: 1`, and a logic gate is described with the two input wire names, the operation, and the output wire name: `x00 AND y00 -> z00`.\n", "\n", "\n", "\n", "For now I'll just parse each line as a sequence of atoms: " ] }, { "cell_type": "code", "execution_count": 280, "id": "47421581-71df-4c72-a62e-c40d0596fdbb", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "Puzzle input ➜ 313 strs:\n", "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "x00: 1\n", "x01: 1\n", "x02: 0\n", "x03: 0\n", "x04: 0\n", "x05: 1\n", "x06: 0\n", "x07: 1\n", "...\n", "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "Parsed representation ➜ 313 tuples:\n", "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "('x00', 1)\n", "('x01', 1)\n", "('x02', 0)\n", "('x03', 0)\n", "('x04', 0)\n", "('x05', 1)\n", "('x06', 0)\n", "('x07', 1)\n", "...\n" ] } ], "source": [ "connections = parse(24, atoms)" ] }, { "cell_type": "markdown", "id": "354dd8da-2737-45c2-af8c-b4b30584ae9a", "metadata": {}, "source": [ "### Part 1: Simulate the system of gates and wires. What decimal number does it output on the wires starting with z?\n", "\n", "We can't just treat the device as a program where we execute statements in order, because in a statement like `z01 = bfn XOR y33`, the values of `bfn` and `y33` may not yet be determined. But we can execute *backwards*, as a [dataflow architecture](https://en.wikipedia.org/wiki/Dataflow_architecture). To go backwards we'll need a mapping from each output wire to where it comes from: either a bit value or a gate. I'll define `Device` as a subclass of `dict` where the keys are wire names and the values are either bits or gates." ] }, { "cell_type": "code", "execution_count": 282, "id": "43b29260-d912-4cfc-91ce-d303ec1c86df", "metadata": {}, "outputs": [], "source": [ "class Device(dict):\n", " \"\"\"A mapping of {wire_name: bit_value_or_gate}, assembled from a device specification.\"\"\"\n", " def __init__(self, lines: Tuple[Tuple]):\n", " for line in lines:\n", " match line: \n", " case (wire, bit): # e.g., ('x00', 1)\n", " self[wire] = bit\n", " case (x, op, y, wire): # e.g., ('y33', 'AND', 'x33', 'bfn')\n", " self[wire] = (x, op, y)" ] }, { "cell_type": "markdown", "id": "ff09bc35-43a4-45c1-bc00-c9cd6a1d7f69", "metadata": {}, "source": [ "Next, the function `simulate` does the dataflow computation. We start from the outputs (the wires whose first letter is `'z'`) and try to **get** their values. If the value is a bit, great, we got it. If the value is a gate, then we recursively **get** the values of both of the gate's input wires, and perform the gate's boolean operation on them. When we're done calculating all the output variables, the function `simulate` returns their values as a string of `'0'` or `'1'` characters." ] }, { "cell_type": "code", "execution_count": 284, "id": "a9a4780f-6033-452f-b49c-74b97c9e2440", "metadata": {}, "outputs": [], "source": [ "def simulate(device: Device) -> str:\n", " \"\"\"Use dataflow to get the values of the output bits of this device (as a \"01\" str).\"\"\"\n", " def get(w) -> int: \n", " match device[w]:\n", " case (x, op, y): return operators[op](get(x), get(y))\n", " case bit: return bit\n", " return cat(map(get, wires(device, 'z')))\n", "\n", "operators = dict(XOR=operator.xor, AND=min, OR=max)\n", "\n", "def wires(device: Device, letter: str) -> List[str]: \n", " \"\"\"The names of all the wires that start with the given letter, in sorted order.\"\"\"\n", " return sorted([w for w in device if w.startswith(letter)], reverse=True)" ] }, { "cell_type": "code", "execution_count": 285, "id": "72437439-dddf-4202-9944-36e796800304", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Puzzle 24.1: .001 seconds, answer 36035961805936 ok" ] }, "execution_count": 285, "metadata": {}, "output_type": "execute_result" } ], "source": [ "answer(24.1, 36035961805936, lambda:\n", " int(simulate(Device(connections)), base=2))" ] }, { "cell_type": "markdown", "id": "7ddc7897-5ff2-46bc-999d-302c92c137da", "metadata": {}, "source": [ "At first I fell victim to one of the [**classic blunders**](https://youtu.be/RWW6aDpUvbQ?si=0uvZFEYgY9i_441N): using the wrong [**endianness**](https://en.wikipedia.org/wiki/Endianness) of my bits. After re-reading the puzzle description, I fixed the **bug** by adding `reverse=True` to `wires`." ] }, { "cell_type": "markdown", "id": "c42bd211-b999-4dd8-9e34-aebf042e55e4", "metadata": {}, "source": [ "### Part 2: What do you get if you sort the names of the eight wires involved in a swap and then join those names with commas?\n", "\n", "In Part 2 we are told that the system is attempting to do addition: treating the `x` wires as a binary number and the `y` wires as another binary number, and computing their sum and outputting it to the `z` wires. But four pairs of output wires are swapped with each other. Our job is to find all eight swapped wires. For example, one pair might be `(z01, z02)` if we detect the following fault:\n", "\n", " Faulty gates: Corrected gates:\n", " a XOR b -> z01 a XOR b -> z02\n", " c XOR d -> z02 c XOR d -> z01\n", "\n", "I have four ideas of how to proceed, none of them completely compelling:\n", "1) Plot the circuit diagram and see if anythng looks funny.\n", " - Making a nice plot would be hard; I'm worried that wires in a circuit diagram cross each other; that seems hard to do cleanly.\n", "2) Examine the structure of the device and look for something that breaks the pattern.\n", " - This might help me, as a detective, uncover the answer, but if I was given another input device I'd have to start all over.\n", "3) Choose `x` and `y` numbers as input, run the simulation, and compare the resulting `z` values to the correct answer.\n", " - If I chose random numbers it might take a long time to isolate the faults.\n", " - It is easy to identify faulty output (`z`) values; trickier to identify faults in internal gates.\n", " - I could test the one-bit adders one at a time (with and without carry). But I don't know if that would always work.\n", "4) I know how an adder circuit is conventionally built; if our device is like that, we should be able to see if each bit conforms to the pattern.\n", " - When it doesn't, I can swap wires to make it conform.\n", " - I don't know if this approach will find all faults.\n", " - It could be that the device is a correct adder, but is built in a non-conventional way." ] }, { "cell_type": "markdown", "id": "3691add5-cd06-4b74-ac5a-7569a1ccb081", "metadata": {}, "source": [ "I started with approach (2). A simple thing to try is to look at all the gates that lead directly to the outputs:" ] }, { "cell_type": "code", "execution_count": 289, "id": "9021ad30-f505-4164-9feb-5af740632182", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'z45': ('nrv', 'OR', 'jsp'),\n", " 'z44': ('jsg', 'XOR', 'hks'),\n", " 'z43': ('gsk', 'XOR', 'fhk'),\n", " 'z42': ('cng', 'XOR', 'mwt'),\n", " 'z41': ('jhg', 'XOR', 'gfd'),\n", " 'z40': ('nns', 'XOR', 'jbd'),\n", " 'z39': ('vqf', 'XOR', 'fkq'),\n", " 'z38': ('sqj', 'XOR', 'wts'),\n", " 'z37': ('jgw', 'OR', 'rhh'),\n", " 'z36': ('rfq', 'XOR', 'hbh'),\n", " 'z35': ('djt', 'XOR', 'khf'),\n", " 'z34': ('jmv', 'XOR', 'nss'),\n", " 'z33': ('dts', 'XOR', 'wmq'),\n", " 'z32': ('rck', 'XOR', 'ftq'),\n", " 'z31': ('rms', 'XOR', 'sgf'),\n", " 'z30': ('pwp', 'XOR', 'nnn'),\n", " 'z29': ('tsk', 'XOR', 'hvc'),\n", " 'z28': ('msf', 'XOR', 'kdd'),\n", " 'z27': ('tvf', 'XOR', 'cmb'),\n", " 'z26': ('wkb', 'XOR', 'jkr'),\n", " 'z25': ('pfc', 'XOR', 'prp'),\n", " 'z24': ('gww', 'XOR', 'jmf'),\n", " 'z23': ('mcp', 'XOR', 'mkf'),\n", " 'z22': ('wwp', 'XOR', 'bvr'),\n", " 'z21': ('qpm', 'XOR', 'csw'),\n", " 'z20': ('bvw', 'XOR', 'hvn'),\n", " 'z19': ('y19', 'AND', 'x19'),\n", " 'z18': ('qvq', 'XOR', 'hns'),\n", " 'z17': ('wrc', 'XOR', 'hbw'),\n", " 'z16': ('rvn', 'XOR', 'kbq'),\n", " 'z15': ('skh', 'XOR', 'rkt'),\n", " 'z14': ('cgg', 'XOR', 'rhf'),\n", " 'z13': ('jkm', 'XOR', 'dmp'),\n", " 'z12': ('htn', 'XOR', 'dtq'),\n", " 'z11': ('gkc', 'AND', 'qqw'),\n", " 'z10': ('kmr', 'XOR', 'rmb'),\n", " 'z09': ('wpb', 'XOR', 'kbb'),\n", " 'z08': ('rjs', 'XOR', 'tmg'),\n", " 'z07': ('qmb', 'XOR', 'qpc'),\n", " 'z06': ('jtg', 'XOR', 'cfn'),\n", " 'z05': ('whf', 'XOR', 'fds'),\n", " 'z04': ('jvf', 'XOR', 'jth'),\n", " 'z03': ('wvt', 'XOR', 'sbt'),\n", " 'z02': ('rvm', 'XOR', 'vdq'),\n", " 'z01': ('hjp', 'XOR', 'kjs'),\n", " 'z00': ('x00', 'XOR', 'y00')}" ] }, "execution_count": 289, "metadata": {}, "output_type": "execute_result" } ], "source": [ "D = Device(connections)\n", "zs = wires(D, 'z')\n", "{z: D[z] for z in zs}" ] }, { "cell_type": "markdown", "id": "aadf7dfc-32a1-4409-9f61-ae08741868ef", "metadata": {}, "source": [ "Right away I can see three anomalies: \n", "- `z37` has an OR gate instead of an XOR.\n", "- `z11` has an AND gate instead of an XOR.\n", "- `z19` connects directly to the inputs `x19` and `y19`; no other `z` does that (except `z00`, which has no carry bit).\n", "\n", "I'm already 3/8 of the way there! I tried a few other things but didn't make progress, so I decided to go for approach (4).\n", "\n", "Here's a picture of a (one-bit) full adder; we have two XOR gates, two AND gates, and one OR gate for every output wire (except for `z00`, which doesn't have a carry bit). \n", "![Adder from Wikipedia](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCXZpXA19TudYZz-S51V6WZ_b1HPAbA-uozACxQdnavllWn9oUrVwID5eOmtOhUhFHZZKadar5TY3os2H-Vs4uiCK92wEERCFSOAamOTwOZTQ_q034zdMUhSmxYNihUHWRIRVwLJVoR7Zo1u7-dPL9gysEifyvQqO8AnTvGv9oEAgkxTZMuVyNVN-D/w400-h245/nbit_1.png) \n", "\n", "Let's see if this matches the number of gates in our device:" ] }, { "cell_type": "code", "execution_count": 291, "id": "3b41a166-d33b-402b-971b-1dc1d33135ec", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Counter({'AND': 89, 'XOR': 89, 'OR': 44})" ] }, "execution_count": 291, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Counter(val[1] for val in Device(connections).values() if val not in (0, 1))" ] }, { "cell_type": "markdown", "id": "c1f072b2-8c7f-40b2-9712-d0fc0dee62e7", "metadata": {}, "source": [ "It does match, so I guess our device is probably implementing the conventional circuit layout. \n", " \n", "The first trouble I ran into was that the two inputs to a gate could be in either order. I will canonicalize this, so that the first input wire is always alphabetically before the second one. The function `canon` enforces this canonicalization. I'll redefine `Device` to use it, and also to cache the **inverse** mapping: from gates to output wires rather than from output wires to gates/bits." ] }, { "cell_type": "code", "execution_count": 293, "id": "ec8d86d4-8caf-40f2-b516-c7da4acbda19", "metadata": {}, "outputs": [], "source": [ "class Device(dict):\n", " \"\"\"A mapping of {wire_name: bit_value_or_gate}, assembled from a device specification.\n", " Also caches the inverse as a dict under self.inverse.\"\"\"\n", " def __init__(self, lines: Tuple[Tuple]):\n", " for line in lines:\n", " match line: \n", " case (wire, bit): # e.g., ('x00', 1)\n", " self[wire] = bit\n", " case (x, op, y, out): # e.g., ('y33', 'AND', 'x33', 'bfn')\n", " self[out] = canon(x, op, y) # canonicalize order\n", " self.compute_outputs()\n", " \n", " def compute_outputs(self):\n", " \"\"\"Make a mapping {gate: output wire name}.\"\"\"\n", " self.outputs = {self[w]: w for w in self if self[w] not in (0, 1)} \n", " \n", "def canon(x, op, y) -> Tuple: \n", " \"\"\"The canonical ordering of the two input wires (and the operator).\"\"\"\n", " return (min(x, y), op, max(x, y))" ] }, { "cell_type": "markdown", "id": "47ef587b-d8de-401d-9015-e4b81e1eef96", "metadata": {}, "source": [ "Here's the code to walk through the diagram, looking for the XOR and AND gates for each input, finding misplaced wires, and swapping them." ] }, { "cell_type": "code", "execution_count": 295, "id": "7ed8f8e6-c3e1-4c22-b812-e1a201afec3d", "metadata": {}, "outputs": [], "source": [ "def find_swaps(device) -> Iterable[str]:\n", " \"\"\"For each bit position in the inputs, x and y, look forward for the\n", " XOR and AND gates they participate in, then look backwards from the \n", " corresponding z output, and see where they fail to match up,\n", " and swap wires accordingly, yielding each swapped wire.\"\"\"\n", " \n", " def output(x, op, y): return device.outputs.get(canon(x, op, y), None)\n", " \n", " for i in range(len(wires(device, 'x'))):\n", " x, y, z = [f'{v}{i:02d}' for v in 'xyz']\n", " if x == 'x00':\n", " carry = output(x, 'AND', y)\n", " else:\n", " a, b = carry, output(x, 'XOR', y)\n", " if not output(a, 'XOR', b):\n", " a2, op, b2, = device[z] # Look backwards from z to see if they hook up\n", " once = [w for w in (a, b, a2, b2) if [a, b, a2, b2].count(w) == 1]\n", " if len(once) == 2: # Wires that appear once in the two gates; they don't connect properly\n", " yield from swap(*once, device)\n", " elif output(a, 'XOR', b) != z:\n", " yield from swap(z, output(a, 'XOR', b), device)\n", " carry = output(carry, 'AND', output(x, 'XOR', y)) # The carry gets propagated through two gates\n", " carry = output(carry, 'OR', output(x, 'AND', y))\n", "\n", "def swap(a: str, b: str, device: dict) -> Set[str]:\n", " \"\"\"Swap wires `a` and `b` in device.\"\"\"\n", " device[a], device[b] = device[b], device[a]\n", " device.compute_outputs() # Recompute outputs after this swap\n", " return a, b" ] }, { "cell_type": "code", "execution_count": 296, "id": "e9b87c38-f67c-4948-9af6-251021747e9d", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Puzzle 24.2: .000 seconds, answer jqf,mdd,skh,wpd,wts,z11,z19,z37 ok" ] }, "execution_count": 296, "metadata": {}, "output_type": "execute_result" } ], "source": [ "answer(24.2, 'jqf,mdd,skh,wpd,wts,z11,z19,z37', lambda:\n", " ','.join(sorted(find_swaps(Device(connections)))))" ] }, { "cell_type": "markdown", "id": "b8d3967e-3473-47b0-b1b8-687c56e49138", "metadata": {}, "source": [ "# [Day 25](https://adventofcode.com/2024/day/25): Code Chronicle\n", "\n", "We're trying to get into the Chief Historian's office, but the door is locked. We have the schematics of all the **locks** and **keys** on the floor we're on, and we need to see which key could fit which lock. A lock schematic has 5 columns of different length growing down from the top, and a key schematic has five columns growing up from the bottom. A key and a lock are a possible fit if none of the five lines overlap; that is, since the lock cylinder has a height of 7 units, it is a possible fit if none of the five columns has more than 7 total `'#'` marks for the lock and the key combined.\n", "\n", "We'll parse the schematics into paragraphs, where each paragraph is a list of lines." ] }, { "cell_type": "code", "execution_count": 298, "id": "f5971853-7139-4f17-bdc5-6c51e12a928d", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "Puzzle input ➜ 3999 strs:\n", "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "#####\n", "####.\n", "####.\n", "####.\n", "##.#.\n", "#....\n", ".....\n", "\n", "...\n", "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "Parsed representation ➜ 500 lists:\n", "────────────────────────────────────────────────────────────────────────────────────────────────────\n", "['#####', '####.', '####.', '####.', '##.#.', '#....', '.....']\n", "['#####', '####.', '##.#.', '##.#.', '.#.#.', '.#.#.', '.....']\n", "['.....', '.....', '#..#.', '#..#.', '##.##', '#####', '#####']\n", "['#####', '###.#', '#.#.#', '#.#.#', '#.#..', '#....', '.....']\n", "['#####', '##.#.', '#..#.', '#..#.', '#..#.', '#..#.', '.....']\n", "['#####', '#####', '#####', '#.##.', '..##.', '...#.', '.....']\n", "['#####', '#.###', '...#.', '.....', '.....', '.....', '.....']\n", "['.....', '.....', '.....', '.#.#.', '##.#.', '#####', '#####']\n", "...\n" ] } ], "source": [ "schematics = parse(25, lines, sections=paragraphs)" ] }, { "cell_type": "markdown", "id": "3bece291-f0e6-463a-9ac9-401563c5184b", "metadata": {}, "source": [ "### Part 1: How many unique lock/key pairs fit together without overlapping in any column?\n", "\n", "This looks pretty easy:\n", "- The function `count_fits` will compute the answer. First it separates the schematics into locks and keys, transforming each one into a list of column heights. Then it counts how many key/lock combinations fit, trying every possibility.\n", "- The function `column_heights` takes a schematic, which is a list of rows, and applies the transpose, `T(schematic)`, to get a list of columns. Then it uses `count` to count the number of `'#'` characters in each column.\n", "- The function `can_fit` takes takes two lists of column counts and determines if any column has more than 7 total `'#'` characters.\n", "\n", "For example, the first lock is:\n", "\n", " ['#####', '####.', '####.', '####.', '##.#.', '#....', '.....']\n", "\n", "We transpose that to get a list of columns, \n", "\n", " ('######.', '#####..', '####...', '#####..', '#......')\n", "\n", "and count the number of `'#'` characters in each column:\n", "\n", " [6, 5, 4, 5, 1]\n", "\n", "Here is the code:" ] }, { "cell_type": "code", "execution_count": 300, "id": "5302ac58-91fc-475a-83d9-cea91457df3b", "metadata": {}, "outputs": [], "source": [ "def count_fits(schematics) -> List:\n", " \"\"\"Try all key/lock combinations and count how many fit each other.\"\"\"\n", " locks = [column_heights(s) for s in schematics if s[0] == '#####']\n", " keys = [column_heights(s) for s in schematics if s[0] != '#####']\n", " return quantify(can_fit(key, lock) for lock in locks for key in keys)\n", " \n", "def column_heights(schematic) -> List[int]:\n", " \"\"\"A counter of {column_number: (number of '#' in that column)}.\"\"\"\n", " return [column.count('#') for column in T(schematic)] # Remember, `T` is transpose\n", " \n", "def can_fit(key: Ints, lock: Ints): \n", " \"\"\"The key can fit the lock if the sum of the '#' count in each column is <= 7.\"\"\"\n", " return all(lock[c] + key[c] <= 7 for c in range(5))" ] }, { "cell_type": "code", "execution_count": 301, "id": "89c28b74-ed31-4bb5-b463-7177952a95ae", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Puzzle 25.1: .021 seconds, answer 3196 ok" ] }, "execution_count": 301, "metadata": {}, "output_type": "execute_result" } ], "source": [ "answer(25.1, 3196, lambda:\n", " count_fits(schematics))" ] }, { "cell_type": "markdown", "id": "ce1c8e04-5297-4798-969d-3cc9210bfd9a", "metadata": {}, "source": [ "And with that, **we're done!** \n", "\n", "Thanks, [**Eric Wastl**](https://adventofcode.com/2024/about), and congratulations for ten years of AoC!\n", "\n", "" ] }, { "cell_type": "markdown", "id": "3e78ac0f-5866-4620-8114-1b05b5c44de1", "metadata": {}, "source": [ "# Summary\n", "\n", "Here are all the puzzle answers and timings. I got all the puzzles right! And I did it before midnight (my time) on December 25th, a rarity for me. \n", "\n", "The median run time is about 5 milliseconds, with 4 puzzles taking over a second. I didn't count the time that `parse` takes, but that is less than a millisecond per day." ] }, { "cell_type": "code", "execution_count": 304, "id": "34813fc9-a000-4cd8-88ae-692851b3242c", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Puzzle 1.1: .000 seconds, answer 1830467 ok\n", "Puzzle 1.2: .000 seconds, answer 26674158 ok\n", "Puzzle 2.1: .000 seconds, answer 257 ok\n", "Puzzle 2.2: .002 seconds, answer 328 ok\n", "Puzzle 3.1: .001 seconds, answer 156388521 ok\n", "Puzzle 3.2: .000 seconds, answer 75920122 ok\n", "Puzzle 4.1: .020 seconds, answer 2401 ok\n", "Puzzle 4.2: .016 seconds, answer 1822 ok\n", "Puzzle 5.1: .001 seconds, answer 5762 ok\n", "Puzzle 5.2: .001 seconds, answer 4130 ok\n", "Puzzle 6.1: .001 seconds, answer 5329 ok\n", "Puzzle 6.2: 1.998 seconds, answer 2162 ok\n", "Puzzle 7.1: .014 seconds, answer 1985268524462 ok\n", "Puzzle 7.2: .606 seconds, answer 150077710195188 ok\n", "Puzzle 8.1: .002 seconds, answer 220 ok\n", "Puzzle 8.2: .003 seconds, answer 813 ok\n", "Puzzle 9.1: .020 seconds, answer 6332189866718 ok\n", "Puzzle 9.2: 2.428 seconds, answer 6353648390778 ok\n", "Puzzle 10.1: .005 seconds, answer 744 ok\n", "Puzzle 10.2: .006 seconds, answer 1651 ok\n", "Puzzle 11.1: .001 seconds, answer 194482 ok\n", "Puzzle 11.2: .061 seconds, answer 232454623677743 ok\n", "Puzzle 12.1: .030 seconds, answer 1402544 ok\n", "Puzzle 12.2: .061 seconds, answer 862486 ok\n", "Puzzle 13.1: .000 seconds, answer 29598 ok\n", "Puzzle 13.2: .000 seconds, answer 93217456941970 ok\n", "Puzzle 14.1: .000 seconds, answer 216027840 ok\n", "Puzzle 14.2: 1.874 seconds, answer 6876 ok\n", "Puzzle 15.1: .029 seconds, answer 1563092 ok\n", "Puzzle 15.2: .042 seconds, answer 1582688 ok\n", "Puzzle 16.1: .146 seconds, answer 103512 ok\n", "Puzzle 16.2: .863 seconds, answer 554 ok\n", "Puzzle 17.1: .000 seconds, answer 2,1,0,1,7,2,5,0,3 ok\n", "Puzzle 17.2: .004 seconds, answer 267265166222235 ok\n", "Puzzle 18.1: .014 seconds, answer 344 ok\n", "Puzzle 18.2: .033 seconds, answer 46,18 ok\n", "Puzzle 19.1: .004 seconds, answer 242 ok\n", "Puzzle 19.2: .189 seconds, answer 595975512785325 ok\n", "Puzzle 20.1: .023 seconds, answer 1343 ok\n", "Puzzle 20.2: .773 seconds, answer 982891 ok\n", "Puzzle 21.1: .000 seconds, answer 205160 ok\n", "Puzzle 21.2: .004 seconds, answer 252473394928452 ok\n", "Puzzle 22.1: .325 seconds, answer 14273043166 ok\n", "Puzzle 22.2: 1.285 seconds, answer 1667 ok\n", "Puzzle 23.1: .001 seconds, answer 1170 ok\n", "Puzzle 23.2: .003 seconds, answer bo,dd,eq,ik,lo,lu,ph,ro,rr,rw,uo,wx,yg ok\n", "Puzzle 24.1: .001 seconds, answer 36035961805936 ok\n", "Puzzle 24.2: .000 seconds, answer jqf,mdd,skh,wpd,wts,z11,z19,z37 ok\n", "Puzzle 25.1: .021 seconds, answer 3196 ok\n", "\n", "Correct: 49/49\n", "\n", "Time in seconds: 0.005 median, 0.223 mean, 10.914 total.\n" ] } ], "source": [ "summary(answers)" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.12.7" } }, "nbformat": 4, "nbformat_minor": 5 }