Lecture 19: Dynamic Programming I: Fibonacci, Shortest Paths

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

Комментарии • 1,3 тыс.

  • @JanacMeena
    @JanacMeena 4 года назад +1461

    The instructor, Erik Demaine, is the youngest professor of all time at MIT and a child prodigy. He has published several articles in scientifical journals, and and now has helped several students publish their own articles. He is one of the modern day geniuses of our time. We are extremely lucky to have a free video of his lecturing.

    • @lukeTHEDUUKE
      @lukeTHEDUUKE 3 года назад +11

      he's no genius

    • @alesc3252
      @alesc3252 3 года назад +160

      @@lukeTHEDUUKE he was a child prodigy when he was 7, he finished college at 14 and got his phd when he was 20. He has won plenty of awards and is the youngest teacher at mit for a reason. Most people think that if someone speaks a lot and you dont undestand him then he must be smart, but actually intelligent people, like mr. Erik demaine, can take complicated concepts and explain them in a way that a lot of people like ourselves can undestand them

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

      So this guy is like dumb smart? A 🐐 of numbers? I'm a dummy and have no clue what is going on in this video but guys and girls that know this stuff it blows my mind. All I'm wondering is does this really figure things out or is this just made up by some super smart people that make these things up for fun

    • @AlexandrBorschchev
      @AlexandrBorschchev 2 года назад +17

      ​ @sammy holdem it's not about being smart, people who have been doing one thing all their life can be extremely good at it.

    • @manmeetworld
      @manmeetworld 2 года назад +7

      @@sammyholdem2492pretty sure it's for faster run times i.e., you're in the program and it outputs your results faster. Or in some cases you may never get the result, like the work on the processor to store all the bits gets used up to the point of failure or low mem. Because I think, what's not explained real well right off the bat is that this program is constantly looping to get to the next fib.

  • @sohntv8105
    @sohntv8105 4 года назад +423

    Watching this 6 years after graduation. The irony of skipping class...

    • @ShubhamSinghYoutube
      @ShubhamSinghYoutube 3 года назад +15

      Never too late to start.

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

      I was lucky enough to find out that there are a lot of videos in yt that could help me during my CS programm...And they really did help me.

    • @yanfranca8382
      @yanfranca8382 8 месяцев назад

      how about 11 years? kkk

  • @sandeepmishra3972
    @sandeepmishra3972 5 лет назад +333

    He is really putting an effort for students....these kind of teachers r very rare to find

  • @sergeykholkhunov1888
    @sergeykholkhunov1888 3 года назад +197

    00:58 dynamic programming (DP)
    05:06 Fibonacci numbers
    11:04 memoized DP algorithm
    23:14 bottom-up DP algorithm
    31:00 shortest paths
    41:14 example

  • @fckdahlloff
    @fckdahlloff 11 лет назад +335

    I'm from Perú and following a Software Engineering, although we sometimes may get an overall view of these kind of topics, we tend to stay in the easy zone and never go any further from that. Having access to these many MIT real lectures just makes me so happy because, even if you don't enjoy the best education, you stil have the opportunity to learn more from reliable sources. And for me, that's what the MIT, give opportunities and hope. Thank you so much!

    • @axelmori9284
      @axelmori9284 3 года назад +7

      Another Peruvian here!

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

      Now we are three. :)

    • @patrickmcpartland1398
      @patrickmcpartland1398 3 года назад +9

      Even at MIT this is a graduate level course, you're not taking this in a regular undergrad haha

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

      @@patrickmcpartland1398 What's the difference? 🤔

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

      @@kartiksangwan3302 How much debt your willing to go into.

  • @Goateduzi
    @Goateduzi 4 года назад +112

    So apparent why MIT students are industry leaders.... their teachers are amazing. My data structures and algorithms professor was trash at my university, and it is a well respected school.

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

      Which university you went to?

    • @M4D4F4K4.
      @M4D4F4K4. Год назад

      @@cmubill prolly outside 100th rank unis

  • @CodeJeffo
    @CodeJeffo 3 года назад +68

    I love how Erik is so humble and approachable. It's so great that MIT recognized him so early as a faculty member. This is so important for students and progress in education and research. MIT is really showing the way for other universities how the modern education is meant to be. Erik stay cool and keep improving this wonderful series of lectures. All the best!

  • @thefreakingmindistaken
    @thefreakingmindistaken 5 лет назад +32

    I watched this guys couple of old lectures quite sometime back and he made me fall in love with dynamic programming. Love this guy.

  • @riverofcustard5027
    @riverofcustard5027 2 года назад +27

    Not only is he knowledgeable but he’s also one of those teachers that makes you really get interested in the lesson

  • @Jason_Kang
    @Jason_Kang 9 лет назад +804

    I love this guy. I can tell he enjoys teaching.. best trait a lecturer can have :)

    • @penips
      @penips 9 лет назад +1

      +Jason Kang nice

    • @fruitjam6529
      @fruitjam6529 9 лет назад +2

      +Jason Kang Indeed.

    • @mriegger
      @mriegger 9 лет назад +7

      +Jason Kang I know, I was struggling with Dynamic Programming until I saw this series. He's awesome.

    • @TheMasonX23
      @TheMasonX23 7 лет назад +11

      Agreed! Erik is an amazing teacher, I love watching his lectures. He manages to make very difficult subjects relatively easy to understand and is very thorough and precise when defining things. And as you pointed out, his obvious love of teaching and the subject matter inspires an eagerness to learn.

    • @adityakulai6419
      @adityakulai6419 7 лет назад

      Yes true!

  • @keyyyla
    @keyyyla 3 года назад +451

    Absolutely fascinating lecture. This guy received his master of science in mathematics at the age of 16.

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

      Lies again? DMP DUO

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

      Another post on this video says 14 yrs of age which one is it 🤔

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

      @@brucesbanner5057 he was bachelor

    • @rschmidtschmidt6810
      @rschmidtschmidt6810 2 года назад +17

      @@brucesbanner5057 his Bachelors at 14 and masters at 16. It matches up.

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

      Daym but not experience

  • @Tavorath
    @Tavorath 9 лет назад +36

    Thank you for caring about the subtitles quality, they made it possible to follow up the whole class.

  • @sujaa1000
    @sujaa1000 3 года назад +73

    I am 55 years old and whenever I watch a lecture from MIT or Stanford, I so wish I could study there! I feel so mesmerized.

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

      Me too, and i am 29. Just graduated at 27 as a Mechatronic Engineerer and now do IT job

  • @pman-codes
    @pman-codes 6 лет назад +55

    Thank you guys. I am doing my masters though I couldn't get in MIT, you give me exposure to top class teaching materials.

  • @AbhishekEkaanth
    @AbhishekEkaanth 5 лет назад +2033

    I just googled him to know that he finished his bachelor's degree at 14 years of age at Dalhousie University in Canada. damnn!!!!

    • @osmedia7239
      @osmedia7239 5 лет назад +61

      geez. Smart guy.

    • @danielalemu3029
      @danielalemu3029 5 лет назад +353

      When you have professors father at young age who inspires you and teach you, that helps a lot. His father is also professor at MIT.

    • @osmedia7239
      @osmedia7239 5 лет назад +29

      @@danielalemu3029 true

    • @winrx
      @winrx 5 лет назад +65

      Daniel Alemu Having the right genes may also help I think......

    • @ikrakkentm9588
      @ikrakkentm9588 5 лет назад +202

      @@winrx no a lot of people are actually as intelligent and perhaps even more than him. Thing is not everyone had the spark by their enviroment from a young age to get interested in specialising in a specific area. Also in other countries there is no alternative to finish high school earlier and apply to university. Also SAT is easy i can imagine back then it was way easier. Im not saying he isnt smart. Hes definetely above average for sure.

  • @santosht6644
    @santosht6644 7 лет назад +2407

    stop scrolling down listen to this guy

  • @JanacMeena
    @JanacMeena 4 года назад +24

    I've always thought of Dynamic Programming as this big, scary, complicated concept that would take forever to understand. Erik helped me understand it easily.

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

      Teachers tend to make the same impressions they had about a course on us when its their turn.

  • @tv..6531
    @tv..6531 4 года назад +3

    # for
    def fibonacci(n):
    r = [1, 0]
    for i in range(1, n+1):
    a = r[0]
    b = r[1]
    c = a + b
    r[0] = b
    r[1] = c
    return r[1]
    if __name__=="__main__":
    for n in range(1, 101):
    print(n, ": ", fibonacci(n))

  • @lapipesmoker3751
    @lapipesmoker3751 3 года назад +58

    "This is kind of obvious"
    Me: Leaving the lecture hall with my head down.

  • @hana-ci6ss
    @hana-ci6ss 10 месяцев назад

    I've been watching many video professor teaching in RUclips....Professor Erik Demaine definitely the best one that I've ever saw...His teaching style really on top.

  • @AlexandrBorschchev
    @AlexandrBorschchev 4 года назад +37

    My goal: binge watch mit course playlist for the whole day :)

  • @문동선-j7d
    @문동선-j7d 6 лет назад +1

    0:00~31:00 DP 설명.
    - 벨만 포드 알고리즘 만든 벨만이 다이나믹 프로그래밍이라는 이름을 창시했다. 벨만이 다이나믹 프로그래밍이라고 이름 지은 이유는 별 뜻 없고 '그냥 멋있어 보여서'다.
    - 하나의 문제를 완전탐색으로 재귀적으로 풀 때 그 문제의 부분문제(Subproblems)의 답을 재활용하는 기법이 메모아이제이션(Memoization)이다. 재귀로 문제를 풀면 exponential 시간이 소요되는데, 한 번 풀었던 문제의 답을 메모로 적어 놓고 다시 필요할 때 반환함으로써 그 문제 풀이는 O(1) 시간밖에 걸리지 않는다.
    - DP에는 재귀적인 구현인 하향식 접근(Top-down approach) 외에도 반복문을 이용한 상향식 접근(Bottom-up approach) 방법이 있다. 상향식은 함수 호출을 적게 하니까 스택을 적게 먹는 장점이 있겠지.
    - 시간복잡도: 부분 문제의 갯수 * 부분 문제를 푸는 데에 걸리는 시간(메모 해 놔서 재귀 안 걸리는 데는 O(1)임)
    ----------
    31:00 이후 최단 경로 설명.
    - 오랫동안 잊고 있었던 그래프 이론이 등장함.
    /
    - 정점(vertex, node), 간선(edge, link, line)
    - 차수(degree): 어떤 정점의 간선의 수.
    /
    - DAG (Directed Acyclic Graph): 비순환 유향(방향) 그래프
    - 내차수(indegree): 방향 그래프에서 어떤 정점으로 들어오는 간선(incoming edge)의 수.
    - 외차수(outdegree): 방향 그래프에서 어떤 정점에서 나가는 간선(outgoing edge)의 수.
    - 위상 정렬(Topological sorting): 선수과목 구조처럼 보이게 DAG을 왼쪽에서 오른쪽으로 한 방향으로 죽 늘어 놓는 것.
    - 출발점에서 나가는 간선을 기준으로 부분문제를 만들 수도 있고 목적지로 들어오는 간선을 기준으로 부분문제를 만들 수도 있음
    - 사이클이 있는 그래프에서 시간복잡도는 무한대임.
    - DAG의 경우 시간복잡도: O(V+E)
    - DP 쓰려면 부분 문제는 비순환이어야 한다.

  • @c.j.dylanxu153
    @c.j.dylanxu153 8 лет назад +251

    the best algorithm lecture i have ever seen! I prefer this "old-style" lecture using blackboard and chalks so much without any bullshit slides and whiteboards

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

    Professor Demaine,
    I really enjoy your confident lectures.

  • @katkong281
    @katkong281 2 года назад +17

    If this guy was my professor I might have not dropped out! We need ppl like him thank you for sharing this

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

      Turn on, tune in, and drop out! There is so much more to life than sitting in a room listening to someone drone on about nothing. Be your own man!

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

      @@cluckhead1913 maybe so but his passion is infectious…I wish I had a real passion for something instead of slogging through life

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

    27:00 Bottom up can be optimized further by hard coding the first two results manually the itterate without a conditional and saving the result right away.
    When done looping, return the last result.

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

      int n = 100;
      Map fib = new HashMap();
      int i;
      for(i= -1; i

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

      30:00
      import java.math.BigInteger;
      public class FibonacciExample{
      public static void main(String args[]){
      int fibSequenceNum = 107;
      int n = fibSequenceNum/2;
      BigInteger[] fib = {BigInteger.valueOf(0),BigInteger.valueOf(1)};
      for(int i = 0; i < n; i++) {
      fib[0] = fib[0].add(fib[1]);
      fib[1] = fib[0].add(fib[1]);
      }
      System.out.println(fib[fibSequenceNum%2]);
      }}

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

      @@weignerg 8ulk777uuu6

  • @justinwmusic
    @justinwmusic 5 лет назад +44

    26:10 "So is this clear what this is doing? I think so."
    [Then corrects the 2nd, 3rd, 4th and 5th typos that prevented comprehension. :) ]

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

    This man is absolutely brilliant. Perhaps too brilliant for anyone in the lecture hall to understand, and certainly for me.

  • @free-palestine000
    @free-palestine000 3 года назад +12

    i love love love Erik's teaching style. usually, i feel pretty dumb when i don't get a concept when my professor or other youtube videos explain but Erik makes it very.....accessible, and relatable.

  • @casperdewith
    @casperdewith 11 месяцев назад +1

    *caption errors*
    0:52 injected it → inject it
    2:39 polynomial time algorithm → polynomial-time algorithm (also at 2:44)
    5:18 sneak peak → sneak peek
    6:17 we’re talking → when we’re talking
    6:46 whatever’s → whatever, is
    6:53 dynamic programming → dynamic-programming
    12:02 computer → compute
    19:03 non-memoize → non-memoized
    21:04 that same problem → that same subproblem
    31:01 onto → on to
    35:32 [INAUDIBLE] → And then: okay, what’s
    40:00 stored it → store it
    41:45 s comma v → s comma b
    45:10 Handshaking → Handshaking lemma
    45:18 it ran a → it ran in
    45:28 depth first search → depth-first search
    48:19 refers to ruclips.net/video/OQSNhk5ICTI/видео.html
    50:52 negative weight cycles → negative-weight cycles

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

      Thanks for your feedback! All the changes have been done to the captions. Also, thanks for the video reference... we didn't know that one! 👍

  • @aayushshah7193
    @aayushshah7193 7 лет назад +5

    Best Algorithm lecture ever seen...Thank You MIT for this Lecture and Eric is one the best lecturer with great teaching skills.

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

    at 47:06 Eric mentions, we need to make the graph acyclic,
    we don't need to make the graph acyclic, we can mark the vertex which is being computed (which is in the call stack) as present in an infinite distance and use it's TAB[v]

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

    I just want to thank you for this video and other related videos from this channel. While working fulltime and schooling at night it is hard sometimes to follow through my classes. However, I managed to earn a MS Computer Science concentration on Network and Security with a big thanks to these videos. Thank you!!

  • @KimMorgan-hc3rk
    @KimMorgan-hc3rk Год назад

    Don't know much about Dynamic Programming but do note the professor's unique and rather attractive chalkboard writing! And being a dapper hand myself at it, I salute you Prof!

  • @JayShankarpure
    @JayShankarpure 2 года назад +5

    Really a great video 🙌
    Have fallen in love with recursion and DP with this video , Great work Erik Sir 👏

  • @RubénAlcoleaNúñez
    @RubénAlcoleaNúñez Год назад

    Amazing lecture from Erik Demaine. It's impressive how easy he explains a topic like dynamic programming and how he can have the attention of the students in the hall. Thank you very much to Erik for his lecture and to MIT for sharing this excellent course!!! I can't wait to see the next DP classes!!!

  • @MahdiZouch
    @MahdiZouch 8 лет назад +56

    I really love how they teach, everything becomes interesting..., i wish i could study full time there :D

    • @MahdiZouch
      @MahdiZouch 7 лет назад +1

      ha ha same here

    • @TheMasonX23
      @TheMasonX23 7 лет назад +5

      Mahdi Zouch A large part of what makes them the best institution (in my opinion, at least one of the best though) is the quality of their instructors. And yes, I too would love to attend MIT if/when I make enough money, but at least until then they've got a lot of their courses available :)

    • @deepakmeena3874
      @deepakmeena3874 6 лет назад +3

      yeah IIT bombay has great quality of students but quality of teaching method is very poor that's why they are so low in rankings

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

      Deepak Meena yeah bro.

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

    I don't get lectures like this post-Covid in my programming classes. My professors just point me to a video they have done 3 years ago and we just do problems in class. I learn better when the lecture is done in person because I remember it as an experience, rather than me watching a RUclips video and trying to memorize every single detail of the video. There's a difference between online and in-person and I can't prove it. I would have loved to sit in this lecture.

  • @ПетяТабуреткин-в7т
    @ПетяТабуреткин-в7т 6 лет назад +14

    Dynamic programming the my favrourite thing in the world...
    in algorithms.

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

    Mannn, Sir Erik is so passionate professor I have ever seen. I just love the way he explains🙏🙏🙏

  • @anniekelly3698
    @anniekelly3698 10 лет назад +14

    way better than my current algorithms professor...thanks!

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

    After following 2-3 lectures of him, He became my favorite prof

  • @sixpooltube
    @sixpooltube 8 лет назад +8

    My favorite DP lecture yet!

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

    I love how much passion and energy the Prof got

  • @ji3g4j6jo3p
    @ji3g4j6jo3p 5 лет назад +6

    I wish my prof taught my algo class was this excited about any of the algos, instead of sitting there hating life

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

    What a guy he is!!! Just to say been through a lot of mit stuff but he really is matching the skills of all other professors in that place

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

    23:22, hey... even I like the recursion based top-down approach over bottom up.
    Btw, very good teacher.

  • @kevincheng1737
    @kevincheng1737 4 месяца назад

    dynamic programming really does apply to life in a lot of ways. "you solve one problem, then you solve another problem. and if you solve enough problems, you get to come home" - mark watney (the martian). the tough part of life is finding out how solving one subproblem relates to another subproblem, and knowing which subproblem will actually get you to your goal of solving your main problem.

  • @prashantsingh1096
    @prashantsingh1096 6 лет назад +8

    I wish I could have Professor like him in my bachelor's and master's .

  • @RahulRoy-tc3lt
    @RahulRoy-tc3lt 2 года назад +1

    That is the most computer-dude looking guy ive ever seen, very apt.

  • @mindsauce3
    @mindsauce3 5 лет назад +1394

    You kept on scrolling anyway, didn't you? ;)

  • @rizanamatya9191
    @rizanamatya9191 7 лет назад +25

    Algorithms Professor wearing a Bob Dylan T-shirt! Awesome!

  • @ChrisLeeX
    @ChrisLeeX 9 лет назад +19

    @26:36: "Man, so many typos" - How I feel whenever I'm coding up on the board.

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

    I am amazed there are actually ppl who understand and can make sense of this.

  • @zeronothinghere9334
    @zeronothinghere9334 4 года назад +8

    Dynamic Programming AKA "Careful Brute Force" XDD I lost it. Sooo accurate

  • @turinreza
    @turinreza 9 лет назад

    at 28:47 for the dependency DAG the arrows should point the other way? or do the arrows go from solved subproblems to unsolved? Confused because according to Wikipedia a dependency graph, the arrow points from the dependent (the depend to the solved subproblems)... en.wikipedia.org/wiki/Dependency_graph

  • @elias8294
    @elias8294 5 лет назад +19

    I love that he writes all of his code in python

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

      Because Python Code is Closest to Pseudo Codes

  • @JuiceGuy07
    @JuiceGuy07 3 года назад +16

    Is it weird that I have absolutely no idea what this class teaches, nor can I understand what it is trying to teach, yet I can't stop watching the lectures?

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

      @Aarni lol, you could be wasting time on worse things I suppose. Hit your teacher with the old "I wanted to write my essay last night, but I just got way too caught up learning advanced algorithms. Time just got away from me."

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

      hahahah im doing the same thing. Started with a video where Jelani Nelson was teaching Linear Data Structures
      I have no idea how it works and how it helps but it's oddly satisfying xD

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

      @@anjanvyas5820 For me, it's Asmr

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

    34:49 The moment you stumble upon life-advice in part 19 of the programming lecture you've been watching.

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

    I used to know all this in my past life. This is way beyond my comprehension. But a great teacher.

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

    Great teaching! I had an algorithmic challenge this year, the solution was dynamic programming.

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

    Idk what my high ass just watched for an hour, he might as well have been speaking a foreign language, but I stayed for the chalk skills

  • @JackLe1127
    @JackLe1127 8 лет назад +238

    This video makes me wanna apply for MIT

    • @darogajee3286
      @darogajee3286 8 лет назад +36

      just collect enough millions..

    • @DarkLordAli95
      @DarkLordAli95 7 лет назад +22

      and very exceptional grades.

    • @BrajeshKumar-ez8zs
      @BrajeshKumar-ez8zs 7 лет назад +12

      Jack Le you can... But you will be kicked out

    • @mlst3rg
      @mlst3rg 7 лет назад +73

      just write #blacklivesmatter on your application

    • @lambda494
      @lambda494 7 лет назад +21

      I went there (Course 8, 2012). Trust me, getting in is the easy part. All the top students at their high schools become more or less average there. You learn a ton but it will wring the life out of you too if you aren't careful. You may spare yourself and just enjoy OCW!

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

    Good job camera person. You're following the material and zooming in when relevant!

  • @victorrice4549
    @victorrice4549 10 лет назад +15

    Very great lecture, super helpful. Thank you MIT.

  • @AaAaAaA-mm7cc
    @AaAaAaA-mm7cc 3 года назад +1

    Just leaving this here for someone to remind me in a couple of years, I regretted majoring in information systems instead of CS, and I cannot change my degree, but I will work hard and learn most of the needed stuff online in order to be able to learn more cs stuff on top of finishing my degree and getting a nice job that i enjoy in the future, through hard work and determination!

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

    Love the giant eraser. Must be quite satisfiying using it.

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

    Fibonacci is when you add the two previous numbers in the sequence to get the next number and so forth.

  • @NitRoGenSmile
    @NitRoGenSmile 10 лет назад +7

    shortest paths 31:00

  • @meditating010
    @meditating010 11 лет назад +2

    Eriks lectures are awesome... pretty decent walkthrough of dynamic programming.

  • @PastaFazool4266
    @PastaFazool4266 10 лет назад +13

    This instructor ROCKS!

  • @Gamercr007
    @Gamercr007 5 месяцев назад

    prof. Erik Demaine is my favourite

  • @EgbertWilliams
    @EgbertWilliams 9 лет назад +236

    Two questions:
    1) How does yellow chalk write in white?
    2) What do all those squiggles he wrote mean?

    • @mitocw
      @mitocw  9 лет назад +195

      ***** 1)The chalk is only yellow on the outside.
      2)Topological sorts. (We presume you don't mean the math.) This link on Wikipedia might help: en.wikipedia.org/wiki/Topological_sorting

    • @EgbertWilliams
      @EgbertWilliams 9 лет назад +89

      Good God, MIT himself answered. Hi, MIT! And, yes, I meant the math. Don't presume or you'll make a pres out of you and me.

    • @prodev7401
      @prodev7401 9 лет назад +1

      this is shortest path or bellman ford ... ?

    • @bobbybob4939
      @bobbybob4939 9 лет назад +2

      Pro Dev ILL BELLMAN FORD YOUR NAN

    • @prodev7401
      @prodev7401 9 лет назад

      ???

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

    I watch this as a layperson and realize that we are without a doubt in a simulation.

  • @rakeshjoshi2306
    @rakeshjoshi2306 9 лет назад +12

    this guy is awesome . very clear explaination..

  • @srinivastadinada3571
    @srinivastadinada3571 7 лет назад +1

    Best tutorial on Dynamic programming I have ever seen :)

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

    This guy is a fantastic teacher with great humor.

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

    Thanks channel for saving my engineering exams

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

    I would dedicate my whole life to algorithms if he was my teacher.

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

    The definition of teacher is who turn something boring in something funny. That guy is the human definition of it.

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

    When I came to know about the name story of DP, I was also very excited.
    If anyone has done the course algorithmic toolbox, you might also be knowing this story!

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

    I am amazed just at his writing on the board at the very beginning .

  • @DeivitMV
    @DeivitMV 7 лет назад +35

    Extra credit for the Bob Dylan T-shirt! :D

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

      Warmed my heart when I noticed it!

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

    Guessing may sound silly [when solving a problem] but it’s a powerful tool! I simply loved it!

  • @deadpiece111
    @deadpiece111 11 лет назад +400

    This dude got his PHD in 20.. How awesome is that.. O.O

    • @RetroGenetic
      @RetroGenetic 10 лет назад +26

      And the way he presents everything is just amazing, there's many gaps in my knowledge on these topics but the way he explains helps me to either fill the gaps or at least know where to look for answers.

    • @tyrisnolam
      @tyrisnolam 10 лет назад +128

      I'm 26 and didn't even finish my undergrad course yet. And I don't give a fuck. Not every universities and colleges are as awesome as the MIT or Caltech (etc). I'm from Hungary. I feel no drive to finish it. What you see here, this lecture, is quite the opposite of the way they teach us in Hungary. There are a very few good teachers here (but they, the good ones are really just great and I respect them), the majority just make us hate what we supposed to be enthusiastic about. Who cares, I just open my laptop and BOOM, I'm an MIT student, I can learn valuable stuff and I enjoy this difficult work with algorithms (or whatever) again. Maybe I'll finish my UG course, maybe I'll just quit and start making something amazing. Having a degree is good but if you can't do it, don't push it. There are many ways to be successful in what you like to do. If you can't finish, then college was just a bad guess and you should try another path to V (see what I did here?)

    • @jeanpaulnavier6726
      @jeanpaulnavier6726 10 лет назад +8

      ranalynamic come on man, i understand the fact that some prof aren't the greatest ones(here in italy too,same faculty) but i think it's a student problem too, isn't it?!

    • @kdub1242
      @kdub1242 10 лет назад +9

      ranalynamic I always thought Hungary was the land of geniuses. You've had John von Neumann, Eugene Wigner, Leo Szilard, Theodore von Karman, and on and on. These guys are my scientific heroes.

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

      Keith Wald It used to be better, I guess... These days it's a shame. I feel embarrassed. Or maybe it wasn't that different at all. Today, a talented student who is actually lucky enough to get the hell out of here, probably will still do a great job pretty much anywhere where she/he is going. But not here.
      Yes, many of them are of Hungarian origins (and by the way, Jewish also). On the other hand, if you read their whole story, almost none of them achieved anything here. This is what Hungary is really good at: putting talents in an impossible situation and make them go the fuck away :)
      Anyway. I'm glad you know about these people. :)

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

    I felt like this was a great way to explain dynamic programming. My course work on it in college was fine enough for me to understand it but this is a much easier better way to explain it to learn from.

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

    It's weird to think that some of us can't have access to this type of education maybe because we were born somewhere else or we don't have the money, so we are stuck with teachers that don't care about teaching you and you basically graduate by yourself. I don't think people that actually study on these types of universities understand how much better some of the teachers are. It makes such a big difference to my understanding of the material when I can find videos like these.

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

      I was thinking the same, i remember when i learned the algorithms for the fibonacci series back in 2008. But i don't think my teachers didn't care, it's just that they didn't know. I still use the fibonacci series each time i try a new programming language.

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

    I love how when you google "Do you need to be good at math to code?", the universal answer is no. Sure doesn't seem like it.

  • @geekoist
    @geekoist 11 лет назад +9

    The last remark that the algorithm can be modified to compute weights of shortest paths in graphs (possibly with cycles) was rushed a little bit. Can someone explain it in better terms? Thanks :)

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

    I love how he much he could do with his mind. I'm a theoretical physics major and computer science

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

    I'm looking at this now,same as I was looking at math class when I was a kid

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

    The Chalk at MIT is just out of this world.

  • @socrat33z
    @socrat33z 11 лет назад +14

    Thank you sooooo much! A lot easier than learning from the economic side.

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

    The first part Fibonacci is easy to understand,
    and the second part Shortest Paths is hard, because of the math formula there.
    DP = Recursion + Memorization + Guessing
    The instructor Eric Demaine was impressive to me,
    who was get the scholar at 14, master at 16, professor at 20.

  • @imalive404
    @imalive404 7 лет назад +74

    Just read about him. He is a child prodigy and has a set record of joining MIT as youngest professor at the age of 20!!!!!!!!! Like what!!!!!!!!!!!!!!

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

      Wtf

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

      At 20?? you sure?

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

      Yes at 20! Just read my self.

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

      @@Alonesmither was he born high school graduate already?

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

    recursive functions alone is a concept which takes some adjusting too. In over 14 years of writing code in manufacturing i've yet to find a place for them. I get its for a situation where you'd want the end result without printing the path to the result on screen (ie a loop) but ive never really needed it in my line. I can imagine it with 3d graphics though

  • @babyloco8199
    @babyloco8199 2 года назад +6

    He had a bachelor’s degree at 14 and a phd at 20. He’s one of the smartest people on the planet

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

    @38:33 This WILL give the right answer... Hopefully.

  • @RobertLugg
    @RobertLugg 5 лет назад +7

    Good talk. My sharpest criticism: I’ll bet he goes though a lot of chalk pressing as hard as he does.

  • @ysc4293
    @ysc4293 7 лет назад +1

    anyone know what "indegree" means? Got lost around 45:00 mark and the lecture did not make sense once he drew the diagram of cyclic graphs becoming acyclic over time (which is 47:35). any help would be appreciated!