# Coin Change (Dynamic Programming)

May 5th, 2015
Studypool Tutor
Price: \$10 USD

Tutor description

Characterize the Structure of an Optimal Solution. The Coin Changing problem exhibits optimal substructure in the following manner. Consider any optimal solution to making change for n cents using coins of denominations

Word Count: 1008
Showing Page: 1/5
Coin Change (Dynamic Programming)Dynamic Programming Solution to theCoin Changing Problem(1) Characterize the Structure of an Optimal Solution. The Coin Changing problem exhibits optimal substructure in the following manner. Consider any optimal solution to making change for n cents using coins of denominations d1 , d2 , . . . , dk . Now consider breaking that solution into two dierent pieces along any coin boundary. Suppose that the left-half of the solution amounts to b cents and the right-half of the solution amounts to n b cents, as shown below.nbbd1d3d1d2d4d5d2Claim 1 The left-half of the solution must be an optimal way to make change for b cents using coins of denominations d1 , d2 , . . . , dk , and the right-half of the solution must be an optimal way to make change for n b cents using coins of denominations d1 , d2 , . . . , dk . Proof: By contradiction, suppose that there was a better solution to making change for b cents than the left-half of the optimal solution shown. Then the left-half of the optimal solution could be replaced with this better solution, yielding a valid solution to making change for n cents with fewer coins than the solution being considered. But this contradicts the supposed optimality of the given solution, . An identical argument applies to the right-half of the solution.2Thus, the optimal solution to the coin changing problem is composed of optimal solutions to smaller

## Review from student

Studypool Student
" awesome work thanks "

Type your question here (or upload an image)

1828 tutors are online

### Other Documents

Brown University

1271 Tutors

California Institute of Technology

2131 Tutors

Carnegie Mellon University

982 Tutors

Columbia University

1256 Tutors

Dartmouth University

2113 Tutors

Emory University

2279 Tutors

Harvard University

599 Tutors

Massachusetts Institute of Technology

2319 Tutors

New York University

1645 Tutors

Notre Dam University

1911 Tutors

Oklahoma University

2122 Tutors

Pennsylvania State University

932 Tutors

Princeton University

1211 Tutors

Stanford University

983 Tutors

University of California

1282 Tutors

Oxford University

123 Tutors

Yale University

2325 Tutors