L-2.5: Recurrence Relation [ T(n)= T(n-1) +logn] | Substitution Method | Algorithm

  Рет қаралды 469,815

Gate Smashers

Gate Smashers

Күн бұрын

Пікірлер: 273
@KaziMd.RakibulHassan
@KaziMd.RakibulHassan 9 ай бұрын
For those who are confused when sir wrote the equation n - k = 1, so, k = n -1 if we input the value in the eq then it is become 1 + log2 + log3 + log4+ log5 + ...... as we all know log1=0 if we write, 1+0+ log2 + log3 + log4+ log5 + ......, there is no problem adding a zero in the eq. then we can replace the 0 with log1 simple, now the eq becomes 1+log1+ log2 + log3 + log4+ log5 + ......, which sir wrote in white board so there is actually no problem. Sir did it right....
@sejalyadav6852
@sejalyadav6852 9 ай бұрын
log 0 will come if we take k=n-1, which is impossible to solve...
@A2_26_Tushar_kalaskar
@A2_26_Tushar_kalaskar 8 ай бұрын
final ans bata, kya hai to
@himanshushah6746
@himanshushah6746 8 ай бұрын
He did make the mistake you mentioned but the mistake lead him to add log1(an extra term which should not be added) to the equation. However, it made no difference since log1 is equal to 0 so its like adding an extra 0 to the answer. Please let me know if i am wrong
@sudhansusekhardaspritam7773
@sudhansusekhardaspritam7773 7 ай бұрын
@@himanshushah6746 wrong question * { 1 if n=0 }
@FITSOUL01
@FITSOUL01 7 ай бұрын
Thanks bhai Mera sir phat gaya
@checkmate0923
@checkmate0923 3 жыл бұрын
Sir, at 6:25 when you equate n-k with 1 then k will be n-1 not just 1. And then the whole equation will get changed after 6:57.
@apexmousham8511
@apexmousham8511 3 жыл бұрын
Answer will be same with same mistake 😳
@ayushsharma4842
@ayushsharma4842 3 жыл бұрын
Yess you are right
@subhayukumarbala1680
@subhayukumarbala1680 3 жыл бұрын
I too got stuck there thinking it'll be 2 😂
@gautamgupta7148
@gautamgupta7148 3 жыл бұрын
yes you are right but even if we write it that way we can still add 1 in multiplication within logn and answer will be same but yes it should be equal to n-1
@rahulyo.gaming
@rahulyo.gaming 3 жыл бұрын
Yaa You Got It Bro 👍😉
@ramijhasanshaik-4177
@ramijhasanshaik-4177 9 ай бұрын
TIPS: Take the two conditions as n = 0; n >0; Rest will be fine. Hope it helps you, guys. Love you sir ❤
@Forthero_J
@Forthero_J 7 ай бұрын
Bro, you are saviour 🫡
@LearnwithRohit-od1hw
@LearnwithRohit-od1hw Жыл бұрын
dear sir here n-k=1 then k will be n-1 and whole equation and question will change at 6:30.
@atharvanimkar6577
@atharvanimkar6577 9 ай бұрын
There is one mistake in given condition everyone should be corrct it.... if n=0 if n>0 This are the correct condition given...👍🏼👍🏼
@lifeandme7360
@lifeandme7360 3 жыл бұрын
At 7:20 of your video....sir n-k=1 n-1=k aayega...not n=k
@kuldeeptiwari1820
@kuldeeptiwari1820 2 жыл бұрын
yeah same i was wondering i am the only on who thought that but still i am getting log 0 in equation which is not possible to solve **edit it will be start from log 2 to log n and time complexity will be same O(n log (n))
@sarbajitacharjee1195
@sarbajitacharjee1195 Жыл бұрын
T(0)=1 may be the Equation
@princemaurya3165
@princemaurya3165 Жыл бұрын
you are right
@dopo_orichi
@dopo_orichi Ай бұрын
@@kuldeeptiwari1820 yes i got same starting from log 2 to log n
@devamshah9649
@devamshah9649 2 ай бұрын
no need to do k = n -1 it will be like T(n-k)=T(1) which is 1 so our equation will be as follow 1+log2+log3+log4+......+log(n-1)+log(n) =1+log(2*3*4*5*...(n-1)*n) =1+log(n!) So time complexity will be O(log(n!))
@yogeshmishra5658
@yogeshmishra5658 Жыл бұрын
don't worry answer is right see explanation n-k=1 k=n-1 T(n)= 1+log(n-(k-1)) +log(n-(k-2)) +log(n-(k-3)) +log(n-(k-4))....................logn T(n)= 1 +log(n-(n-1-1)) +log(n-(n-1-2)) +log(n-(n-1-3))..................logn T(n) = 1 +log2 + log3+ log4+.........logn T(n)= 1+log(2*34*5*6*7*.......................*n) T(n)= 1+log(1*2*34*5*6*7*.......................*n) T(n)= 1+log(n!) T(n)= 1+log(n^n) (how it come see video 8.50) T(n)= 1+nlog(n) 0(nlogn)
@harshakannake1930
@harshakannake1930 Жыл бұрын
if we taking log as a common then in bracket it should be 2+3+4+5+6.. isn't it
@pratapsingh-mv3gg
@pratapsingh-mv3gg 3 жыл бұрын
Happy Teachers' Day Sir. Your explanation style is really eye catching which help us to beat any level of question from any level of concepts. Thank You So much for all of your guidance and support. 🙏
@SAKSHISHARMA-ps3sz
@SAKSHISHARMA-ps3sz 3 жыл бұрын
Computer science ka kuch pta hi nhi tha... Itna interest se pdhaya ki hr topic ka pta h ab apse pdhkr
@utkarshtiwari8590
@utkarshtiwari8590 3 жыл бұрын
I haven't started studying yet, so can you please tell me does this channel has the complete course for GATE?
@pankajpriyadarshy2365
@pankajpriyadarshy2365 3 жыл бұрын
LOTS OF THANK SIR, I WATCHED YOUR ALL(60) VIDEO OF DAA. I AM VERY GLAD TO SEE THIS. I AM VERY INSPIRED WITH YOUR VIDEO LECTURE AND DECIDE TO DO MCA COURSE. I WISH THAT YOU GUIDE ME. I ALSO WISH THAT YOU UPLOAD ALL VIDEO OF SYLLABUS OF MCA. YOUR EVERY VIDEO GIVE DEEP KNOWLEDGE AND BETTER THAN VIDEO PROVIDED BY UNIVERSITY.
@shorts_afx
@shorts_afx Жыл бұрын
Confusion clear, n-k = 1, n = 1 + k k = n - 1 Agar hm n-k = 1 put krke ans. Nikale to ans. Same hi ata hai. 1 + log(n-k+1) + log(n-k+2)........ log(n-3) + log(n-2) + log(n-1) + logn aisa eq.ayega Aur isme *n-k* ko 1 se replace kr do.. To ans. Log(n!) Aa jayega
@904_arghya8
@904_arghya8 3 жыл бұрын
I don't know whether you are reading my comment or not, but wishing you Happy Teacher's Day Bhaiya. You are our Bhaiya as well as a teacher. Lots of love and respect for you, for your effort in providing us such a best courses.
@hafeezaslecturesofcomputer4427
@hafeezaslecturesofcomputer4427 3 жыл бұрын
Pls tell how n-k=1 statment is becomes n=k
@raunakgupta1475
@raunakgupta1475 2 жыл бұрын
No,it is n - k = 0
@MusicOnTopXHindi
@MusicOnTopXHindi 2 жыл бұрын
Approx value is taken as 1000 is approximately equals to 1001 . we cannot find the exact time taken by an algorithm to complete. And also in last we are neglecting constant for finding time complexity. So approx value is taken.
@ananya88agrawal
@ananya88agrawal 2 жыл бұрын
Yes it's k=n+1
@ganeshkumargupta8614
@ganeshkumargupta8614 2 жыл бұрын
@@ananya88agrawal answer mil Jai toh batana 🙂
@NavendrakumarBanjare
@NavendrakumarBanjare 2 жыл бұрын
@@ananya88agrawal k= n-1 😊
@codeattraction2070
@codeattraction2070 3 жыл бұрын
Happy teacher's day 👏👏👏👏 love from Gujarat
@adityasharma2442
@adityasharma2442 3 жыл бұрын
Completed whole playlist today, thank you sir for your efforts, will donate a big amount soon.
@anugrahmasih6347
@anugrahmasih6347 3 жыл бұрын
@Anna English I can share but I have done till lecture 17
@anugrahmasih6347
@anugrahmasih6347 3 жыл бұрын
@Anna English But I was wondering how are you getting these lectures, these are a mix of both hindi and english ?
@observantmagic4156
@observantmagic4156 2 жыл бұрын
I will donate after I get placement 😂
@superblitz2274
@superblitz2274 2 жыл бұрын
@@anugrahmasih6347 whats there to wonder lol, if you understand both hindi and english, its simple
@learncseasily3385
@learncseasily3385 2 жыл бұрын
If u have completed the playlist then why are u here ? You should comment this on the last lecture
@mohammadshahriar5426
@mohammadshahriar5426 9 ай бұрын
lots of love from Bangladesh.....keep up the good stuff
@priyanshisharma8297
@priyanshisharma8297 3 жыл бұрын
Happy Teacher's day sir may god increase your subscriber day by day. Your way of teaching helps me to clear my concepts also when i solve the question I remember your videos it just makes easy for me to do that. Thanku sir for all your dedication and hardwork.
@rahulkiteck692
@rahulkiteck692 3 ай бұрын
Where are you from?
@AnjaliGupta-op1hr
@AnjaliGupta-op1hr 3 жыл бұрын
Happy teacher's day sir✨♥️
@musicandmelody5156
@musicandmelody5156 3 жыл бұрын
Happy teacher's day sir. Thank you so much to help us for gaining knowledge.
@wisdomdoor7712
@wisdomdoor7712 Жыл бұрын
Those who are asking about how k=n , just take n-k=1 then k=n-1 then use it in previous equation so T(n)=T(n-(n-1))+log(n-(n-1-1))+++++log n ; then T(n)=T(1)+log 2+log 3+++++log n ; T(n)=1+ log(2 3 4 5 n) T(n)=1+ log(1 2 3 n) T(n)=log(n!)
@ManpreetKaur-in6gz
@ManpreetKaur-in6gz 3 жыл бұрын
Happy teacher's day Sir... 🙏
@rupaleeranjan2783
@rupaleeranjan2783 3 жыл бұрын
Happy teacher's day sir You are the best teacher for CSE students...you work so hard for us Thank you so much ☺️
@alt-f4gaming222
@alt-f4gaming222 2 жыл бұрын
bhai ek hi dil h kitne bar jitoge......
@puja411
@puja411 3 жыл бұрын
Happy Teacher's Day Sir 🙏❤😊
@ReelVibesGram
@ReelVibesGram 2 жыл бұрын
Sir you taking the value of n=k which is wrong you take it n=k+1 so we become n-k=1. How it is possible to obtain n=k from n-k=1.
@SAKSHISHARMA-ps3sz
@SAKSHISHARMA-ps3sz 3 жыл бұрын
Sir apki kya tarif kre plzz ap hi btao...??? Happy teacher day.. Or bhgwan apko hmesha age se age success de.. Or apki family khush rhe
@TheMotohead
@TheMotohead 11 ай бұрын
I do think the complexity will be log n as the series goes like t(1), log (2), log(3), ……….. log(n)
@abhishekjain3344
@abhishekjain3344 9 ай бұрын
the number of log terms is not fixed, it will depend on n, that's why the complexity is not logn
@deepakgautam6904
@deepakgautam6904 2 жыл бұрын
6:25 n-k= 1
@allahthemostmerciful2706
@allahthemostmerciful2706 2 жыл бұрын
Sir u are super duper awesome. I really appreciate your effort and your style of teaching .Really JazakAllah🤍
@itzmranonymous
@itzmranonymous 2 жыл бұрын
i have taken n-k =1 and got the same answer .😊
@adityaanand5927
@adityaanand5927 2 жыл бұрын
Haa in last 1 + n log n - log n and then n log n dominating so order will O(nlogn)
@techkid358
@techkid358 11 ай бұрын
Sir, at 6:25 when you equate n-k with 1 then k will be n-1 not just 1. And then the whole equation will get changed after 6:57. solution - equate n-k with 0 n-k=0 k=n
@AshmitKumar-ip9tr
@AshmitKumar-ip9tr 10 ай бұрын
If agr last tak ka part smjh nhi aaye then what to do please tell
@abhishek2107
@abhishek2107 2 жыл бұрын
Smasher bhaiya zindabad gate fod denge .......is baar lgta hai .
@Abir_Dutta
@Abir_Dutta 3 жыл бұрын
Happy Teacher's Day Sir.
@VK_BRANDING
@VK_BRANDING 3 ай бұрын
Adv congo for 2 millllllionn !!!!😮❤❤
@AbhiRaj_37
@AbhiRaj_37 9 ай бұрын
Thanks sir
@ape1760
@ape1760 3 жыл бұрын
Happy teacher's day sir 🙏
@abubakarakhlaq7515
@abubakarakhlaq7515 Жыл бұрын
Happy teacher day Sir! and at 6:25 n=k is wrong as you said n-k=1
@swetakr1269
@swetakr1269 2 жыл бұрын
Thank you sir 😊
@kanikachouhan6557
@kanikachouhan6557 10 ай бұрын
I have a doubt, I think the method you are following is iteration method & subtitution uses mathematical induction. But I too find this method easy & I understood the methodology clearly. Thanks
@AshmitKumar-ip9tr
@AshmitKumar-ip9tr 10 ай бұрын
If agr last tak ka part smjh nhi aaye then what to do please tell
@gopalmaheshwari7555
@gopalmaheshwari7555 3 жыл бұрын
Sir there is a one minstake at 6.36 min of lac.. Here u had taken a.. n-k= 1:::::: and in the next step u had taken (n=k) Which is wrong... n=k+1 aata h
@swayamawasthi4030
@swayamawasthi4030 2 жыл бұрын
N-K =1 will be N = K-1 AS N != K. THE EQUATION WILL BE MODIFIED AFTER 6:56
@SidsAnalysis
@SidsAnalysis Жыл бұрын
You also written Wrong Right 👉 n = k + 1 and k = n -1
@bhavanagayathri1347
@bhavanagayathri1347 3 жыл бұрын
Happy teacher's day sir
@dharitrisardar3823
@dharitrisardar3823 3 жыл бұрын
Happy teacher's day 💐💐💐💐💐💐💐💐💐💐💐💐💐💐💐💐
@Deep_Nature_03
@Deep_Nature_03 3 жыл бұрын
Happy teacher's day sir ji
@dhananjaykansule3152
@dhananjaykansule3152 3 жыл бұрын
Happy Teacher's day Sir😍
@debaratighatak2211
@debaratighatak2211 3 жыл бұрын
Happy Teachers' Day sir😊❤
@anukriti5648
@anukriti5648 3 жыл бұрын
Happy Teacher's day sir ✨☺️
@nithishasaravanan1738
@nithishasaravanan1738 3 жыл бұрын
Happy Teacher's Day Sir :))
@pankajpriyadarshy2365
@pankajpriyadarshy2365 3 жыл бұрын
I wish that you upload video of programming language, C++, PYTHON, JAVASCRIPT, HTML. ETC.
@sundeepkumar760
@sundeepkumar760 3 жыл бұрын
sir, i guess n-k = 1 will give k=n-1....
@khabylamefan48
@khabylamefan48 3 жыл бұрын
Happy Teachers day sir❤️
@adddddi781
@adddddi781 11 ай бұрын
n-k=1 then k=n-1?
@albatablays24
@albatablays24 3 жыл бұрын
yhn jo aapny n-k=1 lya hy so eq me wo bhi tw put krskty hy
@nibeditadas4800
@nibeditadas4800 2 жыл бұрын
thank you you made day .
@Ap__54
@Ap__54 2 жыл бұрын
Sir apne n=k q lia usse to T(0) ho jara , Apko to n-1 =k lena chahiye tha na , tb T(n-(n-1))=T(1)=1 hota . Please 🙏 clarify.
@snehapandey3716
@snehapandey3716 3 жыл бұрын
Sir in this at 7:50 if n-k=1 then k=n-1 ? Right or wrong
@snehapandey3716
@snehapandey3716 3 жыл бұрын
Sorry At 2:25
@sumitraina4615
@sumitraina4615 2 жыл бұрын
@@snehapandey3716 yess!! I was wondering the same! And in the end log 1 also won't come but answer will be same in the last....but vo k=n-1 hoga
@mohammadanassheikh1446
@mohammadanassheikh1446 2 жыл бұрын
KING
@calisthenics-
@calisthenics- 3 жыл бұрын
Happy teachers day to varun sir 🙏
@AshmitKumar-ip9tr
@AshmitKumar-ip9tr 10 ай бұрын
If agr last tak ka part smjh nhi aaye then what to do please tell
@pincetoons
@pincetoons Жыл бұрын
great job
@saptarshibose9718
@saptarshibose9718 3 жыл бұрын
sir, it can be done directly with a formula. ! anyway I love your teaching style. I learnt a lot from you. thanks for providing such contents
@S.A.98
@S.A.98 3 жыл бұрын
Which formula ?
@saptarshibose9718
@saptarshibose9718 3 жыл бұрын
@@S.A.98 if problem statement like T(n-1) fx then multiply n with fx. if 2(t-1) fx then 2 power n * fx or 3(t-1) fx then 3 power n multiply fx. or 2(t-1) then 2 power n. and so on...
@hafeezaslecturesofcomputer4427
@hafeezaslecturesofcomputer4427 3 жыл бұрын
Pls isko sahe tara se explain kre not understanding
@Mridulmishra06
@Mridulmishra06 6 ай бұрын
Sir agar kisi question t(1) =1 wale conditions nhi mention h to kya hum apne man se maan ke solve kr skte hain?
@A2_26_Tushar_kalaskar
@A2_26_Tushar_kalaskar 8 ай бұрын
tiem complexcity = 0(n^2 logn) , hai kya is it correct
@vanshgawra
@vanshgawra 2 жыл бұрын
I did it by using n-1 steps instead of k steps and i also got the same answer
@RohitRayakwar
@RohitRayakwar 3 жыл бұрын
Sir please make video on class p and Np completeness .. please sir i am watching your video from my college starting period of time.
@rahultiwary4257
@rahultiwary4257 Жыл бұрын
Happy Teacher ''s day
@bite091_jamee7
@bite091_jamee7 2 жыл бұрын
sir u r great
@farahnisa5475
@farahnisa5475 2 жыл бұрын
After equating n and k, the term T(n-k) should yield zero, won't you agree? If so, then how come it becomes one? To make the term T(n-k) equal to T(1), shouldn't we put the value of k=n-1 so that when its substituted, it becomes: T(n-(n-1))=>T(n-n+1)=>T(1)
@shubhamsukum
@shubhamsukum 2 жыл бұрын
yeah
@shubhamsukum
@shubhamsukum 2 жыл бұрын
we put n-k=1 *** -k=-n+1 *** k=n-1. we have to substitute k=n-1 not n.
@Megh_Jagtap
@Megh_Jagtap Жыл бұрын
It is easy to understand that sir made a mistake. This mistake can be ignored and the answer can be found by taking k=n-1 by our own. Simple.
@darshitsheer2633
@darshitsheer2633 Жыл бұрын
When Mathematics and Algorithms combines. It ruins maths as we have to take approx in Algorithms Complexity.
@sahilingale8906
@sahilingale8906 3 жыл бұрын
Thank You SO Much Sir
@youngboys7342
@youngboys7342 2 жыл бұрын
Thank you sir
@JanakkumarPanchal
@JanakkumarPanchal 2 жыл бұрын
n-k=1 So that K=n-1 How can possible sir n=k
@vanditasharma368
@vanditasharma368 2 жыл бұрын
if possible teach us DIP AND CLOUD
@gangadharamdantu9614
@gangadharamdantu9614 3 жыл бұрын
Happy teacher's day to our best teacher.may god bless u with all the happiness and peace in life 💐💐
@devenpatel4684
@devenpatel4684 3 жыл бұрын
If n-k =1 So n =k-1 nai?
@kaymylon9711
@kaymylon9711 2 жыл бұрын
6:32............if n-k=1 then how come n=k................it's blowing my mind
@Priankadey2011
@Priankadey2011 Жыл бұрын
If the value of n-k = 1 then how it is possible that the value of k = n?? It has to be k = n-1
@cheena30
@cheena30 3 жыл бұрын
🌸Happy Teacher's Day to u Sir 🌸...Thnk u for your all efforts for us...Ur video lectures help us a lot🙂 Thnk u so much sir for always being there to help in live sessions also 🙃 We will always here to support u✌🏻
@shahinparween3496
@shahinparween3496 3 жыл бұрын
Happy teacher day 🙏🙏
@sayandatta389
@sayandatta389 9 ай бұрын
Question is wrong..... if n=0 & n>0 then n-k=0 => k=n
@anurag3150
@anurag3150 3 ай бұрын
I agree
@Banditxam4
@Banditxam4 Жыл бұрын
n-k =1 hua to k = n-1 hoga na or am I dumb
@dibyenduprodhan9089
@dibyenduprodhan9089 3 жыл бұрын
Happy Teacher's Day ❤
@ashishkumarsarma5359
@ashishkumarsarma5359 2 жыл бұрын
Sir how n-k= 1 became K=n ? It must be n= 1+ k right?
@kunalmishra4811
@kunalmishra4811 2 жыл бұрын
can we take this steps n-1 instead of k?
@sahilsaraogi5189
@sahilsaraogi5189 Жыл бұрын
Did you got the answer?
@atifhassan8098
@atifhassan8098 3 жыл бұрын
sir how to solve recurrence relation by tree method? plz upload video on that
@RASmi-s_CREATION
@RASmi-s_CREATION 8 ай бұрын
at 6:25 k=n-1
@akatachadar2846
@akatachadar2846 3 жыл бұрын
Sir plz add videos for k map also in digital
@adityatiwari9535
@adityatiwari9535 7 ай бұрын
how it is possible if n-k =1 then k=n how it is possible sir??
@summaiyalateef5913
@summaiyalateef5913 2 жыл бұрын
Plz anybody tell me the Answer...As sir took the value wrong at 6:23 as n-k=1 but acc to me...it's K=n-1..💁🏻‍♀️
@komal_0507
@komal_0507 Жыл бұрын
bhaiya esme n-k=1 jo h toh vo k=n kese hua
@sarthakjain1824
@sarthakjain1824 Жыл бұрын
Nice
@SurajKumar-kn1ko
@SurajKumar-kn1ko 3 жыл бұрын
Happy Teacher's Day
@IAMLEO-hb4zb
@IAMLEO-hb4zb 2 ай бұрын
n-n=0 why it was assume that 1 ,example 5-5=0 not 1
@huzaifanoor
@huzaifanoor Жыл бұрын
After watching this veido ham apna hatyar otha ka sawal ko haal kraga 😂😂
@Bhojpuriyabayar456
@Bhojpuriyabayar456 2 жыл бұрын
6:20 pe sir n-k= 1 hai to k=n kaise ho jayega please sir tell us
@husanpreetsingh509
@husanpreetsingh509 3 жыл бұрын
n-k=1 ,then k=n-1 but you write k= n
@hafeezaslecturesofcomputer4427
@hafeezaslecturesofcomputer4427 3 жыл бұрын
Me b yehe pooch rahe how it becomes ?
@learn2know79
@learn2know79 3 жыл бұрын
the same confusion is also here.
@gursewakdhillon8288
@gursewakdhillon8288 3 жыл бұрын
@@hafeezaslecturesofcomputer4427 that was just typo....use your common sense....
@jaswanthnaik5033
@jaswanthnaik5033 6 ай бұрын
By mistake n-k=0 it is
@Obnoxious_25
@Obnoxious_25 3 жыл бұрын
This is easy 😎
@sambhavgupta1203
@sambhavgupta1203 Жыл бұрын
happy teachers day
@SUPERMAN-zu6rr
@SUPERMAN-zu6rr 3 жыл бұрын
HAPPY TEACHERS DAY 🥺❤️
I thought one thing and the truth is something else 😂
00:34
عائلة ابو رعد Abo Raad family
Рет қаралды 6 МЛН
А я думаю что за звук такой знакомый? 😂😂😂
00:15
Денис Кукояка
Рет қаралды 3,8 МЛН
L-4.10: Dijkstra's Algorithm - Single Source Shortest Path - Greedy Method
15:49
2.1.1 Recurrence Relation (T(n)= T(n-1) + 1) #1
13:48
Abdul Bari
Рет қаралды 1,7 МЛН