Lecture 11: Integer Arithmetic, Karatsuba Multiplication

  Рет қаралды 150,108

MIT OpenCourseWare

MIT OpenCourseWare

11 жыл бұрын

MIT 6.006 Introduction to Algorithms, Fall 2011
View the complete course: ocw.mit.edu/6-006F11
Instructor: Srini Devadas
License: Creative Commons BY-NC-SA
More information at ocw.mit.edu/terms
More courses at ocw.mit.edu

Пікірлер: 98
@xpickles
@xpickles 6 жыл бұрын
"this is one of those things where if you were born early enough you get your name on an algorithm" damn why you gotta throw shade on my boy karatsuba like that
@avatar098
@avatar098 5 жыл бұрын
The amount of salt in his blood is too damn high! xD
@Artaxerxes.
@Artaxerxes. 2 жыл бұрын
Is it true tho. Do we no longer give names to new algorithms. ifaik if scientist Z comes with a new algo, we call it Z algo
@xpickles
@xpickles 2 жыл бұрын
​@@Artaxerxes. He's saying the algorithm was easy, anyone born early enough could've been the first to come up with it.
@SaisankarGochhayat
@SaisankarGochhayat 6 жыл бұрын
Karatsuba starts at 33:54
@kanishkakaushik1868
@kanishkakaushik1868 3 жыл бұрын
Thanks buddy
@sergeykholkhunov1888
@sergeykholkhunov1888 2 жыл бұрын
02:56 irrationals 06:56 Catalan numbers (fun digression) 18:08 Newton's method 24:12 quadratic convergence 32:52 high precision multiplication 38:02 Karatsuba algorithm 42:13 demo: fun geometric problem Spoiler: plot twist in demo is related to Catalan numbers.
@christopherellis2663
@christopherellis2663 Жыл бұрын
1234. 03 05.07 05 5678 11 13 15 13 33 65 105. 65. And so forth 05 12 21 33
@prateeksinghal630
@prateeksinghal630 4 жыл бұрын
Dr Devadas reminds me of Sheldon Cooper whenever he laughs XD
@bonbonpony
@bonbonpony 3 жыл бұрын
He even laughs in a similar way :J (21:12)
@PamirTea
@PamirTea 6 жыл бұрын
46:17 What a twist!
@productivelb
@productivelb 6 жыл бұрын
Cool demo - I have seen it many times in this lecture and still amazed!
@mingyulu6029
@mingyulu6029 8 жыл бұрын
He's so much more fun in this class
@vagabond7199
@vagabond7199 5 жыл бұрын
Catalan number thing is dope! Pretty cool lecture.
@tentotheace
@tentotheace 5 жыл бұрын
After all the great lectures up to this point, this is a truly confusing and incoherent one. Let's hope Victor clears things up :)
@cvxcfv
@cvxcfv 2 жыл бұрын
my exact thoughts, I think this is more theory and textbook based from their class
@ninadgandhi9040
@ninadgandhi9040 2 жыл бұрын
Exactly! It was all skimming over topics and no dots connected, took a lot of effort to make sense of simple things! Maybe they crammed too much stuff into a single lecture!
@alpers.2123
@alpers.2123 3 жыл бұрын
Speaking from 2020! Multiplication is now proved to be computable in nlogn time complexity
@joedalton77
@joedalton77 2 жыл бұрын
You're from the future? What's it like in 2020!?
@nyc132132
@nyc132132 10 жыл бұрын
36:49 error Z2 = X2*Y2 - should be z2 = x1*y1 .. also 2^log(3) is a transcendental number and not just irrational
@spartacusche
@spartacusche 4 жыл бұрын
I read your comment after 6 years, thank you
@sammyvincent9615
@sammyvincent9615 4 жыл бұрын
Haha thanks. Glad I'm not the only one who sees that
@NadineDeHope
@NadineDeHope 9 жыл бұрын
wow, cool end of the lecture
@noguide
@noguide 5 жыл бұрын
Yes, wow, I didn't see this coming, really amazing!
@crjacinro
@crjacinro 3 жыл бұрын
whas that catalan numbers showing up?
@rahulrachh3320
@rahulrachh3320 3 жыл бұрын
Last 2 mins blew my mind. Numbers are MindBlowing 🤯🤯🤯🤯🤯🤯🤯🤯🤯
@lockersrandom6161
@lockersrandom6161 3 жыл бұрын
Thank you MIT.
@anmolsharma9539
@anmolsharma9539 3 жыл бұрын
Love your concern towards india🇮🇳
@ninadgandhi9040
@ninadgandhi9040 2 жыл бұрын
Ok, completely blown away in the last 5 mins, not gonna lie!
@alwaysspeaktruth9244
@alwaysspeaktruth9244 4 жыл бұрын
Professor’s shirt is glittering in video 💥
@jurian0101
@jurian0101 11 жыл бұрын
x-Sqr(x^2-1)==1/(x+Sqr(x^2-1)~1/2x in this case, it's about 1E-12.
@MichalCanecky
@MichalCanecky 11 жыл бұрын
40:00 z2 supposed to be x1y1 not x2y2, x2, y2 are undefined
@rotariuandreilucian6572
@rotariuandreilucian6572 11 жыл бұрын
i head about MIT ...what a big peace of chulck
@letMeSayThatInIrish
@letMeSayThatInIrish 9 жыл бұрын
3:05 Among the Pythagoreans, Hippasus was likely the first to realize some numbers where not rational. According to legend he discovered this at sea, and his fellow pythagoreans responded by throwing him overboard.
@bonbonpony
@bonbonpony 6 жыл бұрын
Pythagoreans knew about irrational numbers all well. They knew the square root of 2, the golden ratio, and they used the pentagram (full of irrational golden ratios) as their secret sign. What they drowned Hippasus for was not for discovering irrational numbers, but for revealing the secret to the non-initiated.
@mohabmetwally5749
@mohabmetwally5749 8 жыл бұрын
if don't know about catalan numbers. at 6:30 pause the video and read this en.wikipedia.org/wiki/Catalan_number he is terrible in this part. better read wikipedia .
@johnhart1790
@johnhart1790 6 жыл бұрын
The student that said C_1*C_1 was correct.
@johnhart1790
@johnhart1790 6 жыл бұрын
According to the definition on page 61 of Peter Cameron's book. Ok the two definitions are slightly different. The Catalan of Cameron's book C_n = C_(n-1) of the lecture.
@MrMrVV
@MrMrVV 5 жыл бұрын
go to kzfaq.info/get/bejne/m9Wfmdl8rsWzm5s.html start from minute 2:00 and you find great explanation
@ankushmenat
@ankushmenat 5 жыл бұрын
Thanks!
@isbestlizard
@isbestlizard 3 жыл бұрын
maybe it's a matter of style, but I find it a lot easy to grok something if I'm given examples first then generalised with a method/proof/formal definition.. rather than starting with a formal definition then using it to build examples.. like.. just draw a few examples of balanced pairs of brackets 1 = () 2 = ()(), (()) 3 = ((())), ()(()), (())(), (()()), ()()() etc and I think I would have gotten it a lot easier than trying to define alpha and beta which I still don't get :V now it's suddely popping up everywhere especially binary trees
@samoldfield9997
@samoldfield9997 2 жыл бұрын
thank you sir.
@MrNoBody114
@MrNoBody114 11 жыл бұрын
magic design shifting shirt
@joedalton77
@joedalton77 2 жыл бұрын
Moiré
@khushiiversee
@khushiiversee Жыл бұрын
qudratic convergence using newton methos
@franzscheerer
@franzscheerer 2 жыл бұрын
Let's see if the professor was right. >>> def cn(x): ... if x < 2: return 1 ... sum = 0 ... for k in range(x): ... sum = sum + cn(k)*cn(x-1-k) ... return sum ... >>> cn(2) 2 >>> cn(3) 5 >>> cn(4) 14
@laurv8370
@laurv8370 7 жыл бұрын
I like this guy... ! [with the observation that the original (long) 3x3 split would need 9 dm (digit multiplications), not 8 :P (and you can multiply them in only 6 dm, see karatsuba on wiki, asymmetric formulae), which is just a bit better than 2x2 split (where you make 6 dm instead of 8 dm). Toom-3 can get 5 dm instead of 9 dm in that case, etc (see Toom-Cook on wiki).]
@khushiiversee
@khushiiversee Жыл бұрын
goog ting ur middle shool hs teachers arent her elik eim so gladdd
@64standardtrickyness
@64standardtrickyness 4 жыл бұрын
when you break up into 3 chunks why are you trying to get away with less than 8 multiplications ? I think it should be 9 (100a+10b+c )(100d +10e+f) involves ad,ae,af, bd,bd,bf, cd,ce,cf or it should be 5 as log(6)/log(3)>1.58
@EranM
@EranM 4 жыл бұрын
46:30 THIS IS WITCH CRAFT!! How the hell did he get the catlan numbers in there!!! Sorcery !!!
@chonnyung5084
@chonnyung5084 5 жыл бұрын
Excellent lecture ( except for initial explanation of Catalan numbers ) - great teaching nevertheless
@ishan_kumar
@ishan_kumar 4 жыл бұрын
Now that is some sorcery at the end of lecture.
@anonviewerciv
@anonviewerciv 2 жыл бұрын
3:30 Hindu-Arabic numerals are more important than Pythagoras' triangle theorem, so there's that.
@hakki_bluoyd
@hakki_bluoyd 6 жыл бұрын
"42 is on the list!" That was very funny.
@user-hk5dl6bv6m
@user-hk5dl6bv6m 8 жыл бұрын
I was so X[i]-ted
@junzhai1715
@junzhai1715 3 жыл бұрын
37:31, 39:00 z2 = x2*y2 should be z2 = x1*y1
@jakemirra7829
@jakemirra7829 4 жыл бұрын
At MIT, "five hundred thousand" equals "five hundred billion".
@SuryaTripathi
@SuryaTripathi 7 жыл бұрын
16:34 : I came in early.. lol
@spicy_wizard
@spicy_wizard 5 жыл бұрын
i have problem understanding from 33:39 onwards
@reydavid7300
@reydavid7300 3 жыл бұрын
God I want to be in the class of Srini Devadas
@bat_man1138
@bat_man1138 2 жыл бұрын
this lecture was directed by christopher nolan lol(last min was more than crazy)
@twittertalks3934
@twittertalks3934 3 жыл бұрын
his shirt is giving my phones gpu tough time
@vishalsethi4024
@vishalsethi4024 6 жыл бұрын
36:49
@arsenalprince4
@arsenalprince4 4 жыл бұрын
I hope you all recovered from the quiz LOL
@wilhelm.reeves
@wilhelm.reeves 5 жыл бұрын
what is this? some kinda genjutsu!
@1732ashish
@1732ashish 3 жыл бұрын
anyone knows any link where I can read about the appearance of catalan numbers in the last circle calculation?
@neuron8186
@neuron8186 3 жыл бұрын
start learning Discreate math
@Bill_glibc233
@Bill_glibc233 2 жыл бұрын
www.afjarvis.staff.shef.ac.uk/maths/jarvisspec01.pdf see generating function here. A very enlightening read.
@florianwicher
@florianwicher 6 жыл бұрын
His shirt is trippy... :D
@flyhigh6356
@flyhigh6356 5 жыл бұрын
It's like when you take a picture of the computer screen~ :p
@Marshblocker
@Marshblocker 3 жыл бұрын
The problem with his exposition in this lecture is how he abstract the concept even before the viewers know what he will do. For example is when he introduced the high precision multiplication, he started pulling random variables z_2, z_1, z_0, without any context instead of showing how x times y would lead to the derivation of their values: x*y = (r^(n/2) * x_1 + x_0) (r^(n/2) * y_1 + y_0) = (r^(n) * x_1 * y_1) + (r^(n/2)(x_1*y_0 + x_0*y_1)) + (x_0*y_0) [through the distributive property] which is the values of z_2, z_1, z_0 summed up with each other, i.e.: x*y = (r^n * z_2) + (r^(n/2) * z_1) + z_0. If you want to better understand Karatsuba Algorithm, I highly recommend this video: kzfaq.info/get/bejne/gKmSjcSqq9idgnk.html
@noguide
@noguide 5 жыл бұрын
I am a bit surprised that the professor keeps questioning the existence of irrational numbers throughout this lecture, as if advances in computing could in the future reveal a cycle in, say sqrt(2) [sure old Pythagoras would have been delighted if such a hope had ever existed]. If there is one thing I learned from 6.042 (also in youtube), is that what makes mathematical proof superior to other proof methods, like the scientific method, is that you can prove propositions about numbers once and for all without having to enumerate any concrete numbers, just by a chain of logical deductions starting from a set of axioms; such proofs are theorems. As an example, there was a proof by contradiction of the irrationality of sqrt(2) in one 6.042 lecture, apparently the same that was already known by the pythagoreans, which as I have said, must be independent of any advances in computation, by definition of mathematical proof. Have I missed anything? Of course, maybe my mistake is believing that not having a cycle (definition given in this lecture) is the same as claiming that then a number cannot be expressed as the fraction of two whole numbers, which is how irrational numbers were defined in 6.042.
@mostafasaadinasab6338
@mostafasaadinasab6338 4 жыл бұрын
#properties#Soll#Liebe#schönen#Highlight#Episode#awarded Liebe und zu Videos#so#schönes#
@AbhishekTyagi1994
@AbhishekTyagi1994 11 жыл бұрын
didn't know professors could really make u laugh =D
@jshellenberger7876
@jshellenberger7876 4 ай бұрын
#POW
@vivekdas203
@vivekdas203 4 жыл бұрын
4862
@bonbonpony
@bonbonpony 3 жыл бұрын
That wasn't the smartest choice for a shirt :J
@rasraster
@rasraster 6 жыл бұрын
Catalan number explanation is the worst explanation he's given of anything in this course.
@crjacinro
@crjacinro 3 жыл бұрын
its not really related to this video (except for the end part). That's why he did not emphasize it that much.
@hackysacks42
@hackysacks42 4 жыл бұрын
how did he get the derivative at 22:09?
@loupiotable
@loupiotable 4 жыл бұрын
He used the formula for the tangent
@chimsocheat1756
@chimsocheat1756 3 жыл бұрын
🙏🙏🙏💞💓💞👍🐉
@yasser_hussain
@yasser_hussain 3 жыл бұрын
How can I CS professor at MIT make such a glaring mistake? It can be proved that square root(2) can never have repeating patterns, because it can never be expressed as (p/q) where p,q are integers. That's elementary stuff which we learned at school. Quality of education at US universities must be really going down.
@jsh31425
@jsh31425 2 жыл бұрын
He didn't say "repeating patterns." He said "patterns." Irrational numbers can have plenty of patterns. For instance, 0.123456789101112131415161718192021...
@franzscheerer
@franzscheerer 2 жыл бұрын
Are these Catalan numbers of any real importance? Hmmmmmmm - I don't think so, but who knows.
@franzscheerer
@franzscheerer 2 жыл бұрын
Are these big intergers of any real importance? I don't know.
@franzscheerer
@franzscheerer 2 жыл бұрын
But I'm very surprised, that such fast algorithms exist.
@franzscheerer
@franzscheerer 2 жыл бұрын
Maybe, because of RSA.
@astropiu4753
@astropiu4753 3 жыл бұрын
Sadly not many people these days understand the significance of 42
@bonbonpony
@bonbonpony 6 жыл бұрын
If you want to save nearly 40 minutes of your life, the actual Karatsuba multiplication is as far as at 38:19 :P But if you want to save even more, skip this video entirely and go somewhere else, because this dude's explanation is terribly bad :P
@MrMrVV
@MrMrVV 5 жыл бұрын
and I thought I was the only one not undrestanding what he is talking about!
@xinli6243
@xinli6243 5 жыл бұрын
I haven't finished all the videos but so far this lesson is the most difficult one for me.
@smartwolf9045
@smartwolf9045 3 жыл бұрын
Yeah I think he didnt do a good job in this lecture , thanks.
@creavlin
@creavlin 4 жыл бұрын
He is not as good as Erik
Lecture 12: Square Roots, Newton's Method
51:17
MIT OpenCourseWare
Рет қаралды 98 М.
Lecture 13: Breadth-First Search (BFS)
50:48
MIT OpenCourseWare
Рет қаралды 696 М.
ПЕЙ МОЛОКО КАК ФОКУСНИК
00:37
Masomka
Рет қаралды 9 МЛН
Glow Stick Secret (part 2) 😱 #shorts
00:33
Mr DegrEE
Рет қаралды 48 МЛН
Photons and the loss of determinism
17:21
MIT OpenCourseWare
Рет қаралды 949 М.
26. Chernobyl - How It Happened
54:24
MIT OpenCourseWare
Рет қаралды 2,8 МЛН
10. The Four Fundamental Subspaces
49:20
MIT OpenCourseWare
Рет қаралды 622 М.
Lecture 2: Airplane Aerodynamics
1:12:07
MIT OpenCourseWare
Рет қаралды 3,1 МЛН
Introduction to Poker Theory
30:49
MIT OpenCourseWare
Рет қаралды 1,3 МЛН
Lecture 3: The Wave Function
1:17:55
MIT OpenCourseWare
Рет қаралды 1,2 МЛН
How Karatsuba's algorithm gave us new ways to multiply
18:48
Nemean
Рет қаралды 1,1 МЛН
16. Portfolio Management
1:28:38
MIT OpenCourseWare
Рет қаралды 5 МЛН
Numbers too big to imagine
8:02
Digital Genius
Рет қаралды 1,7 МЛН