Design an algorithm to solve the given problem. Submit an implementation for this algorithm in C++,...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Design an algorithm to solve the given problem. Submit an implementation for this algorithm in C++, PHP or Python. Indicate the runtime of your solution. A large wholesale company, Jewels And Gemstones - Upscale And Restricted, has developed an odd way of selling their merchandise to jewelers. JAGUAR's employees carefully shape their gemstones so that each stone of the same type is precisely the same weight and market value. Then they mix together all of the different types of gemstones and pour some into each of a series of strong lead caskets. The caskets are each tightly sealed (in a way that prevents them from being opened surreptitiously) and then taken to auction. Jewelers attending the auction are told the types of stones that went into the mixture in the caskets, but when bidding on any one casket, they are told only the total weight of the gemstones in it and nothing about the composition. JAGUAR obviously hopes to benefit from jewelers overbidding on caskets of lower value. One local jeweler, Bartholomew Tempilken ("That's my real name," he assured you at your first meeting with him. "No pun intended.") has had a few costly purchasing experiences at JAGUAR's auctions and wants to be prepared next time. He has hired you write a program that calculates the minimum value of some casket, based on weight and data about stones in the mixture. Mr. Tepilken plans to bid exactly the minimum possible value for each casket, so he is guaranteed at least not to overpay and maybe even be surprised with a more valuable collection than expected. Write a function minimumCasket Value that accepts two arrays - one with gemstone weights (in milligrams), one with gemstone values (in Swedish kronor) - and a number indicating total weight of the gemstones in the casket. You may assume that all input values are integers. Calculate and return the minimum market value of the stones. Based on the company's long established patterns of fairness and honesty (despite their unusual sales approach), you may assume in your program that the total weight is possible, given the weights of gemstones potentially included. For full points, your solution must implement a dynamic programming approach. Partial credit may be given for correct but less efficient solutions. Design an algorithm to solve the given problem. Submit an implementation for this algorithm in C++, PHP or Python. Indicate the runtime of your solution. A large wholesale company, Jewels And Gemstones - Upscale And Restricted, has developed an odd way of selling their merchandise to jewelers. JAGUAR's employees carefully shape their gemstones so that each stone of the same type is precisely the same weight and market value. Then they mix together all of the different types of gemstones and pour some into each of a series of strong lead caskets. The caskets are each tightly sealed (in a way that prevents them from being opened surreptitiously) and then taken to auction. Jewelers attending the auction are told the types of stones that went into the mixture in the caskets, but when bidding on any one casket, they are told only the total weight of the gemstones in it and nothing about the composition. JAGUAR obviously hopes to benefit from jewelers overbidding on caskets of lower value. One local jeweler, Bartholomew Tempilken ("That's my real name," he assured you at your first meeting with him. "No pun intended.") has had a few costly purchasing experiences at JAGUAR's auctions and wants to be prepared next time. He has hired you write a program that calculates the minimum value of some casket, based on weight and data about stones in the mixture. Mr. Tepilken plans to bid exactly the minimum possible value for each casket, so he is guaranteed at least not to overpay and maybe even be surprised with a more valuable collection than expected. Write a function minimumCasket Value that accepts two arrays - one with gemstone weights (in milligrams), one with gemstone values (in Swedish kronor) - and a number indicating total weight of the gemstones in the casket. You may assume that all input values are integers. Calculate and return the minimum market value of the stones. Based on the company's long established patterns of fairness and honesty (despite their unusual sales approach), you may assume in your program that the total weight is possible, given the weights of gemstones potentially included. For full points, your solution must implement a dynamic programming approach. Partial credit may be given for correct but less efficient solutions.
Expert Answer:
Answer rating: 100% (QA)
Code def minimumCasketValueweights values totalweight n lenweights dp floatinf totalweight 1 dp0 ... View the full answer
Related Book For
Introduction To Materials Management
ISBN: 978-9386873248
8th edition
Authors: Arnold J. R. Tony, Gatewood Ann K., M. Clive Lloyd N. Chapman Stephen
Posted Date:
Students also viewed these programming questions
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
You are working in internal affairs, and in the course of another investigation, you discover disturbing evidence regarding the police chief's son, who is also an officer in the department. Several...
-
The extraction process shown Figure 8.47 is conducted without extract or raffinate reflux. Feed F' is composed of solvent and solute, and is an extract-phase feed. Feed F'' is composed of unextracted...
-
The primary argument of the classical school of criminology is that offenders commit crimes due to rational choice. As discussed in the "Classical School of Criminology". If the risks are low and the...
-
Explain the matching principle in relationship to recording bad debts expense.
-
A reaction turbine has a degree of reaction \(50 \%\) (i.e., Parson's reaction turbine) and running at \(500 \mathrm{rpm}\) develops 8 MW using \(10 \mathrm{~kg} / \mathrm{kWh}\) of steam flow rate....
-
Penny Cassidy is considering forming her own pool service and supply company, Penny's Pool Service & Supply Inc. (PPSS). She has decided to incorporate the business to limit her legal liability. She...
-
Sample Company Account Question You are provided with the trial balance of Twirl Ltd. as at 31st December 2019: Bank 78,000 Ordinary shares at 1 each Retained earnings at 1st January 2019 216,000...
-
A steel company is producing steel for a new contract. The contract specifies the information in the following table for the steel. The steel company mixes batches of eight different available...
-
Carry out a simulation experiment using EXCEL to study the sampling distribution of X when the population distribution is Weibull with a = 2 and B = 5. Consider the sample size n=5 for 500...
-
The plastic material placed in front of a lighting instrument to produce colored light is called Group of answer choices a gobo. shutters. a gel. a wrap.
-
Vapocoolant sprays work on the principle of: (b) Convection (d) Evaporation (a) Conduction (c) Radiation.
-
A skier with a mass of 73 kg is sliding down a snowy slope that makes an angle of 40.0 degrees with the horizontal. Find the coefficient of kinetic friction if the friction is known to be 57.0 N. Mk=...
-
Problem 3: n = 2.7 moles of an ideal gas are pumped into a chamber of volume V = 0.085 m. Randomized Variables n = 2.7 moles V=0.085 m 50% Part (a) The initial pressure of the gas is 1 atm. What is...
-
Two cars, one behind the other, are traveling in the same direction at the same speed. Does either driver hear the other's horn at a frequency that is different from the frequency heard when both...
-
Landscaping project 5. Legal Feasibility: > Registration of the enterprise: > Food related Laws (if any e.g.is license food composition, hygiene and sanitation and food labeling) I want a special...
-
Test whether the 5-year survival rate for breast cancer is significantly different between African American and Caucasian women who are younger than 50 years of age and have localized disease....
-
A company wishes to store the following SKUs so there is 100% accessibility. The items are stored on pallets that can be stacked three high. a. How many pallet positions are needed? b. What is the...
-
If the transit time is 11 days and the annual demand for an item is 10,000 units, what is the average annual inventory in transit?
-
The work center in problem 5.1 is utilized 75% of the time. What are the hours per week actually worked? In problem 5.1 A work center consists of 3 machines each working a 16-hour day for 5 days a...
-
Using Table 14.1 as a guide, do the following: A. Identify a topic for a presentation. B. Write how you could use each type of attention-getter: rhetorical question, vivid example, dramatic...
-
A. Identify a topic for a presentation. B. Write a positioning statement. C. Write a preview statement.
-
Identify a key position that you intend to make during your presentation. Using Table 14.2 as a guide, write out how you could use the PREP (PositionReasonsExamplePosition) method to effectively...
Study smarter with the SolutionInn App