Amortized Analysis

  Рет қаралды 87,192

0612 TV w/ NERDfirst

0612 TV w/ NERDfirst

Күн бұрын

Пікірлер: 257
@caseyli5580
@caseyli5580 6 жыл бұрын
More helpful than a 3 hour lecture. Thank you so much! Subscribed.
@NERDfirst
@NERDfirst 6 жыл бұрын
Hello and thank you very much for your comment and support! Very happy to be of help :)
@KongLodden
@KongLodden 2 жыл бұрын
You just managed to explain in 20 minutes, what my professor could not in 2 hours. Best video I've seen on the topic.
@NERDfirst
@NERDfirst 2 жыл бұрын
Hello and thank you very much for your comment! Glad to be of help =)
@MartianPotato
@MartianPotato 2 жыл бұрын
I sincerely appreciate this content! I am taking an online class that is pure textbook reading and it's murderous. This video seriously saved me from hours of pain and suffering.
@NERDfirst
@NERDfirst 2 жыл бұрын
Hello and thank you very much for your comment and support! Very happy to be of help, all the best for your class =)
@victoriajones8969
@victoriajones8969 3 жыл бұрын
I was really struggling with some very dry literature on amortised complexity for my data science degree and this has helped a huge amount. Great work :)
@NERDfirst
@NERDfirst 3 жыл бұрын
Hello and thank you very much for your comment! Very happy to be of help =)
@shashwathbhaskar673
@shashwathbhaskar673 2 жыл бұрын
i had been trying to find good material for this topic and reading for different sources but couldn’t understand anything and then I came across your video and now have no doubts. thanks bro
@NERDfirst
@NERDfirst 2 жыл бұрын
Hello and thank you very much for your comment! Very happy to be of help =)
@madanielmadaniel
@madanielmadaniel 8 жыл бұрын
Dude, thanks a lot ! Your explanations are a zillion time more clearer than the best University professor :)
@NERDfirst
@NERDfirst 8 жыл бұрын
+Daniel Madar Hello and thank you very much for your comment! That's great to hear, that means I've achieved what I've set out to do :)
@stevennery233
@stevennery233 7 жыл бұрын
This was such an excellent video. Thank you
@NERDfirst
@NERDfirst 7 жыл бұрын
You're welcome! Very happy to be of help =)
@TamilSelvan-xf6ut
@TamilSelvan-xf6ut 7 жыл бұрын
OMG this' the best amortized cost analysis lecture I've ever seen
@NERDfirst
@NERDfirst 7 жыл бұрын
Hello and thank you very much for your comment! Glad you liked the video!
@marcc1179
@marcc1179 4 жыл бұрын
The best explanation of these 3 methods on the Internet! I watched a Corsera video but I did not get the point. Your video is more intuitive and clear! Thank you very much!
@NERDfirst
@NERDfirst 4 жыл бұрын
You're welcome! Very happy to be of help =)
@garrettsmith2256
@garrettsmith2256 4 жыл бұрын
I'm studying for finals, and this was SUPER helpful. Thanks!
@NERDfirst
@NERDfirst 4 жыл бұрын
You're welcome! Glad to be of help and all the best for your finals =)
@sinaazartash3566
@sinaazartash3566 4 жыл бұрын
Best video on youtube that explains amortization analysis so far.
@NERDfirst
@NERDfirst 4 жыл бұрын
Hello and thank you very much for your comment! Glad you liked the video =)
@killerdoml7648
@killerdoml7648 3 жыл бұрын
Im so grateful for this video! Thanks for explaining that topic so well. It was kompact, but every important detail was mentioned. Chapeau!
@NERDfirst
@NERDfirst 3 жыл бұрын
You're welcome! Very happy to be of help and I'm glad you found it useful =)
@anabelsa
@anabelsa 6 жыл бұрын
You look so young, and yet you are better at teaching than most professors. THANKS!!!!!!!!
@NERDfirst
@NERDfirst 6 жыл бұрын
Hello and thank you very much for your comment! Really appreciate the kind words! Very happy to be of help =)
@Aiyara_AoC
@Aiyara_AoC 6 жыл бұрын
Wholesome and amazing explanation, thank you ! I finally understand the bank account method which my professor and the MIT 6.046 video failed to make me understand. keep up with the amazing content !
@NERDfirst
@NERDfirst 6 жыл бұрын
Hello and thank you very much for your comment! Very happy to be of help =)
@priyankitanwar3491
@priyankitanwar3491 4 жыл бұрын
I genuinely cannot thank you enough for this! Thanks a lot man, thanks a lot :)
@NERDfirst
@NERDfirst 4 жыл бұрын
You're welcome! Very happy to be of help =)
@justusmzb7441
@justusmzb7441 4 жыл бұрын
Because of Corona my Algorithm & Data-Structure lecture was severely downgraded, and a lot of subjects were not covered... Thanks to you, i can still get some of that knowledge.
@NERDfirst
@NERDfirst 4 жыл бұрын
Hello and thank you very much for your comment! Glad to be able to fill in that role for you =)
@qkunder
@qkunder 4 жыл бұрын
Your example is surprisingly similar to the question I got in my assignment, just worded differently, which helped me to look at it from dynamic array perspective. Thank you a lot!
@NERDfirst
@NERDfirst 4 жыл бұрын
Hello and thank you for your comment! Array expansion is a classic example for amortized analysis, so I'm not surprised! Glad to be of help =)
@pruthvirajjadhav4049
@pruthvirajjadhav4049 4 жыл бұрын
Best explained video ,I searched for shorter videos on this concept but they didn't explain in easy way .I wish I had watch this before❤
@NERDfirst
@NERDfirst 4 жыл бұрын
Hello and thank you for your comment! Very happy to be of help =)
@lee-3-
@lee-3- 3 жыл бұрын
You're better than my professor !!! thank you so much
@NERDfirst
@NERDfirst 3 жыл бұрын
You're welcome! Very happy to be of help =)
@yapchengyee953
@yapchengyee953 6 жыл бұрын
Cool explanation on the intuition of amortized analysis :D the rough idea does helps a lot in the understanding of the topic. Thank you very much
@NERDfirst
@NERDfirst 6 жыл бұрын
You're welcome! Very happy to be of help :) What remains is to apply!
@siddarthathentu689
@siddarthathentu689 4 жыл бұрын
Just amazing. What a great explanation! You just earned a subscriber.
@NERDfirst
@NERDfirst 4 жыл бұрын
Hello and thank you for your comment and support! Glad you liked the video =)
@skittles6486
@skittles6486 5 жыл бұрын
Wow. Wow wow wow wow wow wow wow wow wow wow...... I am speechless. Just speechless. You are a genius. Best video on this topic. I want to give this video 1 million likes.
@NERDfirst
@NERDfirst 5 жыл бұрын
Hello and thank you very much for your comment! Very happy to be of help =)
@abhishekravoor
@abhishekravoor 4 жыл бұрын
This was the far best video on Amortized Analysis. Thanks a ton❤️
@NERDfirst
@NERDfirst 4 жыл бұрын
You're welcome! Very happy to be of help =)
@tessacarstairs5998
@tessacarstairs5998 3 жыл бұрын
thank you! You teach wayyyyy better than my professors do!
@NERDfirst
@NERDfirst 3 жыл бұрын
You're welcome! Very happy to be of help =)
@tessacarstairs5998
@tessacarstairs5998 3 жыл бұрын
@@NERDfirst you are so sweet!!!!
@ahmadfrhn97
@ahmadfrhn97 6 жыл бұрын
i find it amazing when you can explain to me better compared to my lecturer in a 2 hour lecture. and heck most of the example came from your video 🤣 #keepUpTheGoodWork!
@NERDfirst
@NERDfirst 6 жыл бұрын
Hello and thank you very much for your comment! The example given is the most classic example, that's why you'll see it common to a lot of explanations on this topic!
@didar380
@didar380 2 жыл бұрын
This saved me a lot of time. Appreciated!
@NERDfirst
@NERDfirst 2 жыл бұрын
Hello and thank you for your comment! Happy to be of help =)
@elijahsawyers8950
@elijahsawyers8950 7 жыл бұрын
Just subscribed because of this video...it's 100x better than my professor's method of explaining this concept. However, could you please explain how amortized analysis works for deleting elements in a dynamic array?
@NERDfirst
@NERDfirst 6 жыл бұрын
Hello and thank you for your comment! I'm afraid it's not something I've given much thought to so I don't have an answer for you. However, I found something online that may be of use: www.cs.cmu.edu/afs/cs/academic/class/15451-s15/LectureNotes/lecture06/growing-shrinking-table.txt
@Twxwt
@Twxwt 6 жыл бұрын
This is the best video about Amortized Analysis! Thank you
@NERDfirst
@NERDfirst 6 жыл бұрын
Hello and thank you very much for your comment! Very happy to be of help =)
@Kri38
@Kri38 7 жыл бұрын
thank you for making this video. the pace of the video was perfect.
@NERDfirst
@NERDfirst 7 жыл бұрын
You're welcome! Very happy to be of help, and thank you for the feedback! Pacing is something I'm always very unsure about, so I'm glad to know ti worked well for you!
@MinhLe-xk5rm
@MinhLe-xk5rm 5 жыл бұрын
Awesome video on amortized analysis! Thank you!
@NERDfirst
@NERDfirst 5 жыл бұрын
Welcome! Very happy to be of help =)
@natsableyourself
@natsableyourself 5 жыл бұрын
Wow, very well explained. Please, keep them coming!
@NERDfirst
@NERDfirst 5 жыл бұрын
Hello and thank you for your comment! New videos every week =)
@ppydpc
@ppydpc 4 жыл бұрын
Nicely presented! Very clear and well thought-out.
@NERDfirst
@NERDfirst 4 жыл бұрын
Hello and thank you very much for your comment! Glad you liked the video =)
@mikevollenweider3279
@mikevollenweider3279 4 жыл бұрын
Very clear and concise. Thank you!
@NERDfirst
@NERDfirst 4 жыл бұрын
You're welcome! Very happy to be of help =)
@s7887177
@s7887177 3 жыл бұрын
This video is so awesome... save me a bunch of time to study
@NERDfirst
@NERDfirst 3 жыл бұрын
Hello and thank you very much for your comment! Glad you liked the video =)
@firaseljerdy1244
@firaseljerdy1244 5 жыл бұрын
Hello, great video! Just one thing. At minute 7:16, why did we inflate the numbers and forced an expansion? Could have we just done it with out the inflation? Thanks.
@NERDfirst
@NERDfirst 5 жыл бұрын
Hello and thank you for your comment! The inflation starts from 6:30 actually. The reason why we do that is to create a series of additions 1+2+4+8+... instead of having it start as 4. This helps us see the pattern more clearly later on, where the total cost is almost 2x the number of operations (7:23).
@firaseljerdy1244
@firaseljerdy1244 5 жыл бұрын
@@NERDfirst yes sorry I put the time wrong. Okay so this just for demonstration purposes? If we leave it as it is, can we prove that its the double without the inflation? Thanks
@NERDfirst
@NERDfirst 5 жыл бұрын
Hello again! Personally I feel it is more convincing for a proof to start with an array of size one (ie. The "inflated" version as I have shown). Otherwise, you'll have to explain your arbitrary choice of starting array size, and you could be questioned about whether your proof holds true for smaller array sizes. The clearest proof shows that the _worst case time_ (ie. Even if we start with an array of size one), still gives us under 2x number of operations.
@tech-talks-with-ali
@tech-talks-with-ali 5 жыл бұрын
Thanks for your explanations about amortized analysis. It was helpful for me :)
@NERDfirst
@NERDfirst 5 жыл бұрын
You're welcome! Glad to be of help =)
@christianwu8042
@christianwu8042 4 жыл бұрын
Thank you so much! Extremely helpful video!
@NERDfirst
@NERDfirst 4 жыл бұрын
You're welcome! Very happy to be of help =)
@mustafamohammadi5741
@mustafamohammadi5741 5 жыл бұрын
Perfect explanation. Great Job
@NERDfirst
@NERDfirst 5 жыл бұрын
Hello and thank you very much for your comment! Glad you liked the video =)
@lightstrike7466
@lightstrike7466 4 жыл бұрын
finally got that stuff :D my teacher failed explaining it for over a week now xD thx a lot m8!
@NERDfirst
@NERDfirst 4 жыл бұрын
You're welcome! Very happy to be of help =)
@wentingyu6095
@wentingyu6095 2 жыл бұрын
Thank you so much. I finally know the difference between accounting and potential in real examples and know how to calculate them now (cry)
@NERDfirst
@NERDfirst 2 жыл бұрын
You're welcome! Very happy to be of help =)
@seireen938
@seireen938 5 жыл бұрын
Helped me a lot for my upcoming test! Thanks a lot!
@NERDfirst
@NERDfirst 5 жыл бұрын
You're welcome! All the best for your test =)
@Ashmole3
@Ashmole3 2 жыл бұрын
That was very clear. Thank you.
@NERDfirst
@NERDfirst 2 жыл бұрын
You're welcome! Very happy to be of help =)
@TonyPepperoni27
@TonyPepperoni27 3 жыл бұрын
Great explanation! Thank you
@NERDfirst
@NERDfirst 3 жыл бұрын
You're welcome! Glad to be of help =)
@bpglogic
@bpglogic 2 жыл бұрын
Explained it so well. Kudos to you and subscribed:)
@NERDfirst
@NERDfirst 2 жыл бұрын
You're welcome! Very happy to be of help =)
@forrest-forrest
@forrest-forrest 3 жыл бұрын
Wow this is great. Thank you so much!
@NERDfirst
@NERDfirst 3 жыл бұрын
You're welcome! Very happy to be of help =)
@astaragmohapatra9
@astaragmohapatra9 2 жыл бұрын
This was really helpful, thank you
@NERDfirst
@NERDfirst 2 жыл бұрын
You're welcome! Very happy to be of help =)
@mahditalebi1770
@mahditalebi1770 4 жыл бұрын
great explanation! good job sir. very helpful
@NERDfirst
@NERDfirst 4 жыл бұрын
Hello and thank you for your comment! Very happy to be of help =)
@hakan6449
@hakan6449 Жыл бұрын
This helped a lot. Thanks! Initially I didn't want to click on this video because the thumbnail looked bad though. So if you made it better I think it would get more views.
@NERDfirst
@NERDfirst Жыл бұрын
Hello and thank you very much for your comment! I don't usually give a lot of thought to thumbnails, so this is valuable feedback - Could you elaborate more on what was off-putting about it? I'll see what I can do to make it better!
@CasanovaKingpin
@CasanovaKingpin 7 жыл бұрын
awesome video man ...very well explained each and every step .
@NERDfirst
@NERDfirst 7 жыл бұрын
Hello and thank you very much for your comment! Glad you liked the video!
@高板丽奈单推人
@高板丽奈单推人 Жыл бұрын
Bro you are a legend. 😭
@NERDfirst
@NERDfirst Жыл бұрын
Hello and thank you for your comment! Well, I'm glad you liked the video =)
@hedic414
@hedic414 4 жыл бұрын
Thank you for this. So helpful!
@NERDfirst
@NERDfirst 4 жыл бұрын
You're welcome! Very happy to be of help =)
@minh-trungtang7769
@minh-trungtang7769 2 жыл бұрын
omg this deserves a subscribe thanks bro
@NERDfirst
@NERDfirst 2 жыл бұрын
You're welcome! Glad to be of help =)
@samarthsudarshan4868
@samarthsudarshan4868 5 жыл бұрын
Great content!!
@NERDfirst
@NERDfirst 5 жыл бұрын
Thank you very much! Glad you liked the video =)
@sonalipundpal
@sonalipundpal 6 жыл бұрын
The explanation was good...It really helped me
@NERDfirst
@NERDfirst 6 жыл бұрын
That's great to hear! Very happy to be of help :)
@rakoonberry7879
@rakoonberry7879 5 жыл бұрын
Very helpful video. Thanks :)
@NERDfirst
@NERDfirst 5 жыл бұрын
You're welcome! Very happy to be of help =)
@Daniel-iy1ed
@Daniel-iy1ed Жыл бұрын
Fantastic!!! Thank you so much
@NERDfirst
@NERDfirst Жыл бұрын
You're welcome! Very happy to be of help =)
@ronthedon212
@ronthedon212 5 жыл бұрын
sir, thank you very much. this is a great explanation and great intuition content
@NERDfirst
@NERDfirst 5 жыл бұрын
You're welcome! Very happy to be of help =)
@faxmunke9763
@faxmunke9763 4 жыл бұрын
Thank you for the video!
@NERDfirst
@NERDfirst 4 жыл бұрын
You're welcome! Glad to be of help =)
@nirajchowdhary7372
@nirajchowdhary7372 5 жыл бұрын
Thank You buddy you explained it very well!!
@NERDfirst
@NERDfirst 5 жыл бұрын
You're welcome! Very happy to be of help =)
@mc3749
@mc3749 3 жыл бұрын
Thank you so much. this is super helpful.
@NERDfirst
@NERDfirst 3 жыл бұрын
You're welcome! Happy to be of help =)
@satyadharkumarchintagunta3793
@satyadharkumarchintagunta3793 4 жыл бұрын
Sir,you explanation is tooooooo good🙂🙂🙂
@NERDfirst
@NERDfirst 4 жыл бұрын
Hello and thank you for your comment! Glad you liked the video =)
@hashankarunathilaka4229
@hashankarunathilaka4229 5 жыл бұрын
Great content. Thanks a lot. It helped me big time
@NERDfirst
@NERDfirst 5 жыл бұрын
Hello and thank you very much for your comment! Glad to be of help =)
@williamTjS
@williamTjS 3 жыл бұрын
Amazing video, thank you
@NERDfirst
@NERDfirst 3 жыл бұрын
You're welcome! Happy to be of help =)
@MrEyee2
@MrEyee2 7 жыл бұрын
Why anyone would give this a thumbs-down is beyond me.
@NERDfirst
@NERDfirst 7 жыл бұрын
Hello and thank you for your comment! I wouldn't worry about that =) What's important is that people have found this useful!
@Stuck.in.Matrix
@Stuck.in.Matrix 4 жыл бұрын
Great explanation.. thanks bro
@NERDfirst
@NERDfirst 4 жыл бұрын
You're welcome! Happy to be of help =)
@UditPandyaIRZealot
@UditPandyaIRZealot 6 жыл бұрын
Simply Superb !
@NERDfirst
@NERDfirst 6 жыл бұрын
Thank you very much! Glad to be of help :)
@fz8227
@fz8227 6 жыл бұрын
Very clear! Recoommend
@NERDfirst
@NERDfirst 6 жыл бұрын
Thank you very much! Glad you liked the video =)
@benjaminmathew9061
@benjaminmathew9061 4 жыл бұрын
Thank you! Question about accounting method - how do you decide how much to charge? I'm sure you're not randomly guessing or pulling numbers out of thin air. Is there a method to deciding costs?
@benjaminmathew9061
@benjaminmathew9061 4 жыл бұрын
Same question regarding how you came up with the potential function
@NERDfirst
@NERDfirst 4 жыл бұрын
Hello and thank you for your comment! The way I see it, some amount of trial and error is unavoidable. A good gauge would be to consider how the expensive operations can be "divided into" a number of "cheaper" operations. Set up some numbers from there and try. If the number keeps increasing, consider assigning less to each operation. If the value dips below zero, then the cost must be increased. For deriving potential functions, it may be advantageous to first consider the aggregate method, which allows you to consider step-by-step costs which you can then "generalize".
@abelhecker
@abelhecker 3 жыл бұрын
thanks, it was very helpful :)
@NERDfirst
@NERDfirst 3 жыл бұрын
You're welcome! Glad to be of help =)
@shil331
@shil331 6 жыл бұрын
thanks man, very good explanation
@NERDfirst
@NERDfirst 6 жыл бұрын
You're welcome! Glad to be of help =)
@dharmilshah4934
@dharmilshah4934 4 жыл бұрын
It was a really great video and has given a great understanding for amortized analysis.... I just had one doubt, that why do we have 1 in (1+i) because 'i' is used for moving 'i' elements but likewise we are also inserting 'i' elements right?.. So shouldn't it be (i+i) ?
@NERDfirst
@NERDfirst 4 жыл бұрын
Hello and thank you for your comment! Don't forget, (1+i) is discussed at a time when we're talking about what's going on *step by step* , in other words, on a *per-operation basis* . At any point of time, we are inserting 1 item only. However, there are some cases in which inserting that 1 item causes a chain reaction in which _i_ additional things happen. In that case, the amount of work done *for that one step* is (1+i).
@Tee_eej
@Tee_eej 7 жыл бұрын
Great explanation! You are made to teach
@NERDfirst
@NERDfirst 7 жыл бұрын
Hello and thank you for your comment! Glad you found my work useful =)
@vaibhavsingh1049
@vaibhavsingh1049 5 жыл бұрын
At 6:49 , wouldn't adding item 3 also trigger an array expansion?
@NERDfirst
@NERDfirst 5 жыл бұрын
Hello and thank you for your comment! No, there will be no array expansion for the third item, as at that point, the array has a size of 4. After inserting "2", the now full array (of size 2), is transferred to an array double in size (size 4).
@vaibhavsingh1049
@vaibhavsingh1049 5 жыл бұрын
@@NERDfirst Thanks for replying so quick. I think I get it now.
@NERDfirst
@NERDfirst 5 жыл бұрын
You're welcome! Glad to be of help =)
@dragonpig9842
@dragonpig9842 Жыл бұрын
Great video! May I ask you what is a good way to come out with the potential function?
@NERDfirst
@NERDfirst Жыл бұрын
Hello and thank you for your comment! Unfortunately there is no "one rule" or method for doing that. You'll have to just get your head into the right space and reason it out. There's a good writeup here to start building that intuition: cs.stackexchange.com/questions/30543/what-is-the-intuition-behind-the-potential-function-in-amortized-analysis-of-som
@dhananjaynaik6391
@dhananjaynaik6391 5 жыл бұрын
Hey man. Thank you. It helped a lot.
@NERDfirst
@NERDfirst 5 жыл бұрын
You're welcome! Very happy to be of help =)
@asefsgrd5573
@asefsgrd5573 5 жыл бұрын
Great video ever!
@NERDfirst
@NERDfirst 5 жыл бұрын
Hello and thank you for your comment! Glad you liked the video =)
@kishore4994
@kishore4994 5 жыл бұрын
Nicely covered
@NERDfirst
@NERDfirst 5 жыл бұрын
Hello and thank you for your comment! Glad you liked the video =)
@blacklight8932
@blacklight8932 Жыл бұрын
13:56 You have defined this function but how? How do I define phi(h)?
@NERDfirst
@NERDfirst Жыл бұрын
Hello and thank you for your comment! As mentioned in the video, this is the challenging part. There is no single method that will reliably generate such a function for you. Some frameworks for reasoning about it do exist and I'll link it here, but ultimately your own experience and pattern recognition skills are required here. Further reading: cs.stackexchange.com/questions/30543/what-is-the-intuition-behind-the-potential-function-in-amortized-analysis-of-som
@blacklight8932
@blacklight8932 Жыл бұрын
7:23 What exactly is the number of operations here? 63 < ? Isn't the total cost the number of operations?
@NERDfirst
@NERDfirst Жыл бұрын
Hello and thank you for your comment! The point is to think of this in the abstract! Whether the same algorithm runs for N=4 or N=1000000, the relationship holds. For that example, the total cost of expensive operations (ie. All the array expansions) is 63. There have been 32 insert operations on the array. Hence, the cost is always bounded by 2 × the number of insertion operations.
@anonInDE
@anonInDE 7 жыл бұрын
With the accountant's method... I don't get why you assigned $3 per operation.... I mean what's to stop me from assigning $10, or $20 per operation, or even infinity and then I could use that same argument to argue that any operation amortized costs O(1) only! Where did I get these $3 from? I can't seem to grasp that... Can anybody explain that to me please?
@NERDfirst
@NERDfirst 7 жыл бұрын
Hello and thank you for your comment! The costs assigned are arbitrary, but there is a strategy to picking them. The general idea is that we want to _count_ the number of fundamental units of operation (which we usually assign as $1), and see how many of them take place on average "per step" over a data structure of size n. Of course you could give it $10 or $20, but: 1) In general, we are talking about worst case time complexity, so we want a tight bound. It's the same way saying bubble sort has a worst case time complexity of O(2^n) isn't _technically_ wrong (Big O notations only specify an upper bound), but saying this becomes meaningless because _tight_ upper bounds are more useful. 2) If the algorithm can't be amortized to O(1), using a large constant cost won't help you - You will get to a point where the $10 or even $100 or $1000 you assign won't be enough. Of course, infinity is another question altogether. If you use infinity the whole exercise becomes pointless because you'll never run out, so you can't do that.
@christopherweeks89
@christopherweeks89 3 жыл бұрын
great video!
@NERDfirst
@NERDfirst 3 жыл бұрын
Hello and thank you for your comment! Glad you liked the video =)
@chaochen511
@chaochen511 5 жыл бұрын
I like your shadow on the wall
@NERDfirst
@NERDfirst 5 жыл бұрын
Shadow likes you too!
@amitmohanty2679
@amitmohanty2679 4 жыл бұрын
Thank you for the amazing explanation. Just a doubt In Aggregate analysis isn't the cost of an expensive operation is 4 when 3 items instead of 4 items. This is due to the new array creation point is when we try to insert 3 item to the dynamic array. Correct me if I am wrong.
@NERDfirst
@NERDfirst 4 жыл бұрын
Hello and thank you for your comment! It depends on when you want to expand the array. In the example shown, we expand the array when it becomes full as the result of an insertion operation. You can of course choose to do this earlier.
@amitmohanty2679
@amitmohanty2679 4 жыл бұрын
@@NERDfirst Thank you.
@moritzgoe
@moritzgoe 2 жыл бұрын
Great Video! :)
@NERDfirst
@NERDfirst 2 жыл бұрын
Hello and thank you very much for your comment! Glad you liked the video =)
@sadiahabib5506
@sadiahabib5506 7 жыл бұрын
Wow better than teachers there in university. I wonder about people who disliked 🤔🤔
@NERDfirst
@NERDfirst 7 жыл бұрын
Hello and thank you very much for your comment! I wouldn't worry about dislikes, what's important is that the people who need my help get it :)
@aswing2706
@aswing2706 4 жыл бұрын
Thank you brother
@NERDfirst
@NERDfirst 4 жыл бұрын
You're welcome! Glad to be of help =)
@marcocaniglia3061
@marcocaniglia3061 4 жыл бұрын
Awesome video, wish my boring professor just showed us your video in class instead of wasting our time for 1.5hrs lol
@NERDfirst
@NERDfirst 4 жыл бұрын
Hello and thank you for your comment! Heh, it's not an easy topic to deliver on the go, so I can understand. Either way, glad to be of help =)
@EibeMandel
@EibeMandel 7 жыл бұрын
Perfect, thanks
@NERDfirst
@NERDfirst 7 жыл бұрын
You're welcome! Happy to be of help =)
@jakobskovsndergard7912
@jakobskovsndergard7912 2 жыл бұрын
fantastic video: just a tiny comment. is the cost correct in the table with the aggregate stuff. I would expect the cost to be: 1,2,3,1,5,1,1,1,9,1,1,1,1,1,1,17……because we copy when we want to insert to a full table that has no more space, not when inserting to the last slot in the array.
@NERDfirst
@NERDfirst 2 жыл бұрын
Hello and thank you for your comment! An interesting thought, but it works out all the same, because the work kicks in at comparable points in time - The total amount of work done is exactly equal. I would say both strategies are equivalent, though round powers of two are nicer to look at =)
@Samuel-wl4fw
@Samuel-wl4fw 4 жыл бұрын
Great video
@NERDfirst
@NERDfirst 4 жыл бұрын
Hello and thank you for your comment! Glad to be of help =)
@absence9443
@absence9443 Жыл бұрын
Quick n neat, do you have to guess the cost for accounting and function for the potential method?
@NERDfirst
@NERDfirst Жыл бұрын
Hello and thank you for your comment! I don't think you'll really ever need to blindly guess in the dark. If it helps, start with the aggregate method first to see a pattern. Of course, there's no single method that will always give you a perfect answer from the get go, so some experience and pattern recognition skills are required, but there are some frameworks for reasoning about this. Here's a pretty good writeup: cs.stackexchange.com/questions/30543/what-is-the-intuition-behind-the-potential-function-in-amortized-analysis-of-som
@absence9443
@absence9443 Жыл бұрын
@@NERDfirst thank thee :)
@mahwishch3883
@mahwishch3883 7 жыл бұрын
excellent work..keep it up (Y)
@NERDfirst
@NERDfirst 7 жыл бұрын
Thank you very much! Glad you liked the video =)
@gopikrishnan7380
@gopikrishnan7380 2 жыл бұрын
Thank you sir.
@NERDfirst
@NERDfirst 2 жыл бұрын
You're welcome! Happy to be of help =)
@milda1220
@milda1220 5 жыл бұрын
GOOD JOB!
@NERDfirst
@NERDfirst 5 жыл бұрын
Thank you very much! Glad you liked the video =)
@johndambrosio7410
@johndambrosio7410 4 жыл бұрын
During the accounting method, what is the cost for creating the new, double in size, array?
@NERDfirst
@NERDfirst 4 жыл бұрын
Hello and thank you for your comment! Intuitively I'd say _creating_ the array is O(1) since that just involves setting aside a contiguous block of RAM (assuming availability). It's the _shifting_ of items from the old array into the new that takes O(n).
@farruhhabibullaev5316
@farruhhabibullaev5316 6 жыл бұрын
It is cool bro. Thank you
@NERDfirst
@NERDfirst 6 жыл бұрын
You're welcome! Glad to be of help =)
@AkashVerma-sq8eq
@AkashVerma-sq8eq 4 жыл бұрын
Even if the number of cheap operations are NEARLY (and not equal to n) n times, is it correct to say it's total cost is of order O(n)?
@NERDfirst
@NERDfirst 4 жыл бұрын
Hello and thank you for your comment! To greatly oversimplify, the Big O Notation just indicates the fastest growing component. So usually when we see c*n + a (where c and a are constant numbers), we'll just represent it as O(n). For more on this topic, you may want to check out my playlist on asymptotic notations: kzbin.info/aero/PLJse9iV6Reqh5B_w9koGyT7nlYm92iITk
@thepinkcodon
@thepinkcodon 5 жыл бұрын
I have a question, somebody please help! In the aggregate method, how exactly are there n number of operations? In this example, for the total cost in the aggregate method, it's a GP with sum = 2n-1. So, the total cost is of complexity O(n). But for calculating the average, why did you divide it by n? How is the number of operations = n? Also, what exactly do we mean by operations here?
@NERDfirst
@NERDfirst 5 жыл бұрын
Hello and thank you for your comment! The number of operations is n because there have been n item insertions into the array. The most sensible definition of "operation" is one unit of work, as in, one thing you can do to said data structure. Clearly this will vary depending on what problem you're trying to analyze. However, generally speaking, if you're analyzing a series of steps and want to find out the amortized time complexity, then you'd want to divide by the individual steps that make up the series of operations.
@thepinkcodon
@thepinkcodon 5 жыл бұрын
@@NERDfirst Thank you for the explanation. :)
@thanglai4880
@thanglai4880 5 жыл бұрын
could you explain for me what is the mean of cost you use in aggregate method ? is it related to big o notation ? Again, many thanks for your videos.i really appreciate it
@NERDfirst
@NERDfirst 5 жыл бұрын
Hello and thank you for your comment! Cost "leads" us towards coming up with a conclusion for Big O time complexity, though when we're discussing "cost", we're not quite there yet. Think of cost as a count of the number of steps, as in 1 unit of cost is equivalent to one step.
@parikshitrajpara5706
@parikshitrajpara5706 4 жыл бұрын
good work
@NERDfirst
@NERDfirst 4 жыл бұрын
Hello and thank you for your comment! Glad to be of help =)
Potential method for amortized analysis
27:14
Algorithms Lab
Рет қаралды 9 М.
What P vs NP is actually about
17:58
Polylog
Рет қаралды 145 М.
To Brawl AND BEYOND!
00:51
Brawl Stars
Рет қаралды 17 МЛН
IL'HAN - Qalqam | Official Music Video
03:17
Ilhan Ihsanov
Рет қаралды 700 М.
Гениальное изобретение из обычного стаканчика!
00:31
Лютая физика | Олимпиадная физика
Рет қаралды 4,8 МЛН
How a Russian student invented a faster multiplication method
18:48
CPU Pipelining - The cool way your CPU avoids idle time!
15:25
0612 TV w/ NERDfirst
Рет қаралды 12 М.
7 Outside The Box Puzzles
12:16
MindYourDecisions
Рет қаралды 211 М.
Amortized Analysis: Aggregate Analysis and Accounting Method
38:41
Algorithms Lab
Рет қаралды 41 М.
Fast Inverse Square Root - A Quake III Algorithm
20:08
Nemean
Рет қаралды 5 МЛН
Every Sorting Algorithm Explained in 120 minutes (full series)
1:57:33
Kuvina Saydaki
Рет қаралды 80 М.
Learn Big O Notation In 12 Minutes
12:18
Web Dev Simplified
Рет қаралды 193 М.
Lerp smoothing is broken
57:19
Freya Holmér
Рет қаралды 170 М.
To Brawl AND BEYOND!
00:51
Brawl Stars
Рет қаралды 17 МЛН