Mastering Dynamic Programming - A Real-Life Problem (Part 2)

แชร์
ฝัง
  • เผยแพร่เมื่อ 23 พ.ย. 2024

ความคิดเห็น •

  • @TechWithNikola
    @TechWithNikola  11 หลายเดือนก่อน +60

    Mistakes in the video:
    - At 02:39 the LCS is [2, 3, 4] and its length is 3 (not 2 like I say in the video). Apologies for this mistake. Thanks @davidkumari1420 for pointing this out.
    - I suspect there will be more...

  • @puneetkumarsingh1484
    @puneetkumarsingh1484 11 หลายเดือนก่อน +18

    This is mind blowing stuff! I have now known about the LCS problem for about 4 years. But it had never occurred to me it had such a common use case. I use Gitlab on a daily basis in my job which has this diff feature used whenever we create a new merge request. But I never pondered how it worked under the hood. Really thank you for posting this!!

    • @TechWithNikola
      @TechWithNikola  11 หลายเดือนก่อน +1

      Thank you for taking the time to comment. I’m so happy to hear that it was insightful. It is common that people don’t realise how useful DP is in practice. Please consider sharing this video. It would help me grow this channel.

  • @SadgeZoomer
    @SadgeZoomer 11 หลายเดือนก่อน +19

    2:39 [2,3,4] is the longest subsequence

    • @TechWithNikola
      @TechWithNikola  11 หลายเดือนก่อน +5

      Oops! Thanks. In my mind I had an example where LCS was 2, I didn’t realise that 4 should go as well, despite watching it many times :-)

  • @wenhanzhou5826
    @wenhanzhou5826 9 หลายเดือนก่อน +6

    I rarely use DP explicitly in my proffesion, but in real life, I use the principle of saving the checkpoint of important tasks so I avoid redoing stuff. For difficult problems, I work backwards, asking myself, can I start by solving a simpler problem to begin with? After recursively working a couple of steps backwards, I end up with a super simple task, and the rest just follows effortlessly.

  • @khalidben9940
    @khalidben9940 9 หลายเดือนก่อน +1

    Cool stuff. I used git for longer but never thought that this algorithm was used in it. This is an eye opener. I have to say that our faculties failed in this regard, they would ask to implement and understand the logic of the algorithm but they never talk about the use cases. Knowing why is really great.

    • @TechWithNikola
      @TechWithNikola  9 หลายเดือนก่อน

      Glad you've enjoyed it :) It's true that most schools put most efforts into explaining how things work, but very little towards why. Some people, including myself, find it hard to motivate themselves to learn something without understanding why.

  • @Vssimida
    @Vssimida หลายเดือนก่อน

    Just amazing! Can't understand how you don't have 1M subscribers, you can easily get those with a little more videos.
    The quality of work here is top notch! Thanks a lot!

  • @codepractices7
    @codepractices7 11 หลายเดือนก่อน +6

    You have an extremely intuitive way of teaching!!

    • @TechWithNikola
      @TechWithNikola  11 หลายเดือนก่อน

      Thanks, I appreciate it. That’s great to hear!

  • @bot-bot
    @bot-bot 7 หลายเดือนก่อน +3

    Can't wait for the next DP video. Thanks Nikola! 😀

    • @TechWithNikola
      @TechWithNikola  6 หลายเดือนก่อน +1

      Glad you liked it! Hopefully I’ll find the time soon to make another video 😀

    • @ShailPM
      @ShailPM 6 หลายเดือนก่อน

      @@TechWithNikola hey man i need another video! also can you discuss 'target sum' in detail

  • @uaua-qm2gp
    @uaua-qm2gp 2 หลายเดือนก่อน

    Love the practical example in the end. Well done!

  • @dyutisharma3597
    @dyutisharma3597 11 หลายเดือนก่อน +2

    Please keep up the good work, need more explanations like this. Also bring-in more real-life problems solved by DSA.

    • @TechWithNikola
      @TechWithNikola  11 หลายเดือนก่อน

      Thank you. I have a few more ideas in mind and will start working on them after holidays!

  • @rafa_br34
    @rafa_br34 10 หลายเดือนก่อน +1

    Good video! I'd love to see a video about the Quine-McCluskey algorithm or more neural network stuff.

    • @TechWithNikola
      @TechWithNikola  10 หลายเดือนก่อน +2

      Thank you. I've written this down and may cover it at some point, but I can't promise that this will be any time soon.

    • @rafa_br34
      @rafa_br34 10 หลายเดือนก่อน +1

      @@TechWithNikola thank you very much :D

  • @Daniel-sy3wo
    @Daniel-sy3wo 8 หลายเดือนก่อน

    Great video!!! One nit pick is that around 9:45 you mention that if the “last” elements are equal then we pick them. I was confused because I thought you meant the last elements in the list (eg. a[-1] in python), and I assumed I wasn’t understanding the syntax. Turns out you meant the last as in the previous elements. Words can be ambiguous sometimes but maybe it’s just that Im not a native speaker. Awesome job explaining though!

    • @TechWithNikola
      @TechWithNikola  7 หลายเดือนก่อน

      That’s a good point. Thanks for the feedback.
      I’m glad to hear you’ve enjoyed the video. Thank you for taking the time to leave a comment (and apologies for the late response)

  • @korigamik
    @korigamik 11 หลายเดือนก่อน +1

    This is really cool! Can you tell us what you use for animations and highlighting the code in the video? Maybe share the source code?

    • @TechWithNikola
      @TechWithNikola  11 หลายเดือนก่อน +2

      Glad to hear that. You’re welcome. I used Keynote on MacOS for code animations. There is no source code for that.
      I also use powerpoint and sometimes Manim. I haven’t used Manim for this video.

  • @mathijsstevens
    @mathijsstevens 11 หลายเดือนก่อน

    Could you make a video on the cutting stock problem? There are other video's about it but none of them seem te be as clear to me as your video's.

    • @TechWithNikola
      @TechWithNikola  10 หลายเดือนก่อน

      Glad to hear that you've find my videos clear. I have written this down and I might get to it at some point, but I think it will be a few months from now.

  • @ujjwalaggarwal7065
    @ujjwalaggarwal7065 11 หลายเดือนก่อน +2

    please keep this up love these videos explaining real world stuff

    • @TechWithNikola
      @TechWithNikola  11 หลายเดือนก่อน +1

      Thank you. Will do. If you have any ideas for future videos please let me know.

  • @tkingless
    @tkingless 5 หลายเดือนก่อน

    Cannot wait to watch the sequel

  • @DoChDev
    @DoChDev 11 หลายเดือนก่อน

    Overall a great video, but I have one point for improvement: The animation starting at 13:42 is not in sync with your spoken explanation, which I found confusing. For example when you said "... to start with the first line in the longest common subsequence", the animation already showed the added and deleted lines.

    • @TechWithNikola
      @TechWithNikola  11 หลายเดือนก่อน +1

      Thank you for the comment and feedback. That’s a good point. My initial version did exactly that, but then I also wanted to show full animation and I ended up not saying anything for the duration, so I sped it up.
      In retrospect, I think you’re right and the approach I chose can be confusing.

  • @PrimordialLegend
    @PrimordialLegend 11 หลายเดือนก่อน +2

    Finally!
    Thanks for uploading!

    • @TechWithNikola
      @TechWithNikola  11 หลายเดือนก่อน

      :-) sorry it took a while. It’s difficult to find spare time to work on videos. Let me know what you think about this one. I’d really appreciate the feedback.

  • @dieribadiakhaby9999
    @dieribadiakhaby9999 10 หลายเดือนก่อน

    Really Awesome video! have you any ressources to increase my knowledge on mastering dynamic programming ? website, books ?

    • @TechWithNikola
      @TechWithNikola  10 หลายเดือนก่อน +1

      Thank you. Unfortunately, I can't recommend a specific book because I haven't read any on this topic. I have mostly learned through solving problems. Let me ask around and I'll let you know.

    • @dieribadiakhaby9999
      @dieribadiakhaby9999 10 หลายเดือนก่อน

      @@TechWithNikola Thanks for your answer

  • @e-k4110
    @e-k4110 5 หลายเดือนก่อน +1

    amazing content! happy to give the 1000th thumbs up

  • @pedramhaqiqi7030
    @pedramhaqiqi7030 8 หลายเดือนก่อน

    Could you help me understand the case where there is an existing 9 before the one in B, and why we "dont need to consider numbers past that in B" therefore it is in the optimal solution?

    • @pedramhaqiqi7030
      @pedramhaqiqi7030 8 หลายเดือนก่อน +1

      Answer: because this would take the best of including this 9, or the other one, as the DP table ensures that. :)

  • @pakkiaman2
    @pakkiaman2 2 หลายเดือนก่อน +1

    wao so epic these contents !!!

  • @nikhilsinha2191
    @nikhilsinha2191 11 หลายเดือนก่อน +2

    The python language solution was better may be reason is that I solve dsa in python but it's more simpler to understand for others as well I guess.

    • @TechWithNikola
      @TechWithNikola  11 หลายเดือนก่อน

      That’s a fair point. Thank you for the feedback. I’ll try to use more python. The only downside is that I don’t use the language on a daily basis and I may make mistakes.

  • @ranonrat6164
    @ranonrat6164 11 หลายเดือนก่อน +1

    you-made-a-great-video-i-love-it.
    I-have-been-trying-to-solve-this-problem-but-i-couldnt.
    This-is-really-helpful-thanks.
    I-will-learn-more-about-dynamic-programming.

    • @TechWithNikola
      @TechWithNikola  11 หลายเดือนก่อน

      Thank you for the comment. I’m glad it was helpful!

  • @codinginterview101
    @codinginterview101 2 หลายเดือนก่อน

    I don't think DP is hard until I see this real life example, LOL

  • @CurtisCanby
    @CurtisCanby 9 หลายเดือนก่อน +1

    In the first example with longest common subsequence, where A=[1,2,3,4] and B=[2,3,4,5]
    You didn’t mention 2,3,4 as the longest common subsequence. You had 2,3 as the longest. Is 2,3,4 not the longest?

    • @TechWithNikola
      @TechWithNikola  9 หลายเดือนก่อน

      Hey, [2, 3, 4] is the longest. I made a mistake in the video (see the pinned comment that mentions mistakes)

  • @ivandrofly
    @ivandrofly 11 วันที่ผ่านมา

    thanks

  • @donovanmurray7005
    @donovanmurray7005 11 หลายเดือนก่อน

    Thank you!

  • @megaxlrful
    @megaxlrful 11 หลายเดือนก่อน

    Fantastic video! It is a really clear explanation on DP :-)

  • @marvinalone
    @marvinalone 6 หลายเดือนก่อน

    6:56 why the LCS would contain 5 or 9? B could have no 9 and A could have no 5

  • @tomislam
    @tomislam 11 หลายเดือนก่อน

    You did it. Thank you. 😢

    • @TechWithNikola
      @TechWithNikola  11 หลายเดือนก่อน

      Finally yeah 😀 you’re welcome.

  • @MMarcuzzo
    @MMarcuzzo 6 หลายเดือนก่อน

    Very good!

  • @mehul4mak
    @mehul4mak 7 หลายเดือนก่อน

    You got the subscriber!❤

  • @gingeral253
    @gingeral253 10 หลายเดือนก่อน

    Cool stuff

  • @KKKBarracuda
    @KKKBarracuda 10 หลายเดือนก่อน

    Hello, I'm a new subscriber to your your, I want to thank you because I was able to apply dynamic programming in one of the software solution project in one of my subject and my prof finally approved it since it is not inefficient anymore. If it is okay with you, may I request a video about parallel programming, asynchronous programming, and multi-threading? I tried reading some materials and have asked edge's bing ai and chatgpt to help me understand those techniques of programming(I do not know if it is the correct term for all of them and I am not sure if those are programming paradigms) but your way of explaning things made me understand the logic in those technique. Thank you for your time reading my comment.

    • @TechWithNikola
      @TechWithNikola  10 หลายเดือนก่อน +1

      Hello, thank you for the subscription and for taking the time to write this comment. It's really appreciated.
      That's very exciting. It's not common to use DP in real-life, but I'm very excited when I hear people have done that. I'd like to hear more about your project if you're willing to share.
      Regarding videos about parallel programming, async, and multi-threading, I would love to make videos on these topics, and I will. However, I can't promise that this will happen any time soon. The reality is that it takes a long time to make these videos, and I only do it when I have free time, but I have added these topics to my queue.

    • @KKKBarracuda
      @KKKBarracuda 9 หลายเดือนก่อน

      @@TechWithNikola Thank you for taking you time replying with me, The project I'm currently tasked with is somewhat of a capstone project on web development. I can't really say much since it is a ERP system and each of its module is divided to each group in every block of students. Each group is tasked with handling a single module or section of the system. My group is focused on the Behaviour module. I was able to adjust the time complexity from O(n^3) to O(n) and add a feature that was requested by one of the panelist during the defense. The feature involves Automated Penalty Calculation and Violation Tracking and Management. The first implemented logic was labeled as "inefficient for simultaneous reports" or "slow in handling mass number of reports in one go", the said panelist gave some scenarios where the speed of execution and processing of each feature is detrimental thus our implementation of the request was rejected. I was already studying on how to save information so that it can be used for future references, I've come across solutions like caching but with me and my groupmates knowledge, applying caching is hard specially since the tech stack we are required to use is unfamilliar with us (since it is the first time we are using it). We also thought of using a separate database but that would require changing the architecture of some part and we had an argument with the group tasked for back-end integration, the outcome was we did not create a new one. Then I've come across a topic on dynamic programming on a short on youtube and my search began, a lot of video is complicated and some are hard to replicate but when I've watched you video I was somehow able to replicate and apply somewhat of a hashmap to replicate the memoization.
      I can't really talk about a lot of stuff since we are going to transfer a lot of private data (a room full of filefolders).