I want to multiply $a = 11201$ and $b = 1022$ which are in base $3$, so I have a problem I do not know how to start, normally I should split the numbers into other number of two digits, but I do not know how since a has $5$ digits.
Any help please ?
I want to multiply $a = 11201$ and $b = 1022$ which are in base $3$, so I have a problem I do not know how to start, normally I should split the numbers into other number of two digits, but I do not know how since a has $5$ digits.
Any help please ?
Sorry I did not read the question ... Use the Karatsuba algorithm. I use the notation in the wiki page. So our base $B=3$ and the best split of the numbers is into three digit numbers thus $m=3$. (All numbers will be understood to be in base 3 from here (apart from the exponent of $B$)) \begin{eqnarray*} x=11B^3+201 \\ y=1B^3+022 \end{eqnarray*} Now the theory says $xy= z_2 B^6+z_1 B^3 +z_0$ \begin{eqnarray*} z_2=x_1 y_1 \\ z_1=(x_1+x_0)(y_1+y_0)-z_2-z_0 \\ z_0=x_0y_0 \end{eqnarray*} The finesse,of course is in the second equation, only one multiplication (computationally expensive) needs to be performed at the expense of a few more additions & subtractions. We have \begin{eqnarray*} z_2=11 \\ z_1=(212)(100)-11-12122=1220 \\ z_0=12122 \end{eqnarray*} Now put six zeros on the end of $z_2$ three zeros on the end of $z_1$ and add these onto $z_0$ and we have $20002122$.
It would have been too difficult for me to do this image on the computer so please study the image.
The method is as follows, draw a rectangular grid, write the first number up the left side and the second number (left to right) along the top. Now put in diagonals top left to bottom right & fill in the multiplication digit by digit, with carried digits put below. Now just add up along the diagonals, starting at the top right & work your way across ... carrying when you need to. The answer can then be read off starting at the bottom left & read around until you get to the top right. \begin{eqnarray*} 1022_3 \times 11201_3 =20002122_3 \end{eqnarray*}
You don't need the messy lattice. Just multiply exactly the same as in base 10, remembering the base 3 multiplication table:
$$0* 0 = 0 \ \ \ 0*1 = 0 \ \ \ 0*2 = 0$$ $$1*0 = 0 \ \ \ 1*1 = 1 \ \ \ 1*2 = 2$$ $$2*0 = 0 \ \ \ 2 * 1 = 2 \ \ \ 2*2 =11_3$$
The only carrying you need to do is when you have $2*2$ Then remember base 3 addition, noting $2 + 1 = 10_3$