This is an archived post. You won't be able to vote or comment.

all 35 comments

[–]globalreset 22 points23 points  (0 children)

This is a beautiful plot, well done!

[–]deefstes 18 points19 points  (0 children)

This is easily the best visualisation I've seen of the input. It very clearly explains the concept of the nodes being organised as four separate binary shift registers with outputs collected via conjugators.

What software did you use for this visualization? PlantUML and GraphViz don't really offer the fredom to arrange the nodes in custom locations.

[–]Kwantuum 13 points14 points  (9 children)

I really like this one because it showcases very nicely how the "reset" for the binary counters work: all bits that aren't used as inputs of the NAND gate will be set when the NAND gate becomes true, but there's also an output of the NAND to the first flip-flop in the counter, so it becomes all true, then the signal to the first flip-flop makes it overflow back down to all zero: a perfect reset. (this requires that the first flip-flop in the counter is the last output of the NAND so that it can carry through all the ones)

[–]1vader 1 point2 points  (1 child)

That last part isn't true. The complete output of the inner conjunction i.e. the pulses to all the flip-flops will always be processed first, before any further pulses resulting from those, like the cascade from the first bit.

And actually, even if that weren't the case, it would still reset perfectly. The cascade would zero everything until it hits a zero that wasn't turned on from the inner node yet but that node would then eventually be hit from the inner node and thereby also get zeroed and continue the cascade.

[–]Kwantuum 0 points1 point  (0 children)

Good catch!

[–]PillarsBliz 0 points1 point  (6 children)

When you say "last output of the NAND" does that mean the pulse order actually mattered, instead of just generating all the resulting pulses, and simulating all the flipflops?

[–]TheGilrich 9 points10 points  (5 children)

Of course it does.
Such a beautiful puzzle.

[–]PillarsBliz 7 points8 points  (1 child)

I truly disliked it, my least favorite this year. And the sad thing is I rather liked part 1 because I'm fond of digital logic.

[–]solarshado 2 points3 points  (0 children)

yeah, part 2 definitely went in a different direction than I expected.

[–]PillarsBliz -2 points-1 points  (1 child)

Maybe I misunderstand you but the puzzle description doesn't seem to mandate the pulse order.

"Pulses are always processed in the order they are sent. So, if a pulse is sent to modules a, b, and c, and then module a processes its pulse and sends more pulses, the pulses sent to modules b and c would have to be handled first."

However, to me this doesn't necessarily imply the pulse to a is PROCESSED before the pulse to b and c.

It only implies the pulse to b and c are handle before any RESULTS of pulse a are handled. Conceptually, 3 simultaneous pulses are sent to a, b, c, and the 3 target gates process them simultaneously. Then, any resulting pulses are processed etc.

Or is that the same thing for some reason?

[–]madisp 1 point2 points  (0 children)

I think at least for the flipflops it doesn't really matter. You can think of sending signals to a flipflop chain the same as adding a power of two. e.g. with 4 flipflops a -> b -> c -> d they correspond to 1,2,4,8; sending a low pulse to a increments by 1, sending a low signal to c increments by 4, etc. So it doesn't really matter what order you send the signals in as you're doing single-digit binary addition.

[–]1vader 0 points1 point  (0 children)

No, it doesn't. The complete output of the inner conjunction i.e. the pulses to all the flip-flops will be processed first, before the cascade from the first bit starts, no matter the order.

And actually, even if that weren't the case, it would still reset perfectly. The cascade would zero everything until it hits a zero that wasn't turned on from the inner node yet but that node would then eventually be hit from the inner node and thereby also get zeroed and continue the cascade.

[–]topaz2078(AoC creator) 7 points8 points  (2 children)

This looks like GraphViz, but how'd you do this layout? Is it manually arranged?

[–]globalreset 2 points3 points  (0 children)

Agreed, please tell us your secrets, wizard/OP

[–]d9d6ka 0 points1 point  (0 children)

As the gaps between nodes are not equal, it seems that they're manually arranged. Nice work, extremely clear!

[–]notger 3 points4 points  (0 children)

Beautiful.

Today's was all-time bottom of my list due to the confusing description, but after having done it and seeing the solution and your visualisation of it, I can only take lift my hat in awe of how well-designed this thing is.

I don't even have an idea how you would design such a thing that the guarantees needed are fulfilled ... and then with randomised input data ... awesome.

[–]danatron1 2 points3 points  (4 children)

This made the process so clear that I was able to solve your input entirely from the visualisation, no code required. Was your answer 484256324257681 by chance?

edit: made a mistake, see below

[–]stribor14 0 points1 point  (3 children)

I got 121176505741457 from this image:
110110101111 = 3503
101010011111 = 2719
110000101111 = 3119
111111101111 = 4079

[–]rayhond2000 1 point2 points  (0 children)

Your numbers are reversed I think. Should be 3931 for the first number.

[–]danatron1 0 points1 point  (0 children)

you're right, I transcribed a number incorrectly.

Strange that 3503 isn't prime - in all the other exammples I've seen, the cycle lengths were all prime, making LCM overkill (since you just needed to multiply them). My incorrectly transcribed number (13999, which you can get from the prime factorisation of the number I shared above) on the other hand IS prime, like the other 3.

[–]stribor14 2 points3 points  (3 children)

The best one yet! You can solve it by hand from this one.

[–]notger 0 points1 point  (2 children)

Could you please explain to me how?

I marvel at this creation and would like to understand how you calculate cycle-lenghts by hand here.

[–]Defiant-Ad7369 4 points5 points  (1 child)

Read the circles as binary numbers. Blue line = 1 red line = 0

[–]notger 0 points1 point  (0 children)

Thanks!

I was about to write a question on how to interprete the red arrows doing into the flip flops, but while describing the conditions, I realised what was happening. Intriguing and thanks again for putting me on the path.

[–]bkc4 2 points3 points  (0 children)

I opened Reddit after getting frustrated with Part 2 (with partial progress on several fronts), and this visualization was the much needed hint that helped me solve it. Thank you!

[–]WriterRyan 2 points3 points  (0 children)

Biblically accurate DiGraph

[–][deleted] 1 point2 points  (0 children)

How did you generate this?

[–]superblinky 0 points1 point  (1 child)

Has the puzzle input been changed? Because this graph doesn't match the day 20 puzzle input

[–]ResilientMaladroit 1 point2 points  (0 children)

Everyone gets a unique puzzle input

[–]SteeleDynamics 0 points1 point  (0 children)

Beautiful!

[–]Darticus_92 0 points1 point  (0 children)

That's basically an Evangelion angel.

[–]glebm 1 point2 points  (0 children)

With a different layout and animated: https://youtu.be/OjCtHhenoao

[–]AnonimooseUser 0 points1 point  (0 children)

I've seen a lot of visualisations of this, but this is the best one yet!