Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Hands-On Markov Models with Python

You're reading from  Hands-On Markov Models with Python

Product type Book
Published in Sep 2018
Publisher Packt
ISBN-13 9781788625449
Pages 178 pages
Edition 1st Edition
Languages
Concepts
Authors (2):
Ankur Ankan Ankur Ankan
Profile icon Ankur Ankan
Abinash Panda Abinash Panda
Profile icon Abinash Panda
View More author details

Dynamic programming

Dynamic programming is a programming paradigm in which we divide a complex problem into smaller sub-problems. We solve these sub-problems and store the results. Whenever we need to recompute the same sub-problem again, we just used our stored results, thus saving us computation time at the expense of using storage space. This technique of caching the results of sub-problems is known as memoization. Therefore, using dynamic programming allows us to speed up our computations by using memoization, and in some cases, it can bring the computational complexity from exponential to linear, as we will see in the following example.

One of the simplest examples of optimization using dynamic programming is computing the nth member of the Fibonacci sequence. Any term in a Fibonacci sequence is the sum of the last two terms, which can be formally defined as follows:

fib...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}