2.1.3 Recurrence Relation (T(n)= T(n-1) + log n) #3

Поделиться
HTML-код
  • Опубликовано: 28 дек 2024

Комментарии •

  • @girava4034
    @girava4034 4 года назад +477

    3:56 If someone is wondering how he magically got this (very rarely happens)
    log a + log b = log(a*b)
    hence, log(n) + log (n-1) .. + log(2) + log(1) = log(n*(n-1)*(n-2)...*1) = log(n!)
    O(log(n!)) = O(log(n^n))
    log(a^b) = blog(a)
    hence, O(log(n^n)) = O(nlogn)

    • @badalsarkar736
      @badalsarkar736 4 года назад +9

      I was looking for this. Thanks.

    • @stebasteps
      @stebasteps 4 года назад +4

      Thanks for this. My math is really bad so I had trouble understanding that part.

    • @Msd-bk7yc
      @Msd-bk7yc 3 года назад +1

      thanks broo

    • @shyrenmore8140
      @shyrenmore8140 3 года назад +20

      How did n! become n^n?

    • @sivachowdeswarnandipati9712
      @sivachowdeswarnandipati9712 3 года назад +34

      @@shyrenmore8140 because, n! = 1.2.3...n-1.n, and if you keep on multiplying n inplace of each number because n > c; you get
      1.2.3.4.....(n-1).n < n.n.n.n.....n.n Therefore, Big -oh can be used

  • @goatyt3010
    @goatyt3010 5 лет назад +183

    I like how he looks at me as if I am not paying attention in the back bench and about to get a detention. You are a legend Bari.

  • @danielmartino8068
    @danielmartino8068 6 лет назад +393

    I love your way of teaching, very clear and simple. Our book Algorithm Design by Goodrich and Tamassia is an unnecessary mess. Education should depart from a concise and clear base, otherwise it seems as the author is trying to show off instead of explaining. Your style is of a real professor. You should right a book on Algorithm, you are a real professor.

  • @nitinmahajan3320
    @nitinmahajan3320 4 года назад +60

    Wish had him as a professor a decade ago, these topics would be super interesting. You are doing a great service.

  • @asishraz6173
    @asishraz6173 4 года назад +67

    Sir, you must be aware that I am commenting on each and every video of this playlist, not to gain attention but to prove my sincerity towards your teaching. I have set up this month's target to finish all of the videos in this playlist. Every day, I watch a minimum of 3 and a maximum of 4 videos from this playlist, so that in a week I will able to complete a minimum of 21 and a maximum of 28 videos and in a month, all these 84 videos will get completed.
    The first-week target already completed now jumped in the second-week target.
    The reason is your way of teaching and the valuable information we all are gaining through watching it.
    Lots of love and respect for you Sir. Thank you so much. I will be jumping to the next video of this playlist.
    More power to you and keep the great work that you are doing.
    - Gareeb CODER

    • @codingdaily4094
      @codingdaily4094 4 года назад +2

      My Target is to complete this whole series by the End of this month

    • @asishraz6173
      @asishraz6173 4 года назад +1

      @@codingdaily4094 _ Great. Same here. Let's see, how far we will go till the end of this month

    • @codingdaily4094
      @codingdaily4094 4 года назад +1

      @@asishraz6173 Okay bro

    • @ashwinudhayakumar7466
      @ashwinudhayakumar7466 3 года назад +2

      i just completed 25 videos in one day

    • @enejidjsi5939
      @enejidjsi5939 3 года назад +1

      @@codingdaily4094 did u do it bro? congrats

  • @zizothegreat2769
    @zizothegreat2769 5 лет назад +56

    When I graduate in a year, if I even have the chance to thank the ones that help me along this college journey, I will sure to thank you publicly. I would say something along the lines of "I want to thank god, my mom for supporting me, and most importantly Abdul from RUclips!" haha

  • @mahmoudalfayoumi2056
    @mahmoudalfayoumi2056 5 лет назад +35

    I'm taking a master program in CS, and you don't know how these lessons helped me to make full marks in the exams

    • @noumanbhai7442
      @noumanbhai7442 3 года назад +3

      and i am in BS 2nd semester now or taking this lectures this sir is amazing

  • @TheMsnitish
    @TheMsnitish 5 лет назад +22

    It needs great patience to make wonderful videos like this! Love the way you teach without bringing lot of mathematical jargon like CLRS does.

  • @davidotewa6411
    @davidotewa6411 4 года назад +6

    Doing Masters in Computer Science and your way of teaching is awesome.
    I am almost finishing your Videos

  • @SHAHIDSHAIKH-bw5ys
    @SHAHIDSHAIKH-bw5ys 4 года назад +12

    Sir really when i show that topics available in your channel then my level of confidence of those topics increase to 💯 no matter how complex those theory or topics .❣️
    Thank you sir . 😌

  • @shouvik10
    @shouvik10 2 месяца назад +1

    Wonderful explanation! What clarity! Sir is a master of algorithms.

  • @amberpradhan2484
    @amberpradhan2484 4 года назад

    I believe that the good teacher is the one who is not only smart but explain very well.No words, Best teacher so far. Thank you and God bless you.

  • @sleepypanda7172
    @sleepypanda7172 3 года назад +4

    his teaching is so interesting that when he said 12:20 that you'll see the answer in next video my emotions were same as if I watched some super awesome web series on Netflix and they left the episode at the good part. I clicked the next video quickly just like I click on next episode of web series quickly!!!

  • @samadhanghorpade2302
    @samadhanghorpade2302 Месяц назад +1

    00:02 Understanding the time complexity of a given algorithm.
    01:17 Recurrence relation T(n) = T(n-1) + log n
    02:54 Recurrence relation T(n) = T(n-1) + log n results in T(n) = log n factorial.
    04:38 The time complexity is O(n log n)
    06:21 Recurrence relation T(n)=T(n-1) + log n
    08:24 Recurrence relation T(n) = T(n-1) + log n results in O(n log n)
    09:43 Recurrence relation T(n)= T(n-1) + log n results in O(n^3)
    11:14 Understanding the recurrence relation T(n) = T(n-1) + log n.

  • @badalsarkar736
    @badalsarkar736 4 года назад +4

    Outstanding!! I have been struggling to calculate time complexity of recursive functions, now everything is so clear to me. Thank you so much.

  • @nooreldali7432
    @nooreldali7432 3 года назад +1

    I don't know if this helps but I try to watch some of the adds without skipping cuz you deserve it. May Allah bless you

  • @zizothegreat2769
    @zizothegreat2769 5 лет назад +2

    You made a subject so simple that my professor and book provided for this course made 100x more difficult. Thanks again Abdul.

  • @badarikrishna3169
    @badarikrishna3169 4 года назад +1

    Salute to your patience, writing each line and explaining thoroughly. I remember how I used to spend lot of time scratching my brain in understanding in college I used to write each line and understand. It feels great when you explain in this way..!! 🙌🙌

  • @rnjnmhta.catomato
    @rnjnmhta.catomato 2 года назад +1

    4:30 tight bound : Θ-notation (theta notation) is called tight-bound because it's more precise than O-notation and Ω-notation (omega notation).

  • @Nazmussakib1548
    @Nazmussakib1548 2 года назад

    Teaching the hardest topics in an easy manner is the hardest job in the world & you have made it & helped out thousands of students. Respect Sir. Wishing you a good health & a happy life. Jazak Allahu Khair!

  • @sinistergeek
    @sinistergeek 4 года назад +1

    8:49 when he sums all the part 1,2 and 3. Amazing trick!! I didn't have to prove nothing just understand the power the power of multiplication!!

  • @darkseeven
    @darkseeven 6 лет назад +4

    you remind me of my math meditator... You explain clear, simple, and logical... Thank you :)

  • @zoasis7805
    @zoasis7805 4 года назад +2

    You should take pride in your teaching skills, it is a skill that not many have, nice work

  • @subhanullahdanish8680
    @subhanullahdanish8680 2 года назад +1

    Thank you so much sir . our teacher is teaching us i even not understand on his lecture but you clear my concept . A lot of love from Afghanistan .

  • @aishwaryasingh246
    @aishwaryasingh246 5 лет назад +2

    I have been watching your videos for a while now and it has never been easier than this. Kudos to you!
    Thank you so much. :)

  • @uniquekishi
    @uniquekishi 24 дня назад

    You ate when you explained how to know the time complexity straight away!!!

  • @muthierry1
    @muthierry1 4 года назад +2

    Mr Bari , you are such a great Lecturer....just Amazing they way you explain.. Thank you again ..

  • @softwareengineer8923
    @softwareengineer8923 Год назад +1

    You explanation is too clear and lucid!Thanks a lot for these great lessons!

  • @VPannagS
    @VPannagS 2 года назад +2

    Thanks!

  • @adeypurohit01
    @adeypurohit01 Год назад

    Such a Legend this Man is !
    Thank you Sir for making our lives simpler !

  • @siddhijoshi8759
    @siddhijoshi8759 4 года назад +2

    OUR INDIA HAS THE BEST TEACHERS

  • @valentine5379
    @valentine5379 3 года назад +1

    Top-notch teaching. Thank you for making this so clear and easy to understand.

  • @parryismful
    @parryismful 5 лет назад +1

    Crystal clear explanation. You are doing great service for the learner.Huge Respect ...!!

  • @eva42sh
    @eva42sh 2 года назад

    Thank you Abdul - all of your videos are priceless! you're a legend. Thank you for helping to improve.

  • @RunningBlade_
    @RunningBlade_ 5 лет назад

    Excellent teaching skills.Best Ds & Algo teacher .Thank you for making this topic easy to learn and understand.

  • @dream_work_slay
    @dream_work_slay Год назад +4

    Shouldn't the relation at 7:42 be T(n)= T(n-k) + log(n-(k-1)) + log(n-(k-2))+......+log(n-1) + log(n)? and btw this whole playlist is a lifesaver! Gotta appear for my exams next week and I hope to do well ;)

  • @E_AlIslam
    @E_AlIslam 4 года назад +2

    Love it.. at the last the short cut was awesome i was searching for that and i got here

  • @anindyadas6482
    @anindyadas6482 3 года назад +1

    Your way of teaching is excellent, Thank you sir....

  • @cagataytekin6372
    @cagataytekin6372 9 месяцев назад

    abdul bari hocam, karizma bir dagsa sen everestsin

  • @Swansylinks
    @Swansylinks 4 месяца назад +1

    Thank you so much sir. You've really help me.

  • @mohamed_bin_hussein
    @mohamed_bin_hussein 9 месяцев назад +2

    03:55 property of logarithms = log(a) + log(b) = log(a*b)

  • @kartikvaidyanathan1237
    @kartikvaidyanathan1237 4 года назад

    You are a genius, because you simplify it so beautifully.

  • @nytlyf2085
    @nytlyf2085 2 года назад +1

    I love abdul sir! beautiful job done

  • @somasundaramvenkatachalam8366
    @somasundaramvenkatachalam8366 3 года назад +2

    No words to say simply fantastic

  • @vrushilpatel9570
    @vrushilpatel9570 2 года назад

    This Professor is a LEGEND!

  • @1ycx
    @1ycx 6 лет назад +61

    Hello Sir. Put A Water Mark On Your Videos Such That They Won't Get Stolen.
    Have A Nice Day.

    • @sifatsingh7117
      @sifatsingh7117 6 лет назад +2

      @@abdul_bari youtube has a feature to put watermark on the videos .. its somewhere in the settings

    • @KRVIJAY-es8xl
      @KRVIJAY-es8xl 4 года назад +1

      He literally has his face on these videos, a watermark would be completely redundant here.

    • @sthembiso_mkhwanazi
      @sthembiso_mkhwanazi 4 года назад

      @@KRVIJAY-es8xl The video has no face when is downloaded.

    • @KRVIJAY-es8xl
      @KRVIJAY-es8xl 4 года назад

      @@sthembiso_mkhwanazi that's literally impossible. Cropping the face would cause half the video to be cut off

    • @sthembiso_mkhwanazi
      @sthembiso_mkhwanazi 4 года назад

      @@KRVIJAY-es8xl What I am saying is that when you download the video it has no face, meaning no watermark. It is just like a video which has been captured and got uploaded, the head you see now is not part of the video but a link to the channel.

  • @baotrantong3223
    @baotrantong3223 4 года назад +1

    Thank you very much for the lecture. You are the best teacher!

  • @SrijoniChakraborty
    @SrijoniChakraborty 5 лет назад +2

    Excellent teaching sir...i have already taken ur data structure course from udemy...it is just luv

  • @ary9344
    @ary9344 3 года назад +1

    Really glad I stumble into your Algorithm Playlist, with this Online learning going on, I've never been able to focus on my class, it's few weeks into the end of the semester and your style of teaching really understandable rather than other that using fancy words! Thank you!
    By the way why don't you upload again sir?

  • @mattbonnell3210
    @mattbonnell3210 4 года назад +4

    At 7:40, shouldn't your inductive case be T(n) = T(n-k) + log(n - k + 1) + log(n - k + 2) .... + log(n - 1) + log(n)? Love your videos!

    • @moh.absarrahman7651
      @moh.absarrahman7651 4 года назад +1

      Yeap. I got the same result. I was confused at first that's why I was checking comments and found your comment. Basically he skipped a line.

    • @zubaerahammed
      @zubaerahammed 10 месяцев назад

      Exactly

  • @padaishadhaitechnically5537
    @padaishadhaitechnically5537 5 лет назад +1

    At 11:30, it should be O (n^2) when T(n-2)+1 = n/2*n=n^2/2

  • @dawoodrashid4923
    @dawoodrashid4923 5 лет назад +5

    Sir at 4:15 how did logn+log(n-1)..... change the '+' change to '*' = [n*(n-1)...]?

    • @Thepankaz1
      @Thepankaz1 5 лет назад +10

      I think you got the answer by now but its according to formula,
      log a*b = log a + log b, he has applied it reverse i.e
      log a + log b = log a*b

    • @nikolaikostadinov4036
      @nikolaikostadinov4036 5 лет назад +2

      @@Thepankaz1 you saved my life.... thank you very much for the response

  • @saptarshibose9718
    @saptarshibose9718 3 года назад

    First time I solved this math. Thanks to you 🙏❤️

  • @vakhariyajay2224
    @vakhariyajay2224 2 года назад +1

    Thank you very much. You are a genius.

  • @salariedgirllife
    @salariedgirllife 5 лет назад

    You are best algo teacher in the world

  • @edwintan4784
    @edwintan4784 5 лет назад +1

    How i wish u were my Professor. I’m sure i would have a solid computer science foundation:)

  • @aaronaaronaaron5922
    @aaronaaronaaron5922 4 года назад

    what a wonderfull video 🤸‍♂️🤸‍♂️

  • @yandemusonda6649
    @yandemusonda6649 3 года назад

    I swear , He teaches better than my actual university lecturer

  • @sayanroy4781
    @sayanroy4781 3 года назад

    The last part😍😍😍 Thank You🙏🙏🙏❤❤❤❤

  • @syedmuhammadabdullah2920
    @syedmuhammadabdullah2920 11 месяцев назад

    best teacher ever . Want yo meet you sir

  • @shantanukumar4081
    @shantanukumar4081 3 года назад +1

    doing a great job sir.
    thank u so much sir.

  • @subramaniyanvg6367
    @subramaniyanvg6367 4 года назад

    Finished this one too. Awesome explanation sir.

  • @ramishbatool2994
    @ramishbatool2994 5 лет назад

    Your way of teaching is Excellent

  • @navjeetkaur5742
    @navjeetkaur5742 4 года назад

    Thank u so much sir and the best part was short cut method. God bless u sir.

  • @timlu3126
    @timlu3126 3 года назад

    This man save my life!!

  • @ЗдравкоХристов-в2н
    @ЗдравкоХристов-в2н 4 года назад

    Amazing! It is explained very well.

  • @kamranaesthetics
    @kamranaesthetics 3 года назад +1

    Sir Sir Sir!....Love u❤️

  • @pushpakumarnaidu5583
    @pushpakumarnaidu5583 Год назад +3

    why the log n magically appear, previous videos on n-1 and n+1

  • @ramjitiwari8910
    @ramjitiwari8910 4 года назад +1

    Nice 🌼🌸

  • @dolnuea
    @dolnuea 2 года назад

    BEST TEACHER!!!!!!!!!!!

  • @robinkumar9021
    @robinkumar9021 5 лет назад

    your way of teaching is awesome

  • @qamarzain5216
    @qamarzain5216 6 лет назад

    Sir i really appericiate your efforts the ways you teach us its really fantastic your video lectures helps me to understand the concepts in more detail thanks alot sir

  • @monhern2
    @monhern2 4 года назад

    You are the best teacher!

  • @tadele3947
    @tadele3947 2 года назад

    Amazing lecturer!

  • @biswajitsahoo1456
    @biswajitsahoo1456 4 года назад

    Perfection level is 💯

  • @nagesh007
    @nagesh007 3 года назад +1

    Thanks for the shortcut

  • @piyushgupta809
    @piyushgupta809 6 лет назад

    Great Great level of explanation.

  • @dakshpatel1769
    @dakshpatel1769 Год назад

    Excellent Sir ❤

  • @rohitprasanna4485
    @rohitprasanna4485 Год назад +1

    i just love u sir!!!

  • @FIS_____
    @FIS_____ 5 лет назад +1

    I have a question, in the last substitution (8:00) you wrote log(1)+...+log(n) instead of log(1)+...+log(k). Won't the result be correct only for T(n-k)? You know is log(1)+...+log(n) after the resolution of n-k=0.
    Btw, love the simplicity of your explanations, you're the best

    • @b088mohdzaid5
      @b088mohdzaid5 2 месяца назад

      Yes cause he skipped that step and another way to think is he already mentioned we assume n=k so we can use any of those.

  • @pedramfr3166
    @pedramfr3166 Год назад

    thank you , It helped a lot 🙌

  • @mrak4102
    @mrak4102 3 года назад

    thanks for your great video

  • @yennirafsyam9628
    @yennirafsyam9628 4 года назад

    Thank you professor. Excellent teaching sir.

  • @SRNR_PODCAST.
    @SRNR_PODCAST. 3 года назад +1

    a gold mine in youtube

  • @rnjnmhta.catomato
    @rnjnmhta.catomato 2 года назад

    10:07 : order for other recurrance relations.

  • @aryanrahman3212
    @aryanrahman3212 4 года назад +1

    Sir may Allah bless you

  • @WizBoyYt
    @WizBoyYt 5 лет назад

    Sir, jo apne 7:30 pe log1 likha h uski jagah log(n-k+1) hoga because sir ham phle to use k se hi replace kar rhe h

    • @WizBoyYt
      @WizBoyYt 5 лет назад

      @@abdul_bari ha sir

  • @mohamed_bin_hussein
    @mohamed_bin_hussein 9 месяцев назад +1

    04:47 logarithm distribution

  • @stacywen7908
    @stacywen7908 2 года назад

    This is amazing. Thank you so much.

  • @AllTheFishAreDead
    @AllTheFishAreDead 6 лет назад

    Question: rather than expanding in terms of factorial, can we not make the argument that each of the log calls is ~log(n) (the constant doesn't matter) and we have n of them so nlog(n)?
    EDIT: okay i guess this is addressed partially at the end, thanks!

  • @mohammedadel8948
    @mohammedadel8948 2 года назад

    Thank you , I appreciate your help so much

  • @tusharmaithani3362
    @tusharmaithani3362 6 лет назад

    At 4:00 why you have started from n to 0(up to down).. While in previous video, we have calculated from bottom to top i. e. 0+1+2..+n. Through both cases we get different answer

  • @TaleWeaverJo
    @TaleWeaverJo 7 месяцев назад

    No hatred Only likes for this legend

  • @KCODivyanshuKatyan
    @KCODivyanshuKatyan 3 года назад +1

    Someone please give sir a medal

  • @hussamcheema
    @hussamcheema 6 лет назад

    Level ha sir apka .. Thank you so much.

  • @brahmacharyaadventure6846
    @brahmacharyaadventure6846 4 года назад +1

    Can someone explain me at 4:47 why he took upperbound of log(n factorial)......wht was the need ?

    • @akashshirale1927
      @akashshirale1927 4 года назад +5

      watch his time complexity videos from lec 1...u will understand how lower and upper bound works..
      Here,f(n)= log(n!)
      lets calculate theta bound..
      c1g(n)

  • @subho296
    @subho296 4 года назад

    This is very helpful :)

  • @jenliang5292
    @jenliang5292 5 лет назад

    thanks you sir. great video

  • @PramodRangaiah
    @PramodRangaiah 5 лет назад +1

    sir have a question, logn+log(n-1)+log(n-2)+log(n-3).....+log(1). In this if you take out log as common factor then it should be log[n+(n-1)+(n-2)+(n-3)+(n-4)+.....+1)] but you have taken as log[nx(n-1)x(n-2)x(n-3)x(n-4)x.....x1)]. Could you please explain how?

    • @murthyesn3553
      @murthyesn3553 5 лет назад

      I have the same question .. i stopped the video after this formula.. then i have seen the comments .. you already asked this question.

    • @murthyesn3553
      @murthyesn3553 5 лет назад

      log(n!) = log(1) + log(2) + log(3) + … + log(n)

    • @shantanoosinha
      @shantanoosinha 5 лет назад

      You misunderstood the property of log.
      Property:
      log ab = log a + log b
      so:
      log(1*2*3*4 .... (n-1)*n) = log 1 + log 2 + log 3 + log 4 + .... + log (n-1) + log n

  • @TechnologyViralNews
    @TechnologyViralNews 4 года назад

    Bhut aacha sir