Showing posts with label math. Show all posts
Showing posts with label math. Show all posts

Tuesday, November 11, 2008

"You can use math to do that?" Part 2

In the previous post of this series, I introduced the idea of mathematical modelling and gave a simple model of population growth of bacteria. We ended with the expression

P(t+1) = P(t) + bP(t) - dP(t) ,

where P(t) is the population at (discrete) time t and b and d are the positive birth and death rates, respectively. Now that we've used our biological knowledge to come up with this equation, let's use some math knowledge to learn more about it and what it can tell us about bacteria growth.

First, we can collect like terms, and make the expression simpler. This is like using the fact that x + 2x = 3x, since we have like terms of x and 2x. Since most people become physically ill when algebra is mentioned, I'll just write down the collected terms in our P(t) formula, and get

P(t+1) = (1 + b - d) P(t) .

This "new" form of our population equation can tell us something about what will happen to our population in the long-run (that is, as we let t get larger and larger). The above expression is an example of a geometric sequence. A sequence is just a list of numbers, following some pattern. In a geometric sequence, each number in the sequence is related to the previous one by multiplying it by a constant value. Using another mathematical trick, let's make a substitution, and let
k = 1 + b - d ,
so that our equation really is

P(t+1) = k P(t) .

In this form, we can really see what will happen to our population. If we start with some initial population size, such as P(0) = 100, then using our simplified equation above, we can find P(1), which is
P(1) = k P(0) = 100k.

Then

P(2) = k P(1) = k (100k) = 100 k^2

and

P(3) = k P(2) = 100k^3

and so on. If we look at the pattern here, we see that there is a general equation for

P(t) = P(0) k^t

if the initial population is P(0) and k = 1+ b - d. If you're still with me at this point, you might be asking "so what does this get us, exactly?". Well, if we know what k is, it tells us a lot. The growth in the population depends completely on what k is, which depends on what b and d are. This makes sense: the birth and death rates determine what will happen to the little bacteria culture we have growing. Let's look at an example to see how.

Suppose that b = 0.2 and d = 0.1, meaning that k = 1 + 0.2 - 0.1 = 1.1 in the equation above. Then if we look at powers of k, we get (1.1)^2 = 1.21, (1.1)^3 = 1.331, (1.1)^4 = 1.4641, and so on. You can check for yourself that each power gets larger, and is larger than the previous one. That means as t increases, (1.1)^t is also increases, and in turn, P(t) is increasing. This makes some intuitive sense, since this is a result of the birth rate being higher than the death rate. Since at each time step there are more births and deaths, the population will increase indefinitely. This is a little bit unrealistic, since there are limits to growth (the amount of food the bacteria have available to them, having no more space in the petri dish, etc). This is due to the simplicity of the model, by the strong assumption that birth and death rates are constant in time. Still, the model does tell us something that makes sense and is realistic.

Let's look at the opposite case now. Suppose that b = 0.1 and d = 0.2 so that k = 1 + 0.1 - 0.2 = 0.9. If we look at powers of this k, we get (0.9)^2 = 0.81, (0.9)^3 = 0.729, (0.9)^4 = 0.6561 and so on. Here, as t increases, (0.9)^t is decreasing, and since it can never be negative, it will shrink smaller and smaller until it is almost zero. Biologically this means the bacteria will eventually go extinct if there more deaths than births at each time step. Again, this is exactly what you'd expect. The model, while pretty simple, makes biological sense, and so if our assumptions are not too strict, it would be a good model of bacteria growing in a laboratory.

So, there's a simple model of population growth. Of course, there more complicated models, like the logistic equation, which has rich mathematical properties as well. Personally, I think this area of study is really cool. Math is as useful as it is fun!

Wednesday, November 5, 2008

"You can use math to do that?"

So, after a short hiatus (due to sketchy internet connections), I thought I'd continue along with some posts relating to my current position as a math grad student. Now that you've had a small taste of mathematical biology, you might be asking yourself "That sounds really interesting and stuff, but how do you actually use math for that?". This question comes up a surprising amount when it comes up that I'm an applied math person, and have done or seen projects on epidemic spreads or why individuals cooperate with one another. Most people just don't see the connection between mathematical modelling and "real life" problems. So, as a primer on this, let's talk about mathematical modelling.

The main idea behind mathematical modelling is to try to describe a problem or situation using mathematics and then gain insight from the maths that you've come up with. Think of it as translating the problem into another language, a language that you can work with to find a solution. Once you have this solution, you can just translate it back and see what it says. The goal is to make sure that the translation in either direction is good, and that nothing gets lost or distorted. Usually, this is the toughest part: coming up with a good model to begin with (and when I say model, I mean a set of expressions describing the problem, not Tyra Banks or Christine Brinkley). Once you get a solid model, usually you can analyze it shed some light onto the problem at hand. Perhaps this is a good time to lead by example.

Suppose I'm a biologist, and I am studying bacteria in laboratory settings. In between the lavish late nights I enjoy in such a profession, I want to understand what influences bacteria population growth or extinction. Here, there's at least two ways I can look how bacteria grows
  1. Collect data from the bacteria in petri dishes, and make some plots with it.
  2. Create a mathematical model based on what I know about bacteria.
Of course, I could do both, which would really better my understanding of bacteria population growth. But, since I'm a biologist that loves mathematical models, I'll try the second approach.

First, I'll need some variables to work with. Suppose that P(t) is the population of the bacteria at time t. I want to find an expression for what P(t) for any general time t, so the goal is to find a mathematical model that represents this.

Now, I'll need to make some assumptions.
  • Assume the population changes at regular, discrete time intervals (for example, the population only changes every hour, and not all the time). This may seem a bit strong ("bacteria reproduce all the time, like a million times a minute!" you say) but this is part of translating the bacteria problem into math. I have to make some kind of simplification or else I won't have anything to work with.
  • Also, I assume that the only way the population can change is by bacteria reproducing or dying. This means that I can't just "add in" bacteria once I've started, nor can they just "appear" out of nowhere. They have to be the result of reproduction.
  • Finally, I'll assume that bacteria reproduce and die directly proportional to the population size. In layman's terms, this means that the more bacteria there are, the more will reproduce or die at any time step.

So, with these assumptions in place, I can now develop a model. The simplest model has the form

P(t+1) = P(t) + births - deaths


which means that my population at the next time step is just the population at the previous time step plus the increase from births and less the decrease from deaths. In population dynamics, many, many models start out with "births - deaths".

If assume that the birth and death rates are just a constant proportion of the population at time t, then I can turn this into

P(t+1) = P(t) + bP(t) - dP(t)


where b is the constant birth rate, and d is a constant death rate, and both are fixed constants. What these mean is that at each time step a proportion b of the population reproduces (remember, these are bacteria, so let's just say that they divide to reproduce), and another proportion d die.

So, there is it, I've come up with a mathematical model of bacteria growing. I've now translated the problem of how bacteria grow into mathematics. But that's a lot of work for one day for mathematical biologist, so in my next post, I'll look at working with this model to get some results out of it, and translating those back into real answers.

Wednesday, October 29, 2008

Disease, Heart Attacks and Grizzly Bears: An Introduction to Mathematical Biology

As I've mentioned in a previous post, I'm currently completing a master's degree in mathematical biology. Since this isn't the first thing people see opening up the newspaper or gossip magazines, I thought I'd give you an idea of what exactly mathbio is and what it entails.

The short version is that mathematical biology is exactly what it sounds like: using mathematical methods and techniques to solve problems in biology. What kinds of problems, you ask? Almost all areas of biology can be found in a mathematical context, from ecosystem management to immunology to pure evolutionary theory. Pretty much any area you could study in biology has had someone, somewhere look at things from a mathematical perspective.

Personally, I think that this is a great thing, both on the biological side and the mathematical side. The biology community gets new angles to view problems from and hard quantitative results that can be the basis for experiments and further hypotheses. The mathematical community gets motivation for problems and for more pure mathematical research areas. And everyone gets solutions which could potentially save lives and better the understanding of the world we live in. Mathematical biology is undergoing a revolution of sorts, which began earlier in the 20th Century, and whose fruits are being realized now at larger scales, and not just in the ivory tower. Let me give you a few examples to illustrate this.

Take mathematical epidemiology. In Canada, this seems to be the largest subfield of mathbio (but I could be wrong). This area looks at the study of infectious diseases and epidemics and tries to model them using equations. The goal is to better understand how epidemics begin, persist, and what can be done to prevent or constrain them. Using mathematical models allows researchers and medical professionals to consider different scenarios and look at specific factors and their impact, without any risk or harm to the general population. For example, I've seen models looking at factors causing and preventing Mad Cow disease in livestock, of HPV (human papillomavirus ) and the effectiveness of potential vaccination regimes, and of the spread of HIV in parts of sub-Saharan Africa. These are certainly real issues with real consequences, and solutions are being developed by applied mathematicians and health researchers.

Or perhaps you'd be more interested in mathematical ecology. Ecology is the study of how species interact on a macro level in ecosystems, and what affects the population growth or decline of species. Modelling predator-prey or competing species interactions are classic examples of mathematical biology. One of the most studied examples is the dynamics of lynx-hare populations in the Canadian Arctic. The hare is prey for the lynx, and as one population changes, so does the other. Salmon are an example of competing species. Salmon farms are usually situated near wild salmon habitats, so they use some of the same resources, and there is a chance that either the farm or wild salmon could wipe out the other, each case with negative consequences. I have seen papers and presentations of both ecological situations. Even more interesting is the fact that such ecological modelling has yielded some rich mathematics, specifically for the fields of dynamical systems and chaos theory. Perhaps this shows nature has much to show us about the intricacies of mathematics.

If neither of those took your fancy, perhaps you'd be interested in mathematical physiology and medicine. This area sees the mathematical modelling of physiological processes and medical treatments, and attempts to use math to gain a better understanding how the human body works and how we can better heal it. One big area of research here is tumour development and growth. Here, mathematics and related methods are used to study how tumours grow and sustain themselves and how they can be stopped or at least controlled. Related to this is the study of cancer and how it begins at the cellular level. I have also seen research done on causes of heart attacks and irregular heartbeats and how a to design a better kidney dialysis machine, both using good old mathematics. This I think could be the most promising area of mathbio research, since it could benefit almost everyone by furthering our understanding of medical treatments without using real patients or scarce medical resources. And again it could also give more insight to underlying maths that are used to model such problems.

I should mention that my research isn't really in any of these research areas. I'm more into evolutionary game theory and the evolution of cooperation, which is a pretty cool topic in itself, loosely based the question "Why bother helping others out when you just free load instead?". I'll give more insight to this question and my rears later on. But I hope that I've at least shed a little light on this thing called mathematical biology. But there's lots more than what I've written above. From tropical diseases to why we have sex, a mathbio researcher has used math to understand it.

Tuesday, October 21, 2008

"So, what are you going to do with that?"

This is probably the most annoying question that I get asked on a semi-regular basis. I'm finishing a Master's degree in applied math, and I'll be out looking for work or more school in only a few months. Clearly, I'm asking myself this question as well. But answering this question is tricky sometimes; it's not easy to be specific, and sometimes my response may appear flaky. The result is some awkward situations when "what I do for a living" comes up in oh so casual conversation. Also, saying that I'm a graduate student leads to some funny reactions. Here's why I think this is the case.

First of all, people really don't like math. Some people would rather boil their hair and drink the broth than talk about math. They hated it, had a bad teacher experience, failed some courses or just plain "didn't get it". This means that saying "I'm a math student" or "I do research in math" kills social interactions almost instantly. People just aren't interested. That's why I sometimes say I do mathematical biology, because at least some people like biology. Or that I research the evolution of cooperation, of why animals and people cooperate with one another. That at least goes over well sometimes. But in general, mentioning math is cocktail party suicide. I think this is really unfortunate, but such is life.

Of course, saying I'm a graduate student doesn't fare much better. I think that individuals who aren't in or have done postgraduate work get a little confused by this. They hear "student" and think "poor, unemployed, possibly lazy, but working towards something good hopefully". But there's also the "graduate" part in that statement. Most individuals in the non-academic world went to school at least partially to have better job prospects, perhaps even pursue a professional career like law or medicine. They certainly didn't go to school for the sake of going to school (right?). So when they hear "graduate student" I think some "working world" individuals think I went to school to go to more school, to avoid "working for Man" as it were. "If I'm in school I don't have to grow up and get a real job and be an adult, so why wouldn't I stay in school?" must be my line of reasoning.

Well, it isn't. Why I went to grad school will likely be a topic for another day, but I can say that avoiding "the Man" was not a large factor. Instead, I'll offer my insight to what a graduate student "does" in terms of it being a job (which it is). In some ways, it's like being an apprentice; you learn the in's and out's of research, what's going on in your field of study, and general professional conduct of being a professor/researcher/university teacher. For example, I'm currently writing my thesis, and it needs to include certain things and particular details. With this, I'm also reading up on current research and being exposed to what's happening in the field at the moment. I'm also a TA for a course in linear algebra, which involves marking tests and preparing tutorials each week for a section of around 75 students. Lastly, I engage with other students, professors and researchers on a regular basis to discuss other academic issues and research areas. These are typical duties of a grad student, and add up to a pretty involved "job". I also find time to have fun and prepare for a wedding in less than a year. I enjoy my current line of work, even with its downsides.

So in a nutshell, that's "what I do". What I'm going to "do" with this experience is obviously not as clear. I will likely be looking for work in the "real" world, and likely job positions are things like software developer, actuary, some kind of "analyst" or even teaching at either the high school or college level (university level is not looking good at this point for me). But those are just ideas, and I'm sure there are other things out there for me. Really I'd like a position that let's me do mathy stuff all day, so something quantitative. I'm also comfortable with computers and programming. However, I'll just have to see what I do with my Master's degree.