Digits in product of two numbers

2.7k Views Asked by At

When we multiply a $m$ digit number with a $n$ digit number, the product will have either $m+n$ digits or $m+n-1$ digits. I want to get some condition on the numbers so that we can predict about these two cases.

One straight forward condition: If the leftmost digits of the two numbers result in a number greater than $10$ on multiplication, it will fall in the first case.

I am not sure how to move forward.

2

There are 2 best solutions below

1
On

A positive integer has $n$ digits iff it is $\ge 10^{n-1}$ and $<10^n$, or is of the form $\alpha10^n$ with $0.1\le \alpha<1$. So if the second number id $\beta 10^m$, their product $\alpha\beta10^{n+m}$ will have $n+m$ digits iff $0.1\le \alpha\beta<1$. The $<1$ part always holds as $\alpha,\beta<1$. To decide whether $\alpha\beta\ge1$ or $\alpha\beta<0.1$, it may be sufficient to compute $\alpha\beta$ only with limited precision, i.e., to multiply only a few leading digits of the original integers.

For example, if the first factor begins with $1$, this makes $\alpha<0.2$ and we conclude that $\alpha\beta<0.1$ if $\beta\le0.5$ (i.e., leading digit $\le4$), but cannot make any prediction for leading digits $5$ to $9$: $10\cdot 90$ has three digits, but $19\cdot 59$ has four.

Another example: If you know the leading two digits of the first number are $23$, this tells you $0.23\le\alpha<0.24$. If follows that for $\alpha\beta\ge1$ it is sufficient that $\beta\ge 0.44$ (or that $\beta\ge 434783$, say) and necessary that $\beta> 0.41\overline 6$. So if the other factor has leading digit $1$ to $3$, or the leading digits are $40$ or $41$ followed by less than $6$, etc., then the product has only $n+m-1$ digits. Whereas if the leading digit is $5$ or more, or the leading digits are a $4$ followed by $4$ or more, or ..., then the product has $n+m$ digits. In the cases not covered, we simply need more information (in particular, more digits of the first number).

2
On

Each of those numbers can be written in scientific notation, that is, as a number ≥ and < 10 times a power of 10. As an example, let's take $41 \times 71$. So $m = 2$ and $n = 2$. Then $41 \times 71$ can be reexpressed as $(4.1 \times 10^1) \times (7.1 \times 10^1)$ which is equal to $(4.1 \times 7.1) \times 10^2$. Now $4.1 \times 7.1 = 29.11$ which is greater than or equal to 10. So $(4.1 \times 7.1) \times 10^2$ can be reexpressed as $29.11 \times 10^2$ which in scientific notation is $2.911 \times 10^3$. Since $4.1 \times 7.1$ is greater than or equal to 10, the number of digits of $41 \times 71$ is $m + n$.