The challenges of scientific communication

I read with strong interest this post “How Hard Science Saves Lives” from Bente Lilja Bye at Science 2.0. I will make a very short summary for presentation purposes, but I encourage to read through her very interesting post.

The point being made, shortly stated, is the argument between hard-science and soft-science representatives on saving human lives through hard-science research. With hard-science is intended chemistry, geology, mathematics, physics, and any other discipline requiring the application of the scientific method to rigorous, quantifiable information; On the other hand, soft-science are disciplines like sociology, political science, psychology, and more generally encompasses journalists, politicians, and the layperson. The controversy is that hard-science research doesn’t save lives, a position brilliantly refuted in the post with effective and concrete examples.

I had the same issues with soft-science scholars in the past; similar personal experiences, where scientific knowledge is not considered strictly as “culture”, or where the fact of not understanding math or chemistry was presented as an asset to be proud of, rather than a lack of knowledge to compensate as soon as possible with simple, plain curiosity. I also observe that many scientists and hard-science practitioners I know are also generally interested in philosophy, arts, sociology, psychology, behavior, literature, and they actively search for more information on these topics. On the other hand, soft-science representatives I know, seldom search for accessible scientific knowledge to complement their expertise.

Where does this issue comes from? What are the reasons behind the pure existence of the argument? What can be made to address the issue? I seldom use this blog for “opinion posts”, but I think the observation that such issue exists in the first place is a phenomenon that, as scientists, we should analyze by virtue of its intrinsic existence. The risk to neglect this analysis is lingering misunderstanding and falsity, and as scientists it is our duty to promote the truth.

I personally believe there are many factors to be considered for this analysis. It is a complex and long post, so I tried to make it manageable. I divided my post into different sections, one for each factor. In each section, I will

  1. try to analyze one specific factor I consider important
  2. analyze the root causes of the issue
  3. propose possible strategies for mitigation.

I will rely solely on my experience for this analysis, which can be in some cases not factual nor representative of a general behavior. You will feel a lot of weasel words, a lot of “citation needed” spots along the way. I am aware of this, and I basically risk to become what I criticize in lack of proper communication, thus condemning myself. I plead guilty and appeal to the  McKean’s law extended to concepts and the Gödel’s incompleteness theorems for extenuation causes. I also declare I am ready to change my statements in response to additional experiences complementing or refuting the points being made.

Next page >>

Fortran 90 pitfall: initialization of vars at declaration

I am dusting my Fortran 90 skills. One big gotcha that always leaves me baffled is the following. Suppose you write the following program

program test
  implicit none

  call testsub()
  call testsub()
end program

subroutine testsub()
  implicit none
  integer :: var

  var = 0
  print *, var
  var = 5
  print *, var
end subroutine

If you expect the output to be

0
5
0
5

you are right. This is indeed the output you get.

Now consider the following slight different testsub routine

subroutine testsub()
  implicit none
  integer :: var = 0

  print *, var
  var = 5
  print *, var
end subroutine

See the difference ? I just coalesced the first assignment of var to the
declaration line. You wouldn’t expect a big difference right ? Sorry to bring
the news, but that’s a completely different story. The output you will obtain is

0
5
5
5

What happened? The fact arises from a very subtle point of the Fortran
standard: local vars with initialization at declaration are automatically SAVE,
so they preserve their content between subsequent calls (in C terms, they
are local static). In other words, this statement

integer :: var = 0

is totally equivalent to

integer, save :: var = 0

This is totally counter-intuitive and a huge pitfall if you don’t know it. What’s the rationale behind this practice ? I asked on StackOverflow, and user kemiisto referred me to this page where this behavior is explained in rather detail. The reason is due to historical bad practices.

Apparently, initialization during declaration was already possible in Fortran 77. Usage of this variable without redefinition was allowed behavior, commonly done when you initialize and assign a parameter, for example. On the other hand, redefinition within the routine body was a disallowed practice because, according to the standard, the variable technically became undefined upon reentry.

Before standardization of Fortran 90, the actual internal handling of initialization during declaration was performed with a lot of freedom by compilers, as there was nothing specifying for that in the standard. There were two possible strategies to perform it: static initialization (doing the assignment only once), and reinitialization at every new subroutine call (doing it every time). These two solutions are equivalent, if no reassignment is done inside the subroutine, i.e. the expected practice according to the standard. Compilers were free to choose which strategy to use, but in practice, most compilers used the “initialize once and consider it static” strategy, probably because it’s more efficient (you assign only once), so even if the variable was technically undefined if  reassignment occurred, in practice it behaved like a static variable.

While the Fortran 90 standard was defined, a lot of code was produced abusing this behavior. As time passed, forbidding it in the new release was not feasible, because it would have introduced a lot of trouble with existing code. This was probably one of those moment in history where programmers would have learned that when something is declared undefined in the standard, it’s your fault if you abuse it, and you eventually pay the consequences. The Fortran committee instead condoned and ratified this practice, and now it is part of the standard. Regardless of its status, please follow my advice and stay away from it.

Fear the crowd. Digg 4 spurs users’ revolt.

The community-powered news site Digg played an occasional role on the development of this blog. Some of the findings I posted here started, in some cases, as a spark from a Digg submission, further developed through my personal research. This is the reason why I am writing here about it. News on Digg were frequent and fresh: reloading the page after some minute was already enough to see new upcoming content, and the time span from release to fruition was short, much shorter than Slashdot (which I also follow with very strong interest since almost the very beginning). Last but not least, in addition to interesting scientific or technological news, Digg was also one of the best sites to waste time on when bored.

This all changed recently. Digg’s new version (Digg 4), introduced a radical change on both interface layout and use. Apart from the huge amount of errors the new site presented to the user (the now infamous Ox cart axle message), the main page content has become so stable that reloading and checking “what’s fresh on the web, now” is no longer possible.

The recent changes triggered a raging reaction from the community, and in a perfect and hilarious example of coordinated mob assault, submissions promoted by the community to the current “Top News” front page now contains only links toward the similar site Reddit. If you are the host for an army of users so large they can bring servers down, having them unsatisfied can promote some issue to be dealt with.

I certainly hope the old Digg style comes back, otherwise I will have to look for alternatives to stay fresh on the internet.

Eight molecules that changed the rules of the game: Bakelite

Rule changed: it started the world of plastic we live in

Bakelite

Bakelite structure

When it comes to materials for making tools, housing, chariots, and dishes, humanity had only one choice for many thousands of years: use what nature provided. Clay, rocks, metals, resins, rubber, and wood were the most common materials directly available for harvesting. As primitive technology improved, materials with new and interesting properties were created, such as glass and concrete, but at that time there was little or no understanding of the “magic” behind the process, the new material’s properties, or how to improve them, except by trial and error. The discovery process improved considerably when the rules of physics and chemistry were rationalized: the gained understanding of existing natural materials made possible to design similar ones, either partially or completely synthetic, endowed with unusual interesting properties. One remarkable example of these man-made compounds is plastic: discovered at the end of the 19th century, plastic materials changed and still change the world. Read More »

New StackExchange proposal: Academia

I just created a new proposal at Area51: Academia. The aim of such Question/Answers site, when opened, is to provide assistance to academics of any level and discipline, with particular focus towards academic life, grants, papers and posters, conferences, career, management, research group directions, and academic services.

You can subscribe to the proposal by following this link and clicking “follow”. You will probably have to login using any OpenID provider (such as Google mail).

Google stops Wave development

Google decided to interrupt further development of Wave. The service itself remains active, though. I appear not to be good at predictions: a year ago, I expected Wave to take over email definitely. To be fair, a condition I added was for the server to be made public for third parties, something that never happened and is not going to happen, but to be even more fair, if this had happened the result would not have been different today, I think.

I’m not particularly sad. I subscribed to the beta, and tested Wave as soon as I got access. After some days of loneliness, some friends were allowed in, and we started using it for communication and collaborative writing. Wave is technically amazing, but once you use it for a while, you realize it’s not an email, not a wiki, not a chat. Its main characteristic is NOT to be something, and the final product is impractical for use on each task.

Despite is intrinsic lack of success, Wave gave me a sound demonstration of two important facts: that an impressive technical product is not also a successful consumer product; and that usability of a consumer end-product comes from specialization for use cases.

Hacking your brain for fun

I just came back from Nolan’s latest creation, Inception, and I was completely blown away. The core of the very elaborate plot is the concept of dreaming and consciousness levels inside dreams, in particular taking advantage of the science-fiction concept of “shared dreams”. Not unlike in The Matrix, questions about “what is real, what is a dream” are central in the movie.

That brings me to recall my exploration of the dreaming realm. I used to perform Yoga for a while, and in particular a sub-activity of Yoga called Yoga Nidra. It is an interesting technique that allows you to relax and feel refreshed by “sleeping” a very short amount of time. It is not a substitute for regular sleep, though. The idea is to relax under the guide of the teacher, whose voice instructs you to feel and concentrate your awareness first on different parts of your body, then to colors and visual images, in a completely dark and quiet room. The very relaxing and soothing situation will most likely bring you to fall asleep, and here is the trick: you must not sleep. Instead, you have to fall asleep only “halfway through“. This probably “disables” parts of your brain, allowing you to achieve a strange state of mind where your brain is awake, but lose consciousness of your body. An inexperienced person like me is not able to hold this state for long. It is very subtle and prone to collapse either to full sleep or to full alertness, but with practice and training it is possible to keep it stable for a considerable amount of time. I experienced a floating-like state, or vivid, very real pictures of landscapes, like they were in front of my eyes.

There’s nothing mystic about Yoga Nidra. The brain is a very strange and complex entity, still far from being understood. At the moment we don’t know how it really works while being awake, asleep, or when involved in a Yoga meditation, as we don’t know many, many other things relatively to self-awareness, consciousness and dreaming: we don’t know why children are not self-aware until the 18th month of age; we don’t know why sometimes we have a Deja-vu; we don’t know why we never remember how a dream begins; and we don’t know why even if the dream details are vivid shortly after waking up, they generally vanish within few minutes with poor or no chance of recalling them afterward. We don’t even know why we dream.

What we do know, however, is that the brain is a biological computer, a neural network whose wiring, weights and operations have been laid out by evolution, primed during pregnancy and trained during our lifetime to answer the inputs provided by the external environment. Two consequences should come to no surprise: that it’s a difficult machine to understand, and that it has “exploits”, bugs and “undocumented features”, like any other traditional computer. Our brain is a hackable machine that under proper conditions and inputs can behave in very strange ways: lucid dreams, out of body experiences, pre-lucid dreams, and the false awakenings (the Matryoshka dreams) exploited in Inception. If the system “breaks down”, it can produce temporary or permanent pathologies, such as depression, seizures, schizophrenia, and hallucinations among others. The brain is such powerful sensation and perception processor that it can create symptoms for an illness as real as the actual pathology, even when no actual cause exists. It can get a woman to feel and show the full symptoms of a pregnancy even if there’s no developing fetus at all. These phenomena are found in animals as well. I personally witnessed a false pregnancy in my Great Dane, as well as various level of dog dreaming.

I suggest to give Yoga Nidra a try. It’s a highly instructive and pleasant activity that allows an easy, accessible and harmless experiment with your brain.

StackExchange sites proliferation

I am observing with great interest the development at Area51 for new Question/Answers sites to be opened with the StackExchange system. One thing that makes me cringe a bit is the very strong fragmentation. I think this stems either from the need of personal protagonism of each person (nothing bad with it, progress happens also thanks to personal protagonism), or by lack of notice that a similar proposal has already been done. I could be wrong though, and I accept criticism on this point.

Read More »

The Mandelbrot set, in python

Hello StumbleUpon users. I am writing two additional posts on the Mandelbrot set, and you may be interested in them. The first one is here. The second one is here. Thank you for your interest!

This code is so fascinating

from PIL import Image

max_iteration = 1000
x_center = -1.0
y_center =  0.0
size = 300

im = Image.new("RGB", (size,size))
for i in xrange(size):
    for j in xrange(size):
        x,y = ( x_center + 4.0*float(i-size/2)/size,
                  y_center + 4.0*float(j-size/2)/size
                )

        a,b = (0.0, 0.0)
        iteration = 0

        while (a**2 + b**2 <= 4.0 and iteration < max_iteration):
            a,b = a**2 - b**2 + x, 2*a*b + y
            iteration += 1
        if iteration == max_iteration:
            color_value = 255
        else:
            color_value = iteration*10 % 255
        im.putpixel( (i,j), (color_value, color_value, color_value))

im.save("mandelbrot.png", "PNG")

If you execute the python code above, the result is this beautiful and mysterious picture:

Mandelbrot Set

Mandelbrot Set

What you see is a Fractal, a highly fractured geometric picture, and more specifically one of the most famous representatives: the Mandelbrot Set. I am not familiar at all with the mathematics behind fractals, so I won’t talk about them, or I will simply end up saying something wrong.

Such a highly featured and attractive picture is obtained from a really simple algorithm. It can be explained easily: take a grid of points on the plane, like for example a simple sheet of graph paper. Choose a scale for the axes. For every point (x,y) of the plane now do the following:

  1. start with an empty vector (a,b) containing (0.0, 0.0)
  2. create a new (a,b) vector as (a2 – b2 + x, 2ab + y)
  3. continue with the procedure given in 2. If the length of the vector (a,b) becomes larger than 2.0, plot the (x,y) point black or a shade of gray, depending how far you got in the iterations. Instead, if the length of the vector stays below 2.0 after a given maximum amount of iterations, plot the (x,y) point white.

This, as said, decides the color of one single point (hence, a pixel of the image). Repeat for all the pixels and what you obtain is the Mandelbrot set.

You can also think in terms of complex numbers, plotting on the complex plane. Instead of (a,b) we now have a single complex number z0, and instead of (x,y) we now have a complex number c. The repeated operation now can be described as

  1. z0 = 0.0
  2. c = current complex number expressed by the current pixel point on the complex plane
  3. repeatedly compute zn+1 = zn2 + c
  4. if the absolute value of z goes beyond 2.0, plot black or gray, otherwise plot white, as given before.

What if you change the starting point? What if we choose z0 = 1.0 instead of 0.0, or z0 = 1.0 i ? I tinkered with the program a bit. Here are the results. This image shows how the Mandelbrot Set changes when z0 goes from -3 to 3 (step 0.1). The set “blows away” towards the left, when going either towards -3 or +3.

If you change z0 along the imaginary axis, going from -3.0 i to 3.0 i, what you obtain is instead:

It blows away towards the right. So I said, what happens if I increase both the real part and the imaginary part together? will they “balance out” ? Not really. It burns away

I have absolutely no idea of what all this means from the strict mathematical point of view, except the fact that I am exploring the space of the values of z0 and how the Mandelbrot changes accordingly. I thought it was just cool to try it out.

A Question/Answers site for Popular Science

The kind folks behind StackOverflow, a free Question/Answers website for programming questions, recently decided to open new Q/A websites for many additional interesting topics, from wine tasting and cooking to mathematics. The fundamental requisite for such new sites to be opened is a rather strict community review and development of a critical mass of contributors and interested people. On area51.stackexchange.com the proposals are collected and evaluated by the community.

I really enjoyed the proposal for a Popular Science Q/A site, and if the site is going to be opened, I will certainly be an active contributor. If you are interested, feel free to click on the link and then click “follow” on the proposal. This will largely increase the chances for such site to be opened. I am also positively interested and enthusiast for Q/A sites for Chemistry, Astronomy, Bioinformatics and, as a very old Dungeons and Dragons player, Role-Playing Games.