thetwiceler | 12 years ago | on: Who Says Math Has to Be Boring?
thetwiceler's comments
thetwiceler | 12 years ago | on: Why do we value gold?
Let's say that Apple sees the price of its stock drop to something that it thinks is unreasonably low. They may choose to spend some of their cash on hand to buy back some of their stock. This is a wise investment that shareholders would applaud - Apple is getting a good deal.
Same deal with the Federal Reserve. Federal Reserve notes are nominally liabilities for the Fed, and are much like the concept of Apple stock. If the Fed notices the price of the dollar drops, it's in their best interest to trade some of their holdings to buy back some dollars.
thetwiceler | 12 years ago | on: Why do we value gold?
Our currency has not been pinned to gold for 40 years (when the Bretton Woods system collapse), but the Federal Reserve still maintains the holdings.
Before the Bretton Woods system collapsed, the US government was required to allow large entities to exchange their USDs for gold. Now, it isn't required to. But the fact that the Federal Reserve holds the gold, and that it is well known that they would use it to support the value of the USD, helps maintain the value of the USD.
thetwiceler | 12 years ago | on: Why do we value gold?
The USD is not literally backed by gold, but part of the Federal Reserve's mission is to moderate the rate of inflation; that means holding the value of the USD steady. And the way they do it is beyond the scope of this discussion, but it certainly depends on the Federal Reserve trading its holdings on the market (which, as you point out, is mainly debt (in terms of USD), not gold).
thetwiceler | 12 years ago | on: Why do we value gold?
If taxation were the only form of backing, things would be a little more strange. The currency could work, but taxes would have to be defined differently. Somewhere in the tax rules, there would have to be some statement that pins the value of the USD.
thetwiceler | 12 years ago | on: Why do we value gold?
For some reason, many people believe that this is true. I believe that it is not.
Technically, yes, if people all decide the currency has value, then it will have value. But this is a ridiculous argument! How much is this currency supposed to be worth? According to this argument, any number is potentially valid! This means that there is absolutely nothing that should hold the value of the currency fixed, and with a few "no free lunch" arguments (anyone can claim any random thing has value and try to trade with it), we see that things with no intrinsic value should NOT have value.
So why does the US Dollar have value? It's just paper (cotton), right? Not true! If the exchange rate of the dollar decreases, you'll see the Federal Reserve will start trading some of its goodies from Fort Knox (gold, etc.) for US Dollars, in order to maintain the dollar's exchange rate/value.
So in reality, the US Dollar is backed by holdings that have intrinsic value.
EDIT: As pointed out, I should mention that another important backing of the USD is taxation.
Also, what I said about the Federal Reserve isn't technically true. What's important is that they have a mission to moderate the rate of inflation of the USD (i.e., maintain its value), and their asset holdings are critical in allowing them to do this.
thetwiceler | 12 years ago | on: What I Wish I Knew When Learning Haskell
[1] http://stackoverflow.com/questions/7961604/fixing-issues-not...
thetwiceler | 12 years ago | on: What I Wish I Knew When Learning Haskell
In other programming languages, I'm sure you already use the very same functions that are fundamental to monads; you just don't have a syntactic construct that says "Hey, these things share a similar structure!"
Most of the other replies focus on IO (and on the do-notation side of things), and so I'm not sure that they'll help your confusion.
We'll need to start with functors. Without getting too formal, functors describe "containers" that can hold objects of any type. A list is a functor, a "Maybe" is a functor, the result of a computation (i.e., "IO") is a functor… lots of things are functors!
And since functors can contain anything, they can certainly recursively contain themselves - that is, they can be nested! We can have a list of lists, or a "Maybe (Maybe a)" (hey,… that seems like an awfully redundant thing to construct). When we talk about "IO", we can have an "IO (IO a)": that is, we can describe a computation that returns to us another computation!
And with these functors that I've mentioned, we realize something interesting: We would often like to flatten these nested structures. We use "concat" to reduce a list of lists to just a list; how to reduce a "Maybe (Maybe a)" to a "Maybe a" is obvious; for IO, we might want to take our description of a computation that returns a description of another computation ("IO (IO a)") and convert that into a description of a computation that runs the first computation, and upon receiving the result of that computation (which is a computation itself), run the resulting computation, and then return the result of THAT as our final result.
Also, for these things, we have an idea of how we would inject a pure value into the structure. We can create a list with a singleton element, or "Just" our element, or the computation that does nothing interesting (no missile launches) and just returns our element.
Haskell is just wacky enough to let us use the same syntax for all of these rather different ideas (which only share the similarity of having the monadic structure)!
NOW, I personally don't think that the trouble that people have with monads is related to the abstraction and the shared syntax - I think it has more to do with the use of the use of Haskell's "do" notation. Learn what "do" notation is sugar for! Learn what "bind" (>>=) is (it's basically a neat combination of the two operations ("bind" and "return", for what it's worth) that I described above).
I can't promise you that learning monads is something necessarily pragmatic (except for the fact that I think Haskell is the perhaps the MOST pragmatic language, and you'll need to learn monads to be comfortable with Haskell). But the world would be a pretty dull place if we only did what was pragmatic.
thetwiceler | 12 years ago | on: Compress 7G to 1K with epic vaporware
thetwiceler | 12 years ago | on: Compress 7G to 1K with epic vaporware
[1] http://en.wikipedia.org/wiki/Shannon's_source_coding_theorem
thetwiceler | 12 years ago | on: How I faced my fears and learned to be good at math
[1] http://www.hup.harvard.edu/catalog.php?isbn=9780674057555
thetwiceler | 12 years ago | on: How I faced my fears and learned to be good at math
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 | 12 years ago | on: Quantum physics sheds light on Riemann hypothesis
thetwiceler | 12 years ago | on: TSA loudspeakers threaten travelers with arrest for joking about security
thetwiceler | 12 years ago | on: TSA loudspeakers threaten travelers with arrest for joking about security
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 | 12 years ago | on: Why there is no Hitchhiker’s Guide to Mathematics for Programmers
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 | 12 years ago | on: Principles of Reactive Programming
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 | 12 years ago | on: Don't Fly During Ramadan
[1] http://en.wikipedia.org/wiki/Secondary_Security_Screening_Se...
thetwiceler | 12 years ago | on: A Mathematician’s Lament (2002) [pdf]
thetwiceler | 12 years ago | on: The Haskell School of Music (2012) [pdf]
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.
"How many people actually use any of this “practical math” they supposedly learn in school? Do you think carpenters are out there using trigonometry? How many adults remember how to divide fractions, or solve a quadratic equation? Obviously the current practical training program isn’t working, and for good reason: it is excruciatingly boring, and nobody ever uses it anyway. So why do people think it’s so important? I don’t see how it’s doing society any good to have its members walking around with vague memories of algebraic formulas and geometric diagrams, and clear memories of hating them. It might do some good, though, to show them something beautiful and give them an opportunity to enjoy being creative, flexible, open-minded thinkers— the kind of thing a real mathematical education might provide."
For some reason, the math curriculum is completely about learning techniques, which roughly correspond to formulaic manipulation of symbols. We basically learn to apply algorithms for manipulating symbols, and we do it over and over again. And of course, this is easy to test.
But it's also the absolute least important aspect we need to know! It's the part that doesn't involve thinking. And so we end up with some farce of an education where we learn the procedures without the context why people created them in the first place!
Take the quadratic formula: something wholly useless in real life, but taught to every middle-schooler in the US. Somehow, even though the name has "quad" in it, we learn it without learning the context of the ancient Greek concept of quadrature, and problems relating to whether it is possible to find a rectangle with a certain area and perimeter. In the derivation, we "complete the square", but nobody draws the said square!
And then we do a hundred problems involving applying the quadratic formula, which is neither enlightening nor useful.
[1] http://www.maa.org/sites/default/files/pdf/devlin/LockhartsL...