Topics /
Math & Algorithms
The most popular blog posts about math & algorithms on Hacker News. 2,851 posts.
Bayes' rule in Haskell (2007)
Random code snippets, projects and musings about software from Eric Kidd, a developer and occasional entrepreneur.
Why is x & -x equal to the largest power of 2 that divides x?
Or how to find the largest power of 2 that divides x?
Smoother sailing: Studying audio imperfections in Steamboat Willie
A deep dive into investigating and reducing the flutter distortion on the soundtrack of Steamboat Willie (1928).
The Prime That Wasn’t
Life, technology, and other good things
Number theory explained from first principles
A lot of modern cryptography builds on insights from number theory, which has been studied for centuries.
How AI Training Scales
Stay up to speed on the rapid advancement of AI technology and the benefits it offers to humanity.
Quaternions: A Practical Guide
AnyLeaf Articles: Quaternions: A practical guide
Algebras we love
If you work with anything that can be modeled mathematically, you most likely know that many things you work on can be expressed with algebras. However, if you are not a graduate of a computer science course or similar you might not know how ubiquitous they are and how often you rely on some of them. (And I don’t mean…
Twitter, but for Math, with Toots
Hooray, it’s yet another social network for you to join! I’m skeptical about new social media, but I’ve been seeing enough posts about mathstodon.xyz that I finally caved and got an account. Mathstodon is the math(s) “instance” of mastodon , a new open-source, decentralized microblogging social network. It’s a lot…
Dual_EC_DRBG backdoor: a proof of concept
Dual_EC_DRBG is an pseudo-random number generator promoted by NIST in NIST SP 800-90A and created by NSA. This algorithm is problematic because it has been made mandatory by the FIPS norm (and should be implemented in every FIPS approved software) and some vendors even promoted this algorithm as first source of…
Did NSA Put a Secret Backdoor in New Encryption Standard? (2007)
Random numbers are critical for cryptography: for encryption keys, random authentication challenges, initialization vectors, nonces, key-agreement schemes, generating prime numbers and so on. Break the random-number generator, and most of the time you break the entire security system. Which is why you should worry…
The Hungarian Approach and How It Fits the American Educational Landscape (2015)
By Ryota Matsuura , Assistant Professor of Mathematics at St. Olaf College and North American Director of Budapest Semesters in Mathematics Education .
Golden Ratio using an equilateral triangle inscribed in a circle
Another interesting way to graphically derive the Golden Ratio using an equilateral triangle inscribed in a circle and the chord which passes through the midpoints of the sides of the equilateral triangle.
From multi-head to latent attention: The evolution of attention mechanisms
From Multi-Head to Latent Attention: The Evolution of Attention Mechanisms What is attention? In any autoregressive model, the prediction of the future tokens is based on some preceding context …
Finding Atari Games in Randomly Generated Data
Discovering Atari Games in Randomly Generated Data
A baffling scale transform on a chart of university course selection trends
Harvard Magazine printed the following chart that confirms a trend in undergraduate majors that we all know about: students are favoring STEM majors at the expense of humanities.
A sane introduction to maximum likelihood estimation and maximum a posteriori
It is frustrating to learn about principles such as maximum likelihood estimation (MLE), maximum a posteriori (MAP) and Bayesian inference in general. The main reason behind this difficulty, in my opinion, is that many tutorials assume previous knowledge, use implicit or inconsistent notation, or are even addressing a…
Neural Networks Are Essentially Polynomial Regression (2018)
You may be interested in my new arXiv paper, joint work with Xi Cheng, an undergraduate at UC Davis (now heading to Cornell for grad school); Bohdan Khomtchouk, a post doc in biology at Stanford; a…
Why tensors? A beginner's perspective
Faizan Muhmmad is a Software Engineer at Google
How much oranger do red orange bags make oranges look?
Look at this orange: Now look at this orange: It’s the same orange. But, look how much more orange it looks with the red mesh on top of it: If you buy bags of oranges (at least at many places in the US), they frequently come in this red mesh bag. This bag makes the oranges look more orange. Oranger. Here’s what that…
How Quaternions encode rotations: derivation and sample code
In the post on matrices in Codea I mentionned that an affine transformation (things like rotation, scaling, translation) ℝ 3 → ℝ 3 could be specified by giving four vectors. In this post I want to examine that a little more closely for the special case of a rotation. That is to say: how can I encode a rotation in ℝ 3…
Federal Reserve Bank of NY converts major economic model to Julia
Marco Del Negro, Marc Giannoni, Pearl Li, Erica Moszkowski, and Micah Smith We have implemented the FRBNY DSGE model in a free and open-source language called Julia. The code is posted here on GitHub, a public repository hosting service. This effort is the result of a collaboration between New York Fed staff and folks…
How to implement a spreadsheet
My friend Lindsey Kuper recently remarked on Twitter that spreadsheets were commonly understood to be the most widely used dataflow program...
Emulating double precision on the GPU to render large worlds
One of the problems with developing games with large game worlds is that objects start to jitter and teleport around as you move away from the world origin. This post is about how we overcame one challenge in particular and what we did.