L-2.3: Recurrence Relation [ T(n)= n*T(n-1) ] | Substitution Method | Algorithm

แชร์
ฝัง
  • เผยแพร่เมื่อ 2 ต.ค. 2024
  • #substitutionMethod#solveRecurrenceRelation#algorithm
    👉Subscribe to our new channel: / @varunainashots
    ►Design and Analysis of algorithms (DAA) (Complete Playlist):
    • Design and Analysis of...
    Other subject-wise playlist Links:
    --------------------------------------------------------------------------------------------------------------------------------------
    ► Operating System :
    • Operating System (Comp...
    ►Database Management System:
    • DBMS (Database Managem...
    ► Theory of Computation
    • TOC(Theory of Computat...
    ►Artificial Intelligence:
    • Artificial Intelligenc...
    ►Computer Networks (Complete Playlist):
    • Computer Networks (Com...
    ►Computer Architecture (Complete Playlist):
    • Computer Organization ...
    ►Structured Query Language (SQL):
    • Structured Query Langu...
    ►Discrete Mathematics:
    • Discrete Mathematics
    ►Compiler Design:
    • Compiler Design (Compl...
    ►Number System:
    • Number system
    ►Cloud Computing & BIG Data:
    • Cloud Computing & BIG ...
    ►Software Engineering:
    • Software Engineering
    ►Data Structure:
    • Data Structure
    ►Graph Theory:
    • Graph Theory
    ►Programming in C:
    • C Programming
    ►Digital Logic:
    • Digital Logic (Complet...
    ---------------------------------------------------------------------------------------------------------------------------------------
    Our social media Links:
    ► Subscribe to us on TH-cam: / gatesmashers
    ►Subscribe to our new channel: / @varunainashots
    ► Like our page on Facebook: / gatesmashers
    ► Follow us on Instagram: / gate.smashers
    ► Follow us on Instagram: / varunainashots
    ► Follow us on Telegram: t.me/gatesmash...
    ► Follow us on Threads: www.threads.ne...
    --------------------------------------------------------------------------------------------------------------------------------------
    ►For Any Query, Suggestion or notes contribution:
    Email us at: gatesmashers2018@gmail.com

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

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

    Sir at last the value of n.(n-1).(n-2)............3.2.1 can be O(n!)
    Can't we write this as our answer???

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

    Thanks a lot sir... Love your tutorials. May god bless you :) Thanks for being so good :)

  • @ShivamThakur-rt6js
    @ShivamThakur-rt6js 2 ปีที่แล้ว +57

    Solution of given recurrence relation is n!. But its time complexity is O(n^n). See in worst case we take upper bound (i.e highest possible value for given function ). So we have to find upper bound For n! . If we expand it, it will give us n number of values n times (i.e n(n-1)(n-2).... or factorial of 5 will gives us 5 values 5*4*3*2*1). We also know that while finding O(c) we take it as O(1). So, to summarize O(n!) => O(n*(n-1) * (n-2)....1) => O(n*n*n...n) => O(n^n)

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

      yeah i also got n!. So if question came in exam and both the options are present, should we go for n! or n^n?

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

      @@jigz3903 same qsn..

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

      Wrong. Review what big O represents. If the solution to recurrence is n! then the bound is c*n! because we can find some constant c that will always upper bound n! for some n>n0. While technically true that O(n!) is in the subset of O(n^n) we are trying to make the bounds as tight as possible in these problems. So saying O(n!) = O(n^n) doesn't really provide any useful insight about the algorithm. The solution to this recurrence is O(n!)

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

      @@damianlarocque4958 you sure ?

    • @syedmuhammadabdullah2920
      @syedmuhammadabdullah2920 8 หลายเดือนก่อน +1

      I understand the reasoning provided, but there seems to be a misunderstanding in the interpretation. The time complexity of solving a recurrence relation involving factorials is indeed �(�!)O(n!) and not �(��)O(nn).
      While it's true that �!n! can be expressed as �⋅(�−1)⋅(�−2)⋅…⋅3⋅2⋅1n⋅(n−1)⋅(n−2)⋅…⋅3⋅2⋅1, the growth rate of �!

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

    Sir, shouldn't it be O(n!).
    Can you please explain how we can say that O(n^n) is the answer?
    Is there any role of asymptotic notations here?

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

      Try to expand n! and you'll find n number of n's, and just multiply them

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

      n! is the "answer" of the function whereas n^n is "time" taken by that function. If you want to find f(5), you will get 120 which is n! , on the other hand O(5^5) will be 3125 which is time taken by algorithm to solve problem. And this is the reason you should use "for loop" to find factorial of number which will give you answer in O(n) "time" but not O(n^n)

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

      @@aayushjariwala6256 That's incorrect. The recurrence describes the function in terms of its value on smaller input which tells us the run time of the algo. The algorithm for finding the factorial of a number recursively is actually very simple and is O(n). The algorithm in this problem runs in O(n!)

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

    As usual crystal clear explanation ❤

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

    Finally i found perfect lecture for that topic.
    Thanku sir🎉

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

    Sir, can't we say time complexity of N factorial?! In this case!?

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

      Yes, we can but the answer will remain same only [O(n*n)].

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

      @@koushikkanumuri253 how

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

      @@thedemonlord300 he had taken 'n' common in last but one line . If you observe it clearly it's n! . The time complexity of n! Is [O(n*n)]

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

      @@koushikkanumuri253 What are you trying to say? The time complexity of an algorithm which runs in n! ...is well, O(n!)

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

      @@koushikkanumuri253 for n! It will be O(n power n) order

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

    Sir, Can we write it as O(n!) ?

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

    Dude.......n*(n-1)*(n-2)*........1 = n!
    But not n^n🤦‍♂️🤦‍♂️🤦‍♂️🤦‍♂️

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

    You make this subject easy for me... Thanks

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

    this is the iterative method to solve the recurrence relation

  • @teeshasingh3103
    @teeshasingh3103 4 หลายเดือนก่อน +9

    Teachers in College🤡 Teachers in TH-cam(especially this sir👆)👑🙌🔥
    Not insulting my college teachers, but just speaking up the fact..
    Sir, you are teaching just phenomenal, I lost hope of learning DAA, but watching you, made me again interested in the Subject🔥🙌
    Keep on making more such videos...❤

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

    His teaching way is too better than anyone as well as he's handsome too👀💖

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

    I was confused till I landed on your video. Thnx

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

    sir aap bohat acha parhate hain please pakistan me ajayn karachi wali fast university me akr sary subjects parha den

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

    Isme k times kyu nahi lia is problem mai ??? Can anyone explain ?

    • @SUBZERO-vx7xs
      @SUBZERO-vx7xs 2 หลายเดือนก่อน

      bhai tuze pata chala kya , kyu kiya tha n-1 , k ki jagah

  • @chiragt.lakhani1300
    @chiragt.lakhani1300 4 ปีที่แล้ว +2

    Thanks 😊

  • @iamvikashkk
    @iamvikashkk 9 หลายเดือนก่อน +2

    Galat Bana Hai !!!
    n*(n-1)*(n-2)*........................3*2*1 = n!
    n*n*n*n*n*n*n*.............nth = n^n

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

    Sir if we consider the term N then n*(N-1)*(N-2)(N-3)*..................................................*(N-N) *T(N-(N-1)) ............. does (N-N) Make it zero to whole the equation or Not Please clarify me ? sir after 9 months you not replied my msg please clarify this

  • @anubhavpabby6856
    @anubhavpabby6856 4 ปีที่แล้ว +10

    Time complexity should be O(n!) Here?

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

    Sir can we conclude as O(n!)?

  • @sakshambairathi6058
    @sakshambairathi6058 4 ปีที่แล้ว +31

    I have been searching this topic from a while and believe me no one on youtube could explain it as good as you did thankyou and keep making more videos

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

    Sir iska Time Complexity n! kyu nhi ho sakta?
    Thanks for you videos Sir

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

      same doubt

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

      Same doubt here. Mujhe lagta hain yeah O(n!) Hi hoga

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

    n*(n-1)*(n-2)*(n-3).......1 =n! Only why you write O(n^n)

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

    Sir, shouldn't we take n steps to get n-(n-1) cause for 0th step we got n-1, for st step we got n-2 and so on

  • @anubala7545
    @anubala7545 4 ปีที่แล้ว +8

    Thanqq sir... Aapse Acha or koi nhi pda skta...aap free me itne ache lecture provide krwa rhe ho hme.. thanqq soo much

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

    This is so wrong. This problem is for solving factorial using recursion. The time complexity of this is O(n)

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

      Hi i need some hrlp do u help please??

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

      @@huriarauf189Hi, I wish I could help. I had commented when I was in college. Now I have forgotten everything

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

      @@jotarokujo5043 ohk am facing algorithm problems

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

      ​@@huriarauf189 same problems with me

    • @imaditya7887
      @imaditya7887 8 หลายเดือนก่อน +8

      Certainly! Let's solve the recurrence relation T(n) = n * T(n-1) with the base case T(1) = 1 using the substitution method.
      1. Base case (n = 1):
      T(1) = 1
      2. Assume the formula holds for T(k):
      T(k) = k * T(k-1)
      3. Substitute this assumption into the original recurrence relation for T(n):
      T(n) = n * T(n-1)
      T(n) = n * (n-1) * T(n-2)
      T(n) = n * (n-1) * (n-2) * T(n-3)
      ...
      T(n) = n * (n-1) * (n-2) * ... * 2 * 1 * T(1)
      4. Now, replace T(k) in the assumed formula with its expanded form:
      T(n) = n * (n-1) * (n-2) * ... * 2 * 1 * k * T(k-1)
      5. Simplify the expression:
      T(n) = n!
      So, the solution to the given recurrence relation is T(n) = n! (n factorial).

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

    it's good to watch these videos before exam rather than attending those boring college lectures.

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

    If Loud and Clear had a face❤️❤️.
    I was trying to understand what was written in book and watched this video. Guess what now i open boom just to know next topic🙏🙏.

  • @salilshukla2686
    @salilshukla2686 4 ปีที่แล้ว +70

    No one can teach more clearly than you sir.

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

    Sir but I have a doubt why it is not O (N!) because for large N 2/N and other terms like that ytend to be zero and N^N will be tend to infinite resulting in an indefinite form

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

    Kamaal he👍🏻

  • @Ramu_Sriram
    @Ramu_Sriram 4 หลายเดือนก่อน +1

    Thank you bhai. This topic was confusing during the semester when I was studying DAA. But after practicing recursion questions in DSA and watching this video, it finally made sense for me.

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

    I am an MCA student and your videos helps me to understand the topic thoroughly, Keep growing!
    😇

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

      Bhai am also doing mca 2nd semester

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

      mam is it worth to go for mca or look for any job.... i am a bsc cs student

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

      @@priyansh6978 It depends on you. If you want to pursue a master's go for it. If a job is your priority go for a job.

  • @ramshamanzoor8049
    @ramshamanzoor8049 4 ปีที่แล้ว +13

    much appreciated teaching method THANKYOU ....

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

      A tip: you can watch movies on Flixzone. Me and my gf have been using it for watching all kinds of movies lately.

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

      @Kylen Cannon yea, I've been using Flixzone} for since december myself :D

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

      @Kylen Cannon Yea, been watching on flixzone} for since december myself :)

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

    but sir .......n*(n-1)*(n-2)*(n-3)...........3.2.1 = n! bhi likh sahkte hai na sir....to itna complex kyo kiye sir ....N KO COMMON LEKAR????

  • @Muqaddas_3203
    @Muqaddas_3203 4 หลายเดือนก่อน +1

    Watching during exam😅❤

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

    If series is n*(n-1)*(n-2)*.....*1 then isn't it n! ?

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

      Same question. Why not n!

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

      n^n is called factorial time complexity only because n^n > n! so it will cover all the cases of n! and inturn using n^n makes the maths easy.

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

      @@himanshumaheshwari3210 yes, true

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

    Wrong answer! Time complexity should be O(n)

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

    I have one small question; why cant we write O(n!) instead of O(n^n)

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

      bro did you get the answer? If you have answer of your question then please share

  • @Mandeepsingh-jo5cf
    @Mandeepsingh-jo5cf 2 ปีที่แล้ว

    Thanks!

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

    If it is like T(n) =T(n-1)*n^n please
    Solve this qn also sir

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

    Sir it is backward substitution or forward substitution

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

    Superb teaching sir 👌

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

    the series is equal to n!.
    not n^n

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

    Correct answer is O (n)

  • @mr.mohammedmobinakhtar2617
    @mr.mohammedmobinakhtar2617 4 ปีที่แล้ว +2

    Plz solve by
    substitution method T(n) = T(n - 1) + T(n/2) + n

  • @KING-ni4ze
    @KING-ni4ze 2 ปีที่แล้ว +22

    Sir you are just like Physics Wallah Sir. Thank you for your valuable classes.

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

    Sir shouldnt the complexity be o(n!)??

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

    can you please help me solving this recurrence relation T(n)= n*T(n-1) + n^2 ?

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

    Very helpful all your videos but sir y niche black m wording likhke ati h to hm ache s method dekh ni pate iski vje s vo hide hojate h🙄

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

    This isn't substitution method, this is iteration method for solving recurrence relation.

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

    4:45 bhai x(n-(n-1)) ? kaise kr lete hu ?
    ye tu x(n- n ) hona chaheye...aur agar n-1 hai tu pir tu x(n-1 - (n -1) ) hona chaheye

  • @Abhay.Bhandari
    @Abhay.Bhandari 4 ปีที่แล้ว +1

    For worst case it is O(n^n) and for best case is it omega(n!)?

    • @Abhay.Bhandari
      @Abhay.Bhandari 4 ปีที่แล้ว

      @@sohamnandi4708 I am asking not answering.

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

      Same doubt I have ...

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

    well explained

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

    that is iteration method not substitution method

  • @harini.a7934
    @harini.a7934 4 ปีที่แล้ว +6

    Thank u sir for this wonderful video
    ...

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

    Please make videos on solving problems by recurrence tree method ..

  • @samanmustafa-zy7yu
    @samanmustafa-zy7yu 5 หลายเดือนก่อน

    Sir you didn't make a lecture on some topic I don't understand anyone I am having a hard time.

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

    Can't we write it as O(n!) as it's 1 * 2 * ... * n - 1 * n???

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

    Thnk u sooo much

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

    Many many thanks from Türkiye :)

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

    I didnt get why is it not factorial time?

    • @Abhay.Bhandari
      @Abhay.Bhandari 4 ปีที่แล้ว

      Bro he is one of the best teacher. He only likes the comments which are compliment for him. He never clears doubt.

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

      @@Abhay.Bhandari was this a compliment for him?

    • @Abhay.Bhandari
      @Abhay.Bhandari 4 ปีที่แล้ว

      @@ramakrishnasen4386 it depend on sir. How he will take this. By the way from my side its a good compliment.

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

    The time complexity of factorial algorithm is O(n) because we conside n*T(n-1) as T(n)=T(n-1)+1 please rectify it .Here +1 if for multiplication it is not n-times

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

    I think your second last step is wrong, where you take common of n. If you multiply n(1-1/n) it will come out as (n-1/n) = (n^2 -1)/n
    And you can't eliminate n^2 by n while there is minus
    Idk if i am wrong

  • @Mr.Creapu
    @Mr.Creapu ปีที่แล้ว +1

    yaha and ni(n factorial) kyu nahi ho sakta hai ??

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

    u r simply superb... i too taught Daa ... but watching ur videos make my day

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

    Best teacher ever!!!

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

    sir i think it should be O(n!), we can not interchange O(n ^n) and O(n!) time complexities

  • @younus.athlete
    @younus.athlete ปีที่แล้ว +2

    Sir !! Your Level of Teaching is very closer to our thought.. I really like your way of Teaching ...

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

    Why didn't we write O(n!) ?

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

    *******Order of N****** O(n) is the correct answer.you calculated wrong time complexity.

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

    sir, n*n-1*.....3*2*1 isko sidha n factorial nhi likh skte? ya fir O k andr factorial sign nhi ata?

  • @Phoenix-wr6rn
    @Phoenix-wr6rn 2 ปีที่แล้ว +2

    Please explain about iteration method also🙂

  • @IslamicRizzz
    @IslamicRizzz 10 หลายเดือนก่อน +1

    some one tell me last ma 3*2*1 kasy aya????

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

      If we take n = 100 for the series n*(n-1)*(n-2)......T(1) then the series will be like 100*(100-1)*(100-2)....(100-97)*(100-98)*T(1), the last term will be 1 as T(1) = 1

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

      @@kirisakiElla Please explain again ke end mai 3 2 1 kese agya

    • @kirisakiElla
      @kirisakiElla 9 หลายเดือนก่อน +2

      @@hannanbaig7888 Last term given hai T(1) and according to question T(1) =1 and our series is n*(n-1)*(n-2)*(n-3)......T(1), so it means at every step the value of n is decreasing by 1 until it reaches the last term T(1) = 1, So for example if we take n=100 (put 100 in place of n in the series) our series will become 100*(100-1)*(100-2)*(100-3)....(100-97)*(100-98)*T(1) which is 100*99*98*97....3*2*1

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

    Can't we write it as O(n!)?

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

    why did you take n common in the last step when it could be seen that it is a factorial representation? that means n!.

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

    Sir why we are elementing T(n-3) reason ??

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

    Thank you sir for make this video and this is very helpful.

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

    Well its Iteration Method

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

    Sir how can we solve 2T(n/2)+2 power k

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

    dude, which language is this ?!

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

      That's Hindi.

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

      @@bykenvisions is that Hindi or kinda hybrid of English and Hindi, because some of the sentences sounds like English

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

      @@yigithansaglam9128 Bruv he is not completely speaking in hindi, he is using english words in between. You can call that a hybrid if you wish so. If you watch carefully u will be able to understand it. Maths has no language mate.

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

    Kuchh bhi samajh nanhi araha hai
    Mein aur bhi confuse ho jaa raha hun

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

    Thank you sir 🙏🏻 This is very clear explanation.

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

    It's hard to understand when he's going back and forth from languages

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

    completed

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

    Can someone say that this recurrence expression is for which problem (matrix multiplication, knapsack , maximum sub-array, etc)?

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

    As we see here we have n * (n-1) * (n-2) * ..... * 2 * 1. Even if we multiply the terms, the product here would be a polynomial of order n. That is the largest term of the product is n^n. Can we say that T(n) is O(n^n) by citing this reason? Idk if my understanding here is right here, correct me if I am wrong.

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

      As i feel its a no.but not 100% sure. If we didn't take n out of the bracket, we get O(n) = n! right? which is much lower than n^n?

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

    if base condition is not available

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

    what is the name of the algorithm with this recurrence relation? someone help, please

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

    why n power n can't we say n factorial time complextiy

  • @nikhilkumarsingh2348
    @nikhilkumarsingh2348 10 หลายเดือนก่อน +1

    Leaning currently this Playlist of DAA .Thank you so much sir ❤.Keep growing and keep smiling 😊

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

      kuch samaj meh aya kya

  • @kalpanamishra1758
    @kalpanamishra1758 13 วันที่ผ่านมา

    We start with the recurrence relation:
    𝑇(𝑛)=𝑛×𝑇(𝑛−1)
    T(n)=n×T(n−1)
    Now let's repeatedly substitute to expand the terms:
    Substitute 𝑇(𝑛−1)
    T(n−1):
    𝑇(𝑛)=𝑛×𝑇(𝑛−1)=𝑛×(𝑛−1)×𝑇(𝑛−2)
    T(n)=n×T(n−1)=n×(n−1)×T(n−2)
    Substitute 𝑇(𝑛−2)
    T(n−2):
    𝑇(𝑛)=𝑛×(𝑛−1)×(𝑛−2)×𝑇(𝑛−3)
    T(n)=n×(n−1)×(n−2)×T(n−3)
    Substitute 𝑇(𝑛−3)
    T(n−3):
    𝑇(𝑛)=𝑛×(𝑛−1)×(𝑛−2)×(𝑛−3)×𝑇(𝑛−4)
    T(n)=n×(n−1)×(n−2)×(n−3)×T(n−4)
    General Form:
    Continuing this process, we observe a pattern. After
    𝑘
    k steps, we have:
    𝑇(𝑛)=𝑛×(𝑛−1)×(𝑛−2)× ⋯ ×(𝑛−𝑘+1)×𝑇(𝑛−𝑘)
    T(n)=n×(n−1)×(n−2)×⋯×(n−k+1)×T(n−k)
    This expansion continues until we reach the base case, which is typically
    𝑇(1)=1
    T(1)=1 (it's given in the recurrence).
    Final Step (Base Case):
    For
    𝑘=𝑛−1
    k=n−1, we reach:
    𝑇(𝑛)=𝑛×𝑛−1)×(𝑛−2)×⋯×2×𝑇(1)
    T(n)=n×(n−1)×(n−2)×⋯×2×T(1)
    Given that
    𝑇(1)=1 we get:
    𝑇(𝑛)=𝑛×(𝑛−1)×(𝑛−2)×⋯×2×1=𝑛!
    T(n)=n×(n−1)×(n−2)×⋯×2×1=n!
    Conclusion:
    So, by using the substitution method, we've confirmed that:
    𝑇(𝑛)=𝑛!
    The recurrence relation represents factorial growth. Thus, the time complexity is
    𝑂(𝑛!)
    Correct me if i am wrong but in my opinion, this is how this question should be solved. A discussion would be appreciated.

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

    shouldn't it be n! ?

  • @dybov5473
    @dybov5473 2 วันที่ผ่านมา

    Wrong explanation! Be Aware

  • @AnuragSharma-2782
    @AnuragSharma-2782 9 หลายเดือนก่อน

    Sir this is called iteration method not substitution...

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

    Shouldn't the answer be O(n!).

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

    time complexity of factorial is O(n) or O(n^n) ?

    • @DEVANSHGOEL-dq1wh
      @DEVANSHGOEL-dq1wh 3 ปีที่แล้ว

      O(n)

    • @ShivamThakur-rt6js
      @ShivamThakur-rt6js 2 ปีที่แล้ว

      its O(n^n). See in worst case we take upper bound that is highest possible value. For n! if we expand it it will give us n number of values n times (i.e n(n-1)(n-2)....). We also know that while finding O(c) we take it as O(1). So, to summarize O(n!) => O(n*(n-1) * (n-2)....1) => O(n*n*n...n) => O(n^n)

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

    thnx alot sir🙏🙏❤❤

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

    N factorial it should be and not pow(n,n)