subject

Consider the problem faced by a stockbroker trying to sell a large number of shares of stock in a company whose stock price has been steadily falling in value. It is always hard to predict the right moment to sell stock, but owning a lot of shares in a single company adds an extra complication: the mere act of selling many shares in a single day will have an adverse effect on the price. Since future market prices, and the effect of large sales on these prices, are very hard to predict, brokerage firms use models of the market to help them make such decisions. In this problem, we will consider the following simple model. Suppose we need to sell x shares of stock in a company, and suppose that we have an accurate model of the market: it predicts that the stock price will take the values p1, p2,..., pn over the next n days. Moreover, there is a function f(·) that predicts the effect of large sales: if we sell y shares on a single day, it will permanently decrease the price by f(y) from that day onward. So, if we sell y1 shares on day 1, we obtain a price per share of p1 − f(y1), for a total income of y1 · (p1 − f(y1)). Having sold y1 shares on day 1, we can then sell y2 shares on day 2 for a price per share of p2 − f(y1) − f(y2); this yields an additional income of y2 · (p2 − f(y1) − f(y2)). This process continues over all n days. (Note, as in our calculation for day 2, that the decreases from earlier days are absorbed into the prices for all later days.)

Required:
Design an efficient algorithm that takes the prices p1,..., pn and the function f(·) (written as a list of values f(1), f(2),..., f(x)) and determines the best way to sell x shares by day n. In other words, find natural numbers y1, y2,..., yn so that x = y1 + ... + yn, and selling yi shares on day i for i = 1, 2, . . . , n maximizes the total income achievable.

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 11:00, Lacey9319
The editing of digital photos us about the same level of difficulty as editing an analog photo
Answers: 2
image
Computers and Technology, 23.06.2019 07:30, jackie0833
Which option allows you to view slides on the full computer screen?
Answers: 1
image
Computers and Technology, 23.06.2019 19:00, brittneyrenae7338
This question involves a class named textfile that represents a text file. public class textfile { private string filename; private string filename; private arraylist words; // constructors not shown // postcondition: returns the number of bytes in this file public int filesize() { } // precondition: 0 < = index < words. size() // postcondition: removes numwords words from the words arraylist beginning at // index. public void deletewords(int index, int numwords) { } // precondition: 0 < = index < = words. size() // postcondition: adds elements from newwords array to words arraylist beginning // at index. pub lic voidaddwords(int index, string[] newwords) { } // other methods not shown } complete the filesize() method. the filesize() is computed in bytes. in a text file, each character in each word counts as one byte. in addition, there is a space in between each word in the words arraylist, and each of those spaces also counts as one byte. for example, suppose the words arraylist stores the following words: { mary had a little lamb; its fleece was white as snow. } the filesize() method would compute 4 + 3 + 1 + 6 + 5 + 4 + 6 + 3 + 5 + 2 + 5 as the sum of the lengths of each string in the arraylist. the value returned would be this sum plus 10, because there would also be 10 spaces in between the 11 words. complete the filesize() method below: // postcondition: returns the number of bytes in this file public int filesize() { }
Answers: 1
image
Computers and Technology, 23.06.2019 19:30, sallybob0
What are loans to a company or government for a set amount of time
Answers: 1
You know the right answer?
Consider the problem faced by a stockbroker trying to sell a large number of shares of stock in a co...

Questions in other subjects:

Konu
Mathematics, 28.09.2021 03:10
Konu
Mathematics, 28.09.2021 03:10