What Is Asymptotic Analysis? And Why Does It Matter? A Deeper Understanding of Asymptotic Notation.

Ғылым және технология

Free 5-Day Mini-Course: backtobackswe.com
Try Our Full Platform: backtobackswe.com/pricing
📹 Intuitive Video Explanations
🏃 Run Code As You Learn
💾 Save Progress
❓New Unseen Questions
🔎 Get All Solutions
First, we must ask what asymptotic means. Well, you have probably heard of the word "asymptote".
An asymptote is a "line that continually approaches a given curve but does not meet it at any finite distance".
Therefore, asymptotic analysis is the analysis of tail behaviors not reaching any finite point. It is a method of describing limiting behavior.
Wall Time vs. Asymptotic Complexity
Well...why not just measure the seconds our code takes to run? And get the Elapsed real time (wall time)?...like Leetcode.
So why do we care about this...well in computer science we often deal with problems that are at a grand scale with inputs to the order of millions and billions.
And thus, the true measure of the efficiency of an algorithm is best expressed in its tail behavior on very large input. It only then shows its true colors.
An Expression of Asymptotic Behaviour
Insertion Sort: 2 * n^2
Merge Sort: 50 * n * log(n)
We have 2 computers:
Computer A: runs 10 Billion instructions / second
Computer B: runs 10 Million instructions / second
Computer A is 1000x faster than Computer B
Computer A runs insertion sort, Computer B runs merge sort
How long will each computer take to sort 10 million numbers?
Computer A: 5.5 hours
Computer B: 20 minutes
A computer that runs 1000x faster lost horrendously to a computer that runs 1000x slower than it.
But the thing is that insertion sort will be faster for an initial amount, but it will lose as the input gets larger (and that's what we care about and what is a true expression of its efficiency).
++++++++++++++++++++++++++++++++++++++++++++++++++
HackerRank: / @hackerrankofficial
Tuschar Roy: / tusharroy2525
GeeksForGeeks: / @geeksforgeeksvideos
Jarvis Johnson: / vsympathyv
Success In Tech: / @successintech

Пікірлер: 110

  • @BackToBackSWE
    @BackToBackSWE5 жыл бұрын

    Table of Contents: Quick Intro 0:00 - 0:22 For Loop Madness 0:22 - 0:31 What Does Asymptotic Really Mean? 0:31 - 1:27 Tail Behavior 1:27 - 1:48 Why Elapsed Real Time Is Unreliable 1:48 - 2:31 What We Should Be Interested In 2:31 - 2:55 Racing 2 Computers 2:55 - 3:40 Who Will The Winner Be? 3:40 - 3:52 The Approximate Running Times 3:52 - 4:28 Investigating Linear Functions 4:28 - 5:28 The Graphs Share Something In Common 5:28 - 6:14 Why Do We Drop Constants? 6:14 - 6:40 What I Really Mean When I Say "Linear" Time 6:40 - 7:03 Wrap Up 7:03 - 7:45 Notes: 0:28 -> For those curious, the work that the 2 for loops do would be bounded by O(n). This is because for each of the n iterations of the outer loop, we will perform 10 iterations in the inner loop...do you notice how n does not influence the inner loop? In fact, we notice that the work of 10 (from the inner loop) for each of the outer loop iterations is...constant. Constant in time......O(1) time. So O( n * 1) = O(n). Where n is a measure of an arbitrary input. 2:54 -> Credits to Clyde Kruskal & Mohammad Nayeem Teli (both teachers at the University of Maryland) for the example of Computer A & computer B running 2 different algorithms. That was not an example that I created myself. 5:01 -> no idea why the video looks faded out...camera was acting weird. 6:40 -> Big O is only 1 way we can bound tail behavior. There are others.

  • @khsprashanth
    @khsprashanth4 жыл бұрын

    Best Explanation EVER!!!! I Mean it! ASYMPTOTICALLY

  • @BackToBackSWE

    @BackToBackSWE

    4 жыл бұрын

    thanks

  • @prashantpandya6992
    @prashantpandya69923 жыл бұрын

    Thank you SO MUCH! The best introduction to this concept that I have come across.

  • @Nyquiiist
    @Nyquiiist4 жыл бұрын

    There are too many sites that try to give a quick crash course a month or two months before the interview, but I really like how dive deeper and take your time to explain things. Also love the fact that your content is more academic in nature. Thank you for your hard work man, its much appreciated, def gonna check out your platform.

  • @BackToBackSWE

    @BackToBackSWE

    4 жыл бұрын

    Sure!

  • @kelvinmacharia3715
    @kelvinmacharia37153 жыл бұрын

    I am getting started with algorithms.Still confused but this video made it a little more clearer. Good job bro

  • @c.d.premkumar6867
    @c.d.premkumar68672 жыл бұрын

    Excellent ! I haven't come across such a fantastic explanation so far !

  • @stanmarsh9742
    @stanmarsh97424 ай бұрын

    Thank you so much for helping me understand this concept, this was a great explanation.

  • @luckyjinx226
    @luckyjinx2264 жыл бұрын

    did I understand shit? nah did I enjoy this due to your fun energetic personality? hella

  • @BackToBackSWE

    @BackToBackSWE

    4 жыл бұрын

    that's what it's all about

  • @roscko3142
    @roscko31424 ай бұрын

    Thank you for the examples that you used. This is such a good and less scary introduction to time complexity analysis

  • @benjaminragland7940
    @benjaminragland7940 Жыл бұрын

    Boyyy YOU GOING CRAZY. Great Explanation!

  • @ennymore6124
    @ennymore61242 жыл бұрын

    I really love your videos. Thanks so much for clarifying so many black knowledge holes 🕳 for me!

  • @MBdz557
    @MBdz5573 жыл бұрын

    I was having a problem with understanding what "asymptotic" really mean and you helped me ..thank you very much

  • @davidkorn5253
    @davidkorn5253 Жыл бұрын

    love the energy !

  • @sahithimangalapalli353
    @sahithimangalapalli3532 жыл бұрын

    That's a great explanation

  • @Eww...NotTheHumansAgain
    @Eww...NotTheHumansAgain Жыл бұрын

    Thank you very much!

  • @chalupa501
    @chalupa5013 жыл бұрын

    Very good! Of course I Subscribed. I was looking for a function of asymptotic penetration in quantum immersion and you made it very clear. Thanks.

  • @BackToBackSWE

    @BackToBackSWE

    3 жыл бұрын

    thx and thx

  • @user-ho9dy9vz3p
    @user-ho9dy9vz3p7 ай бұрын

    Wow this was so clear! I love the graphics popping in and out and the way your voice inflections keep us alert. Great teaching skills!

  • @BackToBackSWE

    @BackToBackSWE

    7 ай бұрын

    Happy Holidays 🎉 Thank you for your kind words! We'd love to offer you a 40% Off our exclusive lifetime membership just use the code CHEER40 - backtobackswe.com/checkout?plan=lifetime-legacy&discount_code=CHEER40

  • @guliteshabaeva8922
    @guliteshabaeva8922 Жыл бұрын

    that is very very good explanation

  • @IsayaOdongo
    @IsayaOdongo3 ай бұрын

    Great explanation

  • @florinpricopie9112
    @florinpricopie91123 жыл бұрын

    Always a pleasure to watch your video 😇.

  • @shreyaskharbanda2777
    @shreyaskharbanda27774 жыл бұрын

    By far the best explanation I have encountered!

  • @BackToBackSWE

    @BackToBackSWE

    4 жыл бұрын

    nice

  • @sammeri6997
    @sammeri69974 жыл бұрын

    You are doing such an amazing job, keep them video coming...

  • @BackToBackSWE

    @BackToBackSWE

    4 жыл бұрын

    ok

  • @arobot4398
    @arobot43983 жыл бұрын

    bro ur better than 99% of the online educators and even some professors!

  • @DennisSmdFreefightTrainer
    @DennisSmdFreefightTrainer4 жыл бұрын

    This made it indeed clearer! Thanks a lot

  • @BackToBackSWE

    @BackToBackSWE

    4 жыл бұрын

    nice

  • @bh3302
    @bh3302 Жыл бұрын

    Fantastic video, love the ending 😂

  • @weronikaka6208
    @weronikaka6208 Жыл бұрын

    ohh my f god! this was so quick, yet so helpful. thank you so much!

  • @BackToBackSWE

    @BackToBackSWE

    Жыл бұрын

    Thank you, means a lot 🎉 You can also check out our free DSA course - backtobackswe.com/

  • @Each1Teach1Tech
    @Each1Teach1Tech3 жыл бұрын

    This is mind blowing how you explained it. Keep it up. I subed asap.

  • @prannavkrishna1004
    @prannavkrishna10044 жыл бұрын

    such a clear explanation! thanks!!

  • @BackToBackSWE

    @BackToBackSWE

    4 жыл бұрын

    sure

  • @moism
    @moism Жыл бұрын

    Thanks!

  • @JRK_RIDES
    @JRK_RIDES4 жыл бұрын

    Two years in college and it wasn't this clear for me.....Thanks, man!

  • @BackToBackSWE

    @BackToBackSWE

    4 жыл бұрын

    nice.

  • @ak-hj4xw
    @ak-hj4xw4 жыл бұрын

    Absolutely phenomenal. I just wish you applied examples, to show us how you find the notations. Too bad you didn't cover Recurrence relations as well :(

  • @BackToBackSWE

    @BackToBackSWE

    4 жыл бұрын

    thanks and yeah

  • @engineering-ux
    @engineering-ux4 жыл бұрын

    Awesome :) Thanks for this.

  • @BackToBackSWE

    @BackToBackSWE

    4 жыл бұрын

    sure

  • @Diamond-ej3fm
    @Diamond-ej3fm3 ай бұрын

    thank you!

  • @yicai7
    @yicai74 жыл бұрын

    Helpful! Thanks

  • @BackToBackSWE

    @BackToBackSWE

    4 жыл бұрын

    sure

  • @lauralorenaromeromartinez657
    @lauralorenaromeromartinez6573 жыл бұрын

    Thanks, you explain very clear.

  • @BackToBackSWE

    @BackToBackSWE

    3 жыл бұрын

    sure!

  • @mmaranta785
    @mmaranta7853 жыл бұрын

    Good video

  • @surajmaurya3250
    @surajmaurya32503 жыл бұрын

    Thanks 🙏🙏

  • @allisterlim8988
    @allisterlim89883 жыл бұрын

    you are the GOAT

  • @kwameaddo1007
    @kwameaddo10072 жыл бұрын

    Bro thanks

  • @KB24DW8
    @KB24DW85 жыл бұрын

    yo man thanks for blessing up with such informative videos. Your Asypmptotic videos cleared so many confusions. Just one thing, can you make a video explain how to add and mull algos. Like how do we know by analysing algos if its linear,quad,log, n log n etc

  • @BackToBackSWE

    @BackToBackSWE

    5 жыл бұрын

    haha nice, yeah I'll do that

  • @ahmedelsabagh6990
    @ahmedelsabagh69904 жыл бұрын

    Good explanation Thanks

  • @BackToBackSWE

    @BackToBackSWE

    4 жыл бұрын

    sure

  • @MichaelWaisJr
    @MichaelWaisJr4 жыл бұрын

    Aaaaaahhhaaaaa!!! I just got it!!! Thanks, man! :D

  • @BackToBackSWE

    @BackToBackSWE

    4 жыл бұрын

    cool

  • @MichaelWaisJr

    @MichaelWaisJr

    4 жыл бұрын

    Back To Back SWE Yes, you have contributed greatly to my Mad Ninja Skills! :D Thank you!!

  • @sii479
    @sii4794 жыл бұрын

    a really great job

  • @BackToBackSWE

    @BackToBackSWE

    4 жыл бұрын

    thx

  • @j_5244
    @j_52444 жыл бұрын

    Thank you!

  • @BackToBackSWE

    @BackToBackSWE

    4 жыл бұрын

    sure

  • @hetalrachh5665
    @hetalrachh56654 жыл бұрын

    Thank you so much for such a clear explanation :)

  • @BackToBackSWE

    @BackToBackSWE

    4 жыл бұрын

    sure

  • @maidelriog
    @maidelriog5 ай бұрын

    How did you come up with the 5.5 hours and 20 minutes? Where did you get those values from?

  • @nervous711
    @nervous7112 жыл бұрын

    Your channel is a lifesaver for self-taught programmers...

  • @BackToBackSWE

    @BackToBackSWE

    2 жыл бұрын

    Thank You!! Do check out backtobackswe.com/platform/content

  • @ThatlazyiOSGuy
    @ThatlazyiOSGuy3 жыл бұрын

    For your 100k milestone

  • @BackToBackSWE

    @BackToBackSWE

    3 жыл бұрын

    Ye

  • @darrenchen417
    @darrenchen4174 жыл бұрын

    Amazing

  • @BackToBackSWE

    @BackToBackSWE

    4 жыл бұрын

    thanks

  • @dansteryoo
    @dansteryoo4 жыл бұрын

    damn that was good. thanks.

  • @BackToBackSWE

    @BackToBackSWE

    4 жыл бұрын

    sure

  • @ozcanf6680
    @ozcanf66803 жыл бұрын

    Great explanation!

  • @hullopes
    @hullopes4 жыл бұрын

    Wow! It's was very clear (a little bit more clear than Udi Manber(1989) hahaha).

  • @BackToBackSWE

    @BackToBackSWE

    4 жыл бұрын

    great

  • @mareshbm2731
    @mareshbm27314 жыл бұрын

    Thanku......

  • @BackToBackSWE

    @BackToBackSWE

    4 жыл бұрын

    thank u

  • @lokeshprajapati9197
    @lokeshprajapati91975 жыл бұрын

    hey bro, i wanna learn asymptotic and bigo notation completly. i watched your video it help me. but i want learn completly. could u suggest books or link or make a complete playlist on it. btw u r awesome in explain topics.

  • @BackToBackSWE

    @BackToBackSWE

    5 жыл бұрын

    I made a video on it a while back but it was badly shot and badly edited (you can find it on the channel). I will redo it but that video (if you can bare the bad quality lighting) is pretty exhaustive.

  • @lokeshprajapati9197

    @lokeshprajapati9197

    5 жыл бұрын

    @@BackToBackSWE ok i will try or why you not planing to shoot it again. in my college time bigo notation is hard to understand. but now atleast i am understanding it. what is the actual meaning of log(n). Thanx

  • @anmolsingh4026
    @anmolsingh40264 жыл бұрын

    A very humongous thanks to you 🙌

  • @BackToBackSWE

    @BackToBackSWE

    4 жыл бұрын

    yw

  • @MyFictionalChaos
    @MyFictionalChaos3 жыл бұрын

    I really appreciate this explanation because you made a point to explain why asymptotic complexity is important

  • @samuelgomes6226
    @samuelgomes62262 жыл бұрын

    what is "li code" that he talks about at 2:00 ?

  • @airysm
    @airysm5 жыл бұрын

    Hi, Let's say I was going through a list of numbers and "offering" them into a priority queue whose offer function is log(n), Will this be n*log(n) because I'm doing a log(n) operation n times or will it just be O(n) because the operation itself doesn't matter since the algorithm runs n times? I think I saw you say something about algorithmic complexity vs runtime complexity in one video but I couldn't find it again lol

  • @BackToBackSWE

    @BackToBackSWE

    5 жыл бұрын

    Since you do n operations that take O(log(n)) time it will take O(n * log(n)) time. This does not pertain to heapsort. For heapsort, building the heap takes ϴ(n) time and the extraction phase happens roughly n times and each extraction of the min/max element takes O(1) time (we just pull it from index 0 in the array representing our heap) and then the heapification "downward" of the element swapped to the root will take O(log(n)) time. So yeah, for what you said, O(n * log(n)).

  • @paurushgargtube
    @paurushgargtube3 жыл бұрын

    Wow!!

  • @BackToBackSWE

    @BackToBackSWE

    3 жыл бұрын

    yes

  • @bokams3385
    @bokams33852 жыл бұрын

    U r champ

  • @1vwboxcar
    @1vwboxcar Жыл бұрын

    I wasn't looking for this video and stumbled into it. Your first graph is incorrect. It should be 1/x^2 Hope this helps

  • @workflop4117
    @workflop41174 жыл бұрын

    Subscribing is a MUST!

  • @BackToBackSWE

    @BackToBackSWE

    4 жыл бұрын

    thanks haha

  • @aryuridarthead9286
    @aryuridarthead92864 ай бұрын

    salamuch homie

  • @luisorellana7622
    @luisorellana76223 жыл бұрын

    cool

  • @rickyprophete
    @rickyprophete4 жыл бұрын

    Do some examples!!!

  • @BackToBackSWE

    @BackToBackSWE

    4 жыл бұрын

    ok

  • @ThangHoang-ub8xs

    @ThangHoang-ub8xs

    3 жыл бұрын

    Be kind, man!

  • @Taropok
    @Taropok4 жыл бұрын

    This video must have been shot on the 13th of October...

  • @BackToBackSWE

    @BackToBackSWE

    4 жыл бұрын

    why

  • @faheemrajuu
    @faheemrajuu3 жыл бұрын

    If someone asks you what is the asymptotic solution of a given problem? don't tell him a definition of the asymptotic solution instead tell him that at this arbitrary boundary condition 'a' our model should give us an already known solution 'y'. This known solution is maybe from previously developed models or from experiments. Thoughts?

  • @jaymethodus3421
    @jaymethodus3421 Жыл бұрын

    Yep reality is computer code basically holy crap awkward😮

  • @georgez.7278
    @georgez.72784 жыл бұрын

    I liked the video, but it was not too clear. You can do it better

  • @BackToBackSWE

    @BackToBackSWE

    4 жыл бұрын

    ok haha

Келесі