Nepedia
Back to Discover
Fluent Reader
💻

Dynamic programming

technology Maturity 9-11 Next article →

Sometimes a huge problem is too hard to solve all at once.

Shortest path optimal substructure
Shortest path optimal substructure

Dynamic programming is a smart way to handle these hard jobs. It is both a mathematical method and a way to write computer programs. This method works by breaking a big, complicated problem into smaller, easier pieces. These smaller pieces are called sub-problems. By solving these little parts, we can eventually find the best answer to the whole thing. This approach is used in many areas, like economics and aerospace engineering.

To use this method, a problem must have two special features. The first is called optimal substructure. This means the best answer to a big problem is made of the best answers to its small parts.

Shortest path optimal substructure
Shortest path optimal substructure

For example, the shortest path between two points on a map is made of shorter paths between points in the middle. The second feature is overlapping sub-problems. This happens when the same small job appears many times while you are working. Instead of doing the same work over and over, you solve it once and save the answer.

Fibonacci dynamic programming
Fibonacci dynamic programming

A man named Richard Bellman developed this method in the 1950s. He created a way to link the value of a large problem to its smaller parts. In math, this link is called the Bellman equation. He showed that you can solve problems by working backward through time. You start at the end and figure out the best steps to get there. This is called backward induction. It helps people make a sequence of smart decisions over time.

Computer scientists use two main ways to apply these ideas. The top-down approach starts with the big goal and breaks it down. It uses something called memoization, which is like keeping a notebook of answers.

Fibonacci dynamic programming
Fibonacci dynamic programming

When the computer sees a problem it has already solved, it just looks up the answer. The bottom-up approach works the opposite way. It starts with the smallest possible parts first. It then uses those small answers to build up to the bigger ones.

This math helps us understand many different parts of our world. In economics, it helps people plan how much to save or spend over a lifetime. In biology, it helps scientists study how tiny parts of life like proteins work.

Tower of Hanoi
Tower of Hanoi

Scientists even use it to see how DNA and proteins bind together. Some of the first tools for this were made in the 1970s. Researchers like Charles DeLisi in the US worked on these ideas. They helped make modern biology much more powerful.

421 words

Where will your curiosity go next?

Keep exploring at your chosen reading level.

🖼️ Images & Media (4)
File:Shortest path optimal substructure.svg
Shortest path optimal substructure.svg
File:Fibonacci dynamic programming.svg
Fibonacci dynamic programming.svg
File:Tower of Hanoi.jpeg
Tower of Hanoi.jpeg
File:Tower of Hanoi 4.gif
Tower of Hanoi 4.gif
More to explore

What is Nepedia?

A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.