## 31 May 2010

The PhD you get is the PhD you work for. Just because your advisor has certain expectations for you in mind doesn't meant that you can't exceed them! Here are some ways you can surprise your advisor:
• Be involved in other projects. For example, even though it's not your research area, do you like parallel programming? Then go to the weekly meetings. Then, if something related to parallel programming comes up, you can make your advisor's jaw drop when you are fluent in it. Obviously, you can over do this. Don't let it get in the way of your primary duties.

• Know the conferences. You should know the top conferences in your area. Check out their pages and see what the upcoming deadlines are, and what the co-located workshops are. Mark deadlines in your calendar. Study the members of the PC, and find out more about their work.

• Understand your group project. Are you part of a five person group? Don't stick to just knowing and studying "your part" of it-- look at what your teammates are doing and seek to understand their part too. This could help your own work because you can understand the bigger context. For example, you might think of a way the overall system can be improved. Or, you might help your teammate by showing them a related work you found on your own.

• Generate ideas. Science is an art. There are no fixed ways for you to consistently generate brilliant ideas that have impact. But here are some things I've found helpful:
1. Aim Big - Go for the real problems that bug you. Go for the Holy Grails. Do so with concrete ideas. If you've aimed high enough, there's probably a dissertation in there.
2. Read - The best way I get ideas is reading other people's work. Always make notes when reading, and then later process these notes as a source for papers to work on. A dozen bad ideas that lead to a workable idea makes it all worth it.
3. Combine - Bring a separate interest into your research area, and see what you get. I came up with the idea for my dissertation when I asked my wife, who has a background in fine art, what "deconstructive programming" would look like. Her answer helped shape my big idea into something I could build.

## 24 May 2010

### The Clipart Syndrome

Michael Ernst has some super advice for giving a talk. One point is subtle and deserves extra attention:
"When giving a presentation, never point at your laptop screen, which the audience cannot see."
You should interpret this broadly and metaphorically, not just literally. When you point to a part of a slide, you are pointing to it because it reminds you of something.

Take a simple example with harmless clipart: You might have thought deeply about some concept when making your slides, and picked out a drawing to fit what you had in mind. Now, when you see that clipart, you get an immediate association with that concept you had in mind. It's a mistake to think that pointing to that same piece of clipart will resonate with your audience the same way it does with you.

It follows that this doesn't have to be clipart, either. It could have been a word you chose, a slogan you conjured, or a diagram you constructed. You must be very careful that it means the same thing to the audience that it does to you.

One of the worst ways this clipart syndrome manifests itself is when it applies to the whole slide. When you see a slide, you immediately think about what was on your mind when you made it. I've seen some speakers, who weren't even short on time, bring up a slide filled with text, talk about it using different terminology, and then skip to the next slide before I could even skim the first half of it.

The clipart syndrome applied to a whole slide can also make an audience motion sick. An unprepared speaker might jump forward five slides, because while on their feet they thought of a great connection to other material, and then later jump backward ten slides, because they just thought of another cool connection. When doing such slide jumps, the audience might not even know if the speaker is going forward or backward. [And the speaker isn't even going to show the slide long enough for it to sink in even if it could!] If you must jump to a slide, use the menu to navigate to it directly. This will spare the audience from seeing that fly-in animation happen five times.

***
The reason there is a reference problem in the first place is due to the lack of context.

Your audience has little or no context for your work, while you have been deep in the trenches so long, the context is the only way you see the world. That's why motivation is so important. When you show that something is a problem, keep in mind that your audience might not even see how the problem is a problem. You will need to be explicit: Not only do you say what the problem is, you should say what the implications of that problem are, and what opportunities are missed.

The goal is for the audience to think in the first minute "this might not be my area, but thank god someone is working on this and that this solution exists."

***
You should also banish the temptation of making your talk or publication a mystery novel. One trap I've noticed students fall into is making their talk mirror the structure of a mathematical proof. That means the talk begins with some definitions, some more definitions, a discussion of the actual material, and then, only at the very end, do you see where all of it was going. I can't stress enough that audiences-- even students in a lecture-- won't appreciate this approach.

Perhaps you've even come up with a great definition that generalizes your contributions and it became a real ah-ha moment and breakthrough in your work. Your ah-ha will just look like clipart to someone else if you don't provide it with the context it needs.

## 23 May 2010

### Approximations and the tools you have

If you are interested in finance then you might be aware of The Rule of 72. The basic idea is if your investment gets interest at some percentage r each year (e.g., a ten percent return implies r=10), then you'll have to wait 72/r years before your investment doubles. That means stocks that have an annual return of about 10 percent will double in 7.2 years. (Note: If you account for inflation, stocks have an annual return of 7%.)

I thought the rule was slick, but when trying to do the math things just didn't add up. You can try constructing the recurrence relation yourself, or you can read moneychimp's explanation. The formula I got was to calculate the log of 2 (two for doubling), base (1 + r/100); it turns out the whole time that the rule of 72 is just an inverse linear approximation to the logarithmic function. But it is mostly right for the ranges people would care about. (For a rate of 5%, the log gives you 14.2 years, while the rule of 72 gives you 14.4; for a rate of 50%, the log gives you 1.7, while the rule of 72 gives you 1.44.)

f(x)=72/x is a really simple function, and when comparing the plots of the two functions it is pretty impressive how close it is:

I like the times when all of the math I've learned, even the basic concepts, become useful in analyzing other things. A computer scientist isn't trained in finance, but knowing that what you've learned can be applied widely can empower you.

I had a physics professor who once quipped "men see parabolic trajectories more often than women do." [So as not to leave it too cryptic, he was referencing stand up urinals.] It's an interesting way of thinking about gravity, and it once made me realize something: A friend in Worcester was showing me his "movie" gun (i.e., it wasn't real) and I considered the scope. I knew that scopes were meant for different target ranges, and it was then that I realized that a scope on a gun is a linear approximation to a parabola. Each scope setting is meant for different ranges, which approximates different parts of the parabola. (Also, they only work with Earth's gravity.) I mention guns in my blog only because, after explaining this to my friend he said something funny: "Man, I should totally take you out shooting; you'd be such a great target... I mean shot."

***
Side note: If investment interests you, check out this piece on index funds by Scott Adams, author of Dilbert. The company referenced, Vanguard, is an excellent one due to its unique corporate structure: Customers are also shareholders in Vanguard, so the company always has the customer's best interests in mind. In our culture it's sometimes considered boorish to talk about money, but somebody's got to tell you about it! Particularly now that pensions are going away and that defined contribution plans are your responsibility, you should empower yourself by knowing as much as you can.

## 20 May 2010

### But what can you do about risk?

We've discussed the risk of graduate school, which has left Keyvan a little "distracted."

So, what can we do about that risk? To answer this question, it's easier to answer a much broader question. I found this one passage, quoted in a speech by Tom Malone (author of The Future of Work), to be helpful. Here is Tom, and then the quote:
"You probably have more choices than you realize. To make choices wisely, you need to think about what really matters to you."
"What can I actually do? The answer is as simple as it is disconcerting: we can, each of us, work to put our own inner house in order. The guidance we need for this work cannot be found in science or technology... but it can still be found in the traditional wisdom of mankind."
-- E.F. Schumacher, Small is Beautiful, 1973.

## 19 May 2010

### The Risks of Graduate School

Going to graduate school for your PhD is a risky endeavor. Here’s what’s on my mind:

Opportunity cost. By taking 5-6 years for a job that is very low pay (effectively at subsistence levels), you are forgoing a higher income and the advancement and promotions that 5-6 years work in the industry would give you. Assume a portion of that difference is invested at a return of 3-7%, and it’s a pretty large sum of money. Also, in the industry, a masters degree almost takes you as far a PhD would. Going for the masters-only has lower opportunity cost. Do the math and decide for yourself if a PhD is really worth it.

Getting scooped. You can put three years of work into a result, only to see a much larger and more substantial result be published or released by someone else, just as you are getting your LaTeX macros in order for your first publication. I knew a brilliant researcher at a top school working on a project for two years, only to see a major company release something for free that effectively enveloped the whole project. Often, when you are “scooped” by some related work, there is something different about your approach that makes your work still publishable; but sometimes that just doesn’t happen.

Market forces can’t be controlled. Say that you found grad school worth doing, and did all you could to avoid being scooped. That’s all and good, but when you graduate you might find that your dream research job is no longer available. Both 2009 and 2010 were bad years to be on the academic job market, where only some areas were in high demand. Many people are waiting it out in postdocs, but some have left the academy permanently. Who knows what the market will look like in 5 years.

If you knew it couldn’t fail, it wouldn’t be research. We don’t know if research projects will work. Alan Kay once said that if you aren’t failing 90% of the time, you aren’t aiming high enough. It could be that you have lots of great ideas that just don’t go anywhere, through no fault of your own. Such an “unlucky” person might still be able to form a thesis and graduate, but it might not be enough to launch a research career.

Relationships suck. Being a student is a human activity. You form a bond with your advisor the way an apprentice would with a master. If something harms that relationship, you might need to pick a new advisor and start all over again. The saddest possible way I’ve seen this happen was when a student highly specialized to his advisor’s area, and had to leave the program when his advisor passed away.

There are doors. Let’s be frank. Every time you walk out of your front door, you are taking a risk. Life is not about risks, per se; but living does not happen without risk. Staying inside is a risk, going outside is a risk, and so is standing in the doorway.

## 17 May 2010

### Painless Code Listings

Even though LaTeX is a tool of, by, and for computer scientists, it sure doesn't make it easy for you to include code samples in your papers. Sure, there is the verbatim package, but what if your code listing is too big, and the next font size down is too small? Also, how the heck do you draw a frame around the text?

Let's talk about it. Here's my solution:
• You should put line numbers in your code listings. This makes it easier to refer to particular parts of the code; easier for you in your exposition, or easier for your reviewers. It also seems to give the listing a clean, scientific look.
• Putting a box around the figure helps set it apart from the rest of the text, and avoids "bumping." However, LaTeX is surprisingly bad at letting you compose different commands; you can't just put an "fbox" around your verbatim and leave it at that. Instead, you need to construct it in an lrbox first, and then put the fbox around the lrbox.
• Actually, this box trick works well for the other problem: Finding the right font size. If you use a minipage, you can make it as exactly the number of columns wide as you need.
Here's it all put together:
\newsavebox{\savelisting}
\newenvironment{listing}
{\begin{lrbox}{\savelisting}
\begin{minipage}{4.5in}
\begin{flushleft}}
{\end{flushleft}
\end{minipage}
\end{lrbox}
\begin{center}
\resizebox{\columnwidth}{!}{\setlength\fboxsep{6pt}\fbox{\usebox{\savelisting}}}
\end{center}}

Then, use it in a figure like this:
\begin{figure}
\begin{listing}
\begin{verbatim}
01 void sort(int[] arr, int start, int end) { ... }
\end{verbatim}
\end{listing}
\caption{A code listing}
\end{figure}

Using the "times" package for the fonts, and the 4.5in minipage width, gives you 60 columns of code. (You could have different widths for different code listings, making each exactly what you need and no more, but then that would cause an inconsistency in size across your listings.)

Here's the result: