" /> Ezra's Research: August 2007 Archives

« June 2007 | Main | September 2007 »

August 30, 2007

The 'Attempt' Environment

If you're like me, you often try to prove things and don't finish the same day.

Perhaps you start by writing the word "Proof" at the beginning of a paragraph, and then start writing some of the bits of your proof, as you work them out. Perhaps you even use the nice LaTeX proof environment from the amsmath package, which puts a pretty, italic "Proof." at the beginning and finishes with a tidy square "tombstone" (modern shorthand for "that's all!"). This makes your work look very pretty while you're working on it, helping to motivate you.

Then, invariably, while you're working on the proof, someone else will come along and say, "What are you working on?" Keen about your latest ideas, you'll say, "Oh, I'm trying to show that foo equals bar, for suitable notions of 'foo' and 'bar.'" And then your interlocutor, someone far smarter than you, will start reading and soon find an error, or perhaps will find that some cases of a proof-by-cases are not filled in.

"That's not a proof!" this person will say.

"Oh, well, I didn't say it was a proof. It's just what I'm working on."

"But it says "proof" write there!" this person will say, pointing to that pretty italic Proof at the top of your paragraph.

"Oh, well..." you'll say, and start making sorry excuses for yourself.

If you're often in that situation, then I can help! I've developed a new LaTeX environment called attempt. It's for writing out proof attempts.

Here's how you use it. Paste this into your TeX file:

\newenvironment{attempt}
  {{\parindent 0pt \textit{Proof attempt.}}}
  {{\parindent 0pt \hfill \textit{End of proof attempt.}}}

Then, when you start writing a new proof, before doing anything else, put down this boilerplate and write inside it:

\begin{attempt}
% "proof" goes here
\end{attempt}

Now when that pesky expert peers over your shoulder, he or she'll see something like this:

Proof attempt. By induction on t. Case λx. N. I don't know what goes here. End of proof attempt.

That's setting expectations where they belong!

No need to pay me for the attempt environment! It's just one small contribution I'm happy to make to the field of CS research.

UPDATE: The amsthm package provides a better way to do this. Its proof environment admits optional text to begin the proof, as with \begin{proof}[Proof attempt]. And also, the \qedhere command (see my recent praise for it) gives a way to move the tombstone inside other environments, such as itemize, which would otherwise push the tombstone a couple lines down the page. So, herewith a newer, sleeker, attempt environment, for those using amsthm:

\newenvironment{attempt}
  {\begin{proof}[Proof attempt]
    \let\realqed=\qed \def\qed{\textit{\hfill End~of~proof~attempt.}}}
  {\end{proof}\def\qed{\realqed}}

August 21, 2007

Catenate

Word of the day: "catenate." It means much the same as "concatenate," which is arguably a pleonasm.

The root is Latin catena, meaning "chain," and is hence related to the lovely "catenary" (the arc made by a chain hanging free between two points).

August 14, 2007

On Creative Thinking

Thanks to Radu, I found this fantastic talk "On Creative Ideas" by Murray Gell-Mann, given earlier this year at Google. It's great to see a leading light of intellectual history, who first made his mark many decades ago, still active today and making a contribution, through speaking so articulately, cogently, and encouragingly about intellectual matters.

August 5, 2007

Memoizing pages

Tim Bray, "On Being for the Web":

What do ETags do? They allow you, when you fetch a Web resource, to send a short string along with the request saying “this is the signature you sent me for the version I know about”; then the server can look and see if the signature is still good, and if so not bother sending the data redundantly. Which is potentially a big, big win.

But also potentially not. If you look at actual real-world servers that are maxed out, they’re mostly maxing out on computation or back-end database traffic, not on bandwidth to the Net. So the saving that would be really valuable would be if you didn’t have to rebuild the requested page. Unfortunately, both Rails and Django rebuild the requested page, then compute the signature, then check the ETag. Which is extra run-time work in order to conserve a resource (Web bandwidth) that probably isn’t the problem.

This is sharp. Maybe web frameworks (or <cough /> web-centric languages) should provide support for easy memoization.

August 3, 2007

CS & Gender Notes from All Over

Duly noted:

UC Berkeley opened a program in 1983 as a pathway to graduate study in computer science for women and minority students who were underrepresented in Berkeley's crowded and competitive program. Two female Berkeley graduates, Paula Hawthorn and Barbara Simons, noticed in 1982 that the number of female graduate students entering the CS program was actually decreasing over time as the requirements became more geared toward people who had pursued a standard math or engineering track.

The Computer Science Reentry Program at Berkeley gave 159 students a concentrated education in upper-level computer science classes. Ten of those students have gone on to get PhDs. But the program had to fold in 1998 when California passed Proposition 209, which prohibited any state-funded programs that discriminate based on gender and ethnicity.
—"Nurturing the Drive," Charlie Anders. San Francisco Bay Guardian, Jan 10, 2007.