0% found this document useful (0 votes)
2 views9 pages

Daa PPTTT

The document discusses the Coin Change Problem, which seeks to find the minimum number of coins needed to make a specific amount of change using given denominations. It emphasizes the advantages of using dynamic programming over other methods, highlighting its efficiency in solving optimization problems through techniques like memoization and optimal substructure. The presentation includes source code and analysis of time and space complexity, demonstrating dynamic programming's effectiveness in addressing the Coin Change Problem.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views9 pages

Daa PPTTT

The document discusses the Coin Change Problem, which seeks to find the minimum number of coins needed to make a specific amount of change using given denominations. It emphasizes the advantages of using dynamic programming over other methods, highlighting its efficiency in solving optimization problems through techniques like memoization and optimal substructure. The presentation includes source code and analysis of time and space complexity, demonstrating dynamic programming's effectiveness in addressing the Coin Change Problem.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 9

SRM INSTITUTE OF SCIENCE AND TECHNOLOGY

SCHOOL OF COMPUTING
DEPARTMENT OF COMPUTING TECHNOLOGIES
DAA PROJECT

COIN CHANGE PROBLEM


Using dynamic programming

Batch ID:

ROHAN [RA2211003011614]
VISHAL C [RA2211003011647]
BASITH [RA2211003011670]
2

ABSTRACT :

The Coin Change Problem presents a classic challenge in computer


science and dynamic programming. This problem revolves around
finding the minimum number of coins required to make a certain
amount of change. In this presentation, we delve into the intricacies
of the Coin Change Problem, exploring its significance, various
solution approaches, and the rationale behind choosing dynamic
programming over recursive methods. We present a detailed
overview of dynamic programming and its application in efficiently
solving optimization problems like the Coin Change Problem.
Through source code demonstration and analysis of time and space
complexity, we illustrate the effectiveness of dynamic programming
in tackling this problem. Overall, this presentation sheds light on the
Coin Change Problem, offering insights into its solutions and the role
of dynamic programming in algorithmic problem-solving.
3

PROBLEM STATEMENT:

The Coin Change Problem involves finding the minimum


number of coins needed to make a certain amount of
change, given a set of coin denominations. For example, if
we have coins of denominations [1, 2, 5] and need to make
a change for 11, the minimum number of coins required
would be 3 (one 5-coin and three 2-coins).
4

BRIEF AND APPROACH:

The problem can be approached using various algorithms,


including brute force, greedy algorithms, and dynamic
programming. Among these,
Dynamic programming is often preferred due to its efficiency
and ability to find the optimal solution.

Dynamic programming involves breaking down the problem


into smaller sub-problems and solving each sub-problem only
once, storing the results to avoid redundant calculations. By
efficiently combining solutions to sub-problems, dynamic
programming allows us to find the minimum number of coins
needed for each amount up to the target amount, ultimately
providing the optimal solution.

The Coin Change Problem has various real-world


applications, including vending machines, currency
exchange, and resource allocation. It serves as an important
problem in algorithm design, illustrating the effectiveness
5

WHY USE DYNAMIC PROGRAMMING ?

Dynamic programming is a powerful technique used to solve optimization


problems efficiently. Here are some reasons why dynamic programming is often
preferred:

1.Optimal Substructure: Dynamic programming is particularly useful for problems that exhibit
optimal substructure, meaning that an optimal solution to the problem can be constructed from
optimal solutions to its subproblems. By breaking down the problem into smaller subproblems and
solving each subproblem optimally, dynamic programming allows us to find the optimal solution to
the overall problem.

2.Overlapping Subproblems: Many optimization problems involve overlapping subproblems,


where the same subproblems recur multiple times in the solution process. Dynamic programming
efficiently addresses this issue by storing the results of already solved subproblems in a table and
reusing them when needed. This eliminates redundant computations and leads to improved time
complexity.

3.Memoization: Dynamic programming often employs memoization, a technique where the results
of subproblems are stored in memory for future use. By memorizing the results of subproblems,
dynamic programming avoids recalculating them and reduces the time complexity of the solution.
Memoization is particularly effective in recursive dynamic programming algorithms.
6

4. Time Complexity Optimization: Dynamic programming algorithms are designed to optimize time complexity by efficiently solving subproblems and avoiding redundant computations. This makes dynamic programming suitable for solving problems with large input sizes, as it can provide solutions in polynomial time instead of exponential time.

5. Versatility: Dynamic programming is a versatile technique that can be applied to a wide range of optimization problems across various domains, including computer science, operations research, economics, and bioinformatics. Its adaptability and effectiveness make it a valuable tool for solving complex optimization problems efficiently.

Overall, dynamic programming offers significant advantages in terms of time complexity optimization, memory efficiency, and versatility, making it a preferred approach for solving optimization problems in many real-world scenarios.
7

SOURCE CODE:
8

CODE OUTPUT:

• Time Complexity: O(numCoins * amount)


• Space Complexity: O(amount)
9

CONCLUSION:

In conclusion, we have explored the Coin Change Problem


and its solution using dynamic programming. Dynamic
programming offers an efficient approach to solving
optimization problems like the Coin Change Problem by
breaking them down into smaller subproblems and storing
the results for reuse.

Key Points Discussed:


The Coin Change Problem involves finding the minimum number of coins needed to make change for a
given amount, using a given set of coin denominations.
Dynamic programming provides an efficient solution to the Coin Change Problem by optimizing time and
space complexity through the use of memoization and optimal substructure.
The provided code demonstrates how dynamic programming can be applied to efficiently solve the Coin
Change Problem, with a time complexity of O(numCoins * amount) and a space complexity of O(amount).

You might also like