Ask HN: Concepts that clicked only years after you first encountered them?
579 pointsI'm reading Petzold's Code [1], and it dawned on me that I didn't understand logic gates intuitively until now. I took a Computer Architecture course back in college, and I understood what logic gates meant in boolean algebra but not empirically. Petzold clarified this for me by going from the empirical to the theoretical using a lightbulb, a battery, wires, and relays (which he introduces when he talks about the telegraph as a way to amplify a signal).
Another concept is the relationship between current, voltage, and resistance. For example, I always failed to understand why longer wires mean more resistance while thicker wires mean less resistance.
[1]: https://www.codehiddenlanguage.com/
Comments (913) 203 threads
Earlier commentsA) Packing a binary tree into an array. Anyone that has attended an algorithms course has likely created a binary tree with nodes, leaf nodes, left and right child etc. Seen the pine-tree like sketch with a larger example where each node except the leaf nodes have a left and right child. So how do you pack this tree into an array and traverse it efficiently?
Well you turn it 90 degrees side-ways, slightly shift all nodes on the same level so that none align and put them into an array by going from leftmost to rightmost. (or other way depending on if you shifted 90 degrees or -90 degrees). Congrats, you've packed nodes into an array. How do you traverse it? Our root node is at index 1 and if you packed the array correctly then `idx = (idx * 2) + 1` will move down one side and `idx = (idx * 2) + 0` moves down the other. I don't have a good visual explanation of this but you can think of the integer/index as a bit-sequence describing when in the tree a left vs. right path was taken (with the exception of the root node).
B) Anti-example: Ford Fulkerson algorithm for finding shortest paths between all nodes in a graph. The algorithm is basically just three for-loops stacked on top of each other, but I still can't grasp why it works. Something with dynamic programming and incrementally building on prior established intermediate paths. The algorithm is truly the product of a beautiful mind.
B) Did you mean Floyd-Warshall's?
Decentralization is a key feature of blockchain technology, and it refers to the fact that the blockchain is not controlled by a single entity or organization. Instead, it is maintained by a network of computers working together, and every transaction is recorded on a distributed ledger that is available to everyone in the network.
Realizing the potential implications of this decentralization - such as greater transparency, security, and accessibility - was a big moment for me, and it solidified my belief in the power of blockchain to transform industries and the way we do business.
If you're interested in learning more about blockchain and decentralization, I highly recommend checking out Rather Labs (https://www.ratherlabs.com). We're always looking for passionate people to join our team and help drive the adoption of this exciting technology.
For any professional educators or other folks more familiar with this I am about to butcher this concept I am sure but my layman's understanding is the following. Basically rather than a bottom up approach to learning it's a top down approach where you see the whole picture first rather than each piece and then dance around it until you just "get it". Think of imagining a house and then learning about it until the entire house system makes sense. You might imagine the house, then learn a large "chunk" which is the foundation, then another chunk which is the plumbing, etc. etc. A more typical learning method might be you learn what a brick is and then you learn how they're put together, then you understand a wall, etc. etc. This style of learning is more common in folks on the ASD spectrum but isn't exclusive to ASD folks. I find for me I'll encounter a concept, then think on it periodically over some period of time until one day I just sort of "get it". It's not better or worse than other ways of learning but it just means you need to approach things differently to learn more efficiently.
Maybe someone can direct me to a video to help me develop a deeper insight?
It's a lot of memorization and "getting used to" the math, punctuated by a few "aha moments" of insight when you realize the 100 examples can be compressed into say only 50 examples. In retrospect its tempting to think the insights led to understanding, but really they were just the dopamine hits on top of the real stuff of understanding: tedious acclimation to a new abstract realm.
We know that triangles may be displaced, rotated, flipped and scaled while still looking the same. We have a word for this: we say two triangles are congruent when they are the same up to these operations.
This means that there is something intrinsically invariant about triangles. Can we find it? Actually yes! If the sides of a triangle have lengths A, B, C, then the ratios A/B, B/C, etc. are invariant. That is, if you make a triangle twice as big, all sides will multiply by 2, so A/B becomes (2A/2B)=A/B -- it's the same!
So, we can come up with names for these invariant ratios. They're most useful for right triangles. To give names, we need to pick any of the two smaller angles as a reference, call it "a". Now, let C be the largest side, A be the side opposite to the angle and B the adjacent side. Then, the ratio A/C can be called sin(a), B/C can be called cos(a) and A/B can be called tan(a).
Since sin(a), cos(a) and tan(a) are ratios, they only depend on the angle, not how big your triangle is. But if you know some side of the triangle, then you can know all of the other using these values. So sin, cos and than really capture the uniqueness I was talking about!
---
Now the applications. I memorized these as the "divide by C" rule.
The Pythagorean theorem says thar A^2 + B^2 = C^2.
Divide by C^2, and you get sin(a)^2 + cos(a)^2 = 1.
Divide by cos(a)^2, and you get tan(a)^2 + 1 = sec(a)^2.
These are all the Pythagorean theorem on disguise.
Precomputed values in a book made things an order of magnitude easier at the job site or battlefield before computers.
Depends what you do for a living. Artists won’t. Civil engineers and artillery software programmers will every day.
All comments shown.
Couldn't load more comments. Check your connection and try again.