Live data from Hacker News

Beauty in Mathematics: Modular Multiplication Tables

friendlyfieldsandopenmaps.com

11–20 of 26 posts

Re: Beauty in Mathematics: Modular Multiplication Tables

#12

A while back, Noah Vawter was using this to make ultra-fast math at the cost of accuracy. [1] He computed each bit of an output function such as addition and multiplication as a function of any two of the N inputs of both operands. Then generated approximations using single-operator functions (and, or, nand, etc.) that minimized error. The result was single-cycle approximations. For example, he claims 44% accuracy (n…

Do you have a more direct link? That one just goes to Noah's home page and for the life of me I couldn't navigate to the ultra-fast math page nor find it via Google.

Edit: I think I've found it: http://www.gweep.net/~shifty/portfolio/oddsvf/index.html

Re: Beauty in Mathematics: Modular Multiplication Tables

#13
post #10
post #5

These are definitely interesting. They make me wonder what the underlying continuous function is, and if it's the same function for all the pictures. These mostly look like aliasing to me. Which makes sense, perhaps is nearly obvious, because that's what you get when you plot the mod of a multiply on a grid. It's pretty easy to reproduce something close to the large image (prime 9973), by just plotting the continuous…

Could you elaborate on the signal processing and the filter function?

This video will give you a quick overview of aliasing and an anti-aliasing filter: https://www.youtube.com/watch?v=v7qjeUFxVwQ

Re: Beauty in Mathematics: Modular Multiplication Tables

#14
post #13
post #10

Earlier quoted context omitted.

Could you elaborate on the signal processing and the filter function?

This video will give you a quick overview of aliasing and an anti-aliasing filter: https://www.youtube.com/watch?v=v7qjeUFxVwQ

If you have more time, this is more thorough: https://www.youtube.com/watch?v=yWqrx08UeUs

Re: Beauty in Mathematics: Modular Multiplication Tables

#15

A while back, Noah Vawter was using this to make ultra-fast math at the cost of accuracy. [1] He computed each bit of an output function such as addition and multiplication as a function of any two of the N inputs of both operands. Then generated approximations using single-operator functions (and, or, nand, etc.) that minimized error. The result was single-cycle approximations. For example, he claims 44% accuracy (n…

> [1] http://gweep.net/~shifty/

Eep, that's an eye-burning page. Where should I go for discussion of the fast-but-inaccurate techniques you mention?

Re: Beauty in Mathematics: Modular Multiplication Tables

#16
post #10
post #5

These are definitely interesting. They make me wonder what the underlying continuous function is, and if it's the same function for all the pictures. These mostly look like aliasing to me. Which makes sense, perhaps is nearly obvious, because that's what you get when you plot the mod of a multiply on a grid. It's pretty easy to reproduce something close to the large image (prime 9973), by just plotting the continuous…

Could you elaborate on the signal processing and the filter function?

Sure, yeah. So the second of the three images I posted above, I generated using 25 samples of the function per pixel. To get the pixel color, I averaged the 25 samples. What's interesting about averaging is that you can never get rid of some kinds of aliasing no matter how many samples you use (the ghost waves you can see along the axes, near the outside of the image). It can be surprising to use 10,000 samples per pixel and still have ghost waves. The reason is that averaging is almost the same thing as using a "box filter" meaning you can think of it as a response function for each pixel where the shape of the response function is constant over the pixel (or sample), and 0 outside the pixel - so shaped like a box.

The third image uses a Gauss response function - as in the standard normal distribution (e ^ -x^2). This function spreads each sample around into neighboring pixels, and the result is that the image is just slightly blurrier, but you can get rid of all ghosting.

There are better response functions (or kernels) that are less blurry than Gauss, but I happen to personally like Gauss when generating very high quality and very large poster prints.

The other people here gave links to Nyquist theory:(https://en.wikipedia.org/wiki/Nyquist%E2%80%93Shannon_sampli...)

Knowing the theory is generally good, but I also enjoy resources that talk about image processing specifically, it's closer to home and more concrete, there are more visual examples.

Google "image resampling"

https://en.wikipedia.org/wiki/Kernel_(image_processing)

Image magick has some examples in their docs: http://www.imagemagick.org/Usage/resize/

This one's mathy, but has lots of diagrams and examples: http://eeweb.poly.edu/~yao/EL5123/lecture8_sampling.pdf

Re: Beauty in Mathematics: Modular Multiplication Tables

#19
post #5

These are definitely interesting. They make me wonder what the underlying continuous function is, and if it's the same function for all the pictures. These mostly look like aliasing to me. Which makes sense, perhaps is nearly obvious, because that's what you get when you plot the mod of a multiply on a grid. It's pretty easy to reproduce something close to the large image (prime 9973), by just plotting the continuous…

There’s not really a reasonable continuous analog, IMO (unless you just want to see a single solid blob, like in your picture, but that hides all of the interesting part of the structure). But there are moiré-like patterns.

Check out https://www.youtube.com/watch?v=qhbuKbxJsk8 for some insight based on a related type of diagram (related to a single row at a time from the OP’s diagrams).

Post reply on HN