Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Question :

Suppose you are buying stamps to put on a package at the post office.

The postage required to send the package is N dollars. You can buy $1, $7, and $10 stamps. You want to find the minimum number of stamps required so that you have at least SIV worth of stamps. Note that the solution to this problem may not actually be the cheapest solution in terms of dollars: for example, if you need stamps totaling $16, then you can buy a $10 and a $7 stamp, which adds up to $17.

Or you could buy a $10 stamp and six $1 stamps, which adds up to $16. The second solution requires seven stamps, so the first solution is better (even though it is more expensive). However, if there are multiple solutions that use the same number of stamps, then you should return the one that is cheapest.

Design a dynamic programming algorithm that finds the minimum number of stamps required. The input to your algorithm is the total desired postage value N. The output should be the number of stamps required. (You do not have to tell me which stamps were used.)

Part a: Draw the DAG corresponding to this problem. Hint: Let the nodes correspond to different total postage values, and let the edges correspond to different stamp choices.

Part b: Solve the dynamic programming problem using your DAG. Hint: Once you have drawn the DAG correctly, the original problem becomes a very simple graph problem on the DAG.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M93127236

Have any Question?


Related Questions in Computer Engineering

Question how will you create the cicd process for this

Question: How will you create the CI/CD process for this application? Propose the tools, technologies required to achieve CI/CD in general. The response must be typed, single spaced, must be in times new roman font (size ...

Answer the following question what is the relationship

Answer the following Question : What is the relationship between a role and a competency? How do roles facilitate the development and implementation of specific practices for any organization? The response must be typed, ...

Suppose pointers are 4 bytes long and keys are 12 bytes

Suppose pointers are 4 bytes long, and keys are 12 bytes long. How many keys and pointers will a block of 16,384 bytes have?

A single card is randomly drawn from one standard 52-card

A single card is randomly drawn from one standard 52-card deck of playing cards, and events C and D are as follows: C=the card drawn is a king; D-the card drawn is a heart. Find the probability of event C or event D occu ...

Analyze the time complexity of the following ternary search

Analyze the time complexity of the following ternary search algorithm: identify two points that subdivide a sorted array into three parts. If the given number is equal to one of these two points, we are done. Otherwise, ...

Sorting program note make sure you use c programmingfor

Sorting Program Note: Make sure you use c++ programming For this assignment, you are to write a comparative algorithm that will compare the efficiency of three sorting routines. Here is the approach you should use: 1. Wr ...

Why is a mixture of ethanol and water needed to perform a

Why is a mixture of ethanol and water needed to perform a reaction between oil and NaOH? This question is from a soap lab where we made soap from oils.

The researchers stated that there were no significant

The researchers stated that there were no significant differences in the baseline characteristics of the intervention and control groups. Are these groups heterogeneous or homogeneous at the beginning of the study? Why i ...

Case study the acme corporation is a new startup that

Case Study: The Acme Corporation is a new startup that wishes to sale their new phone to the public called Acmephone, a more secure version of the phone to business organizations, called the Acmephone B+, and highly secu ...

Suppose that we have a binary counter with k bits where

Suppose that we have a binary counter with k bits, where each bit is stored in a array A[0..k - 1]. The operation Increment(A) increments the counter by adding 1 to the content of the counter modulo 2k . The cost of this ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As