Archive for September, 2005

Challenging God

Friday, September 30th, 2005

A friend of the family had a praise celebration party thingie to give thanks for the fact that we survived Rita, with no damage. I sung about 8 hymns, for the first time in months (years!). I also borrowed a book she had: “Who’s Who and Where’s Where in the Bible.” Even though I don’t want to read the Bible, ever— no bigger reason than that I don’t like trying to decipher the King James version, and I have a parentally instilled strong aversion to the more modern versions—, I’d still like to know what’s in it. A little unexpected knowledge goes a long way in quieting holier-than-thou moralists. Also, it is a good source of moderately entertaining, albeit morbidly so, stories.

Who said that challenging God to prove his existence is a bad thing, or a sure ticket to hell? My mother, for one. But consider the story of Gideon, who was visited by an angel that consumed an offering he put before it by fire, yet turned around and asked God for independent confirmation by having him deposit a night’s worth of dew on a fleece without wetting the grass around it, and for futher proof, asked God to switch hit— deposit another night’s worth of dew on the grass around the fleece without wetting the fleece. That’s true cheek! So, excuse me if I need God himself to explain to me that the Bible is indeed his Holy, infallible, literal word. Really, I’d settle for an angel, and just one localized crepuscular precipitation effect.

If I were going to believe any religious text, much more take it literally, it would be the Koran. Unlike ‘the’ Bible, which has been redacted so many times by so many different organizations that the article ‘the’ should in most instances be replaced by ‘a’, the Koran seems to have been passed down in a monolithic, unaltered version. Not that I know much about the Koran, but I do know that even translations of the Koran are not considered as the Koran, because it must be written in the original language. I would guess that there are also stipulations against the modification of the syntax, grammar, and word choices.

SSH Key Authorization

Friday, September 30th, 2005

I just figured out something I’ve been trying to do for a long time: how to get SSH key-based authorization to work correctly. This allows you to just type ’ssh machine.domain’ on one computer and log into the foreign machine without entering a password. Not only does this save typing, it makes it possible to script sftp sessions.

Here’s a quickie way of setting up key-based authorization, which makes the assumption that you don’t already have a key pair generated.

  1. At machine A’s command line, type ’ssh-keygen -b 1024 -t dsa’ to generate a public and private key pair. Accept all the default settings, and DO NOT enter a passphrase. If you enter a passphrase, you’ll have to type it in every time you log into other machines.
  2. Your public key location should have been reported, something like ‘.ssh/id_dsa.pub’; copy this file to machine B, and then in machine B’s .ssh directory, there should be a file authorized_keys. If not, create this file with 600 permission. In either case, append the contents of id_dsa.pub to the authorized_keys file, like so: ‘cat id_dsa.pub >> .ssh/authorized_keys’. Delete machine B’s copy of id_dsa.pub.

Now everything should be working. Test it!

I’m thinking of writing some kind of script– shell, Python, whatever– to automate this process (with a few refinements, and less assumptions about the setup of your machines) to allow you to keep a set of machines interlinked. In my case, I have about 7 machines/accounts I’d like to be able to access from each other without entering passwords, which would require me to repeat the second step of this procedure 2 { 7 \choose 2} = 42 times!

grad schools— the final list!

Wednesday, September 28th, 2005

Only a few people will care, but it’s an important fact that I’m one of them :). Here is my final list of graduate schools to apply to:

  • Caltech
  • Stanford
  • University of California at Berkeley
  • University of Maryland
  • University of Washington at St. Louis
  • University of Houston

The first three on based on considerations of where I want to be– architectural and climactic considerations–, as well as my academic interests— mostly functional analysis– while the last three are purely based on my academic interests.

Also, I just applied for the CalTech GradPreview program, and I’m feeling good about getting it, so maybe in November I’ll be spending 4 days on their campus, seeing what it’s like.

Tomorrow, I’ll start applying in earnest, and I’ll sign up for the general and math subject GREs. I’ve decided to go down the list, in order. I also need to make a similar list of fellowships, so I can get cracking on that front.

simple signal compression

Wednesday, September 28th, 2005

Question

Suppose you have a (periodic) function f : [0, 2\pi) \rightarrow \C whose support is limited to the interval [0,\frac{2\pi}{m}], where m>2. Is there a more compact representation than the entire fourier series? It seems like a good possibility, since the information in the function is actually restricted to a smaller region.

Answer

Yes. Let \tilde f : [0,2\pi] \rightarrow \C be defined as f : \theta \rightarrow f(\tilde \theta) where  \tilde \theta = \theta + \frac{2\pi k}{m}, where  k \in \Z and \tilde \theta \in [0,\frac{2\pi}{m}]. Then consider the fourier coefficients for \tilde f:


\displaystyle
\tilde c_k = \frac{1}{2\pi} \int_0^{2\pi} \tilde f(\theta) e^{-i k \theta} d\theta = \frac{1}{2\pi} \sum_{n=0}^{m-1} \int_{n\left(\frac{2\pi}{m}\right)}^{(n+1)\left(\frac{2\pi}{m}\right)} \tilde f(\theta) e^{-i k \theta } d\theta

\displaystyle
= \frac{1}{2\pi} \sum_{n=0}^{m-1} \int_0^{\frac{2\pi}{m}} \tilde f(\theta + \frac{n2\pi}{m}) e^{-i k \left(\theta + \frac{n 2 \pi}{m}\right)} d\theta
= \left(\sum_{n=0}^{m-1} e^{- \left( i k \frac{2\pi}{m} \right) n } \right) \int_0^{\frac{2\pi}{m}} \tilde f(\theta) e^{-i k \theta} d\theta
= c_k \left(\sum_{n=0}^{m-1} e^{- \left( i k \frac{2\pi}{m} \right) n } \right)

Since the sum of exponentials is m when m \mid k and 0 otherwise, we can throw out all the zero coefficients and represent \tilde f or f using just the coefficients \{m c_{mk}\}_{k \in\Z}.

Comments

This is not directly useful, but considering where I got the idea from (minus the nice proof, all thought out by me :) it probably ends up figuring into quadrature mirror filter theory somewhere. Maybe this has something to do with the ubiquitous downsampling I keep hearing about in relation to wavelet transforms.

Anyhow, it is an interesting result. Notice that as m \rightarrow \infty, the sequence \{m c_{mk}\}_{k\in \Z} approaches a delta pulse, in a certain sense. Which, in a certain sense, is as expected.

Silly problem about multiple downloads

Saturday, September 24th, 2005

I was using the downTHEMall! Firefox plugin to download the pdfs for an online book when I thought of a simple question. To phrase it mathematically:

If you are downloading n files, each of size x_k, how many times does the overall percentage downloaded, OP, equal the percentage of the current file being downloaded, CP_k? And what are these percentages?

I was pretty certain that the answer to the first question is n, but had to work it out for certainty, and an answer to the second question. Assume OP = CP_k for some k, then

\displaystyle OP = \frac{\sum_{j=1}^{k-1} x_j + CP_k x_k}{ \sum_1^n x_j} = CP_k \Rightarrow CP_k = \frac{\sum_{j=1}^{k-1} x_j}{\sum_1^n x_j - x_k}.

Assuming n>0, this is satisfied exactly once for each k, so OP=CP_k n times.

Silly problem, but nice to know.

Principles of Computerized Tomographic Imaging

Friday, September 23rd, 2005

Wow! I just saw this book for the first time two days ago, on one of the shelves in Papadakis’ office, and was impressed. This seems like a very understandable, yet serious, introduction to the reconstruction problems associated with tomography, and various solutions. Of course, I just flipped through it, but it seems to be at a level where it could be read for entertainment as well as information. As much as any math book can be read solely for entertainment.

The wow! part is that I just found out through CVOnline, a collection of computer vision related resources, that it is available online.

My metapost night

Tuesday, September 20th, 2005

Last night, I spent two hours trying to get Mptopdf working, with no success, only to recall this morning that I have a binder with useful MetaPost related clippings in it, one of which applies to this situation:

tex mproof.tex myfile.mp

That processes the illustration in myfile.mp (I don’t know what it does if there’s more than one) to enable quick debugging without you having to write a wrapper tex file. mproof.tex seems to be a standard TeX file, so everyone should have it. Mptopdf was working on my computer at school, so it was even easy to preview stuff there:

mptopdf myfile.mp

produces a pdf in one step, with dimensions only large enough to fit the illustration.

Today, I spent way too much time trying to get Gnuplot and LaTeX to cooperate, since I also had to make a couple of 3d graphs, a task which MetaPost is not readily suitable for. I managed to pound something out, with suprising quality– I’ve always disliked Gnuplot’s output— with the default settings, it’s worse than even default Matlab output. In the process of pounding, I found myself thinking that Gnuplot would be a lot more powerful and easier to use if it was directly integrated into a system like Octave where truly arbitrary functions could be designed (in this particular case, I needed the unit step function). Someone should get to work on that, now.

At some point, I’m going to dedicate a section of this site to posting code showing how I did these and other programmatic illustration tasks— both for my sake, and others’. For now, I just saw Alan Kennington, who made publicly available an excellent set of metapost codes for illustrations in a topology book he’s writing, also has put up a ps file of just the illustrations. See topology.org. I referred to his code to make my graphs quickly.

Why all this work? I’m taking two engineering courses, both taught by the same professor who seems to have an unhealthy obsession with graphs— and getting satisfactory graphs is made a lot harder by the fact that the school’s license server for Mathematica and MathCad are down. I hate Matlab’s output, much more having to write a disposable program just to generate one graph, so my only recourse is more exotic avenues like MetaPost or Postscript.

Epic Movies

Sunday, September 18th, 2005

I finally saw the 2nd part of LOTR: The Two Towers. I’ve seen the first and the third, and wasn’t overly impressed, but on seeing this one, I have a better understanding for people who swear by LOTR. The best part of LOTR, in my opinion, isn’t the plot so much as it is the striving against incredible odds, the emotion laden monologues on that process of striving, and of course, the all out battle scenes. In this sense, The Two Towers outdoes the 1st and the 3rd movies.

Is it a coincidence that I saw a commercial for the forthcoming ‘The Chronicles of Narnia: The Lion, the Witch, and the Wardrobe’ during LOTR? I think not, considering that the way the commercial was worded gave every impression that this is going to be another epic series like LOTR, and the fact that it will also be coming out in December as LOTR did. That gives me lots of time to plan an outing, and form expectations to be disappointed. Unlike LOTR, I actually read all of the Chronicles of Narnia— a long time back— and even saw the PBS’s airing of the BBC miniseries based on the books— again, a long time ago. As I recall, the books were incredibly good (but then I was a kid, so I might have a different opinion on a second reading), and also incredibly laden with Christian overtones, despite the presence of magic and such. It’ll be interesting to see what aspects of the original series makes it over into the movie. And I can’t wait for the inevitable kuro5hin.org slam by some overzealous fan.

Another set of books that I would love to see make it to the big screen is the The Dark is Rising series by Susan Cooper. I remember feeling the need to hide these books from my parents when I was reading them in middle school— there was such a strong, seemingly historically accurate representation of mythology, particularly Celtic, and a sense that this old magic had only moved into the shadows with the advent of Christianity, as opposed to having been proven false. I know my parents would have forbade me to read them; heck, my mom would probably have burned them. It’s incredible that my school library had them stocked. Actually, now I’m feeling the urge to go get them again.

Is this what it means to get old: to realize that you read some of the objectively best books in your experience such a long time ago that you’ve only the impression left that they were some of the greatest books you’ve ever read?

The WikiSystem

Friday, September 16th, 2005

Via the latest article on Kuro5hin.org– the first in a long time to be worthy of being on the front page– I (re)discovered the joy of the wikisystem: Wikipedia, Wikibooks, and Wikimedia Commons. The article is on reasons not to use the Creative Commons -NC (non-commercial use only) licenses. It gives cogent reasons, so check it out! Of course there are situations in which it is the best choice; cf. the comments for those. I agree with the author that even when you do find it necessary to use a -NC license, in 99% of the cases, it makes sense to limit the term of the -NC: who cares what happens after they’re dead that much?

Wikibooks has some nice books; I plan on reading the German languge primer– I’ve always wanted to learn German. Unfortunately, the mathematical pickings are virtually non-existent.