Discussion thread for day 24 of the Advent of Code - https://adventofcode.com/2023/day/24
Part 1 is fairly straightforward vector intercept calculation (recommend converting to slope/intercept form and then comparing.)
Part 2 is a linear algebra mess that is probably better solved in Mathematica than Alteryx.
One hint for part 2:
Agree. Part 1 is just about a formula about the two lines intersecting point.For part 2, unfortunetly, Linear Algebra is not my thing 🤣....
I did MATH, rather than building WF. No macro solution.
Part1
Part2
Overall WF
Not a pleasant one, and I can't figure out what's wrong with my WF (Answer is too high)Anyone care to help? @gawa , @Qiu , @ScottLewis ? Workflow attached
I've had quite a few "edge case" type data sets, though I can't see how that would be impacting my calculations in a straightforward-ish linear algebra problem....Â
Thank you!!
@estherb47Â
You're appending a fileset to itself to create a full match. This works, but it gives you two rows for every pair of input rows (A->B & B->A.) If you don't account for that you're going to double count everything (which you are, checked your workflow with my dataset.)
The way I like to correct for this is to do a record ID before the append and then filter on LeftID>RightID. That also removes the self matches (and can be changed to >= if you want to include them.)
@ScottLewis , thank you! I was wondering if that were the problem. Thanks for confirming. I usually like to solve for that with a Generate Rows and then join on the record IDs
@estherb47 I agree with @ScottLewis and that is how your result is doubled. 🤣
I usually do is to create another parameter by using Min and Max to pair A and B.Now it gives correct answer for my input.and I almost give up on Part 2.
@estherb47 This is a typical pitfall for me, that is simple one but cannot find it immediately😅
As @Qiu and @ScottLewis mentioned, I always go with "Appendix Field + Filter" method to create the unique pairs without duplication.
Good luck!
This problem killed me XD I built a Big Num system in Alteryx which handles Multiplication, Division, and Addition (Subtraction is just addition with sign change).
Wrote out the formulae to generate a system of equations, then used Alteryx to calculate the solution to the system of equations for single variable. The equations are the same whether solving for x,y, or z so substitute relevant variables and the answer is done. One of the worst possible ways to solve, but I did it, and I'm quite happy about that.
Also noticed a cool graph pattern that I couldn't think how to exploit:
Workflow:
Part 1 is simple math problem. But Part 2 is not simple problem.
I made the mathematical equation for part 2, but the number is too big, so that complex formula didn't work. I wasted much time to do this.
Of course, I tried the fixed number.
Honesty, I couldn't solve this quiz without @gawa 's hint!
Part 2 :Â
MOD(([px]-[Source_px]),([SPEED]-[vx]))​
([pz2]-[pz])/([vz]-[vz2])​
([vy2]-[vy])*[t1]+[py2]​
([vx2]-[vx])*[t1]+[px2]​
@gawa , thanks for your hint. I could not create a part2 workflow to create an answer from input data, but I could create an answer.
I go to reddit and youtube for help first but it not applicable to alteryx...
alteryx do not have sympy...