Introduction to Algorithms
3rd Edition
ISBN: 9780262033848
Author: Thomas H. Cormen, Ronald L. Rivest, Charles E. Leiserson, Clifford Stein
Publisher: MIT Press
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Chapter 15, Problem 11P
Program Plan Intro
To give an
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Project Optimization and regression: Exact and approximate methods to solve 0-1 Knapsack problem
Description
The 0/1 Knapsack Problem and Logistics
Transportation companies such as TNT and Royal Mail face daily problems in logistics. Consider the following simple logistics problem, which you will solve:
An airline cargo company has 1 aeroplane which it flies from the UK to the US on a daily basis to transport some cargo. In advance of a flight, it receives bids for deliveries from (many) customers. Customers state the weight of the cargo item they would like delivered, and the amount they are prepared to pay. The airline is constrained by the total amount of weight the plane is allowed to carry. The company must choose a subset of the packages (bids) to carry in order to make the maximum possible profit, given the weight limit that they must respect.
In mathematical form the problem is: Given a set of N items each with weight wi and value vi, for i=1 to N, choose a subset of items…
Shamira Laundry has designed a new calculation system for their shop. The price for each
type is as follows:
10
Туре
Price
Clothes
RM 15 for 1 kilogram
blankets / towels
RM 6 for 1 kilogram
RM 10 for 1 kilogram
comforter
Only one type can be washed at a time. This laundry shop also provides discounts to its
customers as follow:
Total price
>= RM30
Discount
10% from total price
>= RM20 dan = RM15 dan
An oil and gas exploration firm invested
$2,000,000 in drilling for natural gas in a new
gas field. The firm's geologist believes the
field has the potential to produce gas for
many years. The revenue resulting from the
gas well the first year after drilling is
$600,000; based on previous experiences
with similar types of wells, it is expected the
annual revenue will decrease at an annual
rate of 3%. Likewise, the costs of operating
the well the first year totals $100,000; costs
are expected to increase at an annual rate of
7%. If the firm's MARR is 17%, how long will it
take for the firm to recover its investment?
Hint: Using Excel's Goal Seek or SOLVER tool
leave cell for the number of years required to
recover the investment empty. Click here to
access the TVM Factor Table calculator. n = L1
years
Chapter 15 Solutions
Introduction to Algorithms
Ch. 15.1 - Prob. 1ECh. 15.1 - Prob. 2ECh. 15.1 - Prob. 3ECh. 15.1 - Prob. 4ECh. 15.1 - Prob. 5ECh. 15.2 - Prob. 1ECh. 15.2 - Prob. 2ECh. 15.2 - Prob. 3ECh. 15.2 - Prob. 4ECh. 15.2 - Prob. 5E
Ch. 15.2 - Prob. 6ECh. 15.3 - Prob. 1ECh. 15.3 - Prob. 2ECh. 15.3 - Prob. 3ECh. 15.3 - Prob. 4ECh. 15.3 - Prob. 5ECh. 15.3 - Prob. 6ECh. 15.4 - Prob. 1ECh. 15.4 - Prob. 2ECh. 15.4 - Prob. 3ECh. 15.4 - Prob. 4ECh. 15.4 - Prob. 5ECh. 15.4 - Prob. 6ECh. 15.5 - Prob. 1ECh. 15.5 - Prob. 2ECh. 15.5 - Prob. 3ECh. 15.5 - Prob. 4ECh. 15 - Prob. 1PCh. 15 - Prob. 2PCh. 15 - Prob. 3PCh. 15 - Prob. 4PCh. 15 - Prob. 5PCh. 15 - Prob. 6PCh. 15 - Prob. 7PCh. 15 - Prob. 8PCh. 15 - Prob. 9PCh. 15 - Prob. 10PCh. 15 - Prob. 11PCh. 15 - Prob. 12P
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Fergusonball players are given a star rating based on the number of points that they score and the number of fouls that they commit. Specifically, they are awarded 5 stars for each point scored, and 3 stars are taken away for each foul committed. For every player, the number of points that they score is greater than the number of fouls that they commit. Your job is to determine how many players on a team have a star rating greater than 40. You also need to determine if the team is considered a gold team which means that all the players have a star rating greater than 40. Input Specification The first line of input consists of a positive integer N representing the total number of players on the team. This is followed by a pair of consecutive lines for each player. The first line in a pair is the number of points that the player scored. The second line in a pair is the number of fouls that the player committed. Both the number of points and the number of fouls, are non-negative integers.…arrow_forwardA company sales manager requires a sales analysis of the two products on offer atthe end of the month. The company employs five salespeople. Input values for each salesperson are name, number, gender, and total units sold forthe month, for each product (one and two). The salary of each salesperson is strictly commission-based. Each salespersonearns a basic commission calculated as 12.5% of his/her total sales. If a salesperson sells more than R1 000 of product two, he or she receives anadditional 10% commission on product two. If not, commission for sales of producttwo is reduced to 5% (i.e. instead of receiving the basic 12.5% commission for salesof product two, a penalty is paid). If a saleswoman sells more than R500 of product one, she receives a bonus of R100. An added bonus of R750 is given to each salesperson whose total commission ismore than R6 000. Each employee receives a printed pay-slip showing all the employee details, grosspay, all the deductions and/or additions,…arrow_forwardA lucky draw is organized daily among all shoppers to select three shoppers. The shoppers drawn walk through a giant-sized (NXN) board with values at each of the squares on the board. The shoppers must start at square S and finish at square F of the board, by taking steps either to the right, left, down or up (moving diagonally is not allowed) incurring the minimum total. The supermarket manager needs to know the minimum total to go from start to destination to decide the winner of the trolly. required to Calculate the time and space complexities of your algorithm.arrow_forward
- A lucky draw is organized daily among all shoppers to select three shoppers. The shoppers drawn walk through a giant-sized (NXN) board with values at each of the squares on the board. The shoppers must start at square S and finish at square F of the board, by taking steps either to the right, left, down or up (moving diagonally is not allowed) incurring the minimum total. The supermarket manager needs to know the minimum total to go from start to destination to decide the winner of the trolly. Sample Run Enter the dimensions of the board: 3 3 Enter the values of the secures: 84 71 90 68 35 98 41 89 19 The minimum total cost is 295 Explanation The path that yields the minimum total (295) is highlighted.arrow_forwardA lucky draw is organized daily among all shoppers to select three shoppers. The shoppers drawn walk through a giant-sized (NXN) board with values at each of the squares on the board. The shoppers must start at square S and finish at square F of the board, by taking steps either to the right, left, down or up (moving diagonally is not allowed) incurring the minimum total. The supermarket manager needs to know the minimum total to go from start to destination to decide the winner of the trolly. required to Implement your algorithm using Java code.arrow_forwardA lucky draw is organized daily among all shoppers to select three shoppers. The shoppers drawn walk through a giant-sized (NXN) board with values at each of the squares on the board. The shoppers must start at square S and finish at square F of the board, by taking steps either to the right, left, down or up (moving diagonally is not allowed) incurring the minimum total. The supermarket manager needs to know the minimum total to go from start to destination to decide the winner of the trolly. required to 1. Write an algorithm to find the minimum total to go from start to finish. Your algorithm should a. Get the size of the board, NxN. b. Read N lines, each of which consisting of N integer values, separated by a single space, representing the value V on each square of the board. c. Calculate the minimum total to go from start to destination and display on the screen. 2. Calculate the time and space complexities of your algorithm. 3. Implement your algorithm using Java code. Sample…arrow_forward
- A lucky draw is organized daily among all shoppers to select three shoppers. The shoppers drawn walk through a giant-sized (NXN) board with values at each of the squares on the board. The shoppers must start at square S and finish at square F of the board, by taking steps either to the right, left, down or up (moving diagonally is not allowed) incurring the minimum total. The supermarket manager needs to know the minimum total to go from start to destination to decide the winner of the trolly. required to 1. Write an algorithm to find the minimum total to go from start to finish. Your algorithm should a. Get the size of the board, NxN. b. Read N lines, each of which consisting of N integer values, separated by a single space, representing the value V on each square of the board. c. Calculate the minimum total to go from start to destination and display on the screen. 2. Calculate the time and space complexities of your algorithm. 3. Implement…arrow_forwardA lucky draw is organized daily among all shoppers to select three shoppers. The shoppers drawn walk through a giant-sized (NXN) board with values at each of the squares on the board. The shoppers must start at square S and finish at square F of the board, by taking steps either to the right, left, down or up (moving diagonally is not allowed) incurring the minimum total. The supermarket manager needs to know the minimum total to go from start to destination to decide the winner of the trolly. required to: 1. Write an algorithm to find the minimum total to go from start to finish. Your algorithm should Get the size of the board, NxN. Read N lines, each of which consisting of N integer values, separated by a single space, representing the value V on each square of the board. Calculate the minimum total to go from start to destination and display on the screen.arrow_forwardAfter college, a group of students of a certain height planned to go to the movies. The cinema they go to is quite unique because the number of cinema rows is always 2 and the number of seats is as many as the number of students. Because this is a unique cinema, the way they sit is also unique. They will try to minimize their height difference with the one next to it so that the biggest height difference of each pair of students next to each other is as minimal as possible. Example: There are 6 students with height of 1, 6, 9, 7, 2, and 3. There are various sequences that can produce the biggest difference in height. Ordering 1:1 3 62 7 9Difference 1 and 3 is 2.Difference 3 and 6 is 3.Difference 2 and 7 is 5.Difference 7 and 9 is 2.So the biggest difference in height is 5. Ordering 2:1 3 26 7 9The biggest difference in height is 2.This difference is also an optimal answer. Format Input : There are T test cases. Each testcase contains integers N which indicates the number of students…arrow_forward
- Computer Science Investing in stocks is a way to create assets that are supposed to provide financial security over time. In solving this problem, we assume that an investor buys several shares of stock at a certain price. These shares are going to be sold later on for a different price. Obviously, if the selling price is higher than the acquisition price, the investor makes a profit, registering capital gain. If the shares are sold at a lower price, the investor has a loss, which marks a negative capital gain. This whole process is done over a period of time, and you are required to create a scenario for buying and selling shares. The assumption is that the investor sells shares in the order in which they were purchased. The goal is to calculate the capital gain over time. Suppose that you buy n shares of stock or mutual fund for d dollars each. Later, you sell some of these shares. If the sale price exceeds the purchase price, you have made a profit—a capital gain. On the other…arrow_forwardCorrect answer will be upvoted else downvoted. 2k groups take an interest in a season finisher competition. The competition comprises of 2k−1 games. They are held as follows: as a matter of first importance, the groups are parted into sets: group 1 plays against group 2, group 3 plays against group 4 (precisely in a specific order, etc (thus, 2k−1 games are played in that stage). At the point when a group loses a game, it is wiped out, and each game outcomes in disposal of one group (there are no ties). From that point onward, just 2k−1 groups remain. If by some stroke of good luck one group remains, it is pronounced the hero; in any case, 2k−2 games are played: in the first of them, the champ of the game "1 versus 2" plays against the victor of the game "3 versus 4", then, at that point, the victor of the game "5 versus 6" plays against the champ of the game "7 versus 8, etc. This cycle rehashes until just one group remains. Input :The principal line contains one integer k…arrow_forwardBus timetables specify to the second the exact arrival and departure time of each bus on each stop. You need to pay for the full fare of every bus you ride and different bus lines charge different fees , but they are flat fees (independent of distance travelled on the line) A travel plan is a sequence of stop-time pairs where stop is a location of a bus stop and time is when we arrive at that stop. The plan is feasible if for any two consecutive pairs (a, t) and (b, t′) in the plan there exists a bus that departs after t and arrives at b at exactly t′. That is, a travel plan does not allow us to walk between stops. Assuming that no two buses arrive at the same time at the same stop, a feasible plan uniquely identifies the bus lines that we need to take to realize the plan. The cost of the plan is the sum of the fares we need to pay. Your task is to design an efficient algorithm that given a departure time t, an arrival time t′, an origin stop a and a destination stop b, finds the…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Operations Research : Applications and AlgorithmsComputer ScienceISBN:9780534380588Author:Wayne L. WinstonPublisher:Brooks Cole
Operations Research : Applications and Algorithms
Computer Science
ISBN:9780534380588
Author:Wayne L. Winston
Publisher:Brooks Cole
Python Tutorial #10; Math Functions in Python; Author: Art of Engineer;https://www.youtube.com/watch?v=OviXsGf4qmY;License: Standard YouTube License, CC-BY