Lec 1 | MIT 6.046J / 18.410J Introduction to Algorithms (SMA 5503), Fall 2005
Vložit
- čas přidán 7. 09. 2024
- Lecture 01: Administrivia; Introduction; Analysis of Algorithms, Insertion Sort, Mergesort
View the complete course at: ocw.mit.edu/6-0...
License: Creative Commons BY-NC-SA
More information at ocw.mit.edu/terms
More courses at ocw.mit.edu
Lecture details-
17:18 Analysis of algorithms
22:00 Why study algorithms and performance?
27:40 The problem of sorting
29:21 Insertion sort (1)
32:25 Insertion sort (2)
34:28 Example of insertion sort (1)
34:40 Example of insertion sort (2)
34:49 Example of insertion sort (3)
34:54 Example of insertion sort (4)
34:58 Example of insertion sort (5)
35:06 Example of insertion sort (6)
35:11 Example of insertion sort (7)
35:21 Example of insertion sort (8)
35:24 Example of insertion sort (9)
35:29 Example of insertion sort (10)
35:32 Example of insertion sort (11)
36:17 Running time
39:29 Kinds of analyses
46:49 Machine-independent time
50:33 Θ-notation
54:45 Asymptotic performance
57:00 Insertion sort analysis
1:03:35 Merge sort
1:05:25 Merging two sorted arrays (1)
1:06:19 Merging two sorted arrays (2)
1:06:31 Merging two sorted arrays (3)
1:06:39 Merging two sorted arrays (4)
1:06:43 Merging two sorted arrays (5)
1:06:46 Merging two sorted arrays (6)
1:06:49 Merging two sorted arrays (7)
1:06:51 Merging two sorted arrays (8)
1:07:13 Merging two sorted arrays (9)
1:07:16 Merging two sorted arrays (10)
1:08:20 Analyzing merge sort
1:10:49 Recurrence for merge sort
1:12:54 Recursion tree (1)
1:13:40 Recursion tree (2)
1:13:50 Recursion tree (3)
1:14:19 Recursion tree (4)
1:14:50 Recursion tree (5)
1:15:02 Recursion tree (6)
1:16:17 Recursion tree (7)
1:16:33 Recursion tree (8)
1:16:41 Recursion tree (9)
1:16:49 Recursion tree (10)
1:18:13 Recursion tree (11)
1:19:20 Conclusions
Thanks
which is better with this 2 equation N^2+31N^3+24N and I^2+N+21+4*3. thank you for your answer.
sohan badade is
not the hero we deserve, but the hero we need
you will go to heaven
The MIT recommended order for watching this is 6.042J (Mathematics for Computer Science) , then 6.006 (Introduction to Algorithms) and finally 6.046J (Analysis and Design of Algorithms).
And the teaching starts at 17:26.
Another thing... the spring 2015 versions of 6.042J and 6.046J are now available on on CZcams.
Where can I see the recommended order of watching on MIT's website?
We would recommend that you look at the EECS Undergraduate Programs page at www.eecs.mit.edu/academics-admissions/undergraduate-programs. From there, there are a number of resources to see how the courses are connected (either by undergraduate program or by the dynamic graphical display).
You're forgetting 6.001
MIT OpenCourseWare what are recitations and how are they helpful beside video lectures, plz help
+Ishan Pandey It's a supplement to lectures (might be a chance for discussion, homework questions, deeper exploration of select material, conversation practice in a language, etc.).
In my opinion this is even better than the more recent MIT class videos
can I donate to MIT to buy a better camera?
+ocaswiz Sure! Go to ocw.mit.edu/donate/ to donate.
+ocaswiz ,the videos was recorded in 2005,I bet you didn t had a camera at that time, value the work that these people doing!
I wasn't mocking them. I will donate for sure and how do you know I didn't appreciate the work?
+ocaswiz because you have a cat as your dp.
+Mohamed El Atoubi pretty sure there were some fancy cameras available in 2005 lol
these lectures from 2005 are sooo helpful like I wish my prof was this good
This was awesome. I study Computer Science in Italy and this was very helpful, I really appreciate you putting this on the web, this embodies the idea of free culture that I hope everyone will one day agree about.
Yes and i agree that now in 2022
MIT...please re-upload these in 480/720.
I learned more from this 1 hour video than the whole semester of DS attended in college. Only if I knew this lectures existed in 2012.
Can't really believe that we can have the OG prof Leicerson of CLRS teaching us Algorithms! Thanks to MIT.
10 years ago, Eric Domaine at his first step in teaching ☺
Exactly no one took a moment of appreciation for the dude :)
this professor made things seem so easy !! very helpful video lecture :)))))))))))))
after searching a lot I got this awesome lecture thanks, mit.
"Introduction to algorithms"
Thomas H. Cormen
Charles E. Leirson
Since this course is from MIT and for free I wont complain for video quality.
Starts at 17:27
Thanks.
Thanks
Thanks.
You saved 17 mins of my life, thanks
Thanks bro
Book + lectures = god tier
This course is different than the one recorded in 2015, this one is a compact course that contains almost 6.006 and 6.046 at the same course
.
When I used to teach this (and when I learned it too) we take more of sorting algorithms, I think (or that's what I'd do if I teached it again, I think I did it at least once) to make the students work in groups to implement all different kinds of sorting and draw a graph to compare their running times to see & feel the asymptotic order by themselves, and no. comparisons too to get the sense of a dominant operation when they compare its curves to running time curves
.
Also, from the students comments that I quickly scanned...
I once did this long talking introduction in a cryptography & computer security course thinking it will be amazing and get the students attention from stories about Enigma and world War2, the interference of CIA or Bentagon on DES keys... It turns out it's boring and students want u just to get directly to the point
[20] Sebuah senyawa non volatil Z, digunakan untuk membuat dua larutan yang
berbeda. Larutan A mengandung 5 g senyawa Z yang dilarutkan dalam 100 g air.
Sedangkan larutan B mengandung 2,31 g senyawa Z yang dilarutkan dalam 100 g
benzen. Larutan A mempunyai tekanan uap 754,5 mmHg pada titik didih air normal
dan larutan B mempunyai tekanan uap yang sama pada titik didih normal benzen.
Hitunglah massa molar dari senyawa Z pada larutan A dan B!
I like this theacher a lot so much fun to his lesson!I am not in MIT so one the students there please confirm. The metaphor of Performance ~ Money so to have other features was brilliant!
He is one of the authors of the book that suggested.A classic one
"A big supercomputer, or, ummm, your wrist-watch":cracks me up everytime.
He says that indentation as a means of denoting nesting levels is a bad notation in practice.
I'm not particularly a fan of indentation-based nesting, but I have to say that Python has managed to be a fairly popular language, and in companies like Google they use it professionaly with good results.
So I woudn't be so sure about the "bad notation" idea.
It is bad.
Russ Canduit how so? It makes code much more readable
For some reasons being a popular language doesn't imply being a good language
The context was over how the code is displayed, so that you do not lose visual track of how the indentations relate to one another, as they relate to the nesting of the code. This is more obvious when coding in a terminal (tty), hat runs a fixed number of lines of code to the page that is displayed per screen of code. This is not a problem when using an editor on a graphical desktop, for which the editor is endlessly scrollable.
Thanks a lot for uploading them. They are of great help. Definitely of more clear then cormen.
Funny part, this Professor has made references to Cormen's book at every step.
thank you for the course .. its helps people like us who want to learn things.. .
kaushal kashyap hour for this video help you? What did you learn?
+Cyril Varghese he learnt what u probably wont
TG: 8:9 AM
Ngày: 3/13/2017, Tháng 3
Lec 1 | MIT 6.046J / 18.410J
Introduction to Algorithms (SMA 5503), Fall 2005
자막 만들어 주신분들 고맙습니다. 행복하세요. Thanks for sharing subtitle, and Thank to MIT too :)
bro are u working right now?
Tried that on Java. For an array with 1 K inputs Insertion Sort wins. For an array of 1 million values, merge sort finishes for 0.2 secs while insertion sort takes minutes.
My university previous to Corona 2020: We can't do recordings of lectures because they violate privacy
MIT in 2005: 0:48
MIT courses always start watching at -1.5x speed. Also previous comments have done a job of identifying when a particular topic starts.
The first thing that pops in my head about what is more important than performance is compatability
@fashanu1000 Arthur Benjamin gives a useful answer to your question by going over the ABCs of math: A for applications, e.g. math is crucial and foundational for the fields you listed (less so biology but in certain sub-fields dramatically so), B for beauty, e.g. deriving Euler's identity or Euclid's proof of root-2's irrationality, and C for certainty.
what a great teacher!
it's correct .
O(n^2) makes smaller running time than O(n^3), so it's better,actually faster
who came here from geeksforgeek
i came..
Me
Where in geeksforgeeks are these links?
@@Sra4825 not for all topics, but in some of the topics in the website, they put such links...
for this video link on Geeksforgeeks, visit this link: www.geeksforgeeks.org/analysis-of-algorithms-set-1-asymptotic-analysis/
(Go to "References" at bottom of the topic or
CTRL+F -> MIT’s Video lecture 1 on Introduction to Algorithms ) ...
Have a good time ahead :-)
maa mee..
@AMDNiels Yeah, the answer to T(n) = T(n-1) + 1 is c+n-1 or n, and secondly, while you can look at a loop as recursive (just as a Sum is recursive), it's easier not to do so. If you wanted to do it that way, you'd have to account for the second inner loop as well. However, this would be much more complicated, so recursive is only used when a function is calling itself, not a loop iteration.
Lecture details:
34:13 He makes the funniest sound
He is saying thank you for not wasting 17 minutes of my life, thus he already forward it!
Once you buy the hardware you don't need to pay for it again, so the hardware cost is one time. The main cost for writing software is programmer time because for each software (and time spent on optimizing it) you pay the programmers for the time it takes, whereas once you buy a computer you can use it as much as you want and there's no repeated costs.
Hi, anyone knows whether this should be 6.006 or 6.046 (Intro to Algs vs Design & Analysis of Algs)? Many thanks
As the title says, the course is 6.046J / 18.410J Introduction to Algorithms (SMA 5503), Fall 2005. Please keep in mind that numbers and courses titles can change over time. What was 6.046J one year, might be a different course but with the same number in different year.
I remember seeing the first videos of this course something like 8 years ago. And there is a part in which Charles E. Leirson tells people something like "talk, ask questions, verbalize, put emotion on it" or something like that. I am desperately looking for that part of the video but I can't find it
a better lecture than the one i am sitting in right now
There are two courses of Introduction to algorithms 6.006 and 6.046J. To learn algorithms from scratch which one should I choose?
+amit vashwan You should choose 6.006, it is more of an introductory course on algorithms and is considered a prerequisite for the more advanced 6.046J.
Shouldnt it be cn((log n)-1) if the height is log n and all terms are cn except the last one?
O(n) is much less time compl. than O(nlogn), so it is neglected. Constants are ignored too, when it comes to complexity. So c*n*logn + n ~ c*n*logn = O(nlogn)
its easy for one to get lost on how the elements are being sorted for mergesort. its important to understand how mergesort divides the workspace and sorts each half and finally merges it. once this is done, one will always know why mergesort is O(nlgn)
At 20:00 solving the problem. All the performance will not solve the problem.
taking the this exact course at my university. This helps a lot for getting ahead and reviewing.
Skip to 17:11 if you are not a student of MIT/SMA and just watching this to learn something.
Around 41:20, he said T(n) becomes a function from a relation if we specify the word "maximum" (time on any input of n).
Can anyone please help me out with the explanation of that?
Very Useful and Informatic..Got a good idea about algoritms
@Ghaiyst what does Singapore gotta do with India?
Can someone tell me what is the difference between 6.046J course and 6.006 course
+Ricky Ponting 6.006 is more of an introductory course on algorithms and is considered a prerequisite for the more advanced 6.046J.
was looking for this, thank you!
Which version is better? The Fall 2005 version or the 2011 version? I'm about to get started, but this series seems that 20 and 21 are missing.
The course materials mentions that lecture 20 is quiz 2. Lecture 21 was probably the review of quiz 2. Quiz 2 (with solutions) and other course materials are available on MIT OpenCourseWare see ocw.mit.edu/6-046JF05 for more details.
Can we replicate emotion behavior only by a chain of math expression ? Can we make biological algorithm ? Do algorithm is only automation (chain of command) ?
machine learning
Speed is fun!!! Lets all do speed, this guy is all about speed!
This professor has some of the most lecture-friendly penmanship.
Lecture Summary - Insertion sort is n^2 time(quadratic), while Recursive Merge sort is nlog(n) (log time - MUCH faster).
It's amazing like usual, but i wish it was a better quality, it's a bit hard to focus when it's so jerky...
@interted yes there is a book called "introduction to algorithms" ebook, google it
The proof of this is very simple. Supose exist the Fast machine F and the slow machine S. If for each operation in F that take P sec, in S take P*N where N is the input. So the insertion in S run in O(N^3) and in F run in O(N^2)
That's a very late reply, but I just watched it today
The m/c time for an operation can not possibly depend on N, so in ur example it remains O(N2)
U see we derive the asymptotic order based on the most dominant operation in the Algorithm (comparison in sorting), if u have additions & multiplications u must note that multiplications take more m/c time than adding,...
Back to ur example if m/c S is slower than F, u could say a comparison (comparing any 2elements) in S takes Ts time, in F takes Tf time where Ts > Tf, but how could either of Ts or Tf depend on N?!
u can check this lec for a detailed explanation
czcams.com/video/Zc54gFhdpLA/video.html
min 7:30-18 in the exact point, especially if u think of insertion sort as an example, how would u insert the element in its right position? array or linked list? No. Of operations
the best lecture notes ever :))
17:18 Analysis of algorithms
I DO NOT HAVE THE REQUIRED MATH!...BUT I'M VERY INTELLIGEANT ENTILLAGANT/ INTELL//smart!
talking about performance can we say that to get a good throughput we require good performance ??
35:14 the example feels wrong, the code said it is i that is moving right(i plus 1) so it should be 8 moving right not 2 moving left
all cs prof in my university should teach like this guy
skip to 17:00, yw.
hes the asshole guy to leave the class that sir feels bad with that
Alright Sorry I'm watching this and I just want to shout out loud this answer to his question about what is more important in programming than performance. I think one of the best answers would be quality which emcompasses all the answers given
Very good video. Thanks for sharing this video. Please do share more videos on IT courses.
I wish the resolution was higher than 240p, it's hard to read the board sometimes
We also wish these videos were higher quality. These videos were originally quarter screen Real Media files. This course does have lecture notes that should help, see the course on MIT OpenCourseWare at ocw.mit.edu/6-046JF05 (The lecture notes are under the "Related Resources" tabs under the video player.
This is great,I wish I have seen this earlier,my course sucks because my lecturer sucks
36:22 when he writes running time and see his watch....idk y but its funny hahahaha
Guys, try this link: ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-046j-introduction-to-algorithms-sma-5503-fall-2005/video-lectures/lecture-1-administrivia-introduction-analysis-of-algorithms-insertion-sort-mergesort/
Now I have to correct myself. Quality emcompasses performances as well. So I suppose we should be learning how to produce quality code which would means you still have to learn all of the baby steps to doing so. Point Withdrawn.
It's because they are MIT and CZcams would be crazy not to grant them the ability to upload videos of such length.
Other companies have the same priviledge.
In 0:53:59 i think he must explain that he assume that each operation in a Computer is constant (that every time an operation take exactly the same time to perfome its function).
you're right. they all watched his lectures on youtube but never acknowledged publicly.
That was great. Thanks for the generosity.
thanx for providing us this lecture just that quality is not good enough
Thanks for such great lectures
Thank you for making this available!
@sim2k Well, watch from 00:27 again. He talks about that it's an SMA course (Singapore MIT Alliance course). So, I'm not surprised at the idea that a big fraction of the views are from India.
thanks for the great lecture
i tried many courses but this exactly what i needed
So jealous of the 80 min video upload!!!!
No need. You can do it too
Thank you MIT.
Lecture starts at 17:10
I am a professor. How can I contribute by translating the lecture to Portuguese?
This option is currently disabled!
does this playlist cover the CLRS book completely? (introduction to algorithm by cormen)
Looking at the Readings section it looks like most, but not all, the chapters in the book are covered. See Readings for details at: ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-046j-introduction-to-algorithms-sma-5503-fall-2005/readings/. Best wishes on your studies!
Great lecture, algos start at 28th minute
where can i get the course 6.006 from?
i'm not familiar to some of the mathematical techniques he discussed.
You can get 6.006 from MIT OpenCourseWare at: ocw.mit.edu/6-006F11. Fun Fact: we currently have over 2400 courses available! =D ocw.mit.edu
i like the way he is scaring his students.
all the heaven starts from 17:00
wish I found these before I finished my masters or during my bachelors.
ohh i am so late but i hope you reached your goal .
this is a great intro. but as a student, I think the insertion and mergesort implementation details have been scrificed. even tho its just a few lines of code, the mergesort implementation is a beast. for an array of 10 elements, the number of stacks and variable versions generated by the recursive calls is quite large.
Filed under 'old but gold' lecture videos
I would love Computer Science and Engineering if I was to be taught by these legendary professors, what are the options of a foriegn student in MIT after his undergraduate?
I have a year left with my UG course, can anybody guide in the opencourseware panel how can I fully utilize these 12 months.
Hey does anyone know how did he get theta (j) to define the worst case asymotic analysis formulation of insertion sort, I'm lost on that part...
why does everyone laugh at 28:23? did someone fart?
This mystery is yet to be solved
I think someone screamed really dramatically? If you rewind it couple seconds back you can hear a little bit.
it was nice listening to the lecture !! thanks for sharing !
Asymptotic analysis at 48:22
Thanks a lot for all