Hacker News new | ask | show | jobs
by rualca 2040 days ago
> You’re wrong to suggest that elementary-school-multiplication and (discrete) convolution are so dissimilar (...)

They are way more than dissimilar, they are radically different concepts altogether.

Convolution is a function, or an operator that outputs a function given two input functions that share the same domain.

Plain old algebra over real numbers is nothing of the sort.

You're trying to compare a function, with its domain and codomain, with an operation between scalars that results in a scalar. It's way more than apples to oranges. It's apples to orange tree plantations.

1 comments

The standard multiplication algorithm is an algorithm for taking base-b representations of two numbers and outputting the base-b representation of the product of those numbers. A base-b representation of a number is a sequence of digits. A sequence is a function.

This is not a large conceptual chasm. It is boilerplate for actually talking about decimal (or binary or hex or whatever) representations of numbers. Here is one version of that boilerplate, spelled out:

Think of a base-10 representation of a natural number as a function with domain N (the set of natural numbers) and codomain {0, ..., 9}, where f(0) is the ones digit, f(1) is the tens digit, f(2) is the hundreds digit and so on. (This function will be finitely supported, i.e. all but finitely many inputs to this function will give output 0.)

If f and g are the representations of two numbers n and m, then one can say the following about the representation of their product n * m:

  (1) Extend the codomain of f and g, to N, i.e. think of them as functions N -> N instead of functions N -> {0, ..., 9}.
  (2) Compute the convolution of those two functions, giving you another (still finitely supported) function h: N -> N. Usually at this point h will have values that are larger than 10.
  (3) Do all the carrying (e.g. repeatedly take the first n for which h(n) > 10, and subtract 10 from h(n) and add 1 to h(n+1)). Now all the values of h are in {0, ..., 9}, so you can think of h as a function N -> {0, ..., 9}.
The resulting function h is the base-10 representation of the product of the two numbers that f and g represent.