Lisp – wow, that’s a weird feeling.

October 25, 2008

I’ve been holed up in my office lately, teaching myself Common Lisp for an upcoming part of my Ph.D, and I have to tell ya, it’s a weird feeling to write code in Lisp.  I read through Peter Seibel’s great online book Practical Common Lisp, which is an absolutely brilliant resource for first time Lispers, especially those coming from other languages.  (I will admit to a bit of irony, though:  I downloaded the book and wrote a Python script to HTMLize the footnotes into links so that I could jump back and forth without having to continually figure out where the hell I had been when I went to read that note).

In any case, I just finished my first “real” program in Lisp – real in that it was done entirely on my own and required more than 5 lines of code, though the problem I “solved” was an imaginary one.  It’s one of those throwaway efforts to acquaint yourself with a new way of thinking.  I went into it thinking that Lisp was overblown, one of those things that people looked back on fondly with rose-colored glasses while muttering about how “real programmers used to do it”, but by the time I was finished writing the thing, I found that I was actually enjoying myself.  I can’t even explain why, but by the end of writing the program, I was actively looking for new ways to extend the idea so that I could keep writing code!  And now, I find myself looking forward to my next program in Lisp, a far cry from where I started.

(If you’re wondering what I was writing, it’s kind of embarassing, but here it is:  I wrote a program to quantify the cost to typing words on a keyboard from the perspective of a single-finger, one-handed typist.  The “cost” is distance – i.e. how far would the finger have to travel – defined by adjacent keys, so that ‘T’ and ‘E’ are two units apart (‘T’ -> ‘R’ -> ‘E’).  I did this using cl-graph to map the keys onto a graph, and wrote an implementation of Djikstra’s algorithm to calculate the distances between key pairs.  I could then calculate the distance between each pair of letters in a word and sum the distances to get the total cost, which I then averaged over the length of the word so that the penalty for long words was minimized.  After that, it was a snap to write a couple of functions to do things like take in a word list and write out each word with its associated cost, or to get the total cost of a string.  See?  Told you it was trivial. 🙂 )

Advertisement

Scientific salaries.

October 22, 2008

And this is why you don’t go into academia for the money.


10% of our brains, eh?

October 21, 2008

I love Greg Dean’s webcomic, Real Life.  It has some moments of true hilarity in it, and I find the characters enjoyable enough that I’m thrilled to see each new comic pop up in my RSS feeds.  But today’s comic contains a howler which I just can’t let pass. If you don’t want to go read it, the fun is in the final panel where one of the characters says “Hey, it’s not like you were using the other 90% of your brain anyway.”

Now, if you’re literate about neuroscience in any way, this will immediately strike you as stupid;  the myth about human beings using only 10% of their brains is wrong, and that’s been known for decades.  But to be honest, I could have let this go and just read the comic, until I came across a posting in the Real Life Forums by Greg himself, as part of an exchange with another person who commented on this problem:

[BEGIN QUOTE]

Kovac wrote:gaghWhy would you contribute to the myth that humans only use 10% of our brains?

It is for the purpose of a joke, but it just isnt worth it x

Allow me to quote Scientific American, so you foreigners can quit being such dicks about it. (Seriously, I’ve recieved another e-mail from someone else today telling us Americans to quit being so ignorant. Is this just a pet peeve of everyone on the other side of an ocean from us, or something?)Anyway, as I was saying:

Scientific American wrote:Another mystery hidden within our crinkled cortices is that out of all the brain’s cells, only 10 percent are neurons; the other 90 percent are glial cells, which encapsulate and support neurons, but whose function remains largely unknown. Ultimately, it’s not that we use 10 percent of our brains, merely that we only understand about 10 percent of how it functions.

NOW. While I will grant you that the concept that “we only use 10% of our brains” is silly, it’s also been used for DECADES as the basis for a lot of fun “what-if” style storytelling. Powder and Phenomenon are two excellent movies that come to mind which deal specifically with this idea. So, I think what I’m saying is, quit being such a fucktard about something so INSIGNIFICANTLY POINTLESS as this, and just try to enjoy the fucking comic.  I’m sorry if I’m getting a little on the offensive here, but this pedantic bullshit just pisses me off. Especially when it’s passed off in the guise of “Gee, you Americans sure are stupid.” (I know you didn’t do that specifically, but that was the tone of the other e-mail I recieved, and it stuck in my craw a little.)

[END QUOTE]

Uh, wow.

Here’s a couple of points in response, Greg:

  • Really – you’re going to base your argument on the past usage of science in media?  Seen a lot of 50-foot tall women in the talkies lately?  How about books about a guy who goes to the moon by being shot out of a cannon?  Even Marvel is smart enough to keep up with advances in our knowledge, if you’ve seen the re-write of the Spider-man origin in the Ultimates universe (from a radioactive spider to a genetically altered one).
  • To people who don’t know any better, you’re propagating the idea that there is some locked-away 90% of our brain that would turn us into magical super-heroes if we could only access it.  This is a lie, Greg, and it is part of a real issue;  scientific literacy in the United States, where you’re from, is shockingly low. This makes you part of the problem.

Scientists like me struggle every day to correct the misconceptions of science in the public’s view, so you’ll have to forgive us if hearing that we should just shut our yap – because you’re too lazy to come up with a plot point that doesn’t depend upon a thoroughly discredited idea from well over a century ago – is a problem for us.  And if it’s such an insignificant point (as you say to us ‘fucktards’), why can’t you just get it right?

Oh, and Greg, as for your quoting of the Scientific American article:  way to cherry-pick.  The “ultimately we only understand 10% of how it functions” bit is a rhetorical closing at the end of the article.  I prefer this quote from the middle of the piece:

Adding to that mystery is the contention that humans “only” employ 10 percent of their brain. If only regular folk could tap that other 90 percent, they too could become savants who remember π to the twenty-thousandth decimal place or perhaps even have telekinetic powers.

Though an alluring idea, the “10 percent myth” is so wrong it is almost laughable, says neurologist Barry Gordon at Johns Hopkins School of Medicine in Baltimore. Although there’s no definitive culprit to pin the blame on for starting this legend, the notion has been linked to the American psychologist and author William James, who argued in The Energies of Men that “We are making use of only a small part of our possible mental and physical resources.” It’s also been associated with to Albert Einstein, who supposedly used it to explain his cosmic towering intellect.

Emphasis mine.  Or how about this one, from the same article?

Although it’s true that at any given moment all of the brain’s regions are not concurrently firing, brain researchers using imaging technology have shown that, like the body’s muscles, most are continually active over a 24-hour period. “Evidence would show over a day you use 100 percent of the brain,” says John Henley, a neurologist at the Mayo Clinic in Rochester, Minn. Even in sleep, areas such as the frontal cortex, which controls things like higher level thinking and self-awareness, or the somatosensory areas, which help people sense their surroundings, are active, Henley explains.

p.s. Greg, I’m Canadian, not American, so consider my pedantry  to be a message from your own side of the ocean.


Seminar Flow Chart

October 8, 2008

If I were inclined to say it in that special Intertubes way, I’d say:  OMG!!@!  Thiz is sooooo me!!1!1!


“Total Biology” comes to Canada…

October 8, 2008

The CBC is reporting on the spread of “total biology” to Canada;  this story is the first that I’ve heard of this tripe:

A new therapy that claims to cure cancer and other diseases but has been blamed for dozens of deaths in Europe is gaining popularity in Canada, according to a Radio-Canada investigation.

“Total biology” is a therapeutic approach that claims illness is caused by psychological conflicts in the brain.

The approach, also known as new medicine or bio-psycho-genealogy, professes to heal all disease, including AIDS and advanced forms of cancer.

The method is gaining traction in Quebec where patients are often told to ignore their cancer, or stop medical treatment altogether, according to an investigation by CBC’s French-language service.

Some European practitioners have been convicted for illegally practising medicine and another is being sued — but in Quebec, total biology’s proponents are active in more than 30 Quebec cities.

The founder of total biology, Dr. Claude Sabbah, claims that up to 90 per cent of all illnesses are caused by messages from the medical community.

He teaches his approach in six-day seminars offered in France and Canada. He tells students that cancer and other diseases are formed in the brain first, and must be deprogrammed.

During the investigation, Radio-Canada journalists went undercover with hidden cameras seeking medical advice about fictitious diseases.

One of the journalists claimed to have breast cancer. She visited several total biology practitioners who told her that her life was not in danger, and the lump in her breast was the result of a maternal conflict.

She was recommended to stop chemotherapy altogether. During another visit a practitioner told her to drink champagne and relax.

Wow.  It seems that people will believe just about anything.  I want to be angry at the people who are buying into this woo, but I really can’t;  I can only feel sorrow for them.  The drive to understand tragedy and gain control over an illness in your life is strong, and I understand how these sorts of snake-oil peddlers use that to their advantage, but it makes it even more important that we educate people on the basics of medicine and science so that they can protect themselves.


Where are the NDP on science?

October 5, 2008

I’ve been paying attention to Canadian politics as I look forward to exercising my democratic rights ina couple of weeks.  I’ve never been seriously interested in the NDP, for the simple reason that they never seemed to be in a position to take power, but with the Liberals melting down in the polls recently, I’ve come to view the NDP as a serious contender for (at least) the opposition.  Since I would normally vote Liberal, this now leaves me pondering my choices more carefully.

To help figure out what I’m going to do, I sat down tonight to review the platforms of both the Liberals and the NDP.  Mr. Layton’s was interesting, with many ideas on important issues like climate change, the economy, and so on.  But if you’ve read this blog for any time at all, you’ll know that I’m a Ph.D student in Biology, and that science is very important to me.  So what is the NDP stance on science and scientific research in Canada, you ask?

Beats me.

The NDP platform is weirdly vague to begin with.  But doing a search through the document reveals a single mention of the word “science”, and that’s in regards to climate-change.  Searching for “research” leads to such vague platitudes as:

[we will…]  Encourage the best young minds to stay here in Canada by increasing funding for university and college-based research, and for graduate and post-graduate studies.

and

[we will…] Introduce measures to ensure that new drugs are evaluated through evidence-based research to be more effective, before they are prescribed by doctors and paid for by Canadians.

and

[we will…] Work with the provinces and territories to encourage research and develop strategies to minimize the effects of climate change on communities, vegetation and wildlife.

and

Stop the hollowing out of Canadian industries by strengthening the Investment Canada Act. Foreign takeovers of Canadian companies will be subject to more stringent tests respecting job protection and creation, head office location, and the promotion of research and development in Canada.

That’s literally every mention of the word “research” in the NDP platform (and every single mention of “university” as well, come right down to it), yielding not a single concrete item on the matter.  Contrast that with this section of the Liberal platform:

A Liberal government will increase support for the indirect costs of university-based research to $500 million a year, which at full implementation will represent a more than 50 percent increase over current levels.

For researchers and graduate students, a Liberal government will increase the budgets of the three granting councils by 34 percent over four years.  Support for the Canadian Institutes of Health Research (CIHR) and the Natural Sciences and Engineering Research Council (NSERC) will both increase to $1.275 billion a year from the current levels of $960 million.  Funding for the Social Sciences and Humanities Council (SSHRC) will be increased to $450 million a year from the current level of $320 million.

We will also create an Interdisciplinary Sustainability Fund of $100 million.  This Fund will be available to scientists, researchers and graduate students for projects that reach beyond the barriers of their discipline.  Interdisciplinary research is the way of the future.   It is how we will address complex scientific challenges – like adaptation to the climate change crisis – that affect our economy and our society. government will increase the budgets of the three granting councils by 34 percent.

You see, now there’s a set of hard targets that I can vote on.  Seeing as I’m funded (well, I *hope to be* funded) by NSERC, knowing that the Liberals would increase their budget is useful information.  Since NSERC and its sister agencies fund much of the public scientific research in Canada, this is a sign that the Liberals would take basic and applied science seriously.

But the NDP?  I have no idea what they would do.  They’re going to “encourage the best minds”?  How?  I might be interested in voting NDP, but I just really need to know more than this big steaming pile of nothing that I’ve got before me right now.  Jack Layon, or one of your supporters, if you’re reading this:  help a guy out.  Help me vote for you.  Explain what the hell you’re talking about.


New parallel programming tool in Python 2.6

October 3, 2008

For some reason or another, I’m getting a lot of long-term hits to this post that I wrote a few months ago on parallel programming with Python.  Thus, I thought I might share the news with people who have been looking for solutions to this problem:  Python 2.6, which was just released, contains a new multiprocessing library which at first glance seems to formalize the procedure I outlined in my previous post and make it more robust.  From the description:

multiprocessing is a package that supports spawning processes using an API similar to the threading module. The multiprocessing package offers both local and remote concurrency, effectively side-stepping the Global Interpreter Lock by using subprocesses instead of threads. Due to this, the multiprocessing module allows the programmer to fully leverage multiple processors on a given machine. It runs on both Unix and Windows.

If you’re interested in that, go grab 2.6 and check out the documentation for the package here!


In defence of accuracy (Science on TV).

October 2, 2008

I have to admit it:  I’m a tab collector.  Despite my best intentions, and productivity be damned, I inevitably find myself surfing my RSS feeds, popping open new tabs for interesting looking stories, and then winding up doing something else and forgetting about the tabs until I wonder why Firefox takes twenty minutes to come to the foreground.  Which is why I just got around to reading Jennifer Ouellette’s fantastic post about science on prime-time television, and also explains why I’m just getting around to forming my thoughts on her argument.

I urge you to read her post first – she’s the kind of writer I wish I could be, and reading her material is a treat of itself – but if you can’t spare the time, she summed things up in a comment near the bottom:

Stripped of excess verbiage above, my argument is this:

1. TV is quite possibly the most powerful communication medium in modern American society.
2. Anyone who is interested in broad communication to the general public ignores TV at their peril.
3. There is an unprecedented demand for science-themed shows right now, and hence a corresponding need for scientists to serve as technical consultants or participate in other efforts to better acquaint Hollywood with what “real” science looks like.
4. This is made more difficult by an enormous cultural gap between the two worlds: there is fear and distrust of science in Hollywood, and often open disdain by scientists towards mainstream TV, which writers and producers naturally find alienating and irksome.
5. We need more exchanges between the two worlds, and a shift in attitude on both sides, or we will lose an excellent opportunity.

This argument, alone, is one that I find convincing.  I’m happy that science is finding a place in the schedules of prime-time programming, though I won’t be too terribly surprised if we’re back to nothing but Survivor-clones when the networks over-use the “science show” idea and the public’s fancy shifts again.  Yet along the way to making this argument stick, Jennifer ends up saying two things that bother me somewhat, and I wish to address those points with my own thoughts.

First, she suggests that accuracy is less important than the popularization of science itself (reminiscent of the “framing” arguments which have stirred up so much trouble in the sciblogosphere):

True story: a year ago, I met one of the writers for Bones at Grae’s birthday party. He was initially pleased to find that I really was a fan of the show, and not just being polite. (I knew all the characters and plot twists — a dead giveaway.) But when I mentioned I was a science writer, he suddenly became guarded and defensive: “Yeah, yeah, I know, we take liberties with the science, DNA test results never come back that fast….” I reassured him that I wasn’t one of those sorts who compulsively nitpick the writers to death, and he relaxed a little. But the exchange saddened me a little. Here was this very smart, really nice guy who loves his work and finds the scientific elements fascinating. Yet his personal encounters with actual scientists have been unilaterally negative and alienating — so much so, that he physically recoiled upon first learning about my science writing credentials. That has to change, or the cultural gap will just continue to widen.

I sympathize with the writer who has run into prickly scientists.  Yet I would maintain that a higher level of accuracy is necessary on science-based dramas, for reasons both practical and philosophical.  Practically, a lack of accuracy leads to things like the by-now-well-known CSI effect, where people have come to expect things of forensic science that are simply not feasible or practical (like the seemingly 8-second DNA analysis and database search that they routinely employ on that show).  Responses to this problem typically fall into the “poetic license” category or employ the “sure, but we need to focus on communication over accuracy” argument as Jennifer obliquely makes in the quoted section above, but these responses ignore the real problems that a public misperception of what science can do may lead to (as a prosecutor frustrated by a jury demanding DNA evidence for a simply break-and-enter might attest to), and they also ignore the fact that it is possible to do both accuracy and entertainment.  There are shows that are true to the science;  as Jennifer notes, The Big Bang Theory has a realistic image of the science and the environment of science itself, and Numb3rs is great for focusing on real mathematics.  Writers of science-y shows might do well to learn from Law & Order, which (as I have been told by people involved in law enforcement) presents the best depiction of the real process of justice that is on television, even if it glosses over the more repetitive aspects.

The related philosophical problem with Jennifer’s statement above extends past the purely practical problem of the CSI effect and into the “science is magic” problem.  Jennifer criticizes Fringe for flirting with the “science is magic” viewpoint, but doesn’t really take this to its logical conclusion even as she notes the most important part when she says:

Uh, no. That is not what science is about; it’s what science fiction is about. I love both, but let’s not confuse the two.

She’s right: that’s not what science is about.  But when shows like CSI or Bones play fast and loose with the process of science and how the world actually works, they actually contribute to the problem not because they are science fiction, but because they’re not science fiction.  Science fiction is actually easier, because people can clearly distinguish between science fiction and real science.  When the Doctor says that he is going to “reverse the polarity of the neutron flow”, or when someone’s pattern is stuck in a transporter buffer on Star Trek, most people can easily realize that science as we know it does not allows us to do these things.  If NASA could suddenly achieve faster-than-light travel, people would be rightly shocked!  But though viewers can readily distinguish science from science fiction, they likely have a harder time distinguishing science on television from science in reality.  When the television presents a contemporary drama with science as an important element, the portrayal of science in that show can become the only exposure that people have to the science in question, and thus shapes their view of what science can actually do.  I don’t mean this in a pomo, constructivist-reality sort of way, but in a much more real and troubling this may be the only time that these viewers are ever going to see how this works way.  As Jennifer notes, television is one of the most important mediums of communication in our society today, and the chance that people see a show like Bones is a lot greater than the chance that they sit through a documentary on forensic anthropology on the Discovery channel.  Given that, how can we not hold these dramas to a higher standard?  Jennifer says that we shouldn’t:

Many scientists I encounter seem to incorrectly think that the scientific details are all that matter. While those are important for lending verisimilitude — particularly for procedural dramas like C.S.I., Bones, or House — network television isn’t an educational vehicle. Hollywood’s purpose is not to teach viewers about science, and TV shows are not documentaries, and should not be held to the same exacting standards — although the two are not necessarily mutually exclusive, provided both sides are willing to compromise a little. Good television is ultimately about igniting the imagination with a truly kick ass story. If we can enhance the appreciation of science (and by extension, scientists) in the bargain, so much the better, but that is not the industry objective.

But this paragraph relies on an argument that goes like this:

If we create television shows that employ “lies to children” but spark people’s imaginations, they will go out and learn the real story, and we will have a more educated public.

It is this argument that I reject as unlikely and even dangerous.  Sure, some small proportion of people may go on to have great careers in science or even just learn more in science because of some great drama they watched on television, but the vast majority of people will go no further than their TiVo.  If this is to be their only exposure to these concepts, what do we expect to happen when they are on a jury, or on a school board voting about science eduction, or voting for presidents and prime ministers who will shape science and education policy?  Jennifer is right in that the networks don’t care about this sort of thing, but to suggest that scientists should just give up and go along with it simply to get air-time is, to my mind, irresponsible and ultimately self-defeating.

The second issue that I have with her argument revolves around the depiction of scientists themselves.  Let’s see what she has to say:

Monday night was the season premiere of last year’s breakout sitcom, The Big Bang Theory, which proved to be something of a lightning rod for controversy when it debuted last year, at least within the physics community. (My own take in Symmetry magazine can be found here.) Normally, scientists content themselves with nitpicking various aspects of the science in movies and TV shows, but in this case, the science is largely correct, thanks to the efforts of technical consultant David Saltzberg, a physicist at UCLA. So most of the complaints about TBBT have been of the “negative stereotype” variety.

As I’ve said before, such criticisms might have an element of truth but they are entirely missing the point: these characters appeal to viewers. They are likable just the way they are, and that is a Good Thing for Physics. If the goal is to make physicists feel good about themselves, then okay, maybe this isn’t the best approach. But if the goal is make physics and physicists more palatable to the general public and win their hearts and minds, these characters are fantastic ambassadors. I vote for the latter.

Actually, I’ve used this quote only as a starting point, because I agree with the substance of her argument above (and the argument she advances in a post she links to here) about scientists taking their portrayals too seriously;  no comedy (and few dramas, for that matter), get very far depicting characters who are entirely realistic.  But my problem isn’t with “negative” stereotypes, but rather “positive” ones.  I’ve talked about this before, but shows like The Big Bang Theory, CSI, Bones, Numb3rs, and so on all depict scientists unrealistically as incredibly brilliant people who know just about everything and rarely make mistakes.  This contirbutes to the “science as magic” problem by showing us “scientists as magicians”.  Here we are effectively told that the only people who do science are super-geniuses with an encyclopedic knowledge of everything in their field and in some cases of things way outside it, who can whip up science in a second and come up with answers to just about any problem.  Even one of my favourite characters, Charlie Epps from Numb3rs is guilty of this:  though the methods he uses are real and the techniques are sound, he does the work of a dozen people!  Any practicing scientist knows that science is a team game now because it’s impossible to be a polymath any more;  the days of a single person contributing to physics, chemistry, and biology before lunch and rounding things off with a few contributions to mathematics before tea are gone, and it’s increasingly difficult for people to keep up with the tiny corners of the scientific literature that they inhabit themselves.

Yet as intimidating as these characters are to someone like me, who is a scientist and who actually works at this sort of thing, imagine what they look like to someone sitting on their couch at home.  How can we expect to attract people to science if we present nothing but these images of super-people at the lab bench?  Again, we can look back to Bones.  The lead character, Temperance Brennan, is a genius anthropologist, but her assistant is even worse:  a child prodigy, a genius with an IQ of 160+ and packing a “photographic memory” (grrr), yet he always seems to be stumbling behind Brennan (at least in the first season, which is all that I’ve watched so far).  If someone like him can’t keep up with the lead character, how can anyone in the audience picture themselves being motivated to become scientists themselves or even spend any time learning more about science?  Characters like this present such an incredibly high barrier to entry that it seems futile to even try!

Again, the common response to my objections about this is that people either know the difference between fictional depictions of scientists and real scientists, or that the shows will “spark their imagination”, and they’ll flock to the lab for the drama and stay for the science.  And sure, enrollments in forensic science classes surged after CSI became popular.  But if you ask a person on the street if they could see themselves learning anything about the science of physics, or mathematics, or chemistry, or biology, you’ll most often get a self-deprecating laugh and refusal, or a blank stare.  And this is how we’re going to create greater appreciation of science, by portraying scientists as super-men and women who are something Other?  These are the ambassadors that Jennifer speaks of?  It does us no good to win the hearts and minds of people if we’re winning them with the scientific equivalent of demi-gods.[1]

Actually, this is something that I’m sure many other academics and practicing scientists have run into:  mentioning science, or physics, or – God help you – math to someone who isn’t a science person turns your occupation into something untouchable, something to be placed on a pedestal and admired from afar, despite your best efforts to have a normal conversation with the person in question.  And I submit to you that the depictions of scientists on television are a contributing factor for this problem, and that these depictions are something that scientists should be concerned about.  I’m all for the need to show heroes on television, but maybe we could take Numb3rs and cross it with the old Mission: Impossible to get a show where a team of fairly bright people come together to solve hard crimes with some cool math, instead of a show where a single untouchable genius saves the day every damn time.

My word count is telling me that I’ve ranted on for far too long, and my body is telling me that it is time to go to bed, so I’ll leave it here for now.  I’ll just close with this:  instead of satisfying ourselves with what we see on television, perhaps we as scientists, should try even harder to push realistic images of science and scientists out onto the airwaves.  I think that society might thank us, in the long run.

___________

Back to post [1] I think that Chad Orzel at Uncertain Principles may have said something similar in recent months, but for the life of me I cannot find the relevant posts right now.