Блог пользователя 10pullupsin2019

Автор 10pullupsin2019, история, 10 лет назад, По-английски

In this problem many did binary search and calculated the value of the function and stored the values in doubles and compared the results.

Shouldn't there be precision errors? As you are multiplying something with like (1.99999)^100?

  • Проголосовать: нравится
  • +4
  • Проголосовать: не нравится

»
10 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Also why is the polynomial an increasing function? Because xy is greater than xy + 1 for x < 1.

»
10 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

If you directly try to find the value of (1.99999)^100 then it is not possible. So, what we can do is divide the whole equation by the highest power of (1+r) so that (1+r)^x for all x is in the denominator. Now we can define a variable denom = 1/(1+r) and if we do denom/=(1+r) for x times then it is equivalent to 1/((1+r)^x). We can use this value with the corresponding cost values.