General Discussions

Discuss any topics that are not product-specific here.

Advent of Code 2023 Day 6 (BaseA Style)

AlteryxCommunityTeam
Alteryx Community Team
Alteryx Community Team

Discussion thread for day 6 of the Advent of Code - https://adventofcode.com/2023/day/6

47 REPLIES 47
JeffF
Alteryx
Alteryx
Spoiler
2023_AoC_Day4_JeffF.png
rachel_k
Alteryx Alumni (Retired)

So glad today was easy!

Spoiler
 

day6.png

JarrodT
Alteryx
Alteryx

Had to tap into my 8th grade math for this one... It's been a while since I've dealt with parabolas...

Spoiler

Total_distance = hold_ms * (total_ms - hold_ms)
9 < hold_ms * (7-hold_ms)
9 < 7 * hold_ms - hold_ms^2
0 < 7 * hold_ms - hold_ms^2 - 9
0< -hold_ms^2 +7hold_ms - 9

x = (7 +- Sqrt( 7**2 - 4*-1*-9)) / 2*-1
x = (7 +- sqrt( 49 - 36)) / -2
x = (7 +- 3.6) / -2
x = (-10.6 or -3.4)/ -2
3.4/2 < x < 10.6/2
1.7 < x < 5.3

I'm going to take the ceiling (round up) for dist_a and Floor for dist_b after adding a slight edge (+.00001 to dist_a and -.00001 to dist_b) to BEAT the record (since the quadratic formula solves to equals)


Then, I'll subtract the two numbers and add 1 (to include the first number which isn't counted when subtracting).


image.png
dist_a formula: ceil(abs((-[Time] + SQRT(POW([Time],2) - (4*-1*-[Distance]))) / 2*-1)+.00001,1)
dist_b formula: FLOOR(abs((-[Time] - SQRT(POW([Time],2) - (4*-1*-[Distance]))) / 2*-1)-.00001)

 

 

OllieClarke
15 - Aurora
15 - Aurora

Day 5 pt 2 still to come after last night's fiasco. Good to have a nice one again :)

Spoiler
image.png


I also like that I can detour 1 tool's difference for part 1 and part 2

#TeamBruteForce

OllieClarke
15 - Aurora
15 - Aurora

@cgoodman3 obvs different hardware, but my brute force runs in 28 seconds

 

Spoiler
even with its 53,897,697 rows generated
mceleavey
17 - Castor
17 - Castor

After Day 5 mistreated me badly (mostly due to my own incompetence), today was like a big cosy hug made of clouds.

 

Spoiler
Screenshot 2023-12-06 180421.png
I did part one using a simple iterative macro, but then realised it was much quicker just to generate the rows...

M.



Bulien

cjaneczko
13 - Pulsar

Quite easy today. I did type the table up into a Text Input, to make it easier. 

 

Spoiler
 

image.png

cjaneczko
13 - Pulsar

@cgoodman3 I had the same thought process when tackling this. Took 30 seconds to run

 

Spoiler
Generated over 61M rows lol.
alisonpitt
11 - Bolide

Kickin' it 8th grade-style with a little quadratic formula (after the long way in part 1)!

Spoiler
6-ap.png
Carolyn
11 - Bolide

Solved! For Part 2, I initially used my Part 1 brute force solution. I then redid it using the quadratic formula (complete with singing the song to myself for the formula 🤓)

 

Spoiler
2023-12-06_12-39-12.png

Polls
We’re dying to get your help in determining what the new profile picture frame should be this Halloween. Cast your vote and help us haunt the Community with the best spooky character.
Don’t ghost us—pick your favorite now!
Labels