Potential method for amortized analysis

Поділитися
Вставка
  • Опубліковано 30 вер 2024

КОМЕНТАРІ • 9

  • @SupanthaPandit-xs6lf
    @SupanthaPandit-xs6lf 3 місяці тому

    Can you please provide the slides?

    • @algorithmslab
      @algorithmslab  3 місяці тому

      the slides are the second half of the following: github.com/kbuchin/slide-archive/blob/main/advanced-algorithms-2024/02-Amortized-Analysis.pdf

  • @ShakrinJahanMozumder
    @ShakrinJahanMozumder 7 місяців тому

    Could you please give me an idea, how the base-3 counter amortized cost will be calculated here?
    I am getting, Ci = 2, Potential change = 2. So, amortized cost = 4. Is it okay?

    • @algorithmslab
      @algorithmslab  7 місяців тому +1

      This doesn't quite work, because Ci might not be constant.
      The first question you need to do is to define an appropriate potential function. For the binary counter it was the number of 1s, but here it has to look different (Hint: It has to involve the number of 2s. It can also involve the number of 1s.) c_i is the actual cost. Just like for the binary counter, this may vary, i.e., it is not necessarily constant. The trick then is (again like for the binary counter) to make sure to have defined the potential function in such a way, that whenever the counter has to change many digits, that then the potential drops by a similar number. This is a nice exercise.

  • @vsvg3
    @vsvg3 Рік тому

    Heyy, thanks for this! Great work!

  • @gawadahmed3722
    @gawadahmed3722 8 місяців тому

    you are a legend!

  • @kimjaeyoon366
    @kimjaeyoon366 10 місяців тому

    thank u so much

  • @telan3467
    @telan3467 Рік тому

    This is fantastic

  • @ShakrinJahanMozumder
    @ShakrinJahanMozumder 7 місяців тому

    Thanks!