Loooooong Loooooong Loooooong Loooooong Loooooong Man

Author: Long Long Man

Veeery, veeery looong man.


Archived

This page is, in fact, not archived.

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim aeque doleamus animo, cum corpore dolemus, fieri tamen permagna accessio potest, si aliquod aeternum et infinitum impendere malum nobis opinemur. Quod idem licet transferre in voluptatem, ut postea.

Note

Useful information that users should know, even when skimming content.

Ullus investigandi veri, nisi inveneris, et quaerendi defatigatio turpis est, cum esset accusata et vituperata ab Hortensio. Qui liber cum et mortem contemnit, qua qui est imbutus quietus esse numquam potest. Praeterea bona praeterita grata recordatione renovata delectant. Est.

I can be a spoiler, I can be a long text, I could be anything.

in elementary school, we were taught a simple way of multiplying numbers, but it is of course not the most efficient way for multiplying n digit numbers. let’s say we want to multiply the following two n=8 digit numbers: 39475928×1689347 using the elementary school method, we will have multiple 8×8 single digits. in general, multiplying two n digit numbers by this method requires n2 single digit multiplications (and a similar number of single digit additions). in contrast, consider writing these numbers as: x=x110n/2+x0 and y=y110n/2+y0 where x0,x1,y0,y1 are all n/2-digit long numbers. the product can now be written as xy=(x110n/2+x0)×(y110n/2+y0) expanding this, we get xy=x1y110n+(x1y0+x0y1)10n/2+x0y0 notice how this requires four multiplications of n/2 digit long numbers. we can reduce it from four to three by rewriting (x1y0+x0y1) as (x0+x1)(y0+y1)x1y1x0y0.

making the formula cleaner: z0=x0y0 z1=(x0+x1)(y0+y1) z2=x1y1 so, our original problem becomes: xy=z210n+(z1z0z2)10n/2+z0 congratulations 🎉, you’ve just learnt Karatsuba multiplication.

Ullus investigandi veri, nisi inveneris, et quaerendi defatigatio turpis est, cum esset accusata et vituperata ab Hortensio. Qui liber cum et mortem contemnit, qua qui est imbutus quietus esse numquam potest. Praeterea.
Go to Top File an Issue

Receive Trust Math Substack posts straight in your inbox