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 19:30
Are triangles the congruent? write the congruency statement.what is the congruency that proves they are congruent? what is the perimeter of ∆pqr?
Answers: 1
question
Mathematics, 21.06.2019 20:00
How long does it take natsumi to clean up after she is done? table: .area time30. 245. 2.7560. 3.5
Answers: 2
question
Mathematics, 21.06.2019 20:30
The graph of a hyperbola is shown. what are the coordinates of a vertex of the hyperbola? (0, −4) (−3, 0) (0, 0) (0, 5)
Answers: 1
question
Mathematics, 21.06.2019 21:00
Which expressions are equivalent to -7+3(-4e-3)? choose all answers that apply: choose all answers that apply: a -4(3e+4)? 4(3e+4) b 12e12e c none of the above
Answers: 2
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
Biology, 22.06.2021 18:30
question
Mathematics, 22.06.2021 18:30
question
Mathematics, 22.06.2021 18:30
question
Mathematics, 22.06.2021 18:30
question
Mathematics, 22.06.2021 18:30
Questions on the website: 13722363