somewhere near the beginning.

The logical corollary to all the mathematician, engineer, physicist jokes

Filed under: General — Alex @ 8:59 pm 2/7/2005

An engineer, a physicist, and a mathematician find themselves in an anecdote, indeed an anecdote quite similar to many that you have no doubt already heard. After some observations and rough calculations, the engineer realizes the situation and starts laughing. A few minutes later the physicist understands, too, and chuckles to himself happily as he now has enough experimental evidence to publish a paper.

This leaves the mathematician somewhat perplexed, as he had observed right away that he was the subject of an anecdote, and deduced quite rapidly the presence of humor from similar anecdotes, but considers this anecdote to be too trivial a corollary to be significant, let alone funny.

Silly mathematician.

Possibly relevant posts:

The e^x joke

Filed under: General — Alex @ 8:55 pm

The cocky exponential function e^x is strolling along the road insulting the functions he sees walking by. He scoffs at a wandering polynomial for the shortness of its Taylor series. He snickers at a passing smooth function of compact support and its glaring lack of a convergent power series about many of its points. He positively laughs as he passes |x| for being nondifferentiable at the origin. He smiles, thinking to himself, “Damn, it’s great to be e^x. I’m real analytic everywhere. I’m my own derivative. I blow up faster than anybody and shrink faster too. All the other functions suck.”

Lost in his own egomania, he collides with the constant function 3, who is running in terror in the opposite direction.

“What’s wrong with you? Why don’t you look where you’re going?” demands e^x. He then sees the fear in 3’s eyes and says “You look terrified!”

“I am!” says the panicky 3. “There’s a differential operator just around the corner. If he differentiates me, I’ll be reduced to nothing! I’ve got to get away!” With that, 3 continues to dash off.

“Stupid constant,” thinks e^x. “I’ve got nothing to fear from a differential operator. He can keep differentiating me as long as he wants, and I’ll still be there.”

So he scouts off to find the operator and gloat in his smooth glory. He rounds the corner and defiantly introduces himself to the operator. “Hi. I’m e^x.”

“Hi. I’m d / dy.”

I don’t get it.

Possibly relevant posts:

Convergence

Filed under: General — Alex @ 6:27 pm

I’ve been studying up for my real analysis test this Friday, mostly reviewing the stuff on series that we covered last semester and so are expected to remember. The test is on the new material we covered: uniform convergence of function series, and some stuff on power series, so I think I need to know the old material on series also.

In reviewing, I’m once again struck by how counterintuitive some of this stuff can be— I expected that series would admit linear operations like addition and scalar multiplication, which they do, but why don’t multiplication and division work in general? It isn’t obvious at first thought that they wouldn’t. And then, the result due to Riemann which basically says that any series that isn’t absolutely convergent can be rearranged to converge to any real number is mind-boggling. So I think it’s clear to me that there’s something deep going on with convergence of series.

In the new material, I’m once again stumped by why, in general, limits can’t be switched. I can think up simple examples that show that this isn’t so, but why is it exactly? Why is uniform convergence necessary?

Anyhow, here’s a humorous comment on power series:

In discussing power series it is good to recall a nursery rhyme:

"There was a little girl
Who had a little curl
Right in the middle of her forehead
When she was good
She was very, very good
But when she was bad she was horrid."

Possibly relevant posts:

Child Prodigies

Filed under: General — Alex @ 7:31 pm 2/6/2005

Child prodigies are fascinating to me: from fictional ones like Ender in Ender’s Game, and the kids in J.D. Salinger’s novels to real ones in the 60 minute special I’m watching. Of course, not all fascinate me: I could care a lot more about the kids that are good at music or sports. It’s the all-around smartie pants type that fascinate me; it’s not so much the fact that they’re talented kids, but the idea that if they have so much potential and knowledge at a young age, they will have that much more to contribute as time goes on. One of the kids in particular on the program affected me strongly, because he went on to get a PhD in mathematics— I would love to see some of the work he comes up with. A lot the great mathematicians– Euler, Gauss– are associated with stories, perhaps only apochrypal, about how their genius manifested itself at a young age. I would like to have kids like that. Especially since it’s too late for me to be a kid like that :)

Possibly relevant posts:

A good supplementary book on Real Analysis

Filed under: Mathematics — Alex @ 2:10 pm

I mentioned this book in one of my earlier posts, but never gave its name:
A Companion to Real Analysis: A Second First and First Second Course in Analysis
by T.W. Körner. This is a real treasure— at least, if you’re like me and tired of hearing the same development of \R versus \Q, once you skip the first couple chapters. It is part of the blue and yellow cover AMS Graduate Studies in Mathematics series (vol 62), but it is very accessible to undergrads. I would certainly prefer for it to be my textbook in Real Analysis instead of Rudin.

Possibly relevant posts:

Java recursive deletion script

Filed under: Programming — Alex @ 1:56 pm

This is a java script which deletes all files with a given extension from a directory, including its subdirectories. It’s probably not useful on *Nix platforms, since there are several ways of doing that easily from the command line, but I haven’t found an easy way of doing this kind of thing under Windows.

[java]
import java.lang.*;
import java.io.*;

public class DelAll {

static String ext=”class”; //Delete class files by default

public static void main(String[] args) {

//set the extension to check for
if(args.length>1) {
ext = args[1].toLowerCase();
}

//start in the given directory
deleteAll(new File(args[0]));

}

private static void deleteAll(File curdir) {
File[] fileList = curdir.listFiles();
System.out.println(”in ” + curdir);

for(int i=0; i

// recurse through subdirectories
if(fileList[i].isDirectory()) {
deleteAll(fileList[i]);
}
// remove files with given extension
if(fileList[i].getName().toLowerCase().endsWith("."+ext)) {
System.out.println("deleting " + fileList[i].getName());
fileList[i].delete();
}
}

}
}
[/java]

Possibly relevant posts:

Bolzano-Weierstrass theorem

Filed under: Mathematics — Alex @ 12:08 pm

As I mentioned before, I’m taking a complex analysis class that is being taught via the Moore method: we are given definitions, and then asked to prove propositions and defend them against the class; this is the entirety of the class. One of the stipulations is that we are not to reference outside sources, or discuss the solution to problems among ourselves. Unfortunately, I’m taking the second half of a Real Analysis course, so I have to reference outside sources. Usually, this is not a problem— I’ve made the decision to recuse myself from doing any problems that I feel I have had an unfair advantage on.

Now I have a conundrum. I spent a week and a half worrying about one of the propositions:

If s_0, s_1, \ldots is a bounded sequence of complex numbers, and |z|<1, then  \sum_{n=0}^\infty s_n z^n converges.

I finally got it, using a subdivision argument that I thought was very unique. In the process, I proved the triangle inequality and the nested interval theorem, which are tools that I think would really speed up the progress of the class. For instance, the last proposition— to prove that if a series converges, then the associated sequence converges to zero— is trivial to prove once you have the triangle inequality. But the guy doing it either didn’t think of using the triangle inequality, or didn’t think he could prove it. Instead, he took a circuitous, although ingenious, roundabout method of proof that took two classes to lay out, and he’s still not finished!

The problem is, in preparation for a test this Friday in my real analysis class, I started reading a supplementary book on real analysis, and yesterday I came across the Bolzano-Weierstrass theorem:

If x_n \in \R^n and there exists a K such that |x_n|\leq K for all n, then we can find  n(1)<n (2)<\ldots and x\in\R such that x_{n(j)} as j\rightarrow \infty.

Turns out that the proof I have is very similar to the proof the book gives for the theorem. So should I recuse myself? Given the people in the class, I think if I don’t prove this one, we’re going to end up skipping it.

Possibly relevant posts:

Fixing Firefox 0.9’s XBEL problems

Filed under: General — Alex @ 3:45 pm 2/4/2005

I have a huge collection of bookmarks, so when I started using Firefox, I thought it would be a good idea to move all of them from Opera over to Firefox, so I could use the Bookmark Synchronizer to export them to an xbel file on my website that anyone could view, and I would be able to use the xbel file in other tools, if the occasion arised.

Unfortunately, the XBEL support in the 0.9 version of the Bookmark Synchronizer plugin was broken— that version of the plugin could write and read the files fine, but I couldn’t view them in Firefox or in other tools. I also couldn’t load them into the newer version of Bookmark Synchronizer in Firefox 1.0.

I had nearly resigned myself to having to scour the xml file by hand to save my links, but then I checked out the file with xmllint, which didn’t really describe the problem, but did give me a location to start looking at. Then, viewing the file in Vim, which conveniently shows control codes like ^B (the offender) without interpreting them, I saw that the problem was the presence of control codes.

Solution: tr -d [:cntrl:] xbel.xml > fixedxbel.xml [:cntrl:] . Now I can do one thing that I’ve always wanted to do: I have Firefox on my school account, so when I’m browsing there, I can make bookmarks and have them saved directly to the xbel.xml file online, and then synchronize with that when I get home.

Possibly relevant posts:

“Do Task on Modify” Code

Filed under: Programming — Alex @ 11:32 pm 2/2/2005

A while back, I encountered a useful short perl script which runs in the background of a terminal, and periodically checks a file for changes, and when it detects one, it runs a specified command. That was very useful for writing LaTeX documents: when I saved the file, I could use the script to auto-run latex on it. I found the idea fascinating, and wanted to bring it over into the windows world. Here’s a java code that does the same thing; it has a Swing interface that is pretty self-explanatory. An entertaining trick to try– and one of the ways I tested it– is to use a command that changes the file everytime it is changed.

[java]
import java.lang.*;
import java.io.*;
import java.util.*;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

//Runs a command when a file is modified

public class doOnModGui extends JPanel implements ActionListener, Runnable {

JTextField cmdField, fileField;
Thread task = new Thread(this);
boolean dataValid = false;
File monitor;
String cmd;
long lastMod;

GridBagConstraints constraints = new GridBagConstraints();

public doOnModGui() {
JButton taskButton = new JButton(”Set Task”);
taskButton.addActionListener(this);
setLayout(new GridBagLayout());
addGB(new JLabel(”File to monitor: “), 0,0);
addGB(fileField = new JTextField(20), 1,0);
addGB(new JLabel(”Task to run: “), 0, 1);
addGB(cmdField = new JTextField(20), 1,1);
constraints.gridwidth=2;
addGB(taskButton, 0,2);
task.setDaemon(true);
task.start();
}

void addGB( Component component, int x, int y) {
constraints.gridx = x;
constraints.gridy = y;
add(component, constraints);
}

synchronized public void actionPerformed(ActionEvent e) {
dataValid = true;
monitor = new File(fileField.getText());
cmd = cmdField.getText();
lastMod = monitor.lastModified();
notify();
}

synchronized public void run() {
try{
while(true) {
if(!dataValid)
wait();
if(Math.abs(lastMod - monitor.lastModified())>0) {
Runtime rt = Runtime.getRuntime();
lastMod = monitor.lastModified();
try {
Process proc = rt.exec(”cmd /c ” ” + cmd + ” && exit ” “);
proc.waitFor();
}
catch(IOException e) {
System.out.println(”Error encountered running command: “);
System.out.println(e.getMessage());
};
}
wait(25);
}
}
catch (InterruptedException e) {}
}

public static void main(String[] args) {
JFrame frame = new JFrame(”Run task on file modification”);
frame.getContentPane().add(new doOnModGui(), “Center”);
frame.addWindowListener( new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.out.println(”Exiting..”);
System.exit(0);
}
});
frame.pack();
frame.setVisible(true);
}
}
[/java]

Possibly relevant posts:

« Newer PostsOlder Posts »