Dynamic Programming

Dynamic Programming

DYNAMIC PROGRAMMING

? ? ? A technique where we solve #subproblems and use their #solutions to compute the bigger problem. The problem has an #optimal #substructure - used to find the optimal solution to subproblems


Approaches to implement DP

? ? ? ? Tabulation -> bottom up ?-- starting from the base case

? ? ? ? Memoization -> top down ?-- start from top and iterate until the base case is achieved ?-- helps avoid unnecessary #redundant #computation of the same #subproblem


Which one is Better?

? ? ? ? -> bottom up - usually #computes #faster - logical order is preserved

? ? ? ? -> top down - #easier to write - overhead due to use of #recursion - no logical order


When to use DP?

? ? ? ? -> problem can be broken down into #smaller #overlapping solutions

? ? ? ? -> problem has an #optimal #substructure


Characteristics to Identify whether to Implement DP or not:

? ? ? ? -> problem asks for something optimal - min or max

? ? ? ? -> longest possible - shortest possible

? ? ? ? -> finding #subsequences - substrings

? ? ? ? -> Later #decisions depend on earlier decisions

These are just some characteristics. The real-world problem may differ depending upon the scenario.


? ? ? ?

要查看或添加评论,请登录

Aqsa A.的更多文章

  • Understanding LSTM Networks

    Understanding LSTM Networks

    RNNS (Recurrent Neural Networks) Ever wondered how we get to understand things just by looking at them. We don't need…

    1 条评论
  • The Illustrated Word2Vec

    The Illustrated Word2Vec

    Word2Vec is a method to effectively create word embedding and its most popular use case includes the prediction of next…

  • NLP in Healthcare: Challenges and Trends

    NLP in Healthcare: Challenges and Trends

    As the Generative AI field grows, its use cases in healthcare are also increasing rapidly. Most of the AI applications…

    1 条评论
  • A Complete Guide to Meta Connect '23

    A Complete Guide to Meta Connect '23

    Meta Connect 2023 - a two-day virtual event held on September 27-28, 2023, where Meta unveiled new products and…

  • NOTEBOOKLM

    NOTEBOOKLM

    ???? Introducing NotebookLM, a new AI-powered virtual research assistant from Google that can help you - Summarize Docs…

  • Expert Systems

    Expert Systems

    The Components and Limitations of Expert Systems: A Comprehensive Overview Expert System is a computer program which…

    1 条评论
  • Meta AI Unveils SeamlessM4T: A Game-Changing AI Translation Breakthrough

    Meta AI Unveils SeamlessM4T: A Game-Changing AI Translation Breakthrough

    Bringing the World Closer Together with a Foundational Multimodal Model for Speech Translation In this highly connected…

  • Topological Sorting

    Topological Sorting

    TOPOLOGICAL SORTING A way of #sorting Directed Acyclic Graphs (DAGs) such that for a #directed #edge (u, v), vertex #u…

  • REINFORCEMENT LEARNING

    REINFORCEMENT LEARNING

    A machine learning framework based on interaction between system and the environment. The system in a particular state…

  • Regularization

    Regularization

    Working with ML models is all fine until you get noisy and somewhat extra data to train the model. Having such data not…

    1 条评论

社区洞察

其他会员也浏览了