HNHacker News
TopNewBestAskShowJobs

thetwiceler

126 karma · joined April 2, 2013

submissionscomments
thetwiceler··on How I faced my fears and learned to be good at math
Absolutely have to recommend Paul Lockhart's Measurement [1]! Journey Through Genius is a great book as well.

[1] http://www.hup.harvard.edu/catalog.php?isbn=9780674057555

thetwiceler··on How I faced my fears and learned to be good at math
Pictures are worth a thousand words! Now let me put the quadratic formula in disguise as well.

Suppose we wish to make a rectangle with a given area and perimeter. This is an interesting problem! Does the number of possible answers depend on the specific area and perimeter? Certainly! It all comes down to thinking about squares, since squares maximize the area given a fixed perimeter. If the area of a square with the given perimeter is LESS than the desired area, then there's no way we can make such a rectangle. If the area of the square is equal to the desired area, then that's our only answer! Now, how about if our square's area is larger than the desired area? We'll get two possible different lengths of a given side of the rectangle - one representing the rectangle's width, and the other representing it's height. Or we could also think of them as two different rectangles - a tall one, and its rotation by a quarter turn (which makes it wide). By symmetry, we know that the difference between the square's side length and the shorter side will be the same as the difference between the square's side length and the longer side. How large is that difference? Exactly enough to diminish our shape's area from the square's area to the desired area. And that difference in length is simply the square root of the difference between the square's area and the desired area!

It would have been better with pictures :). Anyway, the quadratic formula is probably the greatest mistake in all of mathematics education. Somehow we use the word "quadratic" and even the phrase "complete the square," but never have I ever seen someone draw the said square!

While I think notation is often great for expressing ideas concisely and precisely, I think an excess of notation not a good way to communicate concepts. Nobody should memorize the quadratic formula! We should understand instead how to think about areas and lengths, and then we solve the problems in quadrature that we want.

thetwiceler··on Quantum physics sheds light on Riemann hypothesis
I think people like to say the prime numbers are the basic building blocks of arithmetic (or numbers), and we say this because of the Fundamental Theorem of Arithmetic (which says that every natural number has a unique factorization of primes).
thetwiceler··on TSA loudspeakers threaten travelers with arrest for joking about security
I agree; it is up to us to decide what constitutes a "clear and present danger." You can always claim anything you want, but you'll have a difficult time convincing me that voicing disapproval of the president constitutes a "clear and present danger."
thetwiceler··on TSA loudspeakers threaten travelers with arrest for joking about security
This should not be causing indignation. I think most of you agree with Justice Oliver Wendel Holmes that:

The most stringent protection of free speech would not protect a man falsely shouting fire in a theater and causing a panic. [...] The question in every case is whether the words used are used in such circumstances and are of such a nature as to create a clear and present danger that they will bring about the substantive evils that Congress has a right to prevent.

(whether or not you agree with the decision in the Schenck case.)

I assume that the inappropriate jokes that are being referred to are related to people claiming that they have a dangerous item. We arrest people for making bomb threats (and we shut down schools in response to them), and I wouldn't expect any different at an airport.

thetwiceler··on Why there is no Hitchhiker’s Guide to Mathematics for Programmers
The idea is that the Curry-Howard isomorphism allows you to "play" with constructive mathematics easily. For example, consider the fact that the composition of two functions f and g is continuous if each function is continuous. Suppose f : X -> Y and g : Y -> Z. Then, in pseudo-Haskell syntax, we could say

  continuousf  : Open set in Y -> Open set in X
  continuousg  : Open set in Z -> Open set in Y
  continuousgf : Open set in Z -> Open set in X
  continuousgf = continuousf . continuousg
The idea is that the fact that f is continuous means that we can produce open sets in X given open sets in Y. Now, consider the fundamental theorem of algebra over complex numbers. This says that any polynomial with complex coefficients with degree greater than 0 has at least one complex root. We'd like to have a function

  fta : Polynomial P of degree >0 over C -> (Point x in C, proof that P(x)=0)
which would compute this root. But the thing is, the standard proof (e.g., by Louiville's Theorem) of the FTA is not constructive. The proof is by contradiction: Suppose there were no root. Then we violate some principle of complex analysis that we know is true (Louiville's Thm, or Maximum Modulus Principle, for example). Thus there must be a root.

But this doesn't tell us at all how to compute the root! So instead we need a constructive proof of the FTA in order to produce a root.

So, the idea is that you can't "play" with non-constructive mathematics in programming as you can with constructive mathematics. Our standard FTA proof would look like

  fta : Polynomial P of degree >0 over C -> Exists x. P(x)=0.
But the type of the object that this function produces isn't very fun to play with. We have no idea what the root is!
thetwiceler··on Principles of Reactive Programming
As far as I know, Hudak has updated and renamed his book to The Haskell School of Music, and it's available for free from the Yale Haskell Group's website here: http://haskell.cs.yale.edu/?post_type=publication&p=112

The book is a really awesome way to learn Haskell. However, very little of it is actually about FRP; there's one section about GUIs using FRP, and it doesn't go very much in depth.

thetwiceler··on Don't Fly During Ramadan
Here's a really good way to protest security theater (albeit very much at your expense): write SSSS [1] on your boarding pass, and see how you're treated! (Security officers can write SSSS on your boarding pass, so it doesn't need to be printed on the pass, so this will work...)

[1] http://en.wikipedia.org/wiki/Secondary_Security_Screening_Se...

thetwiceler··on A Mathematician’s Lament (2002) [pdf]
Yes, a million times! Journey through Genius is an excellent book (I, too, had this book for a History of Math class). It's really appropriate for people of all different levels of mathematical maturity. It's aimed to be read by a pretty much lay audience. But it covers some interesting t material that you're likely not to have seen in an undergraduate curriculum (Heron's formula, cubic/quartic equations, Euler's windmill proof).
thetwiceler··on The Haskell School of Music (2012) [pdf]
This is by Paul Hudak, one of the creators of Haskell. I took one of his classes that corresponds with this book. This is how I was introduced to Haskell.

Now I'm hooked on Haskell! The book is a truly excellent introduction to Haskell, and I suggest that anyone who is interested read it. The book goes into some interesting topics, including proofs by computation and induction, UIs and functional reactive programming, and arrows. And it elegantly explains some of the advantages of functional programming and the Haskell language.

Just note that this book is a work in progress; he is always updating and modifying the book as he teaches the corresponding classes.

thetwiceler··on New edX courses
Sometimes; it depends on the class.
thetwiceler··on Isla: a programming language for young children
The first "programming language" that I learned to use was LEGO Mindstorms, when I was around 8 years old. I think that was an absolutely AWESOME way to teach the principles of computer programs to children. (And transferring the programs to the robot was WIRELESS! Serial -> Infrared, that is)

Each "instruction" was represented on a computer as a "LEGO block". For example, there was a conditional block. You'd place it under a block that would return an output (like a "sense" command), and then you'd place two blocks below it for the True/False conditions. So basically you ended up building a tree of the logical structure of the program.

I think this style is the BEST way for children to learn programming. In fact, I think a block-like/tree-like structure is often a great way to think about program structure (even for advanced programs; Simulink is really great!).

Now, once you get comfortable with the constructs, actually dragging-and-dropping blocks often gets too slow. But for children, and for building simple programs, I think it's great.

I'm afraid that text-based languages are just unnecessarily difficult for children - only a small fraction of what you can type actually represents a valid program. The blocks allow programming without having to deal with these syntactic barriers. After all, when I program in a language like Haskell, 90% of my programming errors cause the program to fail to compile. These sorts of errors (syntax errors or type errors) can be prevented as the program is built with the block interface.

And while I'm extolling Mindstorms, another great thing about creating these programs was that you weren't just flipping bits on a computer; it was pretty satisfying to see a robot "in the real word" follow your commands.

thetwiceler··on Human-Powered Helicopter Wins the $250,000 Sikorsky Prize
This is really cool!

On a similar note, for those of you who may not be aware, there has also been a human-powered airplane: http://en.wikipedia.org/wiki/Gossamer_Albatross

I am totally amazed by the Gossamer Albatross. It was made in 1979. And here's the most awesome part - a cyclist flew it across the English Channel!

thetwiceler··on Anatomy of a pseudorandom number generator – visualising Cryptocat's buggy PRNG
If you take this sort-of-stretched case where encryption can be broken, I can explain why this is a problem.

Suppose you are using the PRNG to make a stream cipher. Basically, your random key is a seed for the PRNG. You then generate lots of pseudo-random characters from that seed, and XOR them together (character-by-character) with your message to encrypt it.

Now, the fact that XOR is linear (it's just addition mod 2) means when you XOR two probability distributions against a constant (i.e., an atomic distribution), you'll get a shifted distribution. Let's say your PRNG disproportionately outputs "0" at each character. Then the distribution of each character of the ciphertext will be centered at p XOR 0, where p is the corresponding character of the plaintext!

So by the law of large numbers, if we see the same message encrypted many times, we can determine with high probability exactly what each character of the plaintext is, and completely break encryption!

thetwiceler··on Google Correlate - Draw
Anyone know why "bruising" and "brown spots" are common in the summer? Not as nice as the canonical answer of "ice cream"...

http://www.google.com/trends/correlate/search?e=id:UfmYZwmin...

In case you're wondering what's popular in winter: it's lots of diseases!

thetwiceler··on Normal vs. Fat-tailed Distributions
This is false. Think about it this way. A random walk is a martingale - you're expectation of where you'll be in the future is. So you're right that, before you start the walk, they have expectation of being at 0 at any time in the future.

But the variance of your probability distribution of where you'll be at time t is linear in t. So say that your variance is v(t)=t. Then at t=1, there is a 32% chance that you'll be outside of the range (-1,1). As you can see, as t increases, you expected to drift further than further.

So while the expectation of x(t) may be 0 for all time, the expectation of |x(t)| scales like sqrt(t) (the standard deviation of the distribution).

thetwiceler··on Papers and essays that every programmer should be aware of
I totally agree. Unless we decide to leave the field of rational numbers (with exponents, trigonometrics or nth roots), there's little reason not to keep the exact rational number around.

Fortunately Haskell does this too with Data.Ratio!

thetwiceler··on Economics Is A Lost Field
Once again, don't confuse predictability with ability to understand a system. We actually have a fairly good understanding of weather dynamics and turbulence - and I can give you the formula for both of these - the Navier-Stokes equation! Not the simplest equation, but something understandable (yes, I know there's a Millenium Prize problem to see if we always get a smooth solution). We do understand how turbulence arises from this. And we understand the weather very well.

However, we can't predict the weather, nor can we predict the earthquakes. And as you correctly point out, the reason for this is chaos. The reason is not that we don't understand the underlying processes that govern these dynamics. Rather, the uncertainties in our initial conditions increase exponentially with time (due to chaos) and make long-term predictions unreliable.

thetwiceler··on Economics Is A Lost Field
I think you're just spouting a lot of buzzwords, and you're actually conflating (a) the relevance of chaos theory and (b) criticisms of normal distributions in economics.

A major recent criticism is of some economic models which have assumptions to the effect of "returns on this investment will be normally distributed." The criticism is that evidence seems to suggest that returns are not actually normally distributed; rather they have "fat tails," meaning that extreme events are more likely than with a normal distribution. And this error causes economic models to discount the role of these unlikely extreme events.

The Black-Scholes model effectively models stock prices as Brownian motion. This boils down to a single assumption: stock prices are the buildup of lots of very small INDEPENDENT random events (with FINITE variance) that occur over short times periods; this leads straight to Brownian motion. Brownian motion is indeed continuous; however, it is nowhere differentiable with probability 1. Because of the assumptions of finite variance and independence, the CLT tells us that returns will be normally distributed. So here, people pretty much agree that it's always these assumptions of independence that cause these models to predict poorly.

This is totally different from chaos theory. First of all, chaotic systems are not necessarily complex. Here's a chaotic map with a "nice little formula":

  f : [0,1) -> [0,1)
  f(x) = 2*x (mod 1)
While this is chaotic, we can understand much about this map. For example, each application produces an entropy of 1 bit (see entropy of dynamical systems...). So this is a map that "produces randomness" in a way. This is philosophically nice, because probability theory itself doesn't at all explain how randomness comes about.
thetwiceler··on The State of the Tau
The use of infinitesimals in calculus! Things like integrating against "dx" or taking a derivative of a function "df/dx" make calculus seem like something it's not. Worse, it really introduces a whole new language whose rules for manipulation are unclear.

Like if we have a function f(x,y), we often write the "total" derivative of f as df = (df/dx) dx + (df/dy) dy And the rules for manipulating a differential like this are quite strange (e.g., dx on top cannot cancel the dx on bottom).

There's a language of differential forms that makes this notation a bit more rigorous, but I still think the notation is very misleading and confusing, especially for those who begin to learn calculus.

thetwiceler··on The State of the Tau
Yeah, I've literally never seen lower-case pi used as a variable (thank goodness!). tau is a good choice because it looks like pi, and is possible for normal people to write (I would have had a fit if it were lowercase xi!).

I like the explanation page for why tau a lot, and I think that page is much more important than actually using tau in real mathematical works. It's a great explanation of how 2*pi is the more natural quantity, and how it comes into play in the different functions. But it's just much easier to deal with factors of 2 than it is to explain alternate notation.

In fact, I think a lot of making mathematical works easy to understand is using commonly accepted notation...

thetwiceler··on 8th Grade Twins take Astrobiology and Einstein Courses on Coursera
I disagree to an extent. For some classes (it's quite variable), the forums can be of great quality, and it can be greatly enriching to be learning the material (and educational tangents that occur in the forums) along with lots of others. It's just not possible to get a cohort of people learning things at the same time as you on your own.

In fact, I am kind of hoping that a community is made where people can get together and study any educational material themselves. Coursera still lacks upper-level classes; it would be great to use the great aggregation of the internet to find a group of people to study advanced material together.

thetwiceler··on The State of the Tau
Wow this is hilarious. Truly a "manifesto" to set a constant for 2pi. It definitely has a great point, and I totally agree that it's a better constant than pi, but it's not the worst historical accident of mathematics.

The thing is, tau is really my go-to variable when I need a 2nd constant to compare with t. It is already used as a time constant, a dummy integration variable that substitutes for t... The manifesto has a pre-made counter-argument to this... But I'm not sure it's convincing.

The thing is that we like to say some variation of e^(-tau) a lot, and we also like to say e^(2 pi i) a lot. And often we combine these (rotation and exponential decay), and we get e^(-tau+2pi i). And this would ruin tau notation! It would be e^(-tau'+tau i)...

thetwiceler··on Intuition and Logic in Mathematics (1905)
Actually, this example makes Euclid even more of a logician. Recall that Euclid stated his Fifth Postulate (where his postulates really mean axioms). Geometers for thousands of years afterward, guided by intuition, attempted to prove that in fact the Fifth Postulate could be proved from the other axioms. But by the 19th century, it was actually clear that Euclid was correct to include the postulate; had he not included the postulate, his geometry would not convey what he wanted to convey. Euclid in this way was fundamentally a logician! He realized that he needed the Fifth Postulate to prove facts about a geometry he imagine (e.g. angles in a triangle sum to two right angles), and included as an axiom something that others intuited must be derivable from the others.

But as Poincare mentions, we can also see that Euclid DID have much "intuition" in his works. In modern days, we do not consider Euclid's Elements a rigorous work of logic, mainly because his definitions are not rigorous definitions; he says a point is "that which has no part." Hilbert remedied Euclidean geometry in the 20th century, with a work that has some undefined objects (points and lines) and precisely defines the rest. He needs something like 24 axioms, as opposed to Euclid's 5.

It's interesting to see where Euclid's logic breaks down. Look at his very first proof - the construction of an equilateral triangle. He constructs two circles and looks at their intersection. How do we know we can build the circles to intersect? He draws us a picture and it seems obvious :).

But in Hilbert's Euclidean geometry, we need what I think of as a really nasty axiom in order to ensure the circles intersect: "Axiom of completeness. To a system of points, straight lines, and planes, it is impossible to add other elements in such a manner that the system thus generalized shall form a new geometry obeying all of the five groups of axioms. In other words, the elements of geometry form a system which is not susceptible of extension, if we regard the five groups of axioms as valid."

thetwiceler··on Straight-edge and Compass Construction Kit
http://sciencevsmagic.net/geo/#0A1.0L1.1L2.2A1.1A2.4L0.7A0.9...

Ahh! Well you can't say I didn't try. Must have accidentally hit one of the wrong points somewhere in the construction...

thetwiceler··on Straight-edge and Compass Construction Kit
Somebody construct a 17-gon!
thetwiceler··on Has the US become the type of nation from which you have to seek asylum?
I think this is really hyperbolic. The fact is that Snowden violated the conditions of his Top Secret security clearance, which is a crime that is subject to criminal prosecution.

Now, I'd argue the leak that Snowden made was much more acceptable than, if he had revealed the identities of CIA spies to foreign countries and caused them to be killed.

Nevertheless, we are a nation guided by rule of law, and it would be unreasonable to expect that Snowden wouldn't be prosecuted. Just because he did something which many people consider was a good thing, does not mean that he didn't do something illegal.

thetwiceler··on Bitcoin exchange rate reached $100 USD per BTC
Proof that Bitcoin is worthless:

I set up camp over the Golden Gate Bridge. I ask people if they'd be willing to throw their lunch into the water (use their computer's time/energy/money to mine Bitcoin), with no possibility of retrieving it, and in return I offer to give them a certificate stating that they've thrown their lunch away (a Bitcoin).

Now, I see no reason why anyone would expect why these certificates would have any value. But let's suppose they do have value, and people can trade their certificates, say, for a lunch (or perhaps half a lunch). NOW, suppose I have been secretly stashing away those lunches (really it doesn't need to be in secret - you don't care what happens to your lunch after you throw it away). Then there is now objectively more value in the world than there was before I set up shop - there are the same amount of lunches in the world, but there are also now certificates that have some positive value. We've made a free lunch!

This is a contradiction. If we could create value by this silly game, we could easily make as much value as we want, and we would have solved all the world's problem.

But this should be obvious in the first place! Why on earth would you expect to be rewarded with something of value (a Bitcoin) for doing something fundamentally useless to society (mining Bitcoin). Even though mining Bitcoin comes at a cost to you, this doesn't matter - it just means you're throwing your lunch away.

Now why does the US Dollar have value? Instead of throwing away our lunches for a certificate, we basically asked the government to store our lunches in Fort Knox. Today, lots of gold and other items of value are held there. Why are they held there? There is an implicit assumption that these items of value support the US Dollar. The government knows it could not start "eating those lunches" that it's got in its reserve! It would not yield society a free lunch - it would crash the US Dollar.

← PreviousPage 2 of 2