5. Amortization: Amortized Analysis

แชร์
ฝัง
  • เผยแพร่เมื่อ 3 มี.ค. 2016
  • MIT 6.046J Design and Analysis of Algorithms, Spring 2015
    View the complete course: ocw.mit.edu/6-046JS15
    Instructor: Erik Demaine
    In this lecture, Professor Demaine introduces analysis techniques for data structures, and the implementation of algorithms based on this analysis.
    License: Creative Commons BY-NC-SA
    More information at ocw.mit.edu/terms
    More courses at ocw.mit.edu

ความคิดเห็น • 48

  • @emmafoley8987
    @emmafoley8987 4 ปีที่แล้ว +21

    The best explanation of potential amortization I've found!

  • @alexandrebrownAI
    @alexandrebrownAI ปีที่แล้ว +29

    Timestamps:
    - 0:20 : Introduction, Usefulness of Amortized Analysis
    - 1:41 : Table Doubling Problem with Intuition on Amortized Cost
    - 5:42 : Aggregate Method
    - 7:18 : General Definition of Amortized Bounds
    - 14:02 : Accounting Method
    - 22:22 : Table Doubling Problem using Accounting Method
    - 27:57 : Charging Method
    - 31:00 : Table Doubling Problem using Charging Method
    - 42:11 : Potential Method
    - 48:52 : Binary Counter Problem using Potential Method
    - 56:00 : Insert in 2-3 Trees using Potential Method
    - 1:04:21 Insert & Delete in 2-5 Trees using Problem Method

  • @imprsnt
    @imprsnt 8 ปีที่แล้ว +57

    Load Factor = number of Elements / Size of table = n / m.

    • @samiere
      @samiere 6 ปีที่แล้ว +1

      referencing @2:30

    • @dylancutler1978
      @dylancutler1978 5 ปีที่แล้ว

      I was wondering about that. In his analysis table doubling would have increased the runtime complexity, this makes more sense.

    • @alisalloum2005
      @alisalloum2005 3 ปีที่แล้ว +1

      You saved my life

    • @Jayveersinh_Raj
      @Jayveersinh_Raj 3 ปีที่แล้ว

      @@alisalloum2005 Helloo Buddy!! XD

    • @gshengelaia2001
      @gshengelaia2001 2 ปีที่แล้ว +1

      so there is an error in the video right?

  • @pistachios2463
    @pistachios2463 4 ปีที่แล้ว +14

    41:41 potential method

    • @hamiltonchevez8114
      @hamiltonchevez8114 4 ปีที่แล้ว

      literally came here for this, thanks

    • @flo7968
      @flo7968 3 ปีที่แล้ว

      thank you so much haha

  • @forthrightgambitia1032
    @forthrightgambitia1032 3 ปีที่แล้ว +2

    Interesting, I studied B-trees at uni and they presented the 2, 5 tree without justification of those numbers. But here it is.

  • @DenisG631
    @DenisG631 7 ปีที่แล้ว +17

    11:51 But that's not entirely true, since you can "try" removing an item, which is not in the tree, which will still cost O(logN) in order to look for the item, which is missing.
    Correct me if I'm wrong

    • @MrLala12321
      @MrLala12321 7 ปีที่แล้ว +7

      It's possible the log(n) is referring to the rebalancing of the tree(which wouldn't happen if the element didn't exist) and not the searching for the element. Otherwise you're correct.

  • @rohitnagare7634
    @rohitnagare7634 2 ปีที่แล้ว +5

    14:02 Accounting method

  • @user-tk2jy8xr8b
    @user-tk2jy8xr8b 5 ปีที่แล้ว +6

    I got the idea of amortization in general, but these coins are totally weird. Why the heck do we charge back in time only once per insertion?

    • @junzhai1715
      @junzhai1715 3 ปีที่แล้ว

      as long as the coin value is constant, O(1), it is fine, not necessary "once", could be 2,3,4...
      The point is that the cost of copying n elements charges 2 * n/2. we can save those n/2 coins with value 2 during each of the n/2 element's insertion.
      In contrast, we cannot save coins with value O(n), because that will make the insertion not O(1) anymore.

  • @hritikzurange
    @hritikzurange 9 หลายเดือนก่อน +1

    thanks for the charging method, makes life much easier :)

  • @avoriginal9342
    @avoriginal9342 หลายเดือนก่อน

    so for the accounting method you are adding 2 coins for each insertion, 1 insertion costs 1 coin and you store one to be able to pay for the deletion?

  • @chaitrakeshav
    @chaitrakeshav 3 ปีที่แล้ว

    This is too good!

  • @puffvayne5688
    @puffvayne5688 2 ปีที่แล้ว +2

    Potential Method 42:20

  • @ChadieRahimian
    @ChadieRahimian 7 ปีที่แล้ว +12

    This is the only data structure lecture of MIT, I didn't understand a word of :((

    • @ChadieRahimian
      @ChadieRahimian 7 ปีที่แล้ว

      I have. Even all the other lectures of 6.046.

    • @TroyWhorten
      @TroyWhorten 7 ปีที่แล้ว +1

      Chapter 17 from CLRS? The potential method in particular was pretty fuzzy for me from just the lecture but the description in the book really brought it together.

    • @ChadieRahimian
      @ChadieRahimian 7 ปีที่แล้ว

      Troy Whorten yeah I'm having a hard time understanding the concept of amortization. I guess I need to go through that chapter of the book couple more times 😁

    • @miro-miro-on-the-wall
      @miro-miro-on-the-wall 6 ปีที่แล้ว +27

      oof get out of here with your misogynistic bs

  • @radred3662
    @radred3662 ปีที่แล้ว +2

    shoutouts to any students at uvic cramming for an exam right now

    • @intrinsic9585
      @intrinsic9585 3 หลายเดือนก่อน +2

      🙏

    • @wetbarofsoap
      @wetbarofsoap 3 หลายเดือนก่อน +1

      shoutout to sajin

  • @JuanSanchez-yi1wn
    @JuanSanchez-yi1wn 4 ปีที่แล้ว +1

    At 39:00 Can I use this for Crypto asset valuation? Specifically BTC since BTC white papers solves double spending problem

    • @bhavyagor5366
      @bhavyagor5366 ปีที่แล้ว

      hey pls connect with me, i have a serious blockchain project to make

  • @arno.claude
    @arno.claude ปีที่แล้ว

    11:08 why did he throw that frisbee? :D is it a reward for answering a question correctly? :D

  • @puffvayne5688
    @puffvayne5688 2 ปีที่แล้ว

    Why there are chalks on my face?

  • @sydneystriker5355
    @sydneystriker5355 5 ปีที่แล้ว +1

    The last lecture was so hard that this lecture seemed piece of cake. :)

  • @jawoo2228
    @jawoo2228 ปีที่แล้ว

    huhuhhh, yeahhhhh... Mr Van Driessen's cool...

  • @volkankaln4713
    @volkankaln4713 3 ปีที่แล้ว

    This lecture makes me smell chalk.

  • @radhekrishanrathod9001
    @radhekrishanrathod9001 5 ปีที่แล้ว +1

    why they are not using marker

  • @Sacheess
    @Sacheess 3 ปีที่แล้ว +3

    51:44 does he give frisbees for answers? So fucking cool.

    • @LegolasSmith
      @LegolasSmith 3 ปีที่แล้ว

      i think its like an "extra grade token"

  • @shivanshpachauri2855
    @shivanshpachauri2855 3 ปีที่แล้ว

    i feel Eric to be too less energetic in this video.

  • @thinkweb2
    @thinkweb2 4 ปีที่แล้ว +5

    I love Eric's explanations but this one felt way too theoretical. I wish he started with examples and used these techniques before diving into nitty gritty.

  • @luojihencha
    @luojihencha 4 ปีที่แล้ว +1

    I feel I am so stupid...

  • @hossein_haeri
    @hossein_haeri 4 ปีที่แล้ว +9

    Misleading words... Hard to get the core concept... I kinda think those people sitting there already knew the concept which is no surprise at MIT!

  • @ChrisLeeX
    @ChrisLeeX 7 ปีที่แล้ว +6

    25:15 Not the correct conclusion.

  • @ChrisLeeX
    @ChrisLeeX 7 ปีที่แล้ว +6

    40:27 That example went nowhere.

  • @es8336
    @es8336 2 หลายเดือนก่อน

    i dont understand shit i fucking hate computer science

  • @sudipandatta5371
    @sudipandatta5371 4 ปีที่แล้ว

    this is the most boring lecture of mit