1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Ainat [17]
3 years ago
14

Suppose we need to make change for n cents, and we want to use the least number of coins of denominations 1, 10, and 25 cents. C

onsider the following greedy strategy: suppose the amount left to change is m. Take the largest coin that is no more than m, subtract this coin’s value from m, and repeat. Prove that this algorithm is optimal, or give a counterexample if it is not.
Mathematics
1 answer:
frutty [35]3 years ago
8 0

Answer:

Explained

Step-by-step explanation:

This algorithm does not always give the optimal solution.  There is an alternate method as well.

Consider we have to make change for 30 cents, using the least number of coins of denominations 1,10 and 25 cents.According to the given strategy, we first take a 25 cents coin and subtract it from 30 cents. Now, we have to make 5 cents which we can make only from 5 one-cent coins. So, the total number of coins required is 6 according to the given greedy strategy.

But we can simply use 3 ten-cent coins to make change of 30 cents. So, this example proves that the given strategy is not an optimal one.

You might be interested in
Solve for x I got x=28.394. is that correct?
quester [9]
Cosine 65 = 12 / x
0.4226183 = 12 / x
x = 12 / 0.4226183
<span> <span> <span> x = 28.39441</span></span></span>

So, I'd say you are correct.

6 0
3 years ago
In a right triangle, the length of one leg is 6 units. The length of the other leg is 8 units. What is the length of the hypoten
lozanna [386]
hypotenuse =  \sqrt{6^2+8^2}= \sqrt{36+64}= \sqrt{100}=10 \ units
7 0
3 years ago
Read 2 more answers
Which inequality represents all values of x for which the product below is<br> defined?<br><br> ixt1
sesenic [268]

Answer:

Step-by-step explanation:

i got band and theres nothing below

6 0
3 years ago
Help plz fast with this question
Ivahew [28]

90-7 =83 degrees

height = 3 miles

divide 3 by the cos of 83 degrees

3/cos(83) = 24.6165

rounded to nearest mile = 25 miles

6 0
3 years ago
22 less than 5 times a number f
olya-2409 [2.1K]

Answer:

5f - 22

Step-by-step explanation:

pls igve brainliest

8 0
3 years ago
Read 2 more answers
Other questions:
  • true or false 4. If the area of a rectangle is 6 m2, then the dimensions must be 2 meters by 3 meters.
    10·2 answers
  • II NEED THIS ASAP WILL GIVE BRAINLIEST Which number line correctly shows –3 – 1.5? A number line going from negative 4.5 to posi
    14·2 answers
  • I bought a new pair of basketball shoes on sale they were 30 percent off the original price was $85 how much was the discount ho
    5·1 answer
  • PLEASE HELP ASAP<br><br>which equation could be used to find the length of the hypotenuse?​
    13·1 answer
  • Is the ordered pair (6, 5) a solution to the equation 3x − 4y = −2? Explain.
    14·1 answer
  • If angle b is (6x-5) then what is its supplement?
    11·2 answers
  • 5x²+15x+20=0. find the sum and the product of the roots.​
    5·1 answer
  • ABC and DEF are similar. Find the missing side length.
    10·1 answer
  • Find the value of x. Then find the angle measures of the polygon.<br><br> x=_ <br><br> Question 2
    10·2 answers
  • If 4x - 9 = 35,<br> find the value of 6x + 4
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!