chapter

    Dynamic Programming Short Notes for Cmi M.sc. and Ph.d. Computer Science

    Dynamic Programming short notes for CMI M.Sc. and Ph.D. Computer Science: 21 study cards covering concepts, formulas, shortcuts and exam traps, plus solved pr

    Dynamic Programming short notes

    If You See This Do This

    Triggers

    If You See This Do This

    If you seeDo this
    Problem decomposes into smaller instancesWrite a recurrence relating the answer at state to answers at successor states
    Recursion tree shows repeated callsCache each answer in a table
    Base cases neededEnumerate the smallest instances directly, do not derive them from the recurrence
    Evaluation orderProcess states so that every dependency is computed before it is used
    Counting versus optimizationCounting uses sum over choices, optimization uses max or min over choices

    Formulas and Their Limits

    Validity

    Formulas and Their Limits

    FormulaValid whenBreaks when
    Steps of size 1 and 2 are the only optionsOther step sizes are allowed or steps depend on history
    The cases partition the solution spaceCases overlap or miss some solutions
    Optimal substructure holdsSubproblems share resources such as vertices or items

    Three Second Sanity Checks

    Checks

    Three Second Sanity Checks

    CheckEliminates
    Base case Options with instead of 1
    Table monotonicityOptions where for
    Recurrence orderOptions with too few base cases for a recurrence of order
    Distinct subproblem countExponential-state proposals instead of polynomial

    18 more cards in this chapter

    Free preview ends here

    Login to view the complete short notes

    Creating an account is free. You get the rest of this chapter, step-by-step solutions, and a study plan built around the topics you are actually weak at.

    Explore complete test series, official past papers, and chapter-wise study tools.

    Why MastersUp

    Personalised first. High quality throughout.

    Most platforms hand everyone the same content. Here the content moves with your performance, topic by topic.

    Built around you, not around a syllabus PDF

    Every answer you give moves your topic-level intelligence rate. The next question, the next revision card and tomorrow's plan all change with it.

    Revision that hits your weak spots

    We only revise topics you have actually attempted and are still below the safe bar on — never the same chapter on repeat.

    Questions calibrated to the real exam

    Each question carries a measured toughness. You are served a rung above your current level, so practice keeps stretching you.

    Notes written for recall, not for volume

    Full lesson cards for first study, curated short-note cards for the last mile — with derivations, traps and exam patterns marked.

    One place for everything

    Notes, chapter practice, previous-year questions, test series and full-length papers — all feeding one picture of your preparation.

    Honest progress

    No vanity streaks. Progress here means chapters mastered and accuracy that held up on harder questions.

    Unlock the whole course

    Full notes and short notes, the complete question bank with worked solutions, mock tests, full-length papers, and an adaptive plan that rebuilds itself as you improve.

    Dynamic Programming Short Notes for CMI M.Sc. and Ph.D. Computer Science

    Dynamic Programming short notes for CMI M.Sc. and Ph.D. Computer Science: 21 study cards covering concepts, formulas, shortcuts and exam traps, plus solved practice questions.

    If You See This Do This

    Triggers

    If You See This Do This

    If you seeDo this
    Problem decomposes into smaller instancesWrite a recurrence relating the answer at state to answers at successor states
    Recursion tree shows repeated callsCache each answer in a table
    Base cases neededEnumerate the smallest instances directly, do not derive them from the recurrence
    Evaluation orderProcess states so that every dependency is computed before it is used
    Counting versus optimizationCounting uses sum over choices, optimization uses max or min over choices

    Formulas and Their Limits

    Validity

    Formulas and Their Limits

    FormulaValid whenBreaks when
    Steps of size 1 and 2 are the only optionsOther step sizes are allowed or steps depend on history
    The cases partition the solution spaceCases overlap or miss some solutions
    Optimal substructure holdsSubproblems share resources such as vertices or items

    Three Second Sanity Checks

    Checks

    Three Second Sanity Checks

    CheckEliminates
    Base case Options with instead of 1
    Table monotonicityOptions where for
    Recurrence orderOptions with too few base cases for a recurrence of order
    Distinct subproblem countExponential-state proposals instead of polynomial

    If You See This Do This

    Triggers

    If You See This Do This

    If you seeDo this
    Identify overlapping subproblemscheck if recursive calls solve the same subproblem multiple times
    Identify optimal substructureassume optimal solution, decompose into subproblems, prove sub-solutions must be optimal
    Prove optimal substructureuse contradiction: if sub-solution is not optimal, replace it and improve the whole
    Spot the trapcheck if constraints couple subproblems (like visiting each vertex once)
    Verify both propertiesoverlap alone is not enough, optimal substructure alone is not enough
    Handle the base casedefine or explicitly, verify it anchors the recurrence

    More short notes in this unit