Advent of Code 2021 - Day 17

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
all right adventure code day 17 i wish i am anyway what's going on here uh okay smooth moves x goes down y goes down oh what am i doing one one seven six okay i correctly got 45 food really not 1176 i see what 10296 do hmm just kind of feel like we have to go to the right why okay that was kind of a weird problem um sure so what is there to say here uh so we're basically just speed forcing it trying all possible answers um and we just need to follow the instructions for how to simulate uh so there's a bunch of like guesses here about what um sort of reasonable numbers are although i guess we can infer like sure so actually like x can only be up to like 150 say i think that's correct because you know if you start out at 150 50 you already passed the target area and you're never going to go backwards furthermore x can't be negative because you have to uh like x goes towards zero so if you start out going left you're never going to go right and the target area is to the right so this is a reasonable bound on x similarly y um y is always uh going further down so you shouldn't start at a negative velocity of more than you know 144 let's say 150. uh as far as a positive velocity that's a little bit harder to bound so i think it's reasonable to put a large value here um and as far as the time bound uh that also seems somewhat unclear 2271 yeah so those are still the right answers um you know i suppose we could do some math and get like a real bound here uh right the point is like you know y of t is you know basically some quadratic function uh wait it's it's this is not the correct formula the formula is something like this uh but yeah i guess that doesn't really make it super clear uh what to do here [Music] i'm actually curious what the like you know optimal bound is if you never quite figure it out see apparently this is how you get the max height uh and the max height occurs in how many steps i see i guess the point is to like stall out x to zero when you're in this range and then you have as much time with y as you want uh you just see to like make sure that you hit this range like 50 things uh so it is probably like quite a few steps sure uh anyway so once you've decided on these parameters of like the bounds that you're interested in um you can just try everything uh it's not that slow actually a little bit surprised that it runs as fast as it does but you know like 150 times like a thousand times like a thousand is a perfectly reasonable number uh although i was careful to run it in pi pi uh i think if i read it in python it would be a bit slower all right so that's less than a second and we just want it in python which is what i haven't set up to do by default i think it will take quite a bit longer uh although not terribly slow um so yeah just try all the velocities i guess it's important to remember that you know the y velocity can be negative which if you read the example there's a positive example you know it does happens a lot uh x has to be positive and we probably don't need to simulate that many time steps but um it's harder to get bounds on on y and the number of time steps so better to give large values i guess okay um so i think that is about all there is to say about day 17. see you tomorrow
Info
Channel: Jonathan Paulson
Views: 1,295
Rating: undefined out of 5
Keywords:
Id: C3BjIjPIUPc
Channel Id: undefined
Length: 11min 54sec (714 seconds)
Published: Thu Dec 16 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.