Topics /

Math & Algorithms

The most popular blog posts about math & algorithms on Hacker News. 216 posts.

2019
186

Notes on Weight Initialization for Deep Neural Networks

Neural networks involve long sequence of multiplications, usually between a matrix and a vector, say \(a*x\). The result of this sequence of multiplications will either have a huge magnitude or be reduced to 0. We can divide \(a\) by a number ( scaling_factor ) to scale down its magnitude to the right level. Proper…

187

The Riemann Hypothesis (Part 2)

Note: These pages make extensive use of the latest XHTML and CSS Standards . They ought to look great in any standards-compliant modern browser. Unfortunately, they will probably look horrible in older browsers, like Netscape 4.x and IE 4.x. Moreover, many posts use MathML, which is, currently only supported in…

190

A fast alternative to the modulo reduction (2016)

Suppose you want to pick an integer at random in a set of N elements. Your computer has functions to generate random 32-bit integers, how do you transform such numbers into indexes no larger than N? Suppose you have a hash table with a capacity N. Again, you need to transform your hash values (typically 32-bit ……

191

Towards a Better Pythagorean Cup

There was an article on Hacker News the other day by David Richeson entitled Make Your Own Pythagorean Cup . A Pythagorean cup is a cup with a built-in siphon. Supposedly invented by Pythagoras, the cup functions just like an ordinary cup as long as it is only filled to a certain level. If anyone gets greedy and tries…

192

RSA: Theory and Implementation

RSA has been a staple of public key cryptography for over 40 years, and is still being used today for some tasks in the newest TLS 1.3 standard. This post describes the theory behind RSA - the math that makes it work, as well as some practical considerations; it also presents a complete implementation of RSA key…

195

Curve fitting A: Linear Least Squares

The graph on the left shows a third example, taken from analytical chemistry: a straight-line calibration data set where X = concentration and Y = instrument reading (Y = a + b X). Click to download that data . The blue dots are the data points. They don't all fall in a perfect straight line because of random noise…

197

Gaussian Processes Are Not So Fancy

Gaussian Processes have a mystique related to the dense probabilistic terminology that's already evident in their name. But Gaussian Processes are just models, and they're much more like k-nearest neighbors and linear regression than may at first be apparent.

198

Linguistics Using Category Theory (2018)

Note: These pages make extensive use of the latest XHTML and CSS Standards . They ought to look great in any standards-compliant modern browser. Unfortunately, they will probably look horrible in older browsers, like Netscape 4.x and IE 4.x. Moreover, many posts use MathML, which is, currently only supported in…

205

A Visual Introduction to Morse Theory

In a previous article , I already introduced manifolds and their, ahem, manifold ways. Among the many interesting comments I received about this article, some were dealing with a basic question, namely how to measure the properties of a manifold. In this article, I want to present a few concepts from Morse theory …

207

Cache tables

Hash tables are the most popular probabilistic data structure, by quite a margin. You compute some hash code then compute an array index from that hash code. If you’re using open addressing-c…

210

Stock Option Pricing Inference

I’m a stock market enthusiast 📈, so lately I have spent my spare time on the topic of stock option pricing, and I was curious to find out whether or not I could build a script that accurately reflected real market option prices. It turns out I came close, and learned a lot along the way, which I share in this article.