Readit News logoReadit News
Syzygies commented on The Number That Turned Sideways   zuriby.github.io/math.git... · Posted by u/tzury
Syzygies · 7 hours ago
In grad school around 1980 I took a cab home from a midnight showing of the reggae film "The Harder They Come". The cab driver asked me out of the blue, "Is it true you can't tell the difference between +i and -i?"

Cambridge, MA but still ... unexpected.

If someone hands you a blank board representing the complex numbers, and offers to tell you either the sum or the product of any two places you put your fingers, you can work out most of the board rather quickly. There remains which way to flip the board, which way is up? +i and -i both square to -1.

This symmetry is the camel's nose under the tent of Galois theory, described in 1831 by Évariste Galois before he died in a duel at age twenty. This is one of the most amazing confluences of ideas in mathematics. It for example explains why we have the quadratic formula, and formulas solving degree 3 and 4 polynomials, but no general formula for degree 5. The symmetry of the complex plane is a toggle switch which corresponds to a square root. The symmetries of degree 3 and 4 polynomials are more involved, but can all be again translated to various square roots, cube roots... Degree 5 can exhibit an alien group of symmetries that defies such a translation.

The Greeks couldn't trisect an angle using a ruler and compass. Turns out the quantity they needed exists, but couldn't be described in their notation.

Integrating a bell curve from statistics doesn't have a closed form in the notation we study in calculus, but the function exists. Statisticians just said "oh, that function" and gave it a new name.

Roots of a degree 5 polynomial exist, but again can't be described in the primitive notation of square roots, cube roots... One needs to make peace with the new "simple group" that Galois found.

This is arguably the most mind blowing thing one learns in an undergraduate math education.

Syzygies commented on Put a ring on it: a lock-free MPMC ring buffer   h4x0r.org/ring/... · Posted by u/signa11
atq2119 · 2 days ago
Looks like a good write up, but I'd caution that some of the statements about memory models aren't completely accurate.

The terms relaxed, acquire, and release refer to how an atomic operation is ordered against other accesses to memory.

Counter to what the article states, a relaxed atomic is still atomic, meaning that it cannot tear and, for RMW atomic, no other access can go between the read and the write. But a relaxed atomic does not order other accesses, which can lead to unintuitive outcomes.

By contrast, once you've observed another thread's release store with an acquire load, you're guaranteed that your subsequent memory accesses "happen after" all of the other thread's accesses from before that release store -- which is what you'd intuitively expect, it's just that in modern systems (which are really highly distributed systems even on a single chip) there's a cost to establishing this kind of guarantee, which is why you can opt out of it with relaxed atomics if you know what you're doing.

Syzygies · 2 days ago
Yes. I was surprised there was no mention of "false sharing".

https://en.wikipedia.org/wiki/False_sharing

Rather than incrementing each counter by one, dither the counters to reduce cache conflicts? So what if the dequeue becomes a bit fuzzy. Make the queue a bit longer, so everyone survives at least as long as they would have survived before.

Or simply use a prime length queue, and change what +1 means, so one's stride is longer than the cache conflict concern. Any stride will generate the full cyclic group, for a prime.

Syzygies commented on I tried Gleam for Advent of Code   blog.tymscar.com/posts/gl... · Posted by u/tymscar
crystal_revenge · 5 days ago
> Because LLMs make it that much faster to develop software

I feel as though "facts" such as this are presented to me all the time on HN, but in my every day job I encounter devs creating piles of slop that even the most die-hard AI enthusiasts in my office can't stand and have started to push against.

I know, I know "they just don't know how to use LLMs the right way!!!", but all of the better engineers I know, the ones capable of quickly assessing the output of an LLM, tend to use LLMs much more sparingly in their code. Meanwhile the ones that never really understood software that well in the first place are the ones building agent-based Rube Goldberg machines that ultimately slow everyone down

If we can continue living in the this AI hallucination for 5 more years, I think the only people capable of producing anything of use or value will be devs that continued to devote some of their free time to coding in languages like Gleam, and continued to maintain and sharpen their ability to understand and reason about code.

Syzygies · 4 days ago
Using AI to write good code faster is hard work.

I once toured a dairy farm that had been a pioneer test site for Lasix. Like all good hippies, everyone I knew shunned additives. This farmer claimed that Lasix wasn't a cheat because it only worked on really healthy cows. Best practices, and then add Lasix.

I nearly dropped out of Harvard's mathematics PhD program. Sticking around and finishing a thesis was the hardest thing I've ever done. It didn't take smarts. It took being the kind of person who doesn't die on a mountain.

There's a legendary Philadelphia cook who does pop-up meals, and keeps talking about the restaurant he plans to open. Professional chefs roll their eyes; being a good cook is a small part of the enterprise of engineering a successful restaurant.

(These are three stool legs. Neurodivergents have an advantage using AI. A stool is more stable when its legs are further apart. AI is an association engine. Humans find my sense of analogy tedious, but spreading out analogies defines more accurate planes in AI's association space. One doesn't simply "tell AI what to do".)

Learning how to use AI effectively was the hardest thing I've done recently, many brutal months of experiment, test projects with a dozen languages. One maintains several levels of planning, as if a corporate CTO. One tears apart all code in many iterations of code review. Just as a genius manager makes best use of flawed human talent, one learns to make best use of flawed AI talent.

My guess is that programmers who write bad code with AI were already writing bad code before AI.

Best practices, and then add AI.

Syzygies commented on When would you ever want bubblesort? (2023)   buttondown.com/hillelwayn... · Posted by u/atan2
itemize123 · 7 days ago
interesting, when is this? because that seems obvious today - basically hash-set, right?
Syzygies · 7 days ago
1977. And I didn't know what a hash table was, though I can't explain now why they didn't think of using a hash table. I was effectively using a dumb hash function.

Their 1978 second edition works in exactly the memory needed to store the answer, by simulating my algorithm in a first pass but only saving the occupancy counts.

Oh, and thanks (I guess). I really didn't expect to ever be reading FORTRAN code again. One learned to program at Swarthmore that year by punching cards, crashing our IBM 1130, and bringing the printout to my supervisor shift. I'd find the square brackets and explain how you'd overwritten your array. I even helped an economics professor Frederic Pryor (the grad student in the "Bridge of Spies" cold war spy swap) this way, when I made an ill-advised visit to the computer center on a Saturday night. Apparently I could still find square brackets.

Syzygies commented on When would you ever want bubblesort? (2023)   buttondown.com/hillelwayn... · Posted by u/atan2
Syzygies · 7 days ago
When I was a senior at Swarthmore College, Herb Wilf came over from U Penn to teach a course in combinatorial algorithms. I was encouraged to attend.

He claimed that choosing a subset of k integers at random from {1..n} should have a log in its complexity, because one needs to sort to detect duplicates. I realized that if one divided [1..n] into k bins, one could detect duplicates within each bin, for a linear algorithm. I chose bubble sort because the average occupancy was 1, so bubble sort gave the best constant.

I described this algorithm to him around 5pm, end of his office hours as he was facing horrendous traffic home. I looked like George Harrison post-Beatles, and probably smelled of pot smoke. Understandably, he didn't recognize a future mathematician.

Around 10pm the dorm hall phone rang, one of my professors relaying an apology for brushing me off. He got it, and credited me with many ideas in the next edition of his book.

Of course, I eventually found all of this and more in Knuth's books. I was disillusioned, imagining that adults read everything. Later I came to understand that this was unrealistic.

Syzygies commented on Booking.com cancels $4K hotel reservation, offers same rooms again for $17K   cbc.ca/news/gopublic/go-p... · Posted by u/thisislife2
xnx · 24 days ago
Spread the word: Never use booking.com (or other online travel agencies)
Syzygies · 24 days ago
I always book directly with hotels, airlines, and auto rental agencies. One gains privileges by cutting out the middleman.

For example, one can generally check out early. We had followed a hotel reservation from locals in Nagoya, and found ourselves in a stodgy "classic" hotel. We were able to pivot to possibly the nicest corner suite in the entire city, at a steep last minute discount.

I did get trapped once, not realizing that my Hiroshima hotel became nonrefundable several days before check-in. With a phone call they moved my reservation to a few days later as a courtesy. The web page then let me cancel.

Syzygies commented on Adding an imaginary unit to a finite field   johndcook.com/blog/2025/1... · Posted by u/ibobev
dperrin · a month ago
Spitballing here, but I suspect it's a density thing. If you are considering all prime powers up to some bound N, then the density of prime powers (edit: of size p^n with n > 1) approaches 0 as N tends to infinity. So rather than things being 1/4 like our intuition says, it should unintuitively be 1/2. I haven't given this much thought, but I suspect this based on checking some examples in Sage.
Syzygies · a month ago
exactly
Syzygies commented on Adding an imaginary unit to a finite field   johndcook.com/blog/2025/1... · Posted by u/ibobev
Syzygies · a month ago
My gut, reading the HN title, was "half the time". I had to read the article, to see how many words piled up before he said that.

Of course, considering finite fields of prime power order, one might leap to the conclusion "a quarter of the time". One can adjoin "i" for prime powers p^n for half the primes and odd n.

Alas, this be wrong, for an amusing reason.

Syzygies commented on Maestro Technology Sells Used SSD Drives as New   kozubik.com/items/Maestro... · Posted by u/walterbell
Syzygies · a month ago
"Other than returning the four parts for a refund (which we did) and documenting this behavior here, our only other recourse was to guarantee that these four specific parts were never sold as new again:"

Alas, one can completely remove Sharpie writing from metal with 99% isopropyl alcohol. Did they make a better choice? This looks like Sharpie writing to me.

Syzygies commented on iPhone Pocket   apple.com/newsroom/2025/1... · Posted by u/soheilpro
brk · a month ago
It might be dumb, but at least it's expensive.

This looks like it would make basic interaction with your phone highly cumbersome. It also looks like an easier target for thieves.

Syzygies · a month ago
The classic is two guys on a moped in Marseilles. The passenger cuts a pedestrian purse strap (or iPhone strap) and they vanish.

One could embed an invisible security cable, but then...

u/Syzygies

KarmaCake day3748July 17, 2016View Original