The middle size of the universe

From Kevin Kelly’s book What Technology Wants:

Our body size is, weirdly, almost exactly in the middle of the size of the universe. The smallest things we know about are approximately 30 orders of magnitude smaller than we are, and the largest structures in the universe are about 30 orders of magnitude bigger.

Related posts:

Why the horse in Magician’s Nephew is named Fledge

In C. S. Lewis’ book The Magician’s Nephew, the horse Strawberry becomes Fledge, the father of winged horses. It didn’t occur to me until today why Lewis chose that name. I just thought it was an odd, arbitrary choice.

This morning I saw something that referred to a bird as unfledged which made me suspect the base “fledge” had something to do with flight, which it does. I knew the word fledgling — a bird just beginning to fly — but I had not made the connection between fledglings and Fledge.

If you’d like to read another etymology post, see Cats, Calendars, and Connections.

The trouble with wizards

It’s usually a compliment to call someone a “wizard.” For example, the stereotypical Unix wizard is a man with a long gray beard who can solve any problem in minutes by typing furiously at a command prompt.

Here’s a different take on wizards. Think about wizards, say, in the Harry Potter novels. Wizards learn to say certain spells in certain situations. There’s never any explanation of why these spells work. They just do. Unless, of course, they don’t. Wizards are powerful, but they can be incompetent.

You might use wizard to describe someone who lacks curiosity about what they’re doing. They don’t know why their actions work, or sometimes even whether they work. They’ve learned a Pavlovian response to problems: when you see this, do this.

Wizards can be valuable. Sometimes you just need a problem solved and you don’t care why the solution works. Someone who doesn’t understand what they’re doing but can fix your problem quickly may be better than someone who knows what they’re doing but works too slowly. But if your problem doesn’t quite fit the intended situation for a spell, the wizard is either powerless or harmful.

Wizards can’t learn a better way of doing anything because “better” makes no sense. When you see problem A, carry out procedure B. That’s just what you do. How can you address problem A better when “solving A” means “do B“? Professional development for a wizard consists of learning more spells for more situations, not learning a better spell or learning why spells work.

Wizards may be able to solve your problem for you, but they can’t teach you how to solve your own problems.

Related posts:

The grand unified theory of 19th century math

The heart of 19th century math was the study of special functions arising from mathematical physics.

It is well known that the central problem of the whole of modern mathematics is the study of the transcendental functions defined by differential equations.

The above quote was the judgment of  Felix Klein (of Klein bottle fame) in 1893. The differential equations he had in mind were the second order differential equations of mathematical physics.

Special functions were the core of 19th century math, and hypergeometric series were the grand unifying theory of special functions. (Not every special function is hypergeometric, but quite a few are.) And yet they’re hardly taught any more. I never heard of hypergeometric series in college, even though I studied differential equations and applied math. Later I encountered hypergeometric functions first in combinatorics and only later in differential equations.

It’s odd that what was “the central problem of the whole of modern mathematics” could become almost a lost art a century later. How could this be? I believe part of the explanation is that special functions, and hypergeometric function in particular, fall between two stools: too advanced for undergraduate programs but not a hot enough of a research area for graduate programs.

Consulting in differential equations

Accelerated learning

Derek Sivers tells how a mentor was able to teach him a semester’s worth of music theory in three hours. His mentor also prepared him to place out of four more classes in four sessions. He gives the details in his blog post There’s no speed limit. It’s an inspiring story.

However, Sivers didn’t go through his entire education this way. He finished his degree in 2.5 years, but at the rate he started he could have finished in under a semester. Obviously he wasn’t able to blow through everything as fast as music theory.

Some classes compress better than others. Theoretical classes condense better than others. A highly motivated student could learn a semester of music theory or physics in a short amount of time. But it would take longer to learn a semester of French or biology no matter how motivated you are because these courses can’t be summarized by a small number of general principles. And while Sivers learned basic music theory in three hours, he says it took him 15 years to learn how to sing.

Did Sivers’ mentor expose him to everything students taking music theory classes are exposed to? Probably not. But apparently Sivers did learn the most important material, both in the opinion of his mentor and in the opinion of the people who created the placement exams. His mentor not only taught him a lot of ideas in a short amount of time, he also told him when it was time to move on to something else.

It’s hard to say when you’ve learned something. Any subject can be explored in infinite detail. But there comes a point when you’ve learned a subject well enough. Maybe you’ve learned it to your personal satisfaction or you’ve learned it well enough for an exam. Maybe you’ve reached diminishing return on your efforts or you’ve learned as much as you need to for now.

One way to greatly speed up learning is to realize when you’ve learned enough. A mentor can say something like “You don’t know everything, but you’ve learned about as much as you’re going to until you get more experience.”

Occasionally I’ll go from feeling I don’t understand something to feeling I do understand it in a moment, and not because I’ve learned anything new. I just realize that maybe I do understand it after all. It’s a feeling like eating a meal quickly and stopping before you feel full. A few minutes later you feel full, not because you’ve eaten any more, but only because your body realizes you’re full.

Related posts:

Economics in one sentence

From Economics in One Lesson:

… the whole of economics can be reduced to a single lesson, and that lesson can be reduced to a single sentence. The art of economics consists in looking not merely at the immediate but at the longer effects of any act or policy; it consists in tracing the consequences of that policy not merely for one group but for all groups.

Related post: One thing to remember in economics

Deleting the Windows recycle bin desktop icon

I’ve never kept many icons on my desktop, and tonight I decided to reduce the number to zero. Deleting the recycle bin icon took a little research.

Windows Vista will let you simply delete the recycle bin but other versions of Windows will not.

On Windows 7 you can right-click on the desktop, select Personalize -> Change desktop icons, and uncheck the box for the recycle bin.

On Windows XP, you can edit the registry as described here. The registry changes will take effect next time you log in. [Update: unfortunately the link is no longer available.]

If you don’t want to edit your XP registry, you can right-click on the desktop, select the Arrange Icons By menu, and uncheck the Show Desktop Icons menu. However, this will hide all icons, not just the recycle bin, and will not let you see anything you drag to the desktop until you re-check Show Desktop Icons.

If you miss the recycle bin icon, it’s still in the file explorer on the left side.

Related post: Using Windows without a mouse

Odd perfect numbers

Yesterday I wrote about even perfect numbers. What about odd perfect numbers? Well, there may not be any.

I couldn’t care less about perfect numbers, even or odd. But I find the history and the mathematics surrounding the study of perfect numbers interesting.

As soon as you define perfect numbers and start looking for examples, you soon realize that all your examples are even. So people have wondered about the existence of odd perfect numbers for at least 2300 years.

No one has proved that odd perfect numbers do or do not exist. But people have proved properties that odd perfect number must have, if there are any.  So far, although the requirements for odd perfect numbers have become more demanding, they are not contradictory and it remains logically possible that such numbers exist. However, most experts believe odd perfect numbers probably don’t exist. (Either odd perfect numbers exist or they don’t. How can one say they “probably” don’t exist? See an explanation here.)

Wikipedia lists properties that odd perfect numbers must have. For example, an odd perfect number must have at least 300 digits. It’s interesting to think how someone determined that. In principle, you could just start at 1 and test odd numbers to see whether they’re perfect. But in practice, you just won’t get very far.

A year is about 10^7.5 seconds (see here). If you had started testing a billion (10^9) numbers a second since the time of Euclid (roughly 10^3.5 years ago) you could have tested about 10^20 numbers by now. Clearly whoever came up with the requirement N > 10^300 didn’t simply use brute force. There may have been some computer calculation involved, but if so it had a sophisticated starting point.

Related: Applied number theory

Even perfect numbers

I just got a review copy of Maths 1001 by Richard Elwes. As the title may suggest, the book is a collection 1001 little math articles. (Or “maths articles” as the author would say since he’s English.) Most of the articles are elementary though some are an introduction to advanced topics. Here’s something I learned from an article that was somewhere in the middle, the connection between perfect numbers and Mersenne primes.

Euclid (fl. 300 BC) proved that if M is a Mersenne prime then M(M+1)/2 is perfect. (A number is “perfect” if it equals the sum of its divisors less than itself. For example, 6 = 1 + 2 + 3 and 28 = 1 + 2 + 4 + 7 + 14. A Mersenne prime is a prime of the form 2n – 1.) Euclid didn’t use the term “Mersenne prime” because Mersenne would come along nearly two millennia later, but that’s how we’d state Euclid’s result in modern terminology.

The converse of Euclid’s result is also true. If N is an even perfect number, then N = M(M+1)/2 where M is a Mersenne prime. Ibn Al-Haytham conjectured this result in the 10th century but it was first proved by Leonard Euler in the 18th century. (What about odd perfect numbers? See the next post.)

I’ve enjoyed reading Maths 1001. I’ll flip through a few pages thinking the material is all familiar but then something like the story above will stand out.

Update: Richard Elwes informs me that his book is published under the title Mathematics 1001 in the US. My review copy was a British edition.

Related: Applied number theory

Blasted through a riverbed

In 1916, Marshall Mabey was working on a subway tunnel under New York’s East River. Compressed air was pumped into the tunnel to keep the soft earth between the river and the tunnel from caving in. A crack formed in the tunnel ceiling and Mabey was blown through the crack, through the river, and 25 feet into the air. He fell back into the river and was rescued. He survived unscathed and said he planned to go right back to work. The original New York Times account of the blow out is available here.

Marshall Mabey’s story is amazing. But I also found his wife’s reaction remarkable even though I imagine it was unremarkable at the time.

Of course I know that Marshall is in danger every time he goes to work but all work is dangerous and my husband is as careful as he can be. His job is a good one and I am glad he has it.

Object oriented vs. functional programming

From Michael Feathers:

OO makes code understandable by encapsulating moving parts.
FP makes code understandable by minimizing moving parts.

This explains some of the tension between object oriented programming and functional programming. The former tries to control state behind object interfaces. The latter tries to minimize state by using pure functions as much as possible.

It’s understandable that programmers accustomed to object oriented programming would like to add functional programming on top of OO, but I believe you have to make more of an exclusive commitment to functional programming to get the most benefit. For example, pure functions are easier to debug and to execute in parallel due to their lack of side effects. But if your code is only semi-functional, you can’t have the same confidence in testing your code or in spreading it across processors.

James Hague argues that 100% functional purity is impractical and that one should aim for 85% purity. But the 15% impurity needs to be partitioned, not randomly scattered across your code base. A simple strategy for doing this is to use functional in the small and OO in the large. Clojure also has some very interesting ideas for isolating the stateful parts of a program.

Related post: Pure functions have side effects

Mathematically correct but psychologically wrong

The snowball strategy says to pay off your smallest debt first, then the next smallest, and so on until you’re out of debt.

When I first heard of this I thought it was silly. Clearly the optimal strategy is to pay off the debt with the highest interest rate first. That assessment is mathematically correct, but psychologically wrong. The snowball strategy provides a sense of accomplishment and encouragement by reducing the number of debts as soon as possible. Ideally someone would be able to pay off at least one debt before their determination to get out of debt wanes.

My point here isn’t to give financial advice. I bring up the snowball strategy because it is an example of a problem with an obvious but naive solution. If someone is overwhelmed by debt, they need encouragement more than a mathematically optimal strategy. However, the snowball strategy may not be psychologically optimal for everyone. This further illustrates the idea that optimal real-life strategies are more complicated than mathematical models.

Many things that don’t look optimal are in fact optimal once you take the necessary constraints into account. For example, software that seems poorly designed may in fact have been brilliantly designed when you consider its economic and historical constraints. (This may even be the norm. Nobody complains about how badly obscure software was designed. We complain about software that has been successful enough to criticize.)

Related posts:

Sledgehammer technique for trig integrals

There’s a powerful integration trick that I don’t believe is too widely known. Some calculus books mention it in a footnote, but few emphasize it. This is unfortunate since this trick applies to more problems than many of the more ad hoc techniques that are commonly taught.

Karl Weierstrass (1815-1897) came up with the idea of using t = tan(x/2) to convert trig functions of x to rational functions of t. If t = tan(x/2), then

  • sin(x) = 2t/(1 + t2)
  • cos(x) = (1 – t2) / (1 + t2)
  • dx = 2 dt/(1 + t2).

This means that any integral of a rational function of sines and cosines can be converted to an integral of rational function of t. And any rational function of t can be integrated in closed form by using partial fraction decomposition, though the partial fraction decomposition may need to be performed numerically.

I call this the sledgehammer technique because it’s overkill for the simplest trig integrals; other less general techniques are easier to apply in such problems. On the other hand, Weierstrass’ technique is very general and can evaluate integrals that look impossible at first glance.

Related posts:

Click to learn more about numerical integration consulting

Bias and consistency

Suppose you have two ways to estimate something you’re interested in. One is biased and one is unbiased. Surely the unbiased method is better, right? Not necessarily. Statistical bias is not as bad as it sounds.

Under ideal conditions, an unbiased estimator gives the correct answer on average, but each particular estimate may be ridiculous. Suppose you ask me to estimate how many dwarfs were in Snow White and the Seven Dwarfs. If I alternately guess 100 and -272, each guess will be wildly wrong. But if 75% of the time I guess 100 and 25% of the time guess -272, my average guess will be 7 and so my estimates will be unbiased. But if half the time I guess 8 and half the time I guess 7, my average guess will be 7.5 and my process will be biased. However, each estimate will be more accurate.

Consistency is a weaker condition than unbiasedness. Consistency says that if you feed your method enough data generated from your assumed model, your estimates will converge to the correct value.

But if your model is not exactly correct (and it never is) will you get a reasonably good result? It’s possible for an inconsistent method to provide good results in practice and it’s possible that a consistent method may not.

In his blog post on cross validation, Rob Hyndman mentions a paper that shows one validation method is consistent and another is not. Rob concludes

Frankly, I don’t consider this is a very important result as there is never a true model. In reality, every model is wrong, so consistency is not really an interesting property.

In the context of his post, Rob argues that the most important test of a statistical method is how well it predicts future data. Some people have commented that this comes down too hard on consistency. But we’re talking about a blog post, and blogs don’t use the same kind of carefully qualified language that formal papers do. Perhaps in a more formal setting Rob might argue that a gross failure of consistency gives one reason to suspect a method won’t predict well, but a lack of complete consistency shouldn’t remove a method from consideration. Such language may be inoffensive, but it lacks the verve of his original statement.

Too often bias and consistency are seen as all-or-nothing properties. In theoretical statistics, one typically asks whether a method is biased, not how biased it is. The same is true of consistency. Bias and consistency are only two criteria by which methods can be evaluated. A small amount of bias or inconsistency may be an acceptable trade-off in exchange for better performance by other criteria such as efficiency or robustness.

Related posts:

For daily tips on data science, follow @DataSciFact on Twitter.

DataSciFact twitter icon