Only for rational numbers. Doesn't work for real and complex numbers.
> It's even a useful thing to do, how else would you define multiplication?
Axiomatically, not algorithmically.
Only for rational numbers. Doesn't work for real and complex numbers.
> It's even a useful thing to do, how else would you define multiplication?
Axiomatically, not algorithmically.
How exactly are you going to present multiplication of real numbers axiomatically without essentially including an axiom that bootstraps everything from repeated addition?
I suppose you can try defining the reals as "the unique complete ordered field" or the complex numbers as "the unique algebraically closed field of characteristic zero with cardinality c," but I don't think either of those are pedagogically useful to someone who is still learning what multiplication is.
The construction is rather involved but if we're only interested in the reals for now you can think of it as defining a real number by a set of rational numbers, in particular define a particular "real number" to be the set of all rational numbers less than it, for example sqrt(2) is defined to be the set of all rationals p/q such that p^2/q^2 < 2. We can "recursively" define addition of these real numbers in terms of addition of rational numbers because to add two reals you "just" have to add all the rationals in their respective sets.
In general there is no sensible algorithm to do anything in the real numbers, since most real numbers aren't even computable (there is no way to represent an arbitrary real number on a Turing machine).
This isn't the only case of infinite calculations that can't be computed in practice but that mathematics use all the time anyway; and it reflects quite well the fact that multiplying irrational numbers isn't something that one can do practice. There is no problem with it.
There are countable/computable/constructable subsets of the reals where multiplication has a finite algorithm and is it repeated addition.
One example is the algebraics, as well as extensions the including a few special constants like pi. These are the subsets of the reals most commonly used for math and science. So in a wide range of problems areas, multiplication is not just repeated addition.
If you want an algorithmic (no possible need an infinite number of steps) explicit construction of anything on the Reals you're going to be disappointed. They're an infinite set.
Thinking of multiplication as repeated addition also won't explain anything about it. It's a separate operation. Deal with it. For similar reasons, you can't calculate x-th power of a number, when x is irrational, by decomposing it into exponentiation and roots.
This metaphor is just training wheels. At some point you should lose it.
Together with the notion that "multiplication is repeated addition" comes the notion that numbers are quantities. Only some of them are, and this isn't really what makes them numbers. Now what exactly gets repeated, when you don't have quantities?
You might see the natural numbers as training wheels for higher mathematics, but number theorists might disagree...
I also didn't say natural numbers are training wheels, just this metaphor, which to use HN lingo: doesn't scale.
> In mathematics and computer science, an algorithm (/ˈælɡərɪðəm/ (About this soundlisten)) is a finite sequence of well-defined, computer-implementable instructions, typically to solve a class of problems or to perform a computation.
Newton's method is finite too. You perform finitely many iterations. It doesn't calculate roots. It calculates their approximations.
In an important sense, it only becomes a finite algorithm. It isn't one. You cannot write the finite sequence of instructions down. It's got loops.
To your point about approximations vs not, if you have an algorithm that, for any desired approximation accuracy can compute the square root to that accuracy in a finite number of steps, then that process is as much "the square root" as anything involving the real numbers.
Not really, since approximations, no matter how accurate, don't preserve algebraic properties. You only get to know what it's bigger/smaller than.
If you are representing or thinking of "sqrt(2)" as "the positive solution to x^2 = 2", then you preserve algebraic properties. But you generally (correct me if I'm wrong) don't get to know whether it's bigger or smaller than something else of the form "the _choose_uniquely_ solution to _some_equation_" unless you rely on an argument where you invoke approximations.
Also, an irrational exponent is the product of component factors.
b = Prod(0,inf) a^[x_i * 10^(-i)] = a^x
So even with irrational numbers, operations can be decomposed - such as exponentiation into multiplication of integer exponents and roots.
Which makes sense, because in the sequence definition of reals you need a way to generate the resulting sequence from the two original sequences.
I think you’re trying to claim more than is true.
People are just bit sloppy, and say algorithm when they mean something slightly different.
See https://stackoverflow.com/questions/28841260/what-is-the-dif... and https://en.wikipedia.org/wiki/Corecursion
Basically, you don't want an 'algorithm' here to produce the whole number.
All you need is some scheme that will produce the next digit in finite time (and the next one and the next one etc).
Consider the following real number made of binary digits:
Enumerate all Turing machines and all possible inputs, iff the i-th machine/input combination holds, the i-th binary digit in our number is 0, otherwise 1.
This number is well-defined (once you fix your enumeration scheme).
But there's no finite algorithm to produce approximations in your sense.
What I was after were what's also called Computable numbers (https://en.wikipedia.org/wiki/Computable_number). But I used the more general term of co-recursion, that also applies to arbitrary other data-structures like infinite lists, or with some generalization, infinite event-loops where the important condition is that each run through the body of the loop only takes finite time.
It's probably a tomato/tomato kind of thing, but I'm only objecting to the 'algorithm' part of parent's comment.
Complex numbers aren't really relevant, in my opinion, because they are usually introduced as an extension of the rules for reals and polynomials. To multiply two complex numbers, you can totally forget that i is imaginary, do the multiplication as if it's just an ordinary variable, then substitute "i" back in. But that relies on being able to multiply polynomials, which would be difficult to define in terms of repeated multiplication.
To some extent all of mathematics is a lie. We can do multiplication on the reals because we have decided that it's allowed. It is reasonable to define multiplication at first as repeated addition and then define a way to extend that to the reals that is consistent with the first definition.