HNHacker News
TopNewBestAskShowJobs

sgdpk

265 karma · joined December 4, 2017

submissionscomments
sgdpk··on SageMath – Open-Source Mathematical Software System
Do you know how to install the library in a Python environment?
sgdpk··on Ask HN: What scientific phenomenon do you wish someone would explain better?
This really depends on the level of math you're expecting for your intuition, but for me it really clicked when I understood it in terms of linear algebra.

A function is like a vector, but instead of having two or three dimensions you have a continuous number of them. Adding functions component-wise works just like adding vectors.

Just like regular vectors, you can choose to represent functions in a different basis. So you choose a family of other functions (call it a basis) that's big enough to represent any other you want. For a lot of reasons [1, 2], a very good choice is the set of complex exponentials g_w(x) = exp(2πiwx), for every real w. It's an infinite family, but that's what you need to deal with the diversity of functions that exist.

So you try to find the linear combination of exponentials that sum to your original function. You need a coefficient for each w, so call it c(w) for simplicity. After fixing the basis, the coefficients really have all the information to describe your function. They're an important object, and we call c(w) the Fourier transform.

How do you find the coefficients? Just project your original function onto a particular exp(2πiwx), that is, take the inner product. Usually the inner product is the sum of the products of coefficients. Since functions are continuously-valued, you use an integral instead of a sum. This is your formula for the Fourier transform.

I known there are technical conditions I am glossing over, but this is the intuition of it for me.

[1] There is an intuition for these exponentials. Complex exponentials are periodic functions, so you are decomposing a function in its constituent frequencies. You could also separate the exponential into a sin and cos, and will obtain other common formulas for the Fourier transform.

[2] Exponentials are like "eigenvectors" to the derivative operation (taking the derivative is just multiplying by a constant), so they're really useful in differential equations as well.

sgdpk··on Writing 1/3 in binary (2014) [video]
This actually is the long division algorithm. Usually the positional system hides away the powers of 10 (or 2 in this case) so we can do it mechanically and fast. He is just going through the algorithm explicitly.
sgdpk··on Ask HN: Best books you read in the past decade?
Reading "Why we sleep" right now and enjoying it very much. It covers a lot of research, and Walker manages to tell a story and get you the bird's eye view of what the research means. Definitely recommend.
sgdpk··on Inventing an Operation to Solve x^x = y (2000)
Interesting! The form of the solution can be written conveniently in base 3.
sgdpk··on Inventing an Operation to Solve x^x = y (2000)
I really like this answer on Quora [1], about the precise example you mention. The author is worth following for his insights, and the clear way he talks about math.

[1] https://qr.ae/TaQ8y2

sgdpk··on Neural correlates of the DMT experience assessed with multivariate EEG
Indeed, in general we are not aware of how much we dream, because we don't remember. I should have specified better.

Weed and alcohol specifically suppress REM sleep, where most of dreaming happens.

Suddenly stopping weed or alcohol leads to a REM rebound, and people experience very vivid dreams. This association suggests they were actually not dreaming much before.

sgdpk··on Neural correlates of the DMT experience assessed with multivariate EEG
According to Matthew Walker (Berkeley researcher on sleep), it does affect sleep. See this small clip, starting at 2:14.

https://m.youtube.com/watch?v=lRp5AC9W_F8

sgdpk··on Ask HN: What's the most valuable thing you can learn in an hour?
Just to add that this is not about QWERTY. The portuguese and spanish layouts are QWERTY, but still a pain [1]. Typically the best is to look for the US QWERTY layout or the international layout [2], the ones that have easily accessible brackets.

[1] https://en.wikipedia.org/wiki/File:KeyboardLayout-Portuguese...

[2] https://apple.stackexchange.com/questions/106058/difference-...

sgdpk··on Python is not a great programming language
> "You have to cast your data back to a list/tuple after using enumerate() and map()."

I think he means you don't get a list/tuple back after applying enumerate and map. That's actually lazy evaluation and it's a plus. If you just want to iterate over the values, why create a list that you are going to throw away? Twice the effort for nothing.

I agree with you that this reads as someone expecting JS behavior in Python.

sgdpk··on Solving Num: A combinatoric math game
Exactly :) The polish notation approach is also pretty interesting. I wasn't aware it had the full power of parenthesized expressions.

If you are interested I can share my code (simple Python).

sgdpk··on Solving Num: A combinatoric math game
Coincidentally I was just solving (a variant of) this problem today. The approach I took is taking the list of numbers and recursively replacing each pair (x, y) with x+y (replace + with any operation), until one element remains.

You can separate the process by transforming the list of numbers into a binary tree and applying the operators at the nodes. You then consider all possible binary trees and all combinations of operators.

Bonus: by sorting the input values, you can consider half of the trees, because the operations either commute (x+y = y+x) or don't make sense to reverse in the integers (4/2 vs. 2/4).

sgdpk··on Report: Young adults more likely to live with parents than spouses
This fact is slightly misleadin, because the data shows that there are more people living with a spouse _or_ a partner than with parents. So there seem to be two reasons for these figures: a larger fraction of people living with parents and less (or later) weddings.
sgdpk··on New research questions the evidence for health benefits of eating less red meat
Unfortunately the most compelling evidence I've seen seems to confirm the weight set-point (or set-interval) theory. A good book that summarizes main results is Sandra Aamodt's "Why diets don't work".

That's not to say weight loss is impossible. If you're overeating as a habit you may be keeping your weight above your set-point. Learning to "listen" to hunger cues may then bring your weight down. It happened to me 2 years ago and I managed to keep the weight down, and I'm not feeling hungry. There are other ways of lowering the set-point, but not very recommendable in general.

I think focusing on hunger cues and eating a balanced diet is good advice, together with exercise and avoiding drinking and smoking. These will (statistically) reduce morbidity risks to normal-weight levels.

Note that I am not a doctor, though, so take this information with the proper grain of salt.

sgdpk··on Quantum Computing Through Quaternions (2008) [pdf]
That's interesting. Do you have a page/contact? I am looking for projects in this area
sgdpk··on Facebook to integrate the infrastructure for WhatsApp, Instagram and Messenger
Oops, you're right. I hope it happens.
sgdpk··on Facebook to integrate the infrastructure for WhatsApp, Instagram and Messenger
I agree. It seems to me that Facebook's Messenger and WhatsApp are fundamentally incompatible. With Messenger, you can open Facebook/messenger.com/your phone and see all your messages. With WhatsApp, you have no such option, as messages are not stored remotely.

For the end-user, the most "seamless" way to integrate is to adopt Messenger's approach, which will be a security loss for WhatsApp unfortunately. As other users mentioned, there is also the possibility that the end-to-end encryption will lose its default status.

sgdpk··on Down with Determinants (1995)
Yes, that's right. Addition is just applying the transformations separately to the same vector and adding the result. So what this is saying is that if you apply λI to a vector in that particular direction, then there is nothing left to add to get the effect of T.

Ideally you would like to do this for all n directions of space, and that way you completely describe what T does in simpler terms: it just stretches things differently in different directions. It's not always possible though. The matrices that allow this are called diagonalizable and the process of finding the stretch factors (eigenvalues) is called diagonalization.

Just a caveat: if an eigenvalue is complex, the effect is not as simple as a stretch, but the interpretation is very similar.

sgdpk··on Down with Determinants (1995)
You can think of it in these two steps:

1. λI stretches every vector (the whole space, really) by a factor λ.

2. Saying that the function is not injective means you lose information: when you apply it on some object and get a result, you can't trace back what was the original object, as there may be several. (There is no inverse function, then). In linear algebra, this only happens because there is some direction of space where all the vectors get collapsed to zero.

In short, T-λI collapses some line of vectors to zero.

So, when you took the effect of λI from T, you make it a lossy transformation in some direction. This means that _in that direction_ T had the effect of stretching all vectors by a factor of λ.

You gain some geometric understanding of T.

It is sort of intuitive, but the language may obscure it a little if you are not used to it.

← PreviousPage 3 of 3