Graphical comparison of programming languages

Guillaume Marceau posted an excellent article yesterday that gives a graphical comparison of numerous programming languages. (The page failed to load the first time I tried to load it and it loaded slowly on my second attempt. Be patient and keep trying if it doesn’t work at first.)

It took me a while to realize that the graph axes are the reverse of my expectations. The axes are undesirable quantities — slowness and code size — and so the ideal is in the lower left. Usually comparisons use desirable quantities for the axes — in this case, efficiency and expressiveness — so that the ideal is up and to the right.

Killing too much of a tumor

The traditional approach to cancer treatment has been to try to eradicate tumors. Eliminating a tumor is better than shrinking a tumor, so this approach makes sense. But if you try to eradicate the tumor and fail, you may leave the patient worse off. If you kill 90% of a tumor with some treatment but leave 10%, the remaining 10% is resistant to that treatment. You may have made the tumor more deadly by removing the weaker portions that were suppressing its growth. This explains why cancer treatments sometimes appear to be quite successful, dramatically reducing the size of tumors, without improving survival.

Sometimes one treatment will shrink a tumor as much as possible as a prelude to another treatment, such as shrinking a tumor with chemotherapy prior to surgery. But if only one treatment is being used, the situation may be like the old saying that you don’t want to wound the king. If you’re going try to kill the king, you’d better succeed.

In a recent interview on the Nature podcast, Robert Gatenby of Moffitt Cancer Center advocates an alternative approach, treating cancer as a chronic disease. Instead of killing as much of a tumor as possible, it may be better to kill as little of tumor as necessary to keep it under control. Patients would continue to take anti-cancer treatments for the rest of their lives, just as patients with heart disease or diabetes take medication indefinitely.

Related post: Repairing tumors

OS ecosystems

Colin Howe wrote an interesting article last week comparing the Windows and Ubuntu worlds, not the operating systems per se. Feature-by-feature comparisons of operating systems are not that helpful. Contemporary operating systems have a lot in common in their details, but they create very different ecosystems. These ecosystem differences are not apparent at first, but in the long run they dominate the experience of using an operating system.

You can run a lot of the same software across different operating systems, but using software that wasn’t originally designed with your OS in mind can be like importing an invasive species. It may work at first but cause you grief over time when it doesn’t play well with others.

Related posts:

The world looks more mathematical than it is

From Orthodoxy by G. K. Chesterton:

The real trouble with this world of ours is not that is an unreasonable world, nor even that is a reasonable one. The commonest kind of trouble is that is nearly reasonable, but not quite. Life is not an illogicality; yet it is a trap for logicians. It looks just a little more mathematical and regular than it is; its exactitude is obvious, but its inexactitude is hidden; its wildness lies in wait.

Variations on a theme of Newton

Isaac Newton famously said

If I have seen farther than others it is because I have stood on the shoulders of giants.

Later Mathematician R. W. Hamming added

Mathematicians stand on each other’s shoulders while computer scientists stand on each other’s toes.

Finally, computer scientist Hal Abelson quipped

If I have not seen farther, it is because giants were standing on my shoulders.

(Thanks to Mark Reid for the Hamming quote.)

Off to Puerto Rico

I’m leaving today for San Juan. I’m giving a couple talks at a conference on clinical trials.

Puerto Rico is beautiful. (I want to say a “lovely island,” but then the song America from West Side Story gets stuck in my head.) Here are a couple photos from my last visit.

Down’s syndrome and cancer

The most recent Nature podcast (21 May 2009) has a news story about Down’s syndrome and cancer. Most types of cancer are much less common among people with Down’s syndrome. Since Down’s syndrome is caused by an extra copy of chromosome 21, researchers naturally want to know whether a gene on that chromosome is responsible for the reduced incidence of cancer. The podcast interviews researchers from two promising studies of candidate genes.

Here is the abstract of the medical paper discussed on the podcast.

Related post: Cartoon guide to cancer research

Amazing jazz musician

Brian Lopes is amazing. I’d never heard of him until he was featured on the Eclectic Mix podcast a few days ago. The podcast describes his music “a high energy expedition crossing from jazz to R&B to funk and back again.” On his web site, Brian Lopes lists as his influences John Coltrane, Michael Brecker, Wayne Shorter, David Sanborn, and Cannonball Adderly. These are some of my favorite musicians, and listening to Lopes is like listening to all of these at once.

Apparently he only recently started recording with his own group, the Brian Lopes Trio. According to the podcast, Brian Lopes has played with Chick Corea, Frank Sinatra, Aretha Franklin, Ray Charles, and other well known musicians. Finding his music is difficult, but you can buy his first CD at Blue Canoe Records. (Apparently you can’t actually buy a physical CD, but you can buy the MP3 files, sans DRM, that make up the CD.)

Image credit: Eclectic Mix podcast

Related posts:

The silver ratio

Most people have heard of the golden ratio, but have you ever heard of the silver ratio? I only heard of it this week. The golden ratio can be expressed by a continued fraction in which all coefficients equal 1.

 1 + \cfrac{1}{1+\cfrac{1}{1+\cfrac{1}{1+\cdots}}}

The silver ratio is the analogous continued fraction with all coefficients equal to 2.

 2 + \cfrac{1}{2+\cfrac{1}{2+\cfrac{1}{2+\cdots}}}

You might think for a moment that the silver ratio should be just twice the golden ratio, but the coefficients contribute to the series in a non-linear way. The silver ratio actually equals 1 + √2. The golden ratio has a simple geometric interpretation. I don’t know of a geometric interpretation of the silver ratio. (Update: See Maxwell’s Demon for geometric applications of the silver ratio.)

A previous post mentioned that the golden ratio and related numbers are the worst case for Hurwitz’s theorem. The silver ratio and its cousins are the second worst case for the theorem.

Related posts:

For daily tweets on algebra and other math, follow @AlgebraFact on Twitter.

AlgebraFact logo

Microsoft Ramp Up

A recent .NET Rocks podcast featured Doug Turnure and Johanna White talking about Ramp Up, a new free online training program from Microsoft. It sounds like this program will organize and revise a lot of the scattered training material that Microsoft has produced.

I liked two things I heard about Ramp Up. First, the material for each course will be offered in multiple formats and from multiple perspectives such as conceptual overviews, code-centric drill downs, articles, videos, audio podcasts. Second, they’re not just going to focus on the latest technology. In the past, it’s been easiest to find material on software that hasn’t even been released, followed by the current shipping version. After that, good luck finding material on anything a release or two behind the latest. Microsoft has said that Ramp Up will leave their material online as new versions come out.

Breastfeeding, the golden ratio, and rational approximation

Gil Kalai’s blog featured a guest post the other day about breastfeeding twins.

The post commented in passing that

φ, the golden ratio, is the number hardest to approximate by rationals.

What could this possibly have to do with breastfeeding? The post described a pair of twins with hunger cycles sin(t) and sin(φt), functions that hardly ever come close to synchronizing. The constant φ is difficult to approximate by rational numbers, in a sense that I describe below, and this explains why the two functions are so often out of sync.

graphs of sin(t) and sin(φ t)

In one sense, φ is very easy to approximate by rationals. The ratio of any two consecutive Fibonacci numbers is a rational approximation to φ, the approximation improving as you go further out the Fibonacci sequence. The same is true for any generalized Fibonacci sequence, though the approximation may not be very good until you go out a ways in the sequence, depending on your starting values. So φ is easy to approximate in the sense that it is convenient to think of approximations.

Now let’s look at the sense in which φ is hard to approximate. How accurately can you approximate an irrational number ξ by a rational number a/b? Obviously you can do a better and better job by picking larger and larger fractions. For example, you could always take the first n digits of the decimal expansion of ξ and use that to make a rational approximation with denominator 10n. But that might be very inefficient. How well can you approximate ξ relative to the size of the denominator? This question is answered in general by a theorem of Hurwitz.

Given any irrational number ξ, there exist infinitely many different rational numbers a/b such that

\left| \xi - \frac{a}{b} \right| < \frac{1}{\sqrt{5}\, b^2}

The decimal expansion idea mentioned above is wasteful because the error goes down in proportion to the denominator, while Hurwitz theorem says it’s possible for the error to go down in proportion to the square of the denominator.

Can we do any better than Hurwitz theorem? For example, is it possible to replace √5 with some larger constant? Not in general, and the golden ratio φ provides the counterexample to any would-be refinements of Hurwitz theorem. The constant φ is a worst case. That is the sense in which φ is the number hardest to approximate by rationals. If φ and some related numbers are excluded, then the constant √5 can be increased.

Going back to breastfeeding, suppose the twins had hunger cycles sin(t) and sin(ξt). If ξ is irrational, the two curves will never exactly have the same period. But if ξ were equal to a rational number a/b, then the two functions would have a common period of length bπ if a is even or of length 2bπ if a is odd. If ξ were (approximately) equal to a/b with b small, the feedings would often synchronize. Since φ requires large values of b to make a good rational approximation, ξ = φ is a worst case.

Related posts:

Don’t standardize education, personalize it

I just finished reading Ken Robinson’s book The Element. The title comes from the idiom of someone being in his or her “element.” The book is filled with stories of people who have discovered and followed their passions.

Here are a couple quotes from the book regarding standardized education.

The fact is that given the challenges we face, education doesn’t need to be reformed — it needs to be transformed. The key to this transformation is not to standardize education but to personalize it, to build achievement on discovering the individual talents of each child, to put students in an environment where they want to learn and where they can naturally discover their true passions.

Learning happens in the minds and souls of individuals — not in the databases of multiple-choice tests. I doubt there are many children who leap out of bed in the morning wondering what they can do to raise the reading score for their state. Learning is a personal process …

Here is a talk Ken Robinson gave at TED in 2006 that led to his writing The Element. The video is entertaining as well as thought-provoking.

Related posts:

The Medici Effect

I was reading a chapter from The Element this evening that reminded me of The Medici Effect.

ACM Ubiquity had an interview with Frans Johansson, author of The Medici Effect, around the time the book came out. The title comes from the idea that it takes more than just genius to create a Leonardo da Vinci. It also takes the community of a Renaissance Florence, made possible by patrons like the Medici family.

I thought it was a great premise for a book and bought the book shortly after reading the interview. Unfortunately, the book didn’t live up to my expectations. I recommend the interview, but I’m not as enthusiastic in my recommendation of the book.

Related post: Don’t standardize education, personalize it