Maximize the profit without spending

Assignment Help Basic Computer Science
Reference no: EM131932063

In this "investment" problem, you are given $T, which is the total amount you can invest on n different products. Product x (x is a number between 0 and n-1) has a cost, c[x] and a profit p[x]. The goal is to maximize the profit without spending more than $T.

Example: Product A B C D

Cost 24 10 10 7

Profit 24 18 18 10

If T = 24, the best investment is to spend $20 (out of $24) to buy products B and C and make $36 (18+18) in profit. The API of your program looks like this:

def invest(T, Costs, Profits):

#return a number, which is the best profit you can make.

Reference no: EM131932063

Questions Cloud

What is the minimum after-tax rate of return on investments : Action Inc. has $80 million in debt and 60% of its capital structure consists of common equity. The firm has no preferred stock.
Determining the string in the language : The letter A, the letter B, the letter C followed by a string that is in the language, and the letter D followed by a string in the language.
What effect would it have on next year earnings : What effect would it have on next year's earnings? What effect would it have on next year's earnings?
Identify three potential violations of the false claims act : Identify at least three potential violations of the False Claims Act. Be sure to support your assertion with facts from the case and what you've learned.
Maximize the profit without spending : Product x (x is a number between 0 and n-1) has a cost, c[x] and a profit p[x]. The goal is to maximize the profit without spending more than $T.
What should be the price of bond : Your investment advisor has told you that the yield-to-maturity on this bond is 6.5%. What should be the price of this bond?
Calculate the amount in your bank account : At the end of each year for 20 years, you make a deposit into a bank account which pays 3% annual effective interest. The deposit is $100 at the end of.
Explain important suggestions from the plan you select : Write a 2-page paper on three or four of the most important suggestions from the plan you select.
Calculate the sum of all the numbers : Every C function is required to pass two numbers to the function and calculate the sum of all the numbers between them (both inclusive).

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd