Archive for December, 2006

Auctioneer Auctions

Posted in Economics 1 year, 11 months ago

I had previously written about conducting Vickerey-type auctions honestly. I also wrote about why Google doesn’t have to be completely honest to take advantage of the current hype around adwords, although temporary. This is the cynic in me speaking up, with absolutely no proof to back my claims.

More recently, people have been talking about Google being dishonest in a different way. “Google cheats” some say. The basic premise behind the argument is that Google favors its own product advertisements over competitors. That was then refuted by a Google employee. This was enough to satisfy most people1.

If you’re like me, I don’t really remember URLs anymore. I press “Ctrl+K” to get to the search box in firefox and type in what I want to get to the site. These include “google calendar,” “sfu webmail,” “slashdot” amongst others. But, if you type “yahoo calendar” into Google, you get this (click to expand):

Google search screenshot

I don’t know what to say. “Why have they become pimps?” asks Philipp Lenssen. Gold.


  1. I don't really care either way. ()

Emacs, Xhtml, Javascript

Posted in Web 1 year, 11 months ago

One of my projects for next year has Javascript and related technologies as a strong contender1. A big portion of the satisfaction that comes with programming has to be from the environment used for design and coding. Emacs does that for me.

For modifying the code behind this website, I make use of nxml-mode, css-mode, ecmascript-mode and php-mode. For embedded php, ecmascript or css code, I make use of html-inlined. I’m also going to try integrating Mozilla and emacs via MozRepl. The supposed benefit is never having to leave emacs to evaluate chunk of javascript.

Why emacs? First, I don’t really know any other tool that well. The big advantage for me is in how trivial it is to integrate different tools within the same program. I can transfer the same set of skills from writing papers, coding in C, lisp or assembly, or gasp playing Tetris. Moreover, if a feature isn’t available, it’s trivial to extend it (if you know elisp.) Now that I have my environment more or less setup, I’ll have to actually go and learn javascript…

BTW, emacs 22 is in pre-test. I built a CVS copy of emacs last week and it has been super-stable for me thus far.


  1. the others being C++ and Java ()

Normality, Graphs & R

Posted in Computing 1 year, 11 months ago

R graph

It always irks me to see unsubstantiated claims such as “this is better,” or “this is faster.” Better or Faster than what? I’d much like to see the data and draw my own conclusions.

Similarly, graphs without error bars, or sample means without standard deviations are pure evil. If you don’t report the deviation, I suspect something fishy - like your samples being statistically insignificant.

This reminds me of a physics experiment a friend conducted sometime back. We were supposed to show the linear relationship between two variables. It was quite difficult to keep the other variables fixed, so after a while he gave up. His final dataset had two points. The best fit curve through two points is a straight line, right? QED.

On Linux, the only way to create publication quality graphs was by using gnuplot. If you’ve ever used gnuplot, you’d know how un-intuitive and complicated it is to accomplish even simple tasks. In short, it is an example of software that is very user-friendly, but it gets to choose who its friends are1.

I’ve recently been trying out the graphing capabilities from the R project. Just check out these graphs. The platform also supports scripting. I’ve slowly started using this program for all my graphing needs.

If you’re familiar with Monte Carlo simulations, you’d know that for an equilibrated stochastic process, the distribution of output values is a normal distribution. This is from the Central Limit Theorem, which states for “large” number of samples, the distribution is normal. Ofcourse, as with almost everything else in statistics, nobody tells you how “large” is “large.”

For one of my projects, I wanted to use the Kolmogorov-Smirnov test to check the normality of my output. Here’s a variation of a script I wrote in R:

S <- 10;
I <- 50;
N <- 10000;

p <- numeric(N);
v <- numeric(N);
j <- 0;

for (i in seq(S, N, I)) {
    y <- rnorm (i);
    j <- j + 1;
    v[j] <- i;
    p[j] <- ks.test (y, "pnorm", mean(y), sd(y))$statistic;
}

v <- v[p>0.00];
p <- p[p>0.00];

plot (v, p, "s", col="dark red")
title ("D -vs- N");

What this script does is compare the D-statistic from KS-test with a normal distribution. You can see the value dropping to zero as the number of samples increases.

Kolmogorov-Smirnov Test


  1. On the otherhand, gnuplot is awesome for scripting. I've used it a lot to plot data of the same class. ()

Zipf & Supercomputers

Posted in Computing 1 year, 11 months ago

Matei Ripeanu has a short note in IEEE Distributed Systems Online comparing the performance of supercomputers from the TOP500 list to a power law.

Interesting notes by Ian Foster:

  • Plot of performance versus rank is a power law.
  • The power law coefficient is getting smaller with time. Ian says that “bigger machines are getting faster more slowly than slower machines.” It also means that the gap between the first and last ranks on list is shrinking.
  • Top rankers are more likely to buy faster machines to maintain their ranks. The act of measuring performance evolution changes that very evolution (insert smart QM remark here…)

Nonlinear Physics

Posted in Physics 1 year, 11 months ago

A course I much enjoyed this semester was on the equations of mathematical physics (PHYS384 for those at SFU.) We learnt a whole bunch of methods to solve and analyze equations that fit into the Sturm-Liouville framework of linear partial differential equations. The natural next step is to extend this body of knowledge to non-linear equations of mathematical physics. That is exactly what I’m doing next term.

We have a whole bunch of methods to analyze and predict the performance of linear systems, but systems in nature aren’t always that idealistic. The classic example is that of a frictionless pendulum with the equation of motion:

\ddot{\theta} + \omega_0^2 \sin(\theta) = 0

where \omega_0 = \sqrt{(g/l)}, g is the acceleration due to gravity and l is the length of the pendulum. The sine function being non-linear is often linearized to just \theta for small angles. This is the standard harmonic oscillator equation.

The real challenge is in analyzing the original non-linear equation. The difficulty in solving this equation is readily seen in the following Maxima session, where it isn’t smart enough to recognize the Jacobian elliptical integral.

Maxima session

The only course I’m taking next term is titled “Instabilities, Chaos and Turbulence in non-linear and complex systems” numbered PHYS484. We’ll explore a lot of these concepts. I’m really looking forward to it. Also check out this really cool experiment with a liquid:

YouTube video