Question

In activity selection problem, of all the allowed

0 0
Add a comment Improve this question Transcribed image text
Answer #1

13) Picking the activity that ends first will always helps in completing the activities that takes smaller time and going on to the activities that takes more time. Picking an activity depends on what you want to achieve.

For example if there is list of numbers as [1,2,3,4,5,6,7,8,9,10] and if you want to see an optimal solution to find the number of values that it takes to get a number 30 . In this case it would be better to take the last element 10. the optimal solution with repetitions will be selecting 3 - 10s

If you start from the first element you may get the solution but it wont be optimal solution.

14) The dynamic programming is applicable when the given problem consists of 'Optimal Substructure' and 'Overlapping subproblems'.

Optimal Substructure : if one can break a problem into smaller versions of it, and then combine the solutions of smaller problems, it solved the problem at hand.

Overlapping subproblems: While solving the smaller problem that leads to the same repetitive calculation steps, we term these as overlapping sub problems.

Hence instead of solving for the same calculation steps over and over, we can store solutions to previous calculated steps it into a memory such as hash map or an array.

The major difference between greedy and dynamic programming is that greedy algorithm never reconsiders its choices and the choices are made by using the past activities and you won't be ale to get the optimal solution all the time. On the other hand with dynamic programming is guaranteed to find a solution. dynamic programming makes decisions based on all the decisions made in the previous stage, and may reconsider the previous stage's algorithmic path to solution.

15) Optimal Substructure : if one can break a problem into smaller versions of it, and then combine the solutions of smaller problems, it solved the problem at hand.

The shortest path problem: If a node P lies in the shortest path from a source node Q to destination node R then the shortest path from Q to R is combination of shortest path from Q to P and shortest path from P to R.

The Longest path problem: It doesn't have the optimal substructure. The combination of multiple longest paths will not lead to the optimal solution that we can get. i.e the longest path between two nodes doesn't have to be the longest path between the in between nodes.

16) The greedy- choice property always keeps a local solution after each and every step in the hope of finding a global solution.

In greedy approach you dont have to find or work with all the sub problems, if you feel by going to a certain intermediate stage will get you an optimal solution you can go to it and find the solution. The distance for reaching that node will be reduced. On the other hand in dynamic programming you need to solve all the sub problems and at the end you will get an optimal solution.


Add a comment
Know the answer?
Add Answer to:
In activity selection problem, of all the allowed activities we always picked the activity that ends...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • algorithm TRUE OR FALSE       TRUE OR FALSE    Optimal substructure applies to alloptimization problems.  ...

    algorithm TRUE OR FALSE       TRUE OR FALSE    Optimal substructure applies to alloptimization problems.     TRUE OR FALSE    For the same problem, there might be different greedy algorithms each optimizes a different measure on its way to a solutions.      TRUE OR FALSE Computing the nth Fibonacci number using dynamic programming with bottom-upiterations takes O(n) while it takes O(n2) to compute it using the top-down approach. TRUE OR FALSE Every computational problem on input size n can be...

  • Please read the article and answer about questions. You and the Law Business and law are...

    Please read the article and answer about questions. You and the Law Business and law are inseparable. For B-Money, the two predictably merged when he was negotiat- ing a deal for his tracks. At other times, the merger is unpredictable, like when your business faces an unexpected auto accident, product recall, or government regulation change. In either type of situation, when business owners know the law, they can better protect themselves and sometimes even avoid the problems completely. This chapter...

  • I have this case study to solve. i want to ask which type of case study...

    I have this case study to solve. i want to ask which type of case study in this like problem, evaluation or decision? if its decision then what are the criterias and all? Stardust Petroleum Sendirian Berhad: how to inculcate the pro-active safety culture? Farzana Quoquab, Nomahaza Mahadi, Taram Satiraksa Wan Abdullah and Jihad Mohammad Coming together is a beginning; keeping together is progress; working together is success. - Henry Ford The beginning Stardust was established in 2013 as a...

  • 1. According to the paper, what does lactate dehydrogenase (LDH) do and what does it allow...

    1. According to the paper, what does lactate dehydrogenase (LDH) do and what does it allow to happen within the myofiber? (5 points) 2. According to the paper, what is the major disadvantage of relying on glycolysis during high-intensity exercise? (5 points) 3. Using Figure 1 in the paper, briefly describe the different sources of ATP production at 50% versus 90% AND explain whether you believe this depiction of ATP production applies to a Type IIX myofiber in a human....

  • Below is the information: It is important to understand the different leadership styles employed by nursing...

    Below is the information: It is important to understand the different leadership styles employed by nursing leaders in healthcare organizations and to understand their significance on nursing practice and patient outcomes, for better or for worse. Objective: Read the articles from Nursing Standard (PDF) and Bradley University (PDF). In -250 words, formulate an opinion on the following: 1. Reflect on an occasion where you experienced ineffective leadership (doesn't have to be in the hospital). What behaviors did they display? What...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT