On Abstractions, Generalizations

November 21, 2009

I was battling through Walter Rudin’s Principles of Mathematical Analysis the other day when I came across the following theorem:

Theorem Suppose f is a continuous real function on a compact metric space X, and

M = sup\, f(p), \quad m = inf\, (p) \qquad p \in X

Then there exist points p, q \in X such that f(p) = M and f(q) = m.

And then the proof is one line; it is a corollary of two other theorems:

1. If f is a continuous mapping of a compact metric space X into \mathbb{R}^k, then \textbf{f}(X) is closed and bounded. Thus, f is bounded.

2. Let E be a nonempty set of real numbers which is bounded above. Let y = sup E. Then y \in \bar{E}. Hence y \in E if E is closed.

I was reminded of the same, albeit more specific theorem, in Spivak’s Calculus.

Theorem If f is continuous on [a, b], then there is a number y in [a, b] such that f(y) \geq f(x) for all x in [a,b].

And then the proof

Proof f is bounded above on [a,b], which means that the set

A = \{ f(x) : x \in [a,b] \}

is bounded. This set is not empty, so it has a least upper bound \alpha. Since \alpha \geq f(x) for x in [a, b] it suffices to show that \alpha = f(y) for some y in [a, b].

Suppose instead that \alpha \neq f(y) for all y in [a,b]. Then the function g defined by

\displaystyle g(x) = \frac{1}{\alpha - f(x)}, \qquad x \in [a, b]

is continuous on [a, b] since the denominator is never 0. On the other hand, \alpha is the least upper bound of A; this means that

for every \epsilon > 0 there is x in [a, b] with \alpha - f(x) < \epsilon.

This, in turn, means that,

for every \epsilon > 0 there is x in [a, b] with g(x) > 1/\epsilon

But this means that g is not bounded on [a,b], contradicting continuous functions are bounded.

Phew. The more complicated proof from real analysis is significantly shorter than the one from calculus, even though the one from analysis is actually strictly stronger. I could do a similar writeup for the calculus proof of the fundamental theorem of algebra vs. the complex analytic one using Liouville’s theorem, but the calculus proof would be like 10 hours of typing.


Staedtler Riptide: A Review

November 13, 2009

staedtler_riptideStaedtler is the kind of company, like BMW, that you wish were an American company. Y’know, like something to be proud of? Like BMW — oh wait. Mercedez — oh wait. Budweiser? — right.

I’ve only owned a couple Staedtler pens in my life, so when I saw these Staedtler pencils in the teeny little university bookstore, I knew I had to try them. There are only a few criteria I look for in a writing utensil:

  1. Comfort of grip

The grip must be comfortable! You have to be able to write out the Laplacian in spherical coordinates without your hand cramping up.

  1. Ease of use of mechanical features

This includes things like clicking a pen, removing a cap, or in this case, advancing the lead.

  1. Weight and shape

This is the most important. It is absolutely essential that my writing utensils be weighted and shaped so that they can be easily spun.

So how does it stack up? Well for (1) it’s pretty average. The grip is just a piece of rubber that wraps around near the head. It’s not particularly awful, but it’s nothing special.

(2) is the pencil’s weakest point. Clicking to advance the lead is an arduous process. It almost feels like there’s something rusty in there.

(3) is the pencil’s strongest point. It’s a natural width, and is shaped a lot like a standard Bic pen. But the weight—oh the weight. The weight is heavenly. These mofos are heavier than a normal mechanical pencil, and the weight is almost perfectly distributed. I daresay they compare to the Bic Softfeel Med.

Did I mention it was less than $2 for three of them?


On Collisions: Math and Colloquial Speech

November 5, 2009

So I was remembering this time in, say, fourth grade when the teacher posed the following question:

How many numbers are between ten and twenty?

Of course, this problem is well within the skills of a fourth-grader. Simply subtract ten from twenty and you get ten. In fact, the only appreciable difficulty is in the interpretation of the question. Students, particularly children, struggle with these so-called “word-problems”: problems where the math is relatively simple, but the problem is phrased as a question. You know, using words and stuff.

Being who I am, I completely failed at understanding the question; I answered, “Eleven.”

So I got laughed at… But to this day I maintain that 11 is just as accurate as—indeed more accurate than—10. Why? It all lies in the interpretation of the word “between.” If “between 10 and 20″ means

\{x\in\mathbb{N}\, |\, 10 < x \le 20\}

Then yes, there are 10 such numbers: 11, 12, 13, 14, 15, 16, 17, 18, 19, 20. But who the hell uses “between” to mean “including the upper limit but excluding the lower limit”? In my opinion, there are only two reasonable ways to interpret “between ten and twenty”:

  1. \{x\in\mathbb{N}\, |\, 10 \le x \le 20\}
  2. \{x\in\mathbb{N}\, |\, 10 < x < 20\}

But then the correct answer is either 9 or 11. I chose option (1) in fourth grade, but option (2) is perfectly reasonable.

The problem is that this becomes no longer strictly a subtraction problem. What the teacher wants is for the students to compute 20 - 10 = 10. But this is wrong, so how do we reinterpret the question?

I propose the following: first consider the question, “what are the numbers between ten and twenty?” This question still has the ambiguity of the word “between,” but no person in his right mind would answer:

10, 11, 12, 13, 14, 15, 16, 17, 18, 19

or

11, 12, 13, 14, 15, 16, 17, 18, 19, 20

Then we can ask, after the set of numbers has been identified, “how many of them are there?” I think if the problem were posed this way, no one would ever arrive at an answer of eleven (unless they miscount).

Further Rambling

I’ve decided that word problems like the ones we’re given in grade school don’t really count as “math.” I think they’re physics. Consider the topics covered in college- and higher-level mathematics. They’re abstract and almost completely disconnected from the real world. A mathematician doesn’t care if we live in Euclidean space or a Minkowski space; if they can prove something about both, then that is interesting.

A physicist (or statistician maybe) concerns himself with questions like these word problems—problems dealing with possible real-world scenarios. When we answer such questions, we don’t really learn a lot about math; rather, we learn about the connection between math and the world we live in.

That’s not to say word problems aren’t good or helpful, but I think school teachers should be very careful both in posing questions and in receiving answers. What if my teacher had let me explain my logic? It would have been nice to shut up the kids who laughed at me for a “stupid” answer, and they might learn something at the same time.


On Underrated, Obscure Music

October 13, 2009

office_of_strategic_influenceI recently (read: a month ago) was introduced to the band OSI. I’ve fallen completely in love with their debut album, Office of Strategic Influence.

Their sound is certainly “progressive” in the sense that it’s complex, powerful, and weird. It’s hard for me to categorize them well, but I think Wikipedia does a fine job:

Genres: Progressive rock, industrial rock, electro rock, post-metal, avant-garde metal

It’s hard to not like at least one of those.


New Headphones

September 6, 2009

bose-over-earWell it’s just about that time again.  In January I posted about my new iFrogz headphones. I lamented the fact that I need to replace my headphones quite regularly.

True to form, I managed to break my iFrogz headphones the other day. I say “break,” but really it was the headphones that pooped out on me; the right audio channel just completely died. I imagine the fault occurred somewhere in the wiring where some important thing got disconnected from another important thing. I’m not really sure.

Long story short, I bought new headphones today. In previous headphone purchases I used rather loose search parameters (e.g. they must fit a 1/8 inch jack), but this time I focused my search on quality headphones.

I examined numerous brands: Sennheiser, Bose,  Sony, Razer, and others. I finally decided on the Bose over-ear headphones (pictured). They’re half the price of the “Beats by Dr. Dre,” but still provide gorgeous sound.

These new headphones are easily the best and most expensive headphones I’ve ever owned. They certainly sound the best, but since I’m not a very good audiophile I can’t really comment on their relative quality. What I am amazed by, though, is that they have an impedance of just 32 \Omega.

That is, the power delivered to these monoliths is the same as that delivered to crappy iPod headphones. In practical terms, this means I can listen to loud music with a low-power device like an iPod.

Sweet.


Borders Is Lame

August 30, 2009

All summer I’ve been aching for something good to read. A few days ago, when the “aching” began to cause actual physical pain, I caved and began browsing the web for a book I might like.

I decided that I wanted a collection of short stories. I decided this for a number of reasons. First, short stories are short. I have what probably counts as A.D.D., and it can be tough for me to sit through a old, dry book (I’m looking at you, Great Expectations).

The way I see it, reading a few short stories is like watching an episode of The Simpsons, a couple of Family Guy, and maybe some Arrested Development or something. A long novel is like watching Cassablanca.

Also, short stories allow authors to tackle subjects that can’t quite carry themselves through an entire book. In particular, authors often write short math- or science-related stories. One of my favorite stories, The Library of Babel, is one I read years ago. I wanted a collection of stories like that.

My googling eventually brought me to the book Einstein’s Dreams which, although not quite a “collection” of short stories, is pretty close to what I wanted. The only semi-competent bookstore near me is Borders, so I searched their website with my zip code. I was told this:

WTF?

WTF?

Likely in store”? What the hell does that mean? Shouldn’t the Borders cashiers be competent enough to scan each book that gets sold, and shouldn’t the computers be competent enough to update the store’s inventory?

I realized, as you probably have, that “likely in store” is their way of telling us that if we can’t find a book in the store then they aren’t responsible. Of course, that big, red button that says “reserve in store” indicates that they have it.

So I went to Borders. Just for la-la’s, I ran the same search on the in-store computer and it told me the same thing. OK, I’ll go find it. Hmm… Literature… Fiction… Fiction/Literature… Aha! Alan Lightman (the author)!

Guess what. No Einstein’s Dreams. I asked a “sales representative” to help me find the book. He heroically took me over to the Fiction/Literature section, failed to find the book, and informed me that the book was not there.

“But the computer says ‘likely in store’!” I protested.

“Yeah, but likely doesn’t mean definitely.

It took all of my will power to keep myself from telling him to go fuck himself sideways. All the damn “likely in store” label does is give the Borders employees an excuse to not find a book that was either misplaced or somehow lost.

Then again, I guess this is why Amazon is so successful.


A Logical Fallacy

August 17, 2009

Most people are familiar with the “gambler’s paradox.” You know, the statistical paradox regarding, for example, the flip of a coin: you flip a coin 99 times, and each time it comes up heads. On the 100th flip, what is the probability that the coin shows tails?

It’s called a paradox because intuitively you want tails to be more likely than heads on the 100th flip, but this obviously isn’t the case; the probability of tails is 50% no matter what has happened in the past.

But despite people’s willingness to accept the mathematics behind the trivial example above, many still fall for the gambler’s paradox in more complicated situations. For example, I was talking to a friend the other day who said something like this:

“I was on an airplane to Florida and I swear I saw a plane crash. The only thing that prevented me from being totally scared was the fact that because they crashed, I must be less likely to be in a crash.”

I responded with, “Wait… What?” I tried to explain that her logic made no sense; if one plane has crashed, another plane isn’t suddenly less likely to crash just because it needs to be in keeping with a statistical average.

Suppose every day 1 in 10 planes crashes (obviously not true, but I’m too lazy to look up the real figures). Then the chances of two planes crashing in one day is .10 x .10 = .01, or 1%. Here is the source of the fallacy. The probability of two planes crashing is lower than the probability of one plane crashing. However, the fact that one plane has crashed has no bearing on the probability of another plane crashing.

That is, if one plane has crashed, the probability of it crashing is 100%. Therefore the probability of that plane crashing and your plane crashing is 1 x .10 = .10, or 10%. This is, of course, if we assume that the two probabilities are independent.

In reality, the probabilities are somewhat dependent. If one plane crashes, pilots on other planes might be informed and would then change the way they fly, which, in turn, would change the probability of a subsequent crash. Nevertheless, the impact is probably small, and we can safely assume independence.


Browser Benchmarking

July 27, 2009

In the interest of, well, nothing, I decided to benchmark several of my own browsers at Peacekeeper. The two machines I used:

1. MacBook running Mac OS X 10.5.7

  • 2.4 GHz Intel Core Duo CPU
  • 4 GB RAM
  • GMA X3100 integrated graphics

2. Home-made box running Windows XP SP3

  • 2.4 GHz Intel Core 2 Quad CPU
  • 3.25 GB RAM
  • NVIDIA GeForce 8800 GTS 512 graphics card (x2, no SLI)

The Results

These should, of course, be taken with several grains of salt:

OS X 10.5.7

OS X 10.5.7

That should read “(Netscape Navigator 9),” by the way. I was going to test 6, but I couldn’t get it to load even google.com without crashing.

Windows XP SP3

Windows XP SP3

What surprises me more than anything is Chrome’s ability on OS X. Until I did these benchmarks I hadn’t used Chrome since an early, buggy alpha. It still crashes every 10 minutes, but it renders like a motherfucker (compared to everything but Safari, of course).

I also love that the Windows version of Safari is so good. Apple may have all the kudos they want.


The Monty Hall Problem

July 17, 2009

In a rare coincidence, I spent a solid two hours considering the Monty Hall problem the other night, and today I was linked to a rather absurd discussion on the very same topic. In this post I plan to present not a new solution to the problem, but rather a new explanation that makes the most intuitive sense to me.

Here’s a quick review: the Monty Hall problem is a probability problem based on a game show. There are three closed doors. Behind one is a prize (like a car), and behind the other two are booby prizes (like goats or pigeons or something). The host asks you to choose a door—A, B, or C. After you’ve chosen a door, the host opens a different door and reveals a booby prize. You are then asked whether you want to change your mind or not. What should you do?

The answer, it would appear, is that it doesn’t matter whether you change your mind or not. However, after careful consideration, you can see that you’re better off changing your mind (!)

What does that mean? It means that if you choose door B, and the host opens door A, then you should choose door C. The discussion I linked to above and the Wikipedia provide some useful and interesting explanations. What follows is the explanation I thought up.

My Explanation

My thought process stems from one question: how is it that “changing your mind” can affect the situation? Consider what happens if you choose door A and the host opens door B. There are exactly TWO ways to arrive at this situation:

  1. You have chosen incorrectly (the car is behind door C)
  2. You have chosen correctly (the car is behind door A)

A common (and correct) explanation is that scenario 1 is indeed more likely than scenario 2. But also consider this: if the car is behind door A and you choose door A, then the host can open either door B or door C. If you did a statistical analysis—for example, have 300 contestants choose door A—you would find, on average, ~33% would have chosen correctly (because the car has equal probability of being behind A, B, and C), and ~66% would have chosen incorrectly. Suppose the correct door is door A.

Those ~33% who chose correctly, only half of them, or ~16.5% of the who group, would see door B open as in the situation I described. The other 16.5% would see door C open. For the 33% who chose door C, ALL of them will see door B open (because door A is correct). The 33% who chose door B would NOT see door B open, and would those find themselves in a different situation altogether.

Adding, we find that 16.5% + 33% = 49.5% (actually it’s 50% without rounding) of the entire sample will see door B open if door A is correct–as expected. However, of those 50%, 33% chose incorrectly, and only 16.5% chose correctly. Therefore, 2/3 of the time, it’s better to switch.

You can now easily take this explanation and let door B or door C be correct, and you will find the same result.

The Meta-Explanation

What I like about my explanation is that it can answer the question I first posed: how can changing your mind affect the situation in such a way? The answer: it can’t. My explanation describes how there are only so many ways to arrive at a particular “situation,” and each situation is reached more frequently by people who have chosen incorrectly.

If you examine my argument closely, you’ll find it isn’t much more than an expansion of the standard “you’re more likely to choose wrong” argument, but I like it because it helps me understand the solution more intuitively.


A New Blag

July 6, 2009

I have dedicated an entire new blag to my love for grammar. I affectionately call it “Grammar Camp”