Operations Research : Applications and Algorithms
4th Edition
ISBN: 9780534380588
Author: Wayne L. Winston
Publisher: Brooks Cole
expand_more
expand_more
format_list_bulleted
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
A library must build shelving to shelve 200 4-inch high books, 150 8-inch high books, 300 10-inch high books and 180 12-inch high books. Each book is 0.5 inch thick. The library has several ways to store the books. For example, an 8-inch high shelf may be built to store all books of height less than or equal to 8 inches, and a 12-inch high shelf may be built for the 12-inch books. Alternatively, a 12-inch high shelf might be built to store all books. The library believes it costs $2,300 to build a shelf and that a cost of $5 per square inch is incurred for book storage. (Assume that the area required to store a book is given by height of storage area times book’s thickness.) Formulate and solve a shortest-path problem that could be used to help the library determine how to shelve the books at minimum cost. (Hint: Have nodes 0, 4, 8, 10 and 12, with cij being the total cost of shelving all books of height >i and ≤ j on a single shelf.)
Python Knapsack Problem: imagine you are carrying a knapsack with capacity to hold a total of weight C. You are selecting among n items with values A={a_1, a_2, ... , a_n} and associated weights W={w_1, w_2, ... , w_n}. Here the weights and values are all positive. You wish to maximize the total value of the items you select not exceeding the given weight capacity, example, maximize sum_{a in A} such that sum_{w in W} <= C. Note that you can only select your items once.
Reformulate this as a bottom-up dynamic programming problem as follows. Define K_{i,j} as the highest possible value sum considering items 1 through i and total weight capacity j (j <= C). What is the base case i.e. K_{0,j} for all j and K_{i,0} for all i. What is the loop statement?
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…
Chapter 8 Solutions
Operations Research : Applications and Algorithms
Knowledge Booster
Similar questions
- A chest of drawers, also called a dresser or a bureau, is a type of cabinet that has multiple parallel, horizontal drawers generally stacked one above another (See Figure 1). Each drawer has a lock to secure any property inside, but sometimes a drawer may not be secure even when it is locked. For instance, imagine a scenario where the second drawer from the top is locked, but the top drawer is not. In such a case, a burglar can access the second drawer by opening the top drawer and gaining access to the property inside the second drawer. Given the number of drawers, n, and the number of secure drawers, k. You can assume that nk. Write an O (nk) algorithm to find a number of ways to ensure that exactly k drawers are secure. For example, the number of drawers n = 6, and number of secure drawers k = 4. The output is 6 (ULLLLL, LULLLL, LLULLL, LLLULL, LLLLUL, and LLLLUU). FIGURE 1. Chest of Drawersarrow_forwardSudoku is a popular logic puzzle that uses a 9 by 9 array of squares that are organized into 3 by 3 subarrays. The puzzle solver must fill in the squares with the digits 1 to 9 such that no digit is repeated in any row, any column, or any of the nine 3 by 3 subgroups of squares. Initially, some squares are filled in already and cannot be changed. For example, the following might be a starting configuration for a Sudoku puzzle: Create a class SudokuPuzzle.java Download SudokuPuzzle.java that has the attributes • board—a 9 by 9 array of integers that represents the current state of the puzzle, where 0 indicates a blank square • start—a 9 by 9 array of boolean values that indicates which squares in board are given values that cannot be changed and the following methods: • SudokuPuzzle—a constructor that creates an empty puzzle • toString—returns a string representation of the puzzle that can be printed • addInitial(row, col, value)—sets the given square to the given value as an…arrow_forwardA hardware store is selling steel rods of various lengths. However, customers sometimes want to buy rods that the store doesn't carry. For example, if the store only carries 10cm and 30cm rods and a customer wants to buy a 25cm rod, then the order cannot be fulfilled. To boost sales, the store has come up with an idea to weld two rods together to make a longer rod. For example, if the store only carries 3cm and 5cm rods and a customer wants to buy a 8cm rod, then the order can be fulfilled by welding together 3-cm and 5-cm rods. Since rod welding can compromise the strength, the store will only weld up to TWO rods together. More precisely, this means, an order for x cm can be fulfilled if there is a single rod of length x or there are two rods (potentially of the same length) whose combined length is x. Your Task: Write a function process Orders (orders: List[int], sizes:List[int]) -> List[bool] to determine whether or not each of the given orders can be fulfilled. Here, orders is a…arrow_forward
- In stores, boxes should be placed in an organized way otherwise it will be messy. Given a collection of boxes, it is requested to place them on top of each other to reach the minimum possible height. There is a condition, where a box cannot be placed on top of another box unless the area of its 2D base is smaller or equal of the 2D base of the lower box. It is allowed to rotate any box to use any two sides as its base. For example, consider below 4 boxes where each box has the following dimensions Input: Box 1: (2,1,3), Box 2:(6,3,8) Box 3: (4,2,5), Box 4:(3,1,6), Output: From bottom to top as follows: In the bottom → Box 2 on the base (6,8) and height 3, On top of it → Box 3 on the base (4,5) and height 2, Then → Box 4 on the base (6,3) and height 1, Finally → Box 1 on the base (2,3) and height 1. The total height is 7 [Explanation: as we can see that the first box in the bottom is the box 2 with base 6x8 and height 3, then box3 with base 4x5 and height 2, and so on. This arrangement…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_forwardA typical roulette wheel used in a casino has 38 slots that are numbered 1,2,3,....,36,0,00, respectively. Half of the remaining slots are red and half are black. Also, half of the integers between 1 and 36 inclusive are odd, half are even, and 0 and 00 are defined to be neither odd nor even. A ball is rolled around the wheel and ends up in one of the slots; we assume each slot has equal probability of 1/38, and we are interested in the number of the slot into which the ball falls. (a)Define the Sample space S. (b)Let A = {0,00}. Give the value of P(A). (c) Let B = {14,15,17 18}. Give the value of P(B). (d) Let D = {x:x is odd}. Give the value of P(D).arrow_forward
- In a candy store, there are N different types of candies available and the prices of all the N different types of candies are provided to you. You are now provided with an attractive offer. You can buy a single candy from the store and get at most K other candies ( all are different types ) for free. Now you have to answer two questions. Firstly, you have to find what is the minimum amount of money you have to spend to buy all the N different candies. Secondly, you have to find what is the maximum amount of money you have to spend to buy all the N different candies. In both the cases you must utilize the offer i.e. you buy one candy and get K other candies for free. Example 1: Input: N = 4 K = 2 %3D candies[] = {3 2 1 4} Output: 3 7arrow_forwardProblem You have a fence post located at the point (x,y) where a goat is tethered by a rope. You also have a house, which is a rectangle with diagonally opposite corners at the points bottom-left: (x1,y1) and top-right: (x2,y2). You want to pick a length of rope that guarantees the goat cannot reach the house. Determine the minimum distance from the fence post to the house, so that you can make sure to use a shorter rope. Recall that the distance formula is: (x2−x1)2+(y2−y1)2 The input consists of a single line containing six space-separated integer values: x, y, x1, y1, x2, and y2. You are guaranteed that x1<x2 and y1<y2, and that (x,y) is strictly outside the axis-aligned rectangle with corners at (x1,y1) and (x2,y2). Return the minimum distance from the goat’s post to the house as a floating-point value from main(). Learning Objectives Be able to create a program with a lesser template. Be able to calculate the min/max of integers. Be able to write a mathematical…arrow_forwardA Rajesh teaches a cooking class. The course is attended by NN students, numbered 11 to NN. The cook must participate in the presence before each class, i.e. call out the names of the students one by one and indicate which students are present. Each student has a first and last name. To save time, Rajesh only wants to call up students' first names. However, if there are multiple students with the same first name, the Rajesh must call out the full names (first and last names) of all those students. For any student who does not share a first name with any other student, the cook can still only call that student's first name. Help the Rajesh decide for each student whether to call that student's full name or just their first name. Note: Please Answer in java language only. Input 1 1 hasan jaddouh Output hasanarrow_forward
- A hungry mouse wants to eat all four fruits in a maze such as the one below, in as few moves as possible.. At each turn the mouse can move any number of squares in one of the directions up, down, left or right, but it is not allowed to enter (or jump over) any walls (i.e., the black squares). Thus, the mouse moves just like a rook in chess. To eat a fruit, the mouse has to stop at that square. Assume that the maze has 4 fruits, and the size of b xh squares. 1. Give a suitable representatión of the states in this searching problem. 2. How many possible actions can the mouse perform at each move? (1.e., what is the branching factor?)arrow_forwardIn stores, boxes should be placed in an organized way otherwise it will be messy. Given a collection of boxes, it is requested to place them on top of each other to reach the minimum possible height. There is a condition, where a box cannot be placed on top of another box unless the area of its 2D base is smaller or equal of the 2D base of the lower box. It is allowed to rotate any box to use any two sides as its base. a) Describe how a brute-force approach algorithm would solve the above problem , and explain its complexity b) Design an algorithm to solve the above scenario for N boxes. [The efficiency of your algorithm is the main driver of the mark], and analyze the complexity of your solution. [full explanation of your answer should be provided]c) Develop a python code to implement your efficient algorithm. d) Prepare a brief report (250 words) comparing the two algorithmsarrow_forwardA computer science professor has bought his two children a box of raisin cookies for thanksgiving. The number of raisins in the cookies is not evenly distributed and each cookie can have as many raisins in it. The children love raisins very much and when they open the box they fight over having as many raisins possible. They do not care about the number of cookies they have but rather the total number of raisins they collected. They are not happy with what they have collected, because each of them thinks the other one has more raisins. So they come back to their father for help. The professor comes up with a dynamic programming algorithm to find whether it is possible to, without breaking any cookie, assign all of them to his children where each gets an equal number of raisins. As mentioned it is not important if one of them gets more cookies. The total number of raisins is T and the total number of cookies is n. Write down a dynamic programming algorithm with O(nT) time complexity…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 ColeC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningC++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr
Operations Research : Applications and Algorithms
Computer Science
ISBN:9780534380588
Author:Wayne L. Winston
Publisher:Brooks Cole
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr