Lecture 20: Dynamic Programming II: Text Justification, Blackjack

Поділитися
Вставка
  • Опубліковано 13 січ 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

КОМЕНТАРІ • 177

  • @sergeykholkhunov1888
    @sergeykholkhunov1888 2 роки тому +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

  • @vvfking
    @vvfking 8 років тому +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 5 років тому +3

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

    • @abishekkachroo938
      @abishekkachroo938 4 роки тому +3

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

    • @neuron8186
      @neuron8186 3 роки тому +2

      @@TheR971 i am 5 years late but still weird

    • @chasewarren9702
      @chasewarren9702 2 роки тому +2

      @@TheR971 I am 6 years late but still weird

    • @coldfire6869
      @coldfire6869 7 місяців тому +1

      ​​@@TheR9717 years late, pretty weird

  • @aamike82aa
    @aamike82aa 7 років тому +157

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

  • @siddhartha.saif25
    @siddhartha.saif25 6 років тому +25

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

  • @stefanalexandru2363
    @stefanalexandru2363 9 років тому +158

    this professor is awesome

  • @Deepaksingh-ls3xj
    @Deepaksingh-ls3xj 10 років тому +7

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

  • @robertalaverdyan3150
    @robertalaverdyan3150 4 роки тому +8

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

  • @csl1384
    @csl1384 4 роки тому +3

    The "5 Steps" are pedagogical gold

  • @julianarezende4849
    @julianarezende4849 8 років тому +39

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

    • @lucasandrade7421
      @lucasandrade7421 3 роки тому +2

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

    • @DIPTANGSHUMISHRA
      @DIPTANGSHUMISHRA 3 роки тому +5

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

  • @skc909887u
    @skc909887u 2 роки тому +1

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

  • @casperdewith
    @casperdewith 4 місяці тому +2

    *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  4 місяці тому +1

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

  • @greagarious44
    @greagarious44 9 років тому +15

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

    • @stjepanbrkic3215
      @stjepanbrkic3215 8 років тому +7

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

  • @davemartin157
    @davemartin157 6 років тому +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 4 роки тому +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

  • @maninandadeepmedicharla6213
    @maninandadeepmedicharla6213 3 роки тому +1

    this guy is brilliant !!

  • @hardikchawla645
    @hardikchawla645 5 років тому +1

    Great explanation

  • @skillfullSwaroop
    @skillfullSwaroop 2 роки тому

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

  • @kevnar
    @kevnar 10 років тому +116

    Black-haired girl was on time this class.

  • @akarshrastogi3682
    @akarshrastogi3682 6 років тому +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.

  • @tentotheace
    @tentotheace 5 років тому +41

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

    • @EOh-ew2qf
      @EOh-ew2qf 2 роки тому

      literally paused the video to search for comments

  • @sir1cyr
    @sir1cyr 7 років тому +16

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

    • @sirnawaz
      @sirnawaz 5 років тому +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!

  • @direitoemtela
    @direitoemtela 6 років тому +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.

  • @BorisChiou
    @BorisChiou 9 років тому +2

    Super exciting~~~ I like this~ haha

  • @isbestlizard
    @isbestlizard 3 роки тому +5

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

  • @pablogarin
    @pablogarin 3 роки тому +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 2 роки тому +1

      was thinking the same

    • @chaddaifouche536
      @chaddaifouche536 2 роки тому +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.

  • @apoozeo1715
    @apoozeo1715 6 років тому +9

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

    • @EstebanFilardi
      @EstebanFilardi 3 роки тому +5

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

  • @ChathuraJayalath
    @ChathuraJayalath 7 років тому +4

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

  • @biuku
    @biuku 3 роки тому +1

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

  • @richardbrks
    @richardbrks 10 років тому +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.

  • @KirollosSamyHakim
    @KirollosSamyHakim 10 місяців тому

    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.

  • @csl1384
    @csl1384 4 роки тому +4

    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 5 років тому +4

    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...

  • @LT1FirebirdSLP
    @LT1FirebirdSLP 3 роки тому +3

    Parent Pointers begins at 35:17

  • @siaahmadi413
    @siaahmadi413 5 років тому +2

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

  • @laurietsao8733
    @laurietsao8733 4 роки тому +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.

  • @eepassion9720
    @eepassion9720 5 років тому +11

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

    • @awesomedude824
      @awesomedude824 4 роки тому

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

    • @CyberMew
      @CyberMew 2 роки тому

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

  • @eknuds
    @eknuds Рік тому

    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.

  • @nagesh71086
    @nagesh71086 9 років тому +7

    Did the camera person change or something? I got headache after a while, not because of Erik or the content, but heavy camera movement!

  • @turinreza
    @turinreza 8 років тому +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?

  • @seansmith1685
    @seansmith1685 7 років тому +1

    King

  • @brunonegraozica5459
    @brunonegraozica5459 7 років тому +9

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

    • @antoniodingyi
      @antoniodingyi 4 роки тому +3

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

  • @vaibhavbansal7470
    @vaibhavbansal7470 7 років тому +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 6 років тому +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

  • @PinkuDebNath
    @PinkuDebNath 10 років тому +4

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

  • @spicy_wizard
    @spicy_wizard 5 років тому +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 3 роки тому

      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 2 роки тому

      @@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.

  • @abhishekganesan7081
    @abhishekganesan7081 7 років тому +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 7 років тому +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.

  • @sakcee
    @sakcee 6 років тому +1

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

    • @mitocw
      @mitocw  6 років тому +11

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

    • @sudhanshudey758
      @sudhanshudey758 3 роки тому +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 3 роки тому +1

      You are truly great!

  • @fgfanta
    @fgfanta 5 років тому +4

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

    • @naveenrawat6278
      @naveenrawat6278 3 роки тому +2

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

  • @nikoladd
    @nikoladd 5 років тому +3

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

    • @MeLawenity
      @MeLawenity 3 роки тому +1

      tail is second item onwards, suffix is more general

    • @nikoladd
      @nikoladd 3 роки тому

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

  • @JanacMeena
    @JanacMeena 4 роки тому +1

    35:16 - Parent Pointers

  • @janmichaelaustria620
    @janmichaelaustria620 2 роки тому

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

  • @shrreyabehll2727
    @shrreyabehll2727 4 роки тому +2

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

    • @minh_tran
      @minh_tran 4 роки тому +3

      Because initially both player are dealt with 4 cards in total

  • @AlanKao-fc4km
    @AlanKao-fc4km 7 місяців тому

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

  • @georgefei
    @georgefei 8 років тому +2

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

    • @dhaval12593
      @dhaval12593 7 років тому

      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...

  • @researchandbuild1751
    @researchandbuild1751 4 роки тому +1

    Cubed..i wonder if its rule of thirds?

  • @inferious777
    @inferious777 4 роки тому +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?".

  • @shauryahanda2901
    @shauryahanda2901 6 років тому +1

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

    • @mitocw
      @mitocw  6 років тому +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.

  • @ramnathtejachekka7090
    @ramnathtejachekka7090 2 роки тому

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

  • @JanacMeena
    @JanacMeena 4 роки тому

    38:52: Blackjack

  • @shibyurehash5205
    @shibyurehash5205 9 років тому +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 9 років тому +1

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

  • @srikantaggarwal6016
    @srikantaggarwal6016 9 років тому +1

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

    • @AbstractAbsorption
      @AbstractAbsorption 9 років тому

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

  • @ytuser659
    @ytuser659 3 роки тому +1

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

    • @chaddaifouche536
      @chaddaifouche536 2 роки тому

      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.

  • @jdkoz98
    @jdkoz98 5 років тому +4

    This is so far over my head wow lol

  • @ianhart8037
    @ianhart8037 4 роки тому +1

    Good old chalk talk

  • @isaacweaver2188
    @isaacweaver2188 3 роки тому +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 3 роки тому

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

    • @isaacweaver2188
      @isaacweaver2188 3 роки тому

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

    • @junzhai1715
      @junzhai1715 3 роки тому

      @@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.

  • @brunonegraozica5459
    @brunonegraozica5459 7 років тому +1

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

    • @dhaval12593
      @dhaval12593 7 років тому

      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 7 років тому +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 }

  • @mohitrao7800
    @mohitrao7800 3 роки тому +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 2 роки тому +1

      total count including 0.

    • @mistadeji
      @mistadeji Рік тому

      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

  • @Kevin-ux5xf
    @Kevin-ux5xf Рік тому

    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?

  • @TheMasonX23
    @TheMasonX23 7 років тому +3

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

  • @ShubhamSinghYoutube
    @ShubhamSinghYoutube 2 роки тому +1

    Ah, Counting cards.

  • @AdarshGupta-dk5py
    @AdarshGupta-dk5py 5 років тому +1

    Why word's strategy is not better

  • @brooklyna007
    @brooklyna007 4 роки тому +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"

  • @cskcsk6370
    @cskcsk6370 5 років тому +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 5 років тому +3

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

  • @chrysistef4514
    @chrysistef4514 Рік тому

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

  • @kenichimori8533
    @kenichimori8533 6 років тому

    Prober Proof

  • @benyaminbeyzaie301
    @benyaminbeyzaie301 3 роки тому +1

    Did any one has taken notes from these lectures?

    • @mitocw
      @mitocw  3 роки тому +3

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

    • @benyaminbeyzaie301
      @benyaminbeyzaie301 3 роки тому

      @@mitocw Thanks!

  • @sonduongvan7010
    @sonduongvan7010 4 роки тому +1

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

    • @sonduongvan7010
      @sonduongvan7010 4 роки тому

      @@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 4 роки тому

      @@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 4 роки тому

      @@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!

  • @Anythingforfreedom
    @Anythingforfreedom 5 років тому +5

    Do MIT students ever ask questions?

  • @giovaniventrue3420
    @giovaniventrue3420 4 роки тому

    Why cubed? Who knows.

  • @anshprakash1778
    @anshprakash1778 6 років тому +1

    What is DAG?

  • @Frankhuaylinosvelasquez
    @Frankhuaylinosvelasquez 4 роки тому +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.

  • @kb3khs
    @kb3khs 2 роки тому

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

  • @acestrike40
    @acestrike40 5 років тому

    any 50.004 students?

  • @kaushiksurikuchi
    @kaushiksurikuchi 3 роки тому +5

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

    • @Taabro
      @Taabro 2 роки тому

      How so?

  • @adhishmalviya2408
    @adhishmalviya2408 3 роки тому +2

    Bolo siyavar ram chandra ki jai!

  • @moeinkasraei2114
    @moeinkasraei2114 3 роки тому +1

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

  • @fouchimiousmane1119
    @fouchimiousmane1119 4 роки тому

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

  • @txm2124
    @txm2124 8 років тому

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

    • @ChrisLeeX
      @ChrisLeeX 8 років тому

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

    • @victoro1152
      @victoro1152 8 років тому +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?

  • @researchandbuild1751
    @researchandbuild1751 4 роки тому

    I dont get it...sorry..

  • @florianwicher
    @florianwicher 6 років тому

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

  • @grad201187
    @grad201187 10 років тому +2

    I dont understand this! :(

  • @GucciJohanne
    @GucciJohanne 2 роки тому

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

  • @mystmuffin3600
    @mystmuffin3600 2 роки тому

    49:17 😳

  • @iliasp4275
    @iliasp4275 4 роки тому +7

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

  • @mikewakefieldgeller4164
    @mikewakefieldgeller4164 4 роки тому +1

    11 minutes in ..any questions? No.

  • @kennethhom2935
    @kennethhom2935 5 місяців тому

    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.

  • @Hadoren
    @Hadoren 5 років тому +7

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

  • @NickKravitz
    @NickKravitz 6 років тому +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 6 років тому

      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 5 років тому

      Its not about playing black jack!!

  • @cla2008
    @cla2008 4 роки тому

    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 2 роки тому

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

  • @dscheme4427
    @dscheme4427 6 років тому

    lol, super nerds front-row

  • @applepuddings795
    @applepuddings795 4 роки тому

    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

  • @balaportejean7015
    @balaportejean7015 4 роки тому

    wohhh great
    Jesus loves you
    Believe in him and repent !