Science vs. Software

While browsing some of the content on slashdot.org I came across a link to John Cook’s blog, which discussed the differences between scientists and programmers when it comes to developing code.  The original article can be found here.

The key statement in his blog entry is

“Programmers need to understand that sometimes a program really only needs to run once, on one set of input, with expert supervision. Scientists need to understand that prototype code may need a complete rewrite before it can be used in production.”

As a computational materials scientist extending my competency in software engineering, I fully agree with this statement.  All too often, when graduate students, postdocs, and scientists leave their position and pass on their code to colleagues, a tremendous gap in knowledge results.  This is because the comprehension and use of the software is intricately linked to the person who developed it.  Thus significant one-on-one training is required to ensure that a new user fully understands the code and can make use of it.

The Galton Watson Process – Part II

4 Probability of Extinction

The probability a process is extinct by the ${n}$-th generation is given by

$\displaystyle e_n = P(X_n = 0) \ \ \ \ \ (9)$

Since there is exactly one parent at the beginning of the process (i.e. ${X_0 = 1}$) who produces all the future children, we can say that the probability that ${X_0}$ is equal to 1 is 100%, or ${P(X_0 = 1) = 1}$. Because there is definitely only one parent in the beginning, ${X_0}$ cannot be equal to any other value except one. This can be written mathematically as ${P(X_0 = i) = 0}$ for ${i \ne 1}$. The probability generation function of the total number of people in generation ${n}$ (i.e. ${X_n}$) is given by:

$\displaystyle G_n(s) = \sum_{i=0}^{\infty} P(X_n=i)s^i \ \ \ \ \ (10)$

The Galton Watson Process – Part I

What are the chances of you having the last name you currently have, over that of some other last name? How many children did your ancestors have, on average, in order to ensure that your surname didn’t become extinct, but instead continued to be passed down from generation to generation?

This is a review of previous work that has been done in order to answer, in part, these questions. I hope that this will be used as an educational source to teach others in an easy to digest manner. From my perspective, I get the opportunity to learn about a new topic while working in a new programming language, in this case Python. I chose Python specifically to gain experience with straightforward plotting capabilities (from matlibplot). This will come at the cost of reduced performance over using traditional scientific programming languages such as C++ or Fortran. I will do my best to use the numpy library for some performance boosts to the code where possible.

My contribution will be to translate the analytics into a readily understandable mode and to develop a numerical Monte Carlo simulation software which will compare the results to the well-established analytical model. The process that is explored here is called the Galton-Watson process which describes the manner in which a surname is passed down from generation to generation.

1 Galton-Watson Process

Let us propose the problem of finding the probability of extinction for a lineage of people, where we start in the 0th generation with 1 male parent. In the first generation there are $0,1,2,3,\dots$ possible male offspring where there are distinct probabilities associated with having a certain number of kids. If there are $k$ children in the first generation then in the second generation there will be $C_1 + C_2 + \dots + C_k$ offspring where $C_1, C_2, \dots , C_k$ are independent random variables each with identical distribution probabilities. The situation described here is a branching stochastic process known as the Galton-Watson process.

Figure 1: A particular scenario showing the first 4 generations of the growth of the family of ‘Awesome’.

Welcome

Welcome to Core Computations! This is my first ever blog post and I would like to share this occasion with everyone by saying I’m glad you found your way here. The purpose of this blog is to share useful technical information with others in an open forum. The topics will all be related to math, science, engineering, technology, or computingin some way. My hope is that I can provide tutorials for both technical and simulation/modeling subject matter. I will attempt to fill in the blanks where I have had difficulties in the past and to also introduce you to some stimulating topics.

This documentation will also provide for useful reference notes. As I write this I am preparing the first real content-based post which will discuss the Galton Watson Process. I then have plans to tackle projects concerning OpenGL, CUDA/OpenCL, LaTeX, Phase Field Crystal, Linux, and Eclipse GUI programming. These will all be written in a way that will be easy to follow, even for beginners.For those interested in starting a blog I would like to give you my reasons for choosing WordPress. Of the options out there for blogging, WordPress is free and is simple to use. Specifically, it is easy to incorporate code syntax highlighting and equations in LaTeX form. WordPress also has a huge user base meaning that long term support is very likely.

This is a part time personal project. Since I am currently employed full time I will try my best to add new content as often as possible. The content of this site is mine, however all the maintenance, editing, formatting, and design is a result of the efforts of my significant other. Without her help I would definitely be struggling to find time to get this project off the ground, and that is why I am thanking her right now — thank you! Also, I would like to state as a disclaimer the content here may have bugs in the code or errors, but I will do my best to minimize such undesirables.

Traditionally I’ve always been somewhat against the term “blog” which, according to Wikipedia, stems from joining the two words web and log together and has since then been shorted to blog. Something about the word makes me feel like its an onomatopoeia and I get a visual sensation of someone who has succumbed to food poisoning. So lets go with journey instead, as it has a more positive connotation and definitely sounds more adventurous. With the definition of this site now in place, I would like to again welcome you. I hope that you enjoy your stay!

Ian