Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Beauty in Mathematics: Modular Multiplication Tables (friendlyfieldsandopenmaps.com)
136 points by happy-go-lucky on Oct 3, 2017 | hide | past | favorite | 25 comments


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 function "(x * y) % 2", or even sin(x * y):

https://www.dropbox.com/s/3eayuknh1urayay/001.jpg?dl=0

As a graphics person, what I normally do is try to remove that aliasing by using more samples.

https://www.dropbox.com/s/imx6njdek3wello/002.jpg?dl=0

And for nasty functions like this one, you find out that more samples doesn't fix the aliasing. See the hints of it still there far away from the center?

That's when you get into the fun signal processing math and have to use a better filter function to remove all aliasing:

https://www.dropbox.com/s/ysoibo3v8j9b2gg/003_gauss.png?dl=0


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).


That was awesome thanks for sharing. For the first minute I wasn't expecting much, but the reflections part was so cool! Plus, this connects directly to the cyclic curves in the complex plane, e.g., https://mathlesstraveled.com/2015/06/04/random-cyclic-curves... The curves formed by the envelope of intersecting lines in the circular multiplication table are a slice of cyclic curve space. I animated this after reading the above blog post: https://youtu.be/myGXoLCnx-A You can see some of the curves in the lower left corner are the same ones from Mathologer.



That's exactly what it is! You need two patterns for moire, so in my case one is the continuous function, the other is the pixels (or sampling). If I sample every other pixel, I get a completely different moiré.


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


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


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 (not sure how this is measured) for 7-bit multiplies in a single cycle.

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


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


> [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?


Tao's undergrad analysis book has a great derivation of integers and rationals from the basics of Peano axioms for natural numbers. Highly reccommend it for somebody who wants to learn some basic but elegant mathematics.


Thank you.


Site is down; archive/cache/mirror/ctrl-f: http://archive.is/NHBkq


Parametric equation for a hamburger:

  x(t) = Sin(Tan(t))
  y(t) = Cos(t)
Add a multiplier to x to get a submarine sandwich. Courtesy of Uncyclopedia.


Your burger, sir: https://www.dropbox.com/s/3iyakwegodne9gl/burger.jpg?dl=0

A fun side-note, zoom out to see this is an infinite burger stack, where every other burger is upside-down: https://www.dropbox.com/s/lz53ybz3pmchh9s/burgerStack.jpg?dl...


Cool! That's more of a 3D look. When I plot it I get a line drawing of a burger.


Some of these remind me of Chladni patterns.


the primes look similar to sqrt(x*y)


how about general galois fields?


on a field you have two tables, one for sum and the other one for product, which one are you talking about ?

each of these tables is the table of a group, thus they will look like the tables of other finite groups


As with prime fields, The additive group will look pretty boring. Are the multiplicative groups necessarily isomorphic to the multiplicative groups on (z/nz)*?


The multiplicative group is a finite abelian group, so it is certainly as "boring" as the additive group. The interesting pictures appear when you take into account a particular ordering of the elements of the group.


Yes of course lexicographic ordering is assumed, and the pattern will depend on the polynomial used to mod out multiplication. The boringness of the additive group presumes lexicographic ordering.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: