Lecture 11: Integer Arithmetic, Karatsuba Multiplication
HTML-код
- Опубликовано: 13 янв 2013
- 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
"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
The amount of salt in his blood is too damn high! xD
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
@@Artaxerxes. He's saying the algorithm was easy, anyone born early enough could've been the first to come up with it.
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.
1234. 03 05.07 05
5678 11 13 15 13
33 65 105. 65. And so forth
05 12 21 33
Dr Devadas reminds me of Sheldon Cooper whenever he laughs XD
He even laughs in a similar way :J (21:12)
Karatsuba starts at 33:54
Thanks buddy
Cool demo - I have seen it many times in this lecture and still amazed!
He's so much more fun in this class
46:17 What a twist!
36:49 error Z2 = X2*Y2 - should be z2 = x1*y1 .. also 2^log(3) is a transcendental number and not just irrational
I read your comment after 6 years, thank you
Haha thanks. Glad I'm not the only one who sees that
Speaking from 2020! Multiplication is now proved to be computable in nlogn time complexity
You're from the future? What's it like in 2020!?
After all the great lectures up to this point, this is a truly confusing and incoherent one.
Let's hope Victor clears things up :)
my exact thoughts, I think this is more theory and textbook based from their class
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!
Catalan number thing is dope! Pretty cool lecture.
Last 2 mins blew my mind. Numbers are MindBlowing 🤯🤯🤯🤯🤯🤯🤯🤯🤯
40:00 z2 supposed to be x1y1 not x2y2, x2, y2 are undefined
Ok, completely blown away in the last 5 mins, not gonna lie!
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.
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.
wow, cool end of the lecture
Yes, wow, I didn't see this coming, really amazing!
whas that catalan numbers showing up?
x-Sqr(x^2-1)==1/(x+Sqr(x^2-1)~1/2x in this case, it's about 1E-12.
Thank you MIT.
Professor’s shirt is glittering in video 💥
Love your concern towards india🇮🇳
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 .
The student that said C_1*C_1 was correct.
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.
go to ruclips.net/video/eoofvKI_Okg/видео.html start from minute 2:00 and you find great explanation
Thanks!
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
i head about MIT ...what a big peace of chulck
46:30 THIS IS WITCH CRAFT!! How the hell did he get the catlan numbers in there!!! Sorcery !!!
magic design shifting shirt
Moiré
"42 is on the list!"
That was very funny.
Now that is some sorcery at the end of lecture.
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
16:34 : I came in early.. lol
At MIT, "five hundred thousand" equals "five hundred billion".
I was so X[i]-ted
thank you sir.
i have problem understanding from 33:39 onwards
qudratic convergence using newton methos
37:31, 39:00 z2 = x2*y2 should be z2 = x1*y1
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
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).]
anyone knows any link where I can read about the appearance of catalan numbers in the last circle calculation?
start learning Discreate math
www.afjarvis.staff.shef.ac.uk/maths/jarvisspec01.pdf see generating function here. A very enlightening read.
3:30 Hindu-Arabic numerals are more important than Pythagoras' triangle theorem, so there's that.
I hope you all recovered from the quiz LOL
Excellent lecture ( except for initial explanation of Catalan numbers ) - great teaching nevertheless
God I want to be in the class of Srini Devadas
goog ting ur middle shool hs teachers arent her elik eim so gladdd
this lecture was directed by christopher nolan lol(last min was more than crazy)
his shirt is giving my phones gpu tough time
what is this? some kinda genjutsu!
His shirt is trippy... :D
It's like when you take a picture of the computer screen~ :p
36:49
didn't know professors could really make u laugh =D
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.
how did he get the derivative at 22:09?
He used the formula for the tangent
#properties#Soll#Liebe#schönen#Highlight#Episode#awarded Liebe und zu Videos#so#schönes#
Catalan number explanation is the worst explanation he's given of anything in this course.
its not really related to this video (except for the end part). That's why he did not emphasize it that much.
#POW
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: ruclips.net/video/JCbZayFr9RE/видео.html
4862
That wasn't the smartest choice for a shirt :J
🙏🙏🙏💞💓💞👍🐉
Are these Catalan numbers of any real importance? Hmmmmmmm - I don't think so, but who knows.
Are these big intergers of any real importance? I don't know.
But I'm very surprised, that such fast algorithms exist.
Maybe, because of RSA.
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.
He didn't say "repeating patterns." He said "patterns." Irrational numbers can have plenty of patterns.
For instance, 0.123456789101112131415161718192021...
Sadly not many people these days understand the significance of 42
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
and I thought I was the only one not undrestanding what he is talking about!
I haven't finished all the videos but so far this lesson is the most difficult one for me.
Yeah I think he didnt do a good job in this lecture , thanks.
He is not as good as Erik