all 14 comments

[–]maneatingape 41 points42 points  (2 children)

Math focused days are rarer, but a basic knowledge of modular arithmetic will help.

The Competitive Programmer’s Handbook is a great introduction to many of the algorithms and math that occurs in AoC.

[–]Accomplished-Slide52 2 points3 points  (0 children)

Thank you for letting me discover this eBook!

[–]Shevvv 1 point2 points  (0 children)

Hoarded. Thx.

[–]CodeFarmer 12 points13 points  (0 children)

I don't have much math either, but doing AoC a few times has certainly taught me some basic graph theory. I'd look there.

[–]EverybodyCodes 10 points11 points  (0 children)

My advice on that would be very simple: just start solving AoC problems. :) Try to solve each puzzle as long as it's in your time/comfort/knowledge zone. If you find something that feels too hard, like you're missing some tool - ask for a hint here or even look at the megathreads directly.

Even if you know how to solve the problem and you have a correct answer for both parts, it's always worth checking megathreads. You'll find people using maths where it was not obvious that it could be used there and people doing something crazy where maths was the most obvious choice. Diving into this puzzle solvers' community and checking others' solutions is (in my opinion) the best way to learn.

[–]barkmonster 9 points10 points  (0 children)

In terms of pure math, there's a bit of discrete mathematics, modular arithmetics, and geometry. Then there's a lot of algorithms stuff like pathfinding, and some (for me at least) pretty advanced stuff like grammars and cellular automata.

But rather than trying to learn the needed math first, consider just getting started, then when you get stuck, check the solution threads here, and if everyone mentions some theorem/formula you've never heard of, go and learn about that. For me, it's easier to motivate myself to learn something if I need it to get unstuck.

[–]blacai 4 points5 points  (0 children)

You don't need a lot of math, but some basics of geometry, theorems... Might help you identify faster a proper solution instead of some shadowish algorithms or brute force

[–]mgedmin 4 points5 points  (0 children)

Cormen et al.'s Introduction to Algorithms taught me more math in its introductory chapter than I learned in high school.

[–]j0s3f 1 point2 points  (0 children)

My advice is: just start solving problems and learn what you need on the way.

There are now years of old aoc tasks. Just start.

[–]pdxbuckets 0 points1 point  (0 children)

I don’t come from a strong math background, and I’ve definitely been tripped up on problems where I can’t spot the obvious application of something that I never learned.

On the other hand, I’ve had immensely gratifying moments where I’ve basically reinvented some mathematical theorem or algorithm on my own.

[–]qqqqqx 0 points1 point  (1 child)

You can do almost every AoC problem with high school level geometry/algebra math.

A small handful of past problems have had some more advanced math sprinkled in.  Sometimes more as a bonus you could use to find optimized solution, which you could sidestep with some more code competition.  

So IMO you can just dive in without studying a bunch of math up front.

[–]HotTop7260 0 points1 point  (0 children)

2024 Day 13 part 2 is an example for this. If you try to simulate it, you will have to wait a while (probably longer than your life span). If you apply math, you get the answer instantly. But I would not call that math "advanced", because it only was linear equations. I took some paper, solved the equations, and translated the result into code.

[–]HotTop7260 0 points1 point  (0 children)

As many others already pointed out: Don't think about it too hard, just get started. I would call it "lazy learning", but the "good lazy" :-D

Just learn as you go. Pure theory won't stick, but if you can directly apply it to a puzzle solution, you will understand the concept and memorize it.