Lecture 20: Dynamic Programming II: Text Justification, Blackjack

Sdílet
Vložit
  • čas přidán 13. 01. 2013
  • MIT 6.006 Introduction to Algorithms, Fall 2011
    View the complete course: ocw.mit.edu/6-006F11
    Instructor: Erik Demaine
    License: Creative Commons BY-NC-SA
    More information at ocw.mit.edu/terms
    More courses at ocw.mit.edu

Komentáře • 177

  • @sergeykholkhunov1888
    @sergeykholkhunov1888 Před 3 lety +77

    00:00 review of last lecture
    05:53 five "easy" steps to DP
    08:40 step 1: define sub-problems
    09:51 step 2: guess (part of solution)
    11:06 step 3: relate sub-problems
    13:15 step 4: recurse and memoize or build DP table bottom-up
    15:28 step 5: solve original problem
    17:05 text justification
    35:12 parent pointers
    38:50 blackjack

  • @aamike82aa
    @aamike82aa Před 7 lety +157

    Text justification starts at 17:06
    Blackjack starts at 38:51

  • @vvfking
    @vvfking Před 8 lety +196

    Having this guy as the lecturer in the course I'm taking (Algorithms, design and efficiency) would make the course so much more interesting and easier to follow. Thank you & MIT for these educational videos!

    • @TheR971
      @TheR971 Před 5 lety +3

      I am 3 years late, but damn this is some weird punctuation.

    • @abishekkachroo938
      @abishekkachroo938 Před 4 lety +3

      @@TheR971 I am 4 years late but still its weird

    • @neuron8186
      @neuron8186 Před 3 lety +2

      @@TheR971 i am 5 years late but still weird

    • @chasewarren9702
      @chasewarren9702 Před 2 lety +2

      @@TheR971 I am 6 years late but still weird

    • @coldfire6869
      @coldfire6869 Před 9 měsíci +1

      ​​@@TheR9717 years late, pretty weird

  • @siddhartha.saif25
    @siddhartha.saif25 Před 7 lety +25

    I love Erik Demaine. He is unbelievable. All great lectures! Thanks Erik.

  • @stefanalexandru2363
    @stefanalexandru2363 Před 9 lety +158

    this professor is awesome

  • @Deepaksingh-ls3xj
    @Deepaksingh-ls3xj Před 10 lety +7

    Best one...lecture filled me with lot of energy

  • @robertalaverdyan3150
    @robertalaverdyan3150 Před 4 lety +8

    Excellent. for me watching these lectures is like watching moves : relaxing but very useful and entertaining

  • @julianarezende4849
    @julianarezende4849 Před 8 lety +39

    I was so demotivated about studying and my exam is tomorrow!
    Erik excitement motivates me somehow. He's really passionate! :)

    • @lucasandrade7421
      @lucasandrade7421 Před 3 lety +2

      Hi, I know its kinda late, but I hope the exam went well for you

    • @DIPTANGSHUMISHRA
      @DIPTANGSHUMISHRA Před 3 lety +5

      @@lucasandrade7421 She has probably forgotten all about the exam at this point.

  • @csl1384
    @csl1384 Před 4 lety +3

    The "5 Steps" are pedagogical gold

  • @biuku
    @biuku Před 3 lety +1

    16:46 -- Text justification
    38:50 -- Blackjack

  • @skc909887u
    @skc909887u Před 2 lety +1

    really good insight at 4:30 DP is really finding shortest path in a DAG

  • @tentotheace
    @tentotheace Před 5 lety +41

    49:15 That's what *he* said.

    • @EOh-ew2qf
      @EOh-ew2qf Před 2 lety

      literally paused the video to search for comments

  • @KirollosSamyHakim
    @KirollosSamyHakim Před 11 měsíci +1

    For the text justification problem, I guess that it'd be more efficient in practice to work with prefixes rather than suffixes. Because as the user types new words we can extend our solution from n words to n+1 words easily just guess where the last line begins and minimize over all the possibilities. That wouldn't be possible with the suffixes as for each new word typed we would have to start from scratch.

  • @LT1FirebirdSLP
    @LT1FirebirdSLP Před 4 lety +3

    Parent Pointers begins at 35:17

  • @casperdewith
    @casperdewith Před 5 měsíci +3

    *caption errors*
    5:10 sub-problems we get, → sub-problems, we get
    9:11 to counter → to count
    10:06 There’s nothing. → There’s nothing-
    12:50 n degree → indegree (also at 12:53)
    12:57 again the → again, counting the
    19:09 an anesthetic → an esthetic
    19:36 python → Python (also at 25:16 34:27)
    19:39 J minus 1 → j minus 1
    32:57 top logical → topological
    34:06 [INAUDIBLE] → Can you explain what DP of j would return?
    39:20 sheet → cheat
    41:33 this → in this case
    50:22 BG → BJ (also at 50:24)

    • @mitocw
      @mitocw  Před 5 měsíci +1

      Thanks for your feedback! We've corrected the captions.

  • @csl1384
    @csl1384 Před 4 lety +5

    20:48 "why cubed? who knows". I wonder if this is to penalize big badness in an exaggerated way compared to small badness (so that, say, a badness of 2 is not twice as bad, but 8 times as bad as a badness of one). It seems to me that the effect of this is to favour justifications with a large number of lines that are just a little bit bad, over justifications with a few very bad lines. It sort of reminds me of the different error/objective functions in machine learning, if you know what I mean. The exponent (the 3) could be regarded as a (meta?) parameter of sorts, and it might even make sense to apply machine learning to text justification, where the optimal value for this exponent is learned from a large number of texts that were manually justified.

  • @tririverwangyi
    @tririverwangyi Před 5 lety +5

    The "latest" Word as of 2013 does not have smart line justification. Now it's 2019 Word still does not have it. From time to time I have to delete/change a word to make the next line not too ugly...

  • @pablogarin
    @pablogarin Před 3 lety +2

    It makes sense to cube the result to obtain the badness: you preserve the sign, so you can know if your line is too large or too small...

    • @ih9346
      @ih9346 Před 2 lety +1

      was thinking the same

    • @chaddaifouche536
      @chaddaifouche536 Před 2 lety +1

      No, if your line is too large, the result is +∞, the cube is probably simply a choice made after trying some values for the exponent and looking at the esthetics of the results. It ensure that big divergences from the line width are heavily penalized.

  • @greagarious44
    @greagarious44 Před 9 lety +15

    He was a child prodigy !! Genius is the word !!

    • @stjepanbrkic3215
      @stjepanbrkic3215 Před 8 lety +7

      +greagarious44 guy became bacc. at age of 14, holy crap

  • @eknuds
    @eknuds Před rokem

    I was thinking about these problems. My background in desktop publishing as the network administrator in my college newspaper tells me that there would have to be character by character kerning(min and max) and a hyphenation database to properly be able to break words up.
    Blackjack, there could be a weighted probability. Ten or below, always hit. 21, never hit. Fifteen, maybe 0.5 probability of hitting.

  • @richardbrks
    @richardbrks Před 11 lety +2

    So is the optimal solution of a DP the longest or shortest path of a topological sorted DAG? I know Dr. Demaine states shortest at the beginning, but at the end it seems that he meant longest path for the black-jack example? Perhaps it matters if you guess is searching for the MIN or MAX of a series of choices, which i think would be fine since I believe finding the the longest or shortest path is linear time for topo. sorted DAGs.

  • @apoozeo1715
    @apoozeo1715 Před 6 lety +9

    Name of the red book on the table at 41:55 please? Is it Skiena's Algorithm Design manual?

    • @EstebanFilardi
      @EstebanFilardi Před 3 lety +5

      Hehe, I don't think it's a book. It's the "box" container of the big cards he uses.

  • @sir1cyr
    @sir1cyr Před 8 lety +16

    "But that's what dynamic programming is for -- you don't have to think." (21:58)

    • @sirnawaz
      @sirnawaz Před 5 lety +1

      In that context, it makes so much sense. In fact, I'd say it is such a relief, as you don't have to think about all the things!

  • @siaahmadi413
    @siaahmadi413 Před 5 lety +2

    I wonder how you'd handle the value of Ace in the blackjack algorithm

  • @davemartin157
    @davemartin157 Před 6 lety +21

    Erik Demaine is clearly brilliant. I believe occasionally his teaching to commoners could be improved with more time spent in advance so that he doesn't correct his algorithms midway through, but I is plausible that, for the good of humanity, his time may be better spent on his research.

    • @bjdooi
      @bjdooi Před 4 lety +9

      if he didn't have the opportunity to constantly reinforce his foundations and find new ways of looking at things he knows, he wouldn't be able to accomplish as much. Exercising your foundations is extremely important for anyone trying to make advancements in anything. So in a way, him teaching is tied directly to his research

  • @laurietsao8733
    @laurietsao8733 Před 4 lety +7

    OMG, basic strategy is to hit soft 18 vs 9 or T. Victor erred on both hands. Casing the entire deck makes much more for baccarat, not blackjack. And in reality you'd double, split, and change the number of hands. It gets more interesting if you have partial omniscient information, say suborderings of cards.

  • @turinreza
    @turinreza Před 8 lety +1

    For blackjack, if you use suffix don't you start from the end where i is from # to 0? Say for example for 52 cards (standard) what happens if and when the algorithm decides that the first hand starts at card 2 but you need 4 cards to deal with? Doesn't that mean that hand is scrapped since you only have 2 cards to start a hand?. And when you actually follow the output of the algorithm the first hand will actually use 4 cards instead of 2 and the output is meaningless since the first hand has started with 4 cards in reality instead of 2 (meaning everything shifted over by 2 cards and you can't use the output anymore) that the algorithm thought would be discarded? Isn't this the reverse?

  • @skillfullSwaroop
    @skillfullSwaroop Před 2 lety

    thanks for the 05:53 - five "easy" steps to DP

  • @kevnar
    @kevnar Před 10 lety +116

    Black-haired girl was on time this class.

  • @isbestlizard
    @isbestlizard Před 4 lety +5

    dynamic programming in 5 easy steps that silicon valley don't want you to know!

  • @JanacMeena
    @JanacMeena Před 4 lety +1

    35:16 - Parent Pointers

  • @eepassion9720
    @eepassion9720 Před 5 lety +11

    40:28 that Hoodie Shirt meaning MIT :) for who curious

    • @awesomedude824
      @awesomedude824 Před 4 lety

      I was so proud of myself for figuring that one out XD

    • @CyberMew
      @CyberMew Před 2 lety

      How does the equation become MIT? Edit: ah ok a quick google on Pv/nr shows the reasoning in a Quora post

  • @hardikchawla645
    @hardikchawla645 Před 5 lety +1

    Great explanation

  • @AlanKao-fc4km
    @AlanKao-fc4km Před 8 měsíci

    Is it possible that we reduce the runtime of text justification to O(n) by memorization, like we do with fibonacci number ?

  • @maninandadeepmedicharla6213

    this guy is brilliant !!

  • @ChathuraJayalath
    @ChathuraJayalath Před 7 lety +4

    Its a Portal t-shirt.. man i love that game :D

  • @vaibhavbansal7470
    @vaibhavbansal7470 Před 7 lety +3

    Can someone pls explain to me why, in the Shortest Path example, total time is written as O(VE) when #subproblems = O(V^2) and time per subproblem = indegree of the vertex.
    I am thinking it should be O(E.V^2). Can somebody pls explain ?

    • @strongark
      @strongark Před 6 lety +2

      V^2 is just an initial rough estimation of Erik. When moving forward to recursive algo, at each step (or each vertex), the algo just tries with all incoming edges of that vertex (not all edges, that's why it's not V^2). Because the total number of edges is E, so we have O(V*E) as a more accurate estimation for this algo

  • @abhishekganesan7081
    @abhishekganesan7081 Před 7 lety +1

    25:55 ; How is the time complexity 2^n, if we try to fit in every word into the a single line, then abort and repeat?

    • @egor.okhterov
      @egor.okhterov Před 7 lety +8

      For every word out of n words we have to consider a choice of whether the current word starts a line. If a word starts a line we can denote it as '1'. If it continues some line, we think of '0'. So we can think of all the words as a binary string: 0100011101. Each bit corresponds to our choice for that word. n-word text corresponds to some binary n-bit string. There are 2^n possible binary strings, so there are 2^n possible choices to split the n-word text.

  • @nikoladd
    @nikoladd Před 5 lety +4

    List of remaining items is called "tail". It's a thing in functional programming.

    • @MeLawenity
      @MeLawenity Před 3 lety +1

      tail is second item onwards, suffix is more general

    • @nikoladd
      @nikoladd Před 3 lety +1

      @@MeLawenity no. It's everything after the named variables. I.e. the remainder.

  • @direitoemtela
    @direitoemtela Před 6 lety +52

    I'm watching this video at 2x speed and it just looks like Erik had waaaay too much coffee before coming to the lecture.

  • @PinkuDebNath
    @PinkuDebNath Před 10 lety +4

    Nice lecture! But still did not understand shortest path :(

  • @researchandbuild1751
    @researchandbuild1751 Před 4 lety +1

    Cubed..i wonder if its rule of thirds?

  • @Kevin-ux5xf
    @Kevin-ux5xf Před rokem

    What is wrong with packing as many words as you can into each line of text? Isn’t that how word processors are supposed to work?

  • @fgfanta
    @fgfanta Před 5 lety +4

    I have a hard time finding how "page width" is actually computed in badness(i, j).

    • @naveenrawat6278
      @naveenrawat6278 Před 4 lety +2

      It is fixed for all pages. You don't compute it.

  • @georgefei
    @georgefei Před 8 lety +2

    Could someone help me understand why the number of subproblems is n for both text justification and blackjack?

    • @dhaval12593
      @dhaval12593 Před 7 lety

      Well, the way I would think this is in the worst case we can have only one word per line ( given each word is line length long) and hence at amximum we can have n subproblems...

  • @JanacMeena
    @JanacMeena Před 4 lety

    38:52: Blackjack

  • @spicy_wizard
    @spicy_wizard Před 5 lety +2

    for the text justification, i cant see where the memoization happens. To me, DP(i) is a recurrence function that elaborates the subproblems and min(dp for j in range(...)] is just gonna calculate all the possible new lines. I guess we are to maintain a memo table in the course of bottom up actions which are automated at the end of recurrence? is the job of the memo table to record the dp of i onwards that might have repeated in the course of elaboration?

    • @toebel
      @toebel Před 4 lety

      The memo is just there to store the return value of the recursive calls. Once you have the recursive case, the only thing you need to do to make it a "full" dp solution is use a memo to avoid recomputing the same subproblem more than once

    • @chaddaifouche536
      @chaddaifouche536 Před 2 lety

      @@toebel Yes, or use the topological order you identified to do a bottom-up fill of your memo and change your recursive calls to read your memo table instead.

  • @shauryahanda2901
    @shauryahanda2901 Před 6 lety +1

    could any one guide me which book to use for this topic cause cormen is actually not taking up these algos

    • @mitocw
      @mitocw  Před 6 lety +2

      From the syllabus: "For the student who finds books helpful, we also suggest:
      Miller, Bradley, and David Ranum. Problem Solving with Algorithms and Data Structures Using Python. 2nd ed. Franklin, Beedle & Associates, 2011. ISBN: 9781590282571." See the course materials on MIT OpenCOurseWare for more information at ocw.mit.edu/6-006F11.

  • @shibyurehash5205
    @shibyurehash5205 Před 9 lety +1

    anyone have idea why does in degree(v)+1 come from, to be exact, the "+1" come from?, I have thought about it quite for some time, still unable to figure it out.

    • @cerlaneL
      @cerlaneL Před 9 lety +1

      Shibyu Rehash In event that there is 0 edge, u=v=s, that is the "+1" I believe.

  • @shrreyabehll2727
    @shrreyabehll2727 Před 4 lety +2

    at 49:00 , why is the range from(i+4,n)? what does 4 in i+4 signify?

    • @minh_tran
      @minh_tran Před 4 lety +3

      Because initially both player are dealt with 4 cards in total

  • @akarshrastogi3682
    @akarshrastogi3682 Před 6 lety +8

    Somewhere in India, I mention to my mom, do you know who this guy is? He's a prodigy, now he teaches at MIT and I can't wait to watch each of his lectures, here on my laptop.
    Thank you MIT, Eric, the Internet and Computer Science in general for existing and making all of this possible.

  • @brunonegraozica5459
    @brunonegraozica5459 Před 8 lety +9

    I would love to see an implementation of the "Text Justification" algorithm

    • @antoniodingyi
      @antoniodingyi Před 4 lety +3

      Give it a try: leetcode.com/problems/text-justification/

    • @casperdewith
      @casperdewith Před měsícem

      Type something in a .tex file and run TeX on it. You’ll see your text justified with dynamic programming.

  • @srikantaggarwal6016
    @srikantaggarwal6016 Před 9 lety +1

    Well shouldnt the j vary from i+1 - n in the text justification problem ?

    • @AbstractAbsorption
      @AbstractAbsorption Před 9 lety

      In Python notation, the lower bound for range is inclusive, the upper bound is exclusive.

  • @ytuser659
    @ytuser659 Před 4 lety +1

    But how do we add memoization to the recursive text justification algorithm?

    • @chaddaifouche536
      @chaddaifouche536 Před 2 lety

      As he said, adding memoization is an automatic process : you write the recursive version, putting your result in a variable whose value you return at the end of your recursive function, then you take this version and add a global dictionary, at the start of your function you check if the answer for your argument is already in the dictionary and returns it if it is, at the end of your function, you add the return value to your dictionary with the argument as key.
      In Python, there's even a decorator @cache in functools to do it automatically on any function.

  • @inferious777
    @inferious777 Před 4 lety +3

    An algorithmic problem I was trying to solve required Dynamic Programming (Kickstart 2020 Plates) as the optimal solution. Scratched my head so much looking at the solution and time complexity thinking : "isnt this just brute force?".

  • @sakcee
    @sakcee Před 6 lety +1

    @Mit Opencourseware, is the homework, labs and other handouts available for this lecture

    • @mitocw
      @mitocw  Před 6 lety +11

      All materials for this course are available on ocw.mit.edu/6-006F11. Best wishes on your studies!

    • @sudhanshudey758
      @sudhanshudey758 Před 3 lety +1

      Thanks for this wonderful idea of open source education! No wonder you are the best engineering institute in the world both in terms of quality of studies and in terms of kindness and compassion for students all over the world. May you continue to give such high quality educational content forever !! :))

    • @sudhanshudey758
      @sudhanshudey758 Před 3 lety +1

      You are truly great!

  • @isaacweaver2188
    @isaacweaver2188 Před 3 lety +1

    At 33:23 shouldn't the run time actually be O(n(n+1)/2) instead of O(n^2)? If you think about it as starting with i = n - 1 and working backward to i=0, then the for loop iterations in the min statement will look like this:
    range(n, n+1) - 1 iteration
    range(n - 1, n+1) - 2 iterations
    range(n - 2, n+1) - 3 iterations
    ...
    range(0, n+1) - n iterations
    The runtime should just be the sum of integers 1 to n, which by induction is n(n+1)/2 which is significantly faster then n^2

    • @junzhai1715
      @junzhai1715 Před 3 lety

      usually we don't worry about constant factors in big O notation. O(n(n+1)/2)=O(n^2)

    • @isaacweaver2188
      @isaacweaver2188 Před 3 lety

      @@junzhai1715 Where's the constant factor? O(n(n+1)/2) = O((n^2)/2+n/2)

    • @junzhai1715
      @junzhai1715 Před 3 lety

      @@isaacweaver2188 O(0.5*n^2+0.5*n) the constant factor 0.5 does not matter in the big O notation. Also 0.5*n grows slower than n^2, so it can be removed.

  • @ramnathtejachekka7090
    @ramnathtejachekka7090 Před 2 lety

    Okay, now my question is what to do with the infinite loop on Erik's T-shirt!!

  • @cskcsk6370
    @cskcsk6370 Před 5 lety +1

    Did he explain what he means by badness? Is it just me where I feel he just brushed very vaguely on these subjects? Is that the intent?

    • @EscapedConvict2007
      @EscapedConvict2007 Před 5 lety +3

      I think he explained "badness" very clearly, he even wrote the formula on the blackboard.

  • @brunonegraozica5459
    @brunonegraozica5459 Před 8 lety +1

    I didn't understand the "suffixes", at 25:00. what is that for?

    • @dhaval12593
      @dhaval12593 Před 7 lety

      I think it means given an array of words say words[] and u fit in 0 to i words in line 1 (say for example) and the sub problem is reduced to remaining words in array words[] ( suffix ) which fill in the remaining lines.

    • @egor.okhterov
      @egor.okhterov Před 7 lety +9

      Consider some array a[4] = { 2, 15, 42, 13 }.
      Here are all of the suffixes of that array:
      a[0..3] = { 2, 15, 42, 13 }
      a[1..3] = { 15, 42, 13 }
      a[2..3] = { 42, 13 }
      a[3..3] = { 13 }

  • @AdarshGupta-dk5py
    @AdarshGupta-dk5py Před 5 lety +1

    Why word's strategy is not better

  • @kb3khs
    @kb3khs Před 2 lety

    That text justification recurrence is really hard to follow. I see a for statement with no body.

  • @janmichaelaustria620
    @janmichaelaustria620 Před 2 lety

    51:30 "You can do it, its not that hard"
    Statement for every DP solution ever LMAO!

  • @mohitrao7800
    @mohitrao7800 Před 3 lety +4

    Can somebody explain, Why was 1 added to indegree(v)?
    At one point he says it's for memorization(12:55) and then at another point he says it's account for 0 edges(10:25).
    Great lecture! Thanks Erik and MIT.

    • @anujsingh2836
      @anujsingh2836 Před 2 lety +1

      total count including 0.

    • @mistadeji
      @mistadeji Před rokem

      it's coming from the base case. remember your recursion should have a base case. In a case when you compute shortest from point S to point S. the length of that path is zero because you didnt do any work and your recursive algorithm can just return zero

  • @BorisChiou
    @BorisChiou Před 9 lety +2

    Super exciting~~~ I like this~ haha

  • @sonduongvan7010
    @sonduongvan7010 Před 4 lety +1

    49:48 to 50:12
    Can someone explains me why j equal to i + 4 + #hits +#dealer-hits? Thank you

    • @sonduongvan7010
      @sonduongvan7010 Před 4 lety

      @@yicheng1991 I still can't understand. i is the number of cards played now, isn't it? So, I think i include 4 cards played at begin of the game. Unless each round we play at least 4 card, we don't need plus 4 to i. It's my way of understanding Blackjack's rule, is it wrong?

    • @sonduongvan7010
      @sonduongvan7010 Před 4 lety

      @@yicheng1991 If i doesn't include 4 original cards, j also doesn't include them. But j=i+4+#hits+#dealer-hits => j includes 4 played cards. It's a little conflict.

    • @sonduongvan7010
      @sonduongvan7010 Před 4 lety

      @@yicheng1991 OK I understood it. i, or j, or whatever passed into BJ() functuion is the number of cards played of previous 'rounds'. Your answers are usefull for me. Thank you!

  • @giovaniventrue3420
    @giovaniventrue3420 Před 4 lety

    Why cubed? Who knows.

  • @ianhart8037
    @ianhart8037 Před 4 lety +1

    Good old chalk talk

  • @fouchimiousmane1119
    @fouchimiousmane1119 Před 4 lety

    This doesn't really help much. How would you define badness?

  • @anshprakash1778
    @anshprakash1778 Před 6 lety +1

    What is DAG?

  • @benyaminbeyzaie301
    @benyaminbeyzaie301 Před 3 lety +1

    Did any one has taken notes from these lectures?

    • @mitocw
      @mitocw  Před 3 lety +3

      Lecture notes are available on MIT OpenCourseWare at: ocw.mit.edu/6-006F11. Best wishes on your studies!

    • @benyaminbeyzaie301
      @benyaminbeyzaie301 Před 3 lety

      @@mitocw Thanks!

  • @jdkoz98
    @jdkoz98 Před 5 lety +4

    This is so far over my head wow lol

  • @seansmith1685
    @seansmith1685 Před 7 lety +1

    King

  • @ShubhamSinghYoutube
    @ShubhamSinghYoutube Před 3 lety +1

    Ah, Counting cards.

  • @TheMasonX23
    @TheMasonX23 Před 7 lety +3

    I thought everyone at MIT knew how to play blackjack... :P

  • @kenichimori8533
    @kenichimori8533 Před 6 lety

    Prober Proof

  • @brooklyna007
    @brooklyna007 Před 5 lety +6

    Professor: " This talk will be about DPs and BJ with some text justification."
    Interviewer: "What about BJs?"
    Professor: "About BJ, (as I said at 49:15) if I've already busted, I can't hit again"
    Interviewer: "But what is the general starting point?"
    Professor: "Well the base case for a 2x3^2 problem is 18 but as I said at 49:18 : maybe I take another hit , maybe I take another hit again, maybe I take another hit again. At some point I go over 21 and then you have got to stop the for loop."
    Interviewer: "What exactly are we talking about? Weed? Young women?"
    Professor: "Absolutely not. THIS IS COMPUTER SCIENCE! (/SPARTA) =D"

  • @researchandbuild1751
    @researchandbuild1751 Před 4 lety

    I dont get it...sorry..

  • @acestrike40
    @acestrike40 Před 5 lety

    any 50.004 students?

  • @kaushiksurikuchi
    @kaushiksurikuchi Před 3 lety +5

    Actually the "shortest paths in some DAG" perspective for dynamic programming could be a very slippery slope

  • @Anythingforfreedom
    @Anythingforfreedom Před 5 lety +5

    Do MIT students ever ask questions?

  • @txm2124
    @txm2124 Před 8 lety

    In text justification problem, shouldn't the number of ways to arrange n words be 2^(n-1) ?

    • @ChrisLeeX
      @ChrisLeeX Před 8 lety

      +Tushar Mehta Yes. It is one of the many errors in this lecture.

    • @victoro1152
      @victoro1152 Před 8 lety +4

      +Tushar Mehta No. Because your words must be "consecutive". So you basically think: Should I take the first word? the first 2 words? the first 3 words?...or the first n words?

  • @chrysistef4514
    @chrysistef4514 Před rokem

    You realize that those of you who understand have SUPERPOWERS 😅🤪

  • @florianwicher
    @florianwicher Před 6 lety

    "I didn't realize that all problems can be expressed as DAGs" - You can describe all finite state machines as DAGs, no?

  • @grad201187
    @grad201187 Před 10 lety +2

    I dont understand this! :(

  • @adhishmalviya2408
    @adhishmalviya2408 Před 3 lety +2

    Bolo siyavar ram chandra ki jai!

  • @moeinkasraei2114
    @moeinkasraei2114 Před 3 lety +1

    اهل مدرسه را به اهالی مدرسه پاس می دهند ،مگر خودشان اینرا نمی خواهند
    واهل تحقیق همدیگر را می شناسند

  • @GucciJohanne
    @GucciJohanne Před 2 lety

    maybe pick a demonstrator that isn't glued to their ipad tetris game

  • @mystmuffin3600
    @mystmuffin3600 Před 2 lety

    49:17 😳

  • @Frankhuaylinosvelasquez
    @Frankhuaylinosvelasquez Před 4 lety +1

    Those 5 guys who until this moment gave their dislikes I believe they are taking courses at high school. Btw, this professor is amazing! He motivated me much more that I usually used to be doing.

  • @iliasp4275
    @iliasp4275 Před 4 lety +7

    can't belive he said "the n-word" so many times and got away with it

  • @kennethhom2935
    @kennethhom2935 Před 6 měsíci

    The explanation for the Text Justification Algorithm wasn't convincing. The professor missed step 5 in solving the original problem. The lectures need to show the pseudocode at the very end so that we can verify it for ourselves. dp[j] + some random function Isn't an acceptable solution. You have to break it down into a concrete definition otherwise it does not help.

  • @mikewakefieldgeller4164
    @mikewakefieldgeller4164 Před 4 lety +1

    11 minutes in ..any questions? No.

  • @NickKravitz
    @NickKravitz Před 6 lety +2

    Pretty poor demonstration of the BlackJack game. Eric took a dealer hit on 17 which is not allowed. Victor incorrectly stood on soft 18 against a 9 and 10. An intuitive explanation of why the dealer has an advantage is that he gets to go last i.e. if both player and dealer bust the player busts first and loses. The cheating method of a perfect information deck was accomplished in the 1970s by a cheat swapping in his own pre-arranged shoe for the dealers. This resulted in the card shoes being chained to the BlackJack table. On the upside Eric has great handwriting. fun lecture overall.

    • @nick1f
      @nick1f Před 6 lety

      If the player does not see one card of the dealer, he will not know if his two cards are better. I think the advantage of the dealer is not that the player may bust first. If the player gets two cards that total 21, he does not receive double his money - he gets less and this is the house advantage. Many years ago I simulated a blackjack game where the player was playing using the same rules as the house and in the beginning I did not understand why in long term the player always loses.

    • @ariabanazadeh1016
      @ariabanazadeh1016 Před 5 lety

      Its not about playing black jack!!

  • @cla2008
    @cla2008 Před 4 lety

    how is this different from original word greedy approach? this is the greedy approach. just take as much as you can on one line and recurse

    • @CyberMew
      @CyberMew Před 2 lety

      That’s the original way Microsoft did it. This DP way looks at all possible combinations to get the best

  • @Hadoren
    @Hadoren Před 5 lety +7

    Yeah unfortunately this was really confusing. No code examples, no clarity, just random babble that left me utterly confused.

  • @applepuddings795
    @applepuddings795 Před 4 lety

    Such lectures are never free people pls young people if u are plannig to go for any university then also u have to pay like I am paying

  • @dscheme4427
    @dscheme4427 Před 6 lety

    lol, super nerds front-row

  • @pablogarin
    @pablogarin Před 3 lety

    hearing "DP" and "BJ" in a video made me wonder if I was watching the wrong kind of video :V

  • @TheWasteAccount
    @TheWasteAccount Před 5 lety +1

    Where’s all the Indians saying MIT was so easy??

    • @landychapman3
      @landychapman3 Před 4 lety

      they all quit and joined the Post Office (lol). Seriously I just wish he'd stop drawing letter L like that... Man is damn brilliant though. He's computer science version of Jordan Peterson!!

    • @ashutoshjha7124
      @ashutoshjha7124 Před 4 lety

      @@landychapman3 Even the co-lecturer of this course is Indian, lol