Thursday, March 31, 2011

Matlab liked my idea

Matlab is one of the most frequently used programming languages for science and engineering.

Though I can't verify it, it seems that Matlab has incorporated one of my ideas into its standard distribution.

Back in 2006, I was working on reconstruction algorithms for computed tomography (CT). Here is a video I made that demonstrates CT reconstruction. It takes the radon transform (at the bottom) and constructs the image slice (top).


I found Matlab's code slow, so I replaced the time-consuming part of their code with a faster version that I wrote. It was faster because I precompiled it using mex... nerd detail. I submitted my code to their File Exchange service so other people could benefit from it.

Anyhooo, in preparing my lecture on CT reconstruction today, I was suprised to see that Matlab's code was now faster than mine. WTF?!

I looked at their code, and saw that they had replaced the exact same part with mex code, just like I did.

Here is what a snippet of their original (slow) code looked like.


I replace it with the following code that calls the program I wrote (LinearBackproject).


And now this is what their new code looks like.


They even used my 0/1 flag (the last argument) to indicate to the iradonmex subroutine whether to use nearest-neighbour or linear interpolation.

Even if Matlab did use my code directly, I have no financial recourse. But it feels nice to be appreciated.

Friday, March 25, 2011

The Paradox of Choice: Book Review

Just finished listening to the audiobook version of The Paradox of Choice: Why More is Less by Barry Schwartz.

I'd first heard of this book a while back, and it sounded amazing. I reconnected with it in a rebroadcasted episode of the Skeptically Speaking podcast (actually, radio show).

Here's the idea. You walk up to a samples table at the grocery store and are faced with 6 brands of jam. You can try any or all of them. After, you can choose to buy some jam, or mosey on with your other business.

Suppose instead that you are faced with 24 brands of jam instead of 6. Logic dictates that you're likely to find a jam that's superior to any of the 6 in the original scenario. Again, you are free to purchase.

Which scenario do you think garners the most jam sales? The 24-jam case? WRONG! Significantly more people opt to buy jam when there are only 6 brands to compare. ... I know... WTF!

Paradoxically (hence the title), including more options actually makes all options seem less appealing, even though it gives one more of an opportunity to find the BEST option. Why? Dr. Schwartz offers a number of reasons. For example, when faced with more options, you have more pressure to find the best.

Another example: Students taking a photography course were allowed to keep one of their prints. However, half were allowed to reconsider their choice, and had the option to change their mind and select a different one of their prints to keep. Even though very few actually exchanged their prints, a survey revealed that those with no option to trade were happier with their print. Somehow, adding the option to change their minds made the free-to-choose group less satisfied with their choice. Paradox.

While having too much choice can make you unhappy, he's careful to point out that too little choice can also be a problem. He's not condoning slavery and destitution. But most of us are offered more options than we can realistically understand.

One of his central theses is the differences between "maximizers" and "satisficers". A maximizer is someone who wants to consider ALL the options, and is seriously interested in finding the best. A satisficer, on the other hand, is someone who wants to find an option that is simply good enough. I can related to being a maximizer, thinking of each decision as a challenge. But Schwartz supplies ample evidence from the scientific literature that maximizers are less happy than satisficers. Well, that sucks.

Luckily, he offers suggestions on how to limit the impact of choice in your life, to make you happier and regret less. But you'll have to read the book to find out what they are.

Tuesday, March 1, 2011

Evolution and Beer, two of my favourite things

Now there's a beer for all you Darwinists,

The circular seal on the left says, "Created in 27 days, not 7". Here's what it says on the back label,

I bought it at a ski resort in Utah, near Salt Lake City.

Saturday, February 26, 2011

COSYNE Day 2: Mormon Temple Square

Many of the talks today were about the molecular mechanics of neurons. Not quite my cup of tea, since I didn't understand much.

I did, however, spend some time at the Mormon Temple Square. The buildings are beautiful. I was amazed to hear that this big chapel was started in 1853, and completed in 1889.


I toured the visitor centre. It was basically divided into 3 parts: (1) the building of the chapel, (2) the words of the modern prophet Thomas Monson, and (3) families.

I watched about 6 of the short sermons given by Thomas Monson, the current president of the Mormon church. He's also considered a prophet.


In one video about raising children, he talked about how early life experiences can affect a person. I was amused when he used phrases like "The evidence reveals..." He accepts scientific evidence when it's convenient, but rejects it if it contradicts his faith.

As I watched him speak, I became aware of the striking contrast between his talk, and the talks I'm attending at the conference. If anyone at the conference makes a claim that goes beyond their evidence, they are promptly called on it. Of course, you might argue that a sermon and a scientific conference are entirely different. But are they? In both cases, the expert is sharing their wisdom with others. The only real difference is that in a scientific conference you're free to question and demand evidence for claims. No so in religion.

I spent some time talking to a couple young lady missionaries; that's what they call the volunteers with the name tags that wander around looking to talk to visitors. One girl was from Ottawa, and she did almost all of the talking.

I asked her if Mormons were encouraged to talk to their peers about their beliefs. She said that they were, and that anyone would want to talk about their passion. I was relieved to hear that, and told her that I consider myself an evangelical scientist. I guess I agree with her on that, at least. So, she tried to talk me into becoming a Mormon, and I tried to talk her into becoming... a secular humanist, I suppose.

I was conscious that she kept us moving away from other visitors.

We basically established that her "evidence" is an emotional knowing, and is subjective. I told her - a number of times - that subjective truths can easily lead to irreconcilable conflicts. When religion A disagrees with religion B, who is right? Science, I continued, is based on objective truth, a reality that we can all agree on and share. She nodded politely. It seems that she prefers her own reality.

In case you're not aware, the Church of Jesus Christ of Latter Day Saints was started by Joseph Smith in 1830. Joseph had a revelation, in which God asked him to transcribe some gold plates into modern English. He was told where to find the plates, buried in New York state. The result was the Book of Mormon, considered by Mormons to be a new testament that rescues the Christianity that had gone off the rails. Disappointingly, the gold plates disappeared and went back to Heaven. The only remaining evidence is the Book, and the signed testimony of 11 witnesses that claim to have seen the plates.

That's a nice story, and might even be true. But I offered a different explanation. Perhaps Joseph Smith decided to start his own religion, so wrote a book and made up a story about it being divinely inspired.

The nice girl had never heard of Occam's razor, but I suggested that my explanation was in many ways more parsimonious... requiring fewer miracles (none, to be exact). That clearly pissed her off. She said, "Yes, even though there are 14 million of us", as if to imply that 14 million people can't be wrong. I said that many religions have lots of followers. I wish I'd thought to say that popularity dos not make something true. Flat earth, for example.

I felt bad for making her mad. I certainly wouldn't expect her to change her mind overnight, since her entire family would probably stage an intervention to reel her back in.

Friday, February 25, 2011

COSYNE Day 1

I'm at a conference in Salt Lake City, Utah. The conference is called Computational and Systems Neuroscience (COSYNE).

What have I learned so far?

That there are many MANY monkeys and mice out there with electrical probes in their brains. The majority of talks so far talk about measurements of neural activity in various regions of the brain, and the subsequent data analysis that tries to make sense of it all in light of the stimulus that caused the activity in the first place.

The first talk was amazing! E.J. Chichilnisky described a project in which they put a piece of a retina on an electrical array (that picks up electrical activity), and shone various configurations of light on the retina. Correlating the input image with the output electrical activity, he was able to isolate the activities of individual cone photoreceptors, as well as how the cones pool their activity for individual retinal ganglion cells - the long, thin neurons that are bundled to form the optic nerve. Basically, elucidating the wiring diagram of the retina, and what image processing gets done in the back of your eyeball. Cool.

I also learned that the visitors' centre of the Mormon Temple (The Church of Jesus Christ of Latter Day Saints) is open from 9am to 9pm. The "sisters" that I spoke to were very friendly. I'm really curious to check it out, and find out what makes these people tick. I think I'll spend an hour or so tomorrow looking around and asking questions.


One more thing. I got a kick out of Chichilnisky's talk when he said that his "focus was on the retina".

Thursday, January 20, 2011

Homeopathetic logic

It's so cute when homeopaths try to talk all sciency. This web page tries to offer responses to common challenges to homeopathy.

Here's the challenge...
Argument #3: There is no scientific proof from placebo controlled human trials that homeopathy is effective therefore homeopathic remedies are nothing but a placebo.
And the response...
Rebuttal #3: Placebos are by far the best studied medicines. Their benefits have been evaluated and proven in every placebo controlled study ever conducted. Placebos definitely have an effect; in fact they have become the standard by which all pharmaceutical are compared. ...
How can you test the efficacy of a placebo in a placebo-controlled study? It's like saying you can fly by pulling up on your bootstraps.

But let's not lose sight of the most glaring issue. To quote the Homeopathy Evidence Check from the British House of Commons,
In our view, the systematic reviews and meta-analyses conclusively demonstrate that homeopathic products perform no better than placebos.

Wednesday, January 19, 2011

Free hotel

I just booked my hotel for the conference ICIAM. What a bargain! Here's the confirmation page.


Indeed, I had to enter my VISA number to pay $0. Hmm... somehow this seems too good to be true. I'll wait a bit, and then call to confirm the reservation.