Telescope on the dark side of the moon

The 60-Second Science podcast from February 27, 2008 tells of plans for NASA and MIT to build a giant radio telescope on the dark side of the moon. (The “dark” side is really the “far” side, the side that always faces away from Earth. It gets just as much sunlight as the side we’re familiar with.) This side of the moon is shielded from radio noise from Earth, and so a radio telescope there could detect radio signals further back in time than is possible here. The plan is to use robots to assemble radio antennas over two square kilometers.

What to make "u" in integration by parts

Integration by parts says

integration by parts

The first question students ask is What do I make ‘u’ and what do I make ‘dv’? I used to tell my students to set ‘u’ equal to the part you’d rather differentiate and ‘dv’ equal to the part you’d rather integrate. That’s not bad advice, but it begs the question “How do I know what I want to differentiate and what I want to integrate?” Until you have some experience and intuition, that’s hard to answer.

Here’s a good rule of thumb: set ‘u’ to the first term you see on this list:

  1. logarithm
  2. inverse trig function
  3. algebraic function
  4. trig function
  5. exponential

This rule doesn’t cover everything — no rule can — but it works remarkably well. I don’t remember just where I found this; I believe it was in an article somewhere. I’m fairly certain I’ve never seen it in a calculus textbook.

Update: I found the reference for the rule above. “A Technique for Integration by Parts” by Herbert E. Kasube. American Mathematical Monthly, March 1983, page 210.


One of my professors once told me that you learn the fastest when you’re slightly confused. If you’re too confused, you’re likely to give up in frustration. But if you’re not confused at all, you’re either not learning or learning very slowly. Slight confusion is the optimal state where you’re holding unresolved ideas in your head and making connections.

Confusion shows you’re thinking deeply enough to be confused. It takes effort to be confused rather than complacent.

Sometimes a muse will stir confusion in your mind on a previously settled topic. You can try dismiss the muse as you would a housefly, or you can pursue a resolution to the confusion. You can find relief from your confusion by apathy or by hard work. If you choose to push through the confusion to resolution, your confidence will initially decrease even as your understanding increases. If you’re vocal about your confusion, you will invite ridicule. Confusion takes courage.

What a probability means

My daughters and I went to a CoinStar machine last night to convert a huge bowl of change into an Amazon gift card. The question came up of the probability of the total coming out an even dollar amount. My oldest said this had probability 1/100. My second oldest asked why we could talk about probabilities at all since the bowl just contained whatever it contained. Without knowing it, they represented the two major schools of probability interpretation, subjectivist and frequentist.

Subjectivists use probabilities to represent degrees of human belief or uncertainty, as well as frequencies. A subjectivist would argue that while content of the bowl is not a random variable, our knowledge of that content is.

Frequentists shy away from such psychological interpretations of probability. A frequentist might come to the same 1/100 probability estimate but would interpret the statement as follows. “If we were to randomly fill the bowl with coins many times and take it each time to the CoinStar machine, in about 1 out of 100 trips on average we would end up with a whole dollar amount.”

To look at another example, suppose an Oxford librarian discovered a manuscript and suspected it of being a previously unknown Shakespeare play. He might analyze word choice frequencies to come up with a probability that the play was indeed written by Shakespeare. He might conclude, for example, that there is an 80% chance that The Bard wrote the play. This would be a subjective probability since the 80% figure is a statement about the librarian’s confidence, not about the manuscript itself.

A strict frequentist would object that this is all nonsense: either Shakespeare wrote the manuscript or he didn’t, so there’s no probability involved. He might try to salvage the probability interpretation by speculating about what would happen if we were to discover and analyze an infinite number of similar manuscripts.

Code to make an XML sitemap

Here’s some Python code to create a sitemap in the format specified by and read by search engines. Download the file sitemapmaker.txt and change the extension from .txt to .py.

Change the url variable in the script before running it or else you’ll point search engines to my web site rather than yours. Also, edit the file extensions_to_keep variable if you want to index any file types besides HTML and PDF.

Copy the file to the directory on your computer where you have your files. Run the script and direct its output to a file, > sitemap.xml. See for instructions on how to let search engines know about your sitemap.

This code assumes all the files to index in your sitemap are in one directory, the directory you run the script from. It also assumes the timestamps on your computer match those on your web server. Optional fields are left out of the sitemap.

Everything begins with "p"

There’s only one symbol in statistics, “p”. The same variable represents everything. You just get used to it and figure out which p is which from context. It reminds me of George Forman naming all five of his sons George. Here’s an example I ran across recently where p represents four different functions in one equation:

p(θ | x) = p(x | θ) p(θ) / p(x)

Usually this is done with no explanation, but in the example above the author explains that he’s denoting entirely different functions with the same symbol in order to avoid the “clumsy notation” that being explicit would require. 

Sometimes the overloading of the 16th letter of the English alphabet becomes just too much and statisticians break down and use the Greek counterpart, π (pi). So then to make matters even more confusing to the uninitiated, π can be a variable or a function.

Sample code sites

Here are two sites with sample code in dozens of programming languages.

PLEAC (Programming Language Examples Alike Cookbook) takes the Perl Cookbook as its template and implements the examples in 25 languages. Some languages are more complete than others. For example, Python is about 85% complete while Erlang is down at 2%.

Rosetta Code is a Wiki with sample code in 86 languages. As with PLEAC, some languages are better represented than others. The site lets you search by task or by language.

Technical papers posted

I added two technical articles to my personal web site this evening.

Step size for numerical differential equations is a one-page set of notes on how to select the optimal step size when numerically solving ODEs (ordinary differential equations).

Separation of convex sets in linear topological spaces is a highly technical article I wrote a long time ago. I decided to put it on the web in case someone finds it useful. It’s a fairly obscure topic, but this paper covers it thoroughly.

I maintain two pages for articles, one for informal notes and one for academic publications. I went back and added my old PDE papers to my academic publications page this evening.

Update: Posted an old PDE paper, Distributed Systems of PDE in Hilbert Space.


Phil Windley recently released a podcast about OpenDNS. My first thought was to wonder why anyone would want to tweak their DNS, except for the most sophisticated users. But in some ways, the least sophisticated users have the most to gain from a service like OpenDNS since it provides extra protection from online mischief.

Periodic table of Perl operators

Mark Lentczner has posted a periodic table of Perl operators. The table shows Perl 6 in all its Byzantine glory. If you work in the language constantly and enjoy the terse syntax optimized for experts, you’ll love Perl 6. But if you’re already having difficulty holding Perl in your head, this periodic table might be the straw that breaks the camel’s back.

 Periodic table of Perl 6 operators

Probability distribution relationships

In 1986, Lawrence Leemis published a paper containing a diagram of 43 probability distribution families. The diagram summaries connections between the distributions with arrows: chi-squared is a special case of gamma, Poisson is a limiting case of binomials, the ratio of two standard normals is a Cauchy, etc. It’s a very handy reference, a sort of periodic table for statisticians. His diagram and variations have appeared in several text books over the last 20 years, such as Casella and Berger.

Now Leemis has published an expanded version containing 76 probability distributions. The paper is in the February 2008 issue of American Statistician and is also available online. The heart of the article is the diagram on page 3.

portion of Leemis chart

Update: See clickable distribution diagram

Free bitmap to vector format software

VectorMagic is a free online tool from the Standford University AI lab for converting bitmap images to vector formats. The image below shows an example of what you might use this tool for.

bitmap to vector conversion

I just heard about the software and tried it out with a fairly complex image, a sample of Japanese calligraphy, and it did a beautiful job converting the image from bitmap to EPS (Encapsulated PostScript).

The software supports JPEG, GIF, PNG, BMP, and TIFF input. It supports EPS, SVG, and PNG output.

(In case you’re not familiar with graphic formats, a bitmap image is a matrix of dots. The format records what color each dot is. That works fine when an image is displayed at its original resolution. But if you make the image bigger, you just get bigger dots and things look grainy. A vector format stores the formulas for the curves that make up the image, not the dots, and computes the dots when it’s time to display the image. If you make an image larger, it computes new dots according to the formulas. Software for making bitmaps smaller is common. Software that does a good job of making bitmaps larger is rare.)

Update: VectorMagic has moved to a new domain. I’ve corrected the link above.

What to make flexible

In the book Universal Principles of Design by William Lidwell, Kritina Holden, and Jill Butler, the authors have this to say about the flexibility-usability trade-off.

It is a common assumption that designs should always be made as flexible as possible. However, flexibility has real costs in terms of complexity, usability, time, and money; it generally pays dividends only when an audience cannot clearly anticipate its future needs.

Good design is not about making everything flexible. It’s about making the right things flexible, and making other things more rigid. Good design could be described in terms of what is rigid as much as in terms of what is flexible. The art is knowing which things to make flexible, while casting other things in stone. 

Why programmers cannot be managed

Interaction design guru Alan Cooper gave a presentation recently entitled An Insurgency of Quality. As part of his talk, he explains why programmers cannot be managed. Traditional management has an industrial age mindset, while software development is a post-industrial craft. That mismatch explains a great deal. For example, industrial workers respect authority, but programmers respect competence.  

According to Cooper, the leader of a group of programmers should be a facilitator, not a manager. Johanna Rothman in her interview on the Pragmatic Programmer podcast elaborates on this same view. The manager’s job is to remove obstacles to productivity — acquire resources, provide protection from interruptions and distractions, etc. — rather than to manage in the industrial sense.