Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

General Discussions

Discuss any topics that are not product-specific here.

Advent of Code 2024 Day 13 (BaseA Style)

AlteryxCommunityTeam
Alteryx Community Team
Alteryx Community Team
Discussion thread for day 13 of the Advent of Code - https://adventofcode.com/2024/day/13
15 REPLIES 15
CoG
14 - Magnetar

Nice! Lucked out with another easy problem. Having a mathematics background was very helpful.

 

 

Spoiler
In order to identify whether a particular prize is achievable, it helps to recognize that we have 2 variables at our disposal (1) 'A' button presses and (2) 'B' button presses and two outputs to achieve (1) Px and (2) Py (aka the X and Y positions of the Prize). This sets up a linear system of equations, and if you know anything about linear systems, then you know that when the count of variables and outputs are equal, then there is at most 1 solution (assuming the equations are not multiples of one another, which is true for the problem data) 

Thus, the solution to this problem is to identify all integer solutions to the provided systems of linear equations. If one exists, then that is the only solution, and thus, by extension, the minimum solution as well. Perform the strange cost calculation (which tripped me up initially; reading is still important apparently). Sum up all the costs and solve the problem. Thankfully, part 2 still fits an int64, so no challenge there at all!

Main.png

 

 

 

gawa
16 - Nebula
16 - Nebula

DO THE MATH!😁

Using a pencil and paper is not violation to Base-A, I believe.

Spoiler
Part1: Calculate all patterns and find the match result
Part2: Gave up the approach in part1. After 5 minutes, I realized this is just a simple algebra that has restriction of 'answer is integer'.
image.png
ScottLewis
10 - Fireball

Came here all excited to write about Math but @CoG beat me to it. 

I will accept the consolation prize of a substantial amount of bonus sleep.

AkimasaKajitani
17 - Castor
17 - Castor

Solved!

 

Make Column tool is useful for dataprep.

Spoiler
I solved a system of simultaneous equations. I thought there was some trick to Part 2, but it was none!

image.png
abe_ibanez
9 - Comet

I was stuck on this for 40 minutes until the solution finally hit me. Once I figured out the way to solve it, it only took a few minutes. Really fun problem though. 

Spoiler
day13solution.png
kelsey_kincaid
12 - Quasar
12 - Quasar

This one was fun! 

 

Spoiler
It took me longer to conceptualize the math than to build the workflow. I had to bust out a pen and paper to get the systems of equations right in the formula tool. Part 2 came very easily once Part 1 was built.

2024_Day13_KelseyKincaid_WF.png2024_Day13_KelseyKincaid_Formulas.png
Raj
16 - Nebula

Both methods added 
brutal did not work for part2

Qiu
21 - Polaris
21 - Polaris

I took the easy way. 

Spoiler
AOC2024-Day13.png
DaisukeTsuchiya
14 - Magnetar
P1 was solvable with brute force, but P2 didn’t work out.

Spoiler

I used the system of equations formula:
For Ax+By=C Dx+Ey=F then x=(BF-EC) / (BD - EA), y=(FA-CD) / (AE - BD)

スクリーンショット 2024-12-13 185446.png

Labels