Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Tickling your passion a bit, what's your favorite concept, or bit of math, in this context?


I would say very close to the top is the amazing depth of sampling methods, in particular Quasi-Monte Carlo (QMC) methods. I'll try to give a small sample of that.

Basically what you're doing in MC is estimating expected values (and thereby integrals: average height times base width equals area under the graph) using random numbers, to be roughly thought of as a rnd() function which gives you back a float in [0,1).

However, using actual proper random number generators has a very slow convergence rate, as the random numbers chosen will tend to clump; on the other hand, if you just use a perfectly uniform distribution, you'll suffer from correlation problems.

Consider a 1-D numerical integration problem, and instead of using rnd() to pick points in your integrand range, you start with some seed value in [0,1), and each time you need a new random number, you add phi-1 to the existing number and mod with 1.0 to get the new number. If you plot this sequence on a [0,1) number line, you'll see that it divides up the interval into finer pieces really nicely, magically keeping a good distance from all the previous values, without even knowing them!

Why does this work? Well, there's a lot of beautiful theory about phi (also relating to biology and nature, e.g. seashells and the distribution of sunflower seeds), in particular how it is in some sense (continued fraction) the "most irrational" number. Does it work well for other numbers, and can it be extended to higher dimensions? Sure, there are some interesting things you can do: http://extremelearning.com.au/unreasonable-effectiveness-of-...

This isn't even scratching the surface of things like the Halton, Hammersley and Sobol sequences, the human visual response to different kinds of noise that makes blue noise preferable, etc. Here's a wealth of recent research on all that: https://sites.google.com/view/myfavoritesamples

Rendering is particularly beautiful in that it touches on so many fields, from pure maths, to applied maths and numerical methods, to physics, to human biology and perception, aesthetics, both low- and high-level programming concerns, even philosophy: if we can simulate visual reality to such high precision, it lends credence to the idea that we ourselves are simulated. To me the apparently obvious truth of this is up there with understanding that the iron that makes our blood red can only be formed in supernovae.


In case anyone is confused by the idea that “random numbers [...] will tend to clump”, I can’t resist mentioning the glowworm story referred to in the Wired article “What does randomness look like?”[1] and how people showed the seemingly purposeful clustering of V-1 impacts during the London Blitz was purely due to randomness[2].

(h/t Leonid Petrov, Victor Kleptsyn)

[1] https://www.wired.com/2012/12/what-does-randomness-look-like...

[2] https://www.actuaries.org.uk/system/files/documents/pdf/0481...




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

Search: