subject
Mathematics, 21.04.2020 22:21 MogTaee

We're looking at the price of a given stock over n consecutive days, numbered i = 1,2, …, n. For each day i, we have a price p(i) per share for the stock on that day. (We'll assume for simplicity that the price was fixed during each day.) We'd like to know: How should we choose a day i on which to buy the stock and a later day j > i on which to sell it, if we want to maximize the profit per share, p(j) - p(i)? (If there is no way to make money during the n days, we should conclude this instead.) In the solved exercise, we showed how to find the optimal pair of days i and j in time O(n log n). But, in fact, it's possible to do better than this. Show how to find the optimal numbers i and j in time O(n).

ansver
Answers: 3

Another question on Mathematics

question
Mathematics, 21.06.2019 18:30
10% of 1,900,000. show me how you got the answer
Answers: 2
question
Mathematics, 21.06.2019 21:00
How do you write y-10=2 (x-8) in standard form
Answers: 1
question
Mathematics, 21.06.2019 21:30
Acoffee shop orders at most $3,500 worth of coffee and tea. the shop needs to make a profit of at least $1,900 on the order. the possible combinations of coffee and tea for this order are given by this system of inequalities, where c = pounds of coffee and t = pounds of tea: 6c + 13t ≤ 3,500 3.50c + 4t ≥ 1,900 which graph's shaded region represents the possible combinations of coffee and tea for this order?
Answers: 1
question
Mathematics, 21.06.2019 23:00
Acaterer knows he will need 60, 50, 80, 40 and 50 dinner napkins on five successive evenings. he can purchase new napkins initially at 25 cents each, after which he can have dirty napkins laundered by a fast one-day laundry service (i.e., dirty napkins given at the end of the day will be ready for use the following day) at 15 cents each, or by a slow two-day service at 8 cents each or both. the caterer wants to know how many napkins he should purchase initially and how many dirty napkins should be laundered by fast and slow service on each of the days in order to minimize his total costs. formulate the caterer’s problem as a linear program as follows (you must state any assumptions you make): a. define all variables clearly. how many are there? b. write out the constraints that must be satisfied, briefly explaining each. (do not simplify.) write out the objective function to be minimized. (do not simplify.)
Answers: 1
You know the right answer?
We're looking at the price of a given stock over n consecutive days, numbered i = 1,2, …, n. For eac...
Questions
question
Mathematics, 22.02.2021 08:40
question
Mathematics, 22.02.2021 08:40
question
World Languages, 22.02.2021 08:40
question
Mathematics, 22.02.2021 08:40
Questions on the website: 13722367