Feeds:
Posts

## Archive for August, 2010

Let us say that I have been getting weird fortune cookies lately. It is my belief that whoever makes them is getting more inventive with what they dare put into such messages. Apart from fortunes of the type

You will travel far in the near future

I’ve been getting professional help from these cookies. For example, a couple of weeks ago I got one that went like this:

It is better to be approximately right than certainly wrong

Which is some of the best advice for physics I have ever heard. I’ve had other such that seem to resonate with my profession. Today’s was particularly funny:

You could prosper in the field of wacky inventions

If a colleague would tell me that I would be willing to bet that he thinks I am a crackpot. Oh well. Share your own.

## Epsilon

Today’s message is rather simple.

$1.0 \times 10^{-16}=0$

This is what I get numerically when I try to see if something is really zero on my computer.

The correct test is

$1.0\times 10^{-16}<\epsilon$

where $\epsilon$ is determined by the problem.

## Physics at the beach.

I have been enjoying the hospitality of the Simons Center for Physics and Geometry these past two weeks. I have been attending the workshop on Mathematics and Physics that has been going on yearly for the past few years.

It is a fun filled event where there is about one talk per day (on most days) and where I get to have a lot of conversations with very many people that I don’t see all that often.

The most interesting day of the week is when we have a seminar at the beach. We get together and drive away for about an hour to reach Smith Point Park. We then get to hear a whiteboard talk from some participant under a tent while the rest of the passer-byes gawk at  us: the idea of going all the way to the beach to hear someone speak about physics just floors them.

There are some pictures about those events that you can find in the webpage of the workshop, so you can go there to have a look (if you really must).

Perhaps because of my sense of humor, I kind of imagine us as a flock of kids who suddenly find themselves without their toys: the laptops are missing and we have to have fun’ without doing calculations. Such activities involve tanning, getting in the sea and riding the waves, walking on the beach and perhaps even play volleyball.

All in all I definitely recommend the experience and welcome the chance to get some rest from my laptop.

## Opt in vs opt out.

I’m not a fan of Junk mail and much less so for e-mail Junk mail. I also prefer to have control over my personal information. This is why I get annoyed when I receive letters with an ultimatum: answer this or we will share of all our information on you with our partners.I’m also annoyed when I’m registering for a service and I have to scour the webpages to see where I have to opt out of junk e-mail. Both of these happened to me last week, so here is my rant on the subject.

I would be much better served if the law erred on the side of caution and forced the companies to have to work on the opt in model, rather than the opt out model. For those of you who don’t know, the opt out model is where you are offered a service automatically and you have to go out of your way to opt out. The opt in model,  you have to go out of your way to receive the service. I’m calling it a service, although I’ve never felt that I benefit from said services.

For example, you need to register for your phone service. When you do so, you are automatically opted in’ to being able to spend money easily on your phone unless you restrict it. The case in point is calling numbers that charge for phone calls. There are various scams that exploit this standard setting. Sometimes they kind of register you through a promotion so that you end up spending money even if you didn’t want to do so. The phone company will just charge you for it and wash their hands since it is not their fault. So you have to opt out of the service by going out of your way and doing so. This is especially important if you consider the most recent virus on android enabled phones.

Of course, this does not protect against stupidity. But if you have to opt in for paying for such services by speaking to a representative, the cost to your wallet would go down in such an event because most people find bothersome to have to do anything.

It is clear why marketers like the opt out model: they have a direct line to serve you stuff (as much as they can try to funnel towards you without completely annoying you) as soon as you sign up unless you go out of your way to stop them. In the opt in model, you have to ask for your information to be shared.

The thing is that it is very hard to keep track of who has your information when you’re dealing with individual companies. However, if your information is shared a lot by default, you lose all control on that almost from the start.

Of course, you could always read economic papers on the subject that suggest that the opt out model is the most efficient for market economics. I’m not inspired by these studies into buying the opt out model: the studies do not seem to take into account the misuses of all that information.

I’m also not inspired by the recent developments where various governments around the world get an automatic pass on surveilance without court warrants. Current technological farming of information can be done on industrial scales at very low cost. This is very worrisome for freedoms that I hold dear: like talking nonsense on my phone without me having to worry on who’s listening.

I just came across this article in the NYT, about Artificial Intelligence. It made me want to share it, thereby making me a cog in the Artificial Intelligence of the Internet.

## Index ordering with pointers.

Sometimes programing can be fun. Sometimes it isn’t. I particularly hate debugging.

Today I was programming a function that would compute the commutator of two square matrices in c++, which do not have a definite size in the program. I ended up implementing it in the following way, by using the pointers to the beginning of the matrices and the size of the matrix n.

void commutator(int n , double *a1, double  *a2, double *b1)
{
for(int i=0; i<n; i++){
for(int j=0; j<n; j++){
*(b1+i+n*j)=0;
for(int k=0; k<n;k++){
*(b1+i+n*j)+= *(a2+i+n*k)*(*(a1+k+j*n))-*(a1+i+n*k)*(*(a2+k+j*n)) ;
}
}
}
}

The two matrices are a1, a2, and the result is placed on b1.

The placing of parenthesis is very crucial. This was the best solution I found after trying all kinds of other ways that were giving me trouble with the compiler. This is probably good for numerics, but lousy for preventing errors in the handling if one does not pay attention. What is fascinating to me is that the symbol * does two things: both multiplication and looking up the address of a pointer. And these can appear consecutive to one another.

Oh well. Just thought I’d share my messy code.