0
$\begingroup$

I am reading a book in discrete mathematics and it assumes that a multiplication of two integers yields an integer.

Although that this book's saying is justifiable since the book is making an assumption, I found that that this is "completely wrong but it is still a good estimation".

let $n \ge 1$ be an integer. Then, by the above assumption, $(n^2-3) * 5$ yields an integer. But, this is not accurate.

Factorize $n^2-3 = (n+\sqrt{3}) (n-\sqrt{3})$.

Now, use a computer system to evaluate this statement substituting any integer ($1$ or larger). You will find that, extremely, the result is not an integer and therefore we kinda have an contradiction between $n^2-3$ and its factorization.

So, "Is it accurate to say that multiplication of two integers yields an integer ?"

$\endgroup$
  • 1
    $\begingroup$ If you are saying that "a multiplication of two integers yields an integer" is wrong, you have to do the following, and nothing else: take an integer; take another integer; multiply them; show that the result is not an integer. Now which two integers do you want to take? $\endgroup$ – David Feb 8 '16 at 4:54
  • $\begingroup$ @graydad I am still using the factorization multiplies by (or with) 5 and not only among themselves. $\endgroup$ – Gold_Sky Feb 8 '16 at 4:59
  • $\begingroup$ @graydad oh, gotcha $\endgroup$ – rschwieb Feb 8 '16 at 5:02
  • $\begingroup$ @David But here is a contradiction. n^2 - 3 is not really an integer if its factorization does not lead to an integer and based on this my question's title will useless since the problem is not the statement stated but rather in the factorization and "non" factorization states of n^2 - 3. $\endgroup$ – Gold_Sky Feb 8 '16 at 5:03
  • $\begingroup$ $5=\sqrt5\sqrt5$, are you saying that proves $5$ is not an integer? $\endgroup$ – David Feb 8 '16 at 5:10
6
$\begingroup$

You are confusing computer arithmetic with mathematical arithmetic. In a computer, integer arithmetic is exact as long as you don't overflow and $5(n^2-3)$ will always yield an exact integer if $n$ is an integer and the computation is done using integer representations. When you go out of the integers, you use floats, which have a limited number of bits of precision. It may be that $(\sqrt 3)^2 \neq 3$ in a computer, but it is always true in math that $(\sqrt 3)^2 = 3$. In math it is accurate to say that multiplying (or subtracting or adding) two integers yields an integer. In a computer using 32 bit integers, $2^{20} \cdot 2^{20}$ will give an overflow, not an integer. Computer arithmetic is close to real arithmetic, but it has some foibles to trap the unwary.

| cite | improve this answer | |
$\endgroup$
  • $\begingroup$ Your example is only about sqrt (3). Would what you are saying still be valid with 1+sqrt(3) for example? $\endgroup$ – Gold_Sky Feb 8 '16 at 5:18
  • 1
    $\begingroup$ Yes, I was following your example. Generally floats are only accurate to within a factor $1+ \epsilon$, where $\epsilon$ is the smallest number that can be added to $1$ to give a different result. The IEEE standard is discussed here. A 64 bit float has $53$ binary bits in the mantissa, so $\epsilon$ is about $2^{-53}$. This error makes comparisons of equality problematic for floats. You need to think hard about what equality means for you. $\endgroup$ – Ross Millikan Feb 8 '16 at 5:37
4
$\begingroup$

If your computer system does not give an integer when computing $(n-\sqrt3)(n+\sqrt 3)$, then it is because of the floating point arithmetic involved in computing with the irrational number $\sqrt3$. See the section in https://en.m.wikipedia.org/wiki/Floating_point on "accuracy problems."

This is a good lesson in realizing that the results of computing devices are not beyond question, and that they have limitations.

Of course the product of two integers is an integer. Via the distributive law, you can view multiplication as repeated addition, and hopefully you believe adding integers gets you integers.

| cite | improve this answer | |
$\endgroup$
0
$\begingroup$

You have to step back and ask yourself, "what is an integer"? You can't decide if something is an integer or not until you define the integers!

Defining the integers requires choosing axioms the integers must satisfied. Picking the "right" axioms so that the definition is consistent, and unambiguous (so that, for instance, you can tell the difference between the integers and modular arithmetic, or polynomials with integer coefficients) is a bit tricky, but has been worked out in detail and several options exist.

Some axiomatizations of the integers define it to have ring structure, which implies they are closed under addition and multiplication. If you pick these axioms, the fact that two integers multiply to an integer is automatic.

Other axiomatizations (for instance those arising from extending the Peano axioms) do not include an axiom about closure of the integers under multiplication, but instead give a recursive definition for the product of two integers, and enough additional axioms (i.e. induction) to prove that the product of two integers is always an integer.

| cite | improve this answer | |
$\endgroup$
  • $\begingroup$ I don't think this looks relevant to the question. $\endgroup$ – Kevin Arlin Feb 8 '16 at 5:14
  • $\begingroup$ @KevinCarlson Confusion about whether the product of two integers is an integer is precisely confusion about how, exactly, the integers are defined. Once cannot ask the former question if one understands the latter! $\endgroup$ – user7530 Feb 8 '16 at 5:15
  • $\begingroup$ @user7530 The important issue that needs to be dealt with here is that the OP thinks they can trust a computer's floating point circuits to tell them about math. This will just be over their head. $\endgroup$ – Jack M Feb 8 '16 at 5:27
  • 1
    $\begingroup$ @Jack M I am not sure why every body is attacking this answer. If I can choose more than one answer as " an accepted answer", I would choose this one among them.Wonder why cant some one update stack exchange so that several answers are accepted since people do a good effort to show their best but... $\endgroup$ – Gold_Sky Feb 8 '16 at 5:38
0
$\begingroup$

Your incorrect interpretation:

$[ab=c]\wedge[c\in\mathbb{Z}]\implies[a,b\in\mathbb{Z}]$


The correct interpretation:

$[ab=c]\wedge[a,b\in\mathbb{Z}]\implies[c\in\mathbb{Z}]$

| cite | improve this answer | |
$\endgroup$
0
$\begingroup$

Yes the set of integers is closed under multiplication. There are a number of axioms (laws) defining what an integer is. The following three axioms (laws) are important to this argument.

1 is a multiplicative identity. In other words anything multiplied by 1 returns the same value.

$ \forall a \in \mathbb{Z}, 1 a = a $

When you add integers together you will always get an integer.

$ \forall a,b \in \mathbb{Z}, a + b = c \implies c \in \mathbb{Z} $

This is called the integers being closed under addition.

The last axiom we need is the distributive law.

$ \forall a,b,c \in \mathbb{Z}, a(b + c) = ab + ac $

With that you can expand out any multiplication this way.

$ ab = a( 1 + (b - 1)) = a + a(b-1) = a + a + a(b-2) = ... $

And so on until you have a row of b "a"s all being added together. And since each addition is between two integers the result has to be an integer as well.

(You have to do a little mucking around to deal with negative numbers but it still works).

| cite | improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.