Interview with A.I. Chatbot George about A.I.
June 25th, 2008
Here's an unedited transcript of my difficult interview with George, the Jabberwacky AI chat bot, on the topic of artificial intelligence. I chose George because he learns entirely by human interaction as opposed to a chat bot like A.L.I.C.E. which just uses specific pattern matching conversation rules. Even then, it was really hard to get him to stay on topic, especially near the end...
Motion Sensor Manipulated Mathematics
June 15th, 2008
Taking Control of Mathematica was posted on the Wolfram blog about 10 months ago. That just shows you how how far behind I am on the blog schedule because I finally got a chance to try it out.
Mathematica 6 has built in support for input devices with the Manipulate function. So, you can use a number of controllers to adjust any 2d or 3d plot parameter. You can imagine the possibilities!
Support for controllers includes support USB gamepads, joysticks, IR remotes, and, last but not least, the Apple sudden motion sensor built into your Macbook or Macbook Pro.
You knew about the sudden motion sensor (SMS), right? It was originally intended for the practical use of preventing damage to your hard drive if your laptop hits the floor but it has a variety of additional uses.
I took it upon myself to whip up SMS controls for some existing 3D examples in the Mathematica documentation. The main problem I encountered was that the SMS values changed so quickly and I didn't have the CPU power to re-render my object when the values changed. I'm not really a Mathematica master, but I settled on nesting my Manipulates in a Dynamic so I could set an UpdateInterval. You can download my Sudden Motion Sensor Controlled 3D Plots Notebook.
You may notice how exceptionally swift and dextrous I am. This unexplained speed doubling is surely due to my roommate's Dell, but the point remains.
Eons of Evolution On Your Desktop
June 8th, 2008
Evolution can be a tricky (but by absolutely no means impossible!) process to observe. This can make teaching students about the theory of evolution somewhat difficult compared to more readily demonstrable concepts such as magnetism or acid-base chemistry.
Computer simulations of evolution offer an excellent solution to this problem. Using these simulations, students and scientists can explore the process of evolution and get (in some cases highly visual) results in a matter of minutes. Luckily, thanks to intrepid biologist/programmers, many of these sexy in silico simulations of evolution are now freely available for download! Here are a few, at a glance:
Java Biomorph (Java implementation of the Dawkins Biomorph program)
(OK, its not a true evolution simulator, but I have a soft spot for Conway's Game of Life. And mushrooms.)
See also:
Dr. Saul's Evolution Lab
Evorunners
Flow in games
Maxis 1990 computer game Simlife
Discussion of the validity of computer simulation to provide evidence for evolution.
Jacks of Science Blogging Experiment Failure
May 31st, 2008
Jacks of Science is a bit of an experiment.
I hypothesized that the site would become a flourishing group science blog as far back as 2006.
To observe this desired blog state I devised a simple theory. I would mix a solution from a staff of student bloggers in different fields such as Physics, Biology, Geology, and Chemistry.
Would I be able to find reactants that formed a homogeneous mixture or a highly reactive substance on the brink of explosion?! Even if I found writers that worked coherently together, would I continue to get decent results over time?
I figured that the greatness of Jacks of Science would be directly correlated with post diversity. Many authors would lead to diversity in post subject matter, writing style, humor, complexity, geekiness, and length. However, in theory, things are much different than in experiment. As you may have noticed, this diversity of authors ended up just being a diverse range of posts authored by me. I didn't follow through on my original plan of finding other writers since I was busy trying to become a better blogger myself.
The original intention of the site has been lost but, 102 posts later, as my domain renewal date draws nearer, you're looking at the results of the Jacks of Science experiment. Full of random art doodled on my class notes (which now includes my 1st and 2nd year!), to pro-piracy open science discussion, to science DJ mixes, to my most popular article: Science Valentines.
So I'm trying to draw some conclusions about the data so far. As far as the traffic indicates the site is growing in popularity but I'm just not sure if things are working out. Blogging is a lot of fun, but the Jacks of Science initiative, as originally imagined, has been stagnant for some time. It doesn't seem to be going anywhere for a variety of reasons off the top of my head.
- No clear audience that I'm writing for!
- No incentive for new writers to be part of the site!
- I can only post once a week by myself (quality over quantity)!
- Science is boring (and thus cannot reach a wide enough audience)!
- My single column blog theme is too narrow!
Filling In the Blanks
May 26th, 2008
I'm out of Ontario on a co-op placement this summer. I've had to dust off my first year chemistry brain synapses because I'm researching small clusters of water molecules. Like in any research project, one must ask oneself, and be able to explain to ones family, why is my research important?
From nuclear reactors filled with heavy water to pouring out some Bling H2O on the concrete for our fallen homies, we need be able to accurately understand water in any context.
By computing how water molecules interact with each other on a small scale one may be able to gain insight into the bigger picture. An interesting property of a group of 2-5 water molecules is that they are most likely to form a ring structure. However, this is not the case for 6 or more water molecules as more stable structures are available (Xantheas). One might wonder if this small scale phenomena has macro consequences leading to the watery characteristics we have come to appreciate and adore.
For example, starting from just 2 hydrogens and an oxygen, would it be possible to predict that ice floats at the top of your glass of water instead of sinking to the bottom? The ab initio techniques I use on my daily grind are designed to do just that. I input a list of electrons and protons into my computer and it outputs a fantastic amount of data on that system (but not the ice density in particular). Computation is a powerful tool in understanding properties emergent in chemical systems.
This study of emergencies has been an ongoing battle for all flavors of scientists in understanding nature. Physicists want to understand how the classical laws of our daily lives are emergent from quantum mechanics (subscription required). Some biologists want to understand the sociality emergent in bee colonies (or ant colonies). Chemists want to predict crystal structures [PDF] emergent in clusters of molecules. Computation is an essential tool for understanding many if not all of these situations.
My work brings up an interesting philosophical question about the scientific theories we use to describe the world. Are our theories of biology, chemistry, and physics really discontinuous? Desiraju [PDF] argues that our current model of chemistry is incompatible with biology and that there exists a new model of chemistry on the forefront which cannot be expressed in terms of physics and mathematics. The thought is this a little disconcerting to me. Not being able to compute everything implies that we would never be able to build The Matrix!
Anyway, call me a reductionist computational scientist but I'm pretty sure computation will one day be able to fill in the blanks of our models of science. Admittedly, it hinges on the discovery of a grand unified theory to build upon, but I'll leave that to the theoretical physicists. From there on out, it's all computation baby!
Coming Out Of The Closet
February 24th, 2008
It's time to come clean. It was a difficult thing to admit to myself but I've just had this unusual attraction for such a long time. At least it's comforting to know that you share something in common with great thinkers such as Alan Turing, DaVinci, ... Euclid, Leibniz, Gauss, Newton and Pythagoras. Yep, we're all "gay".Just to confirm here: That's gay for math.
Amadana’s Sexy Designer Calculators
January 24th, 2008

TI-83? Hideous Rarely cool. TI-Nspire? Well, those are kind of awesome. How about the Casio fx-300MS? I'd rather barf than use that thing! Just look at these amazing calculators by Japanese appliance designer Amadana.
The calculators above are the LC-104 series and they cost about 65 clams. That's a small price to pay for such features as "Hugging Texture" and "Light Key Touch". It's not about complexity here folks, it's about simplicity and style. Plus, Amadana is kind enough to give complimentary safety warnings for using the calculator properly:

Sure they may not have an X^Y button or any trigonometric functions, but honestly, if I was cool enough to own one of these I'd be willing to calculate those things from first principles.
You wanna step your game up? Then get 1 of 500 limited edition color series with stunning sharkskin case. A $350 calculator like this is a serious investment in top notch calculations. It essentially pays for itself after you start charging $1 per calculation for your friends per day for 1 year.
Okay, if your first year chemistry course was as big as mine, 500 units worldwide might not be exclusive enough. The last thing you want is to be seen with the same calculator as a friend. Amadana recently collaborated with British fashion brand Eley Kishimoto and made 250 super stylish limited edition calculators available on Colette for $370.

So what type of calculator do you use? I use a Casio FX-300 ![]()
Optimizing My Morning Sock Search Algorithm
January 10th, 2008

Here's my morning routine on a school day like today:
- Rise by alarm
- Sift through my sock drawer for 5 minutes trying to find a matching pair
- Select outer layers of clothes
- Do hygienic things
- Eat cereal while I check my sites
- Exit house, hopefully dressed, and proceed to bus stop
Clearly the sock search is the weakest link! I know what you're going to say, it's my fault for not sorting them right out of the laundry but even in that case the problem still persists. How can I efficiently sort my socks, especially at 7:30 in the morning?
So heck, might as well make use of my university education and see if there is any research done in the cutting-edge sock sorting algorithm field. Sure enough, the internet provides:
Rohit Parikh, Laxmi Parida, Vaughan R. Pratt: Sock Sorting: An Example of a Vague Algorithm. Logic Journal of the IGPL 9(5): (2001)
My normal method of sorting is a greedy algorithm. I pick up the first sock I see and go one by one through the rest of my socks trying to find a match. If things go according to plan (since my socks are pretty unique in coloration) I can sort through them pretty quickly, but in the worst case this search algorithm has O(n2) run time. That is, if there are n socks I'll have to make n comparisons with n other socks. This could explain my 5 minute sock search runtime. I just wish I had a faster CPU.
Parikh et. al. discuss a more interesting example in which socks can be matched vaguely based on their colors. For example, "suppose a dark gray sock will match either a dark gray sock or a charcoal gray sock and a black sock will match either a black or a charcoal gray sock", which unfortunately opens up possibilities for free-loading unmatched socks. The unmatched sock is never desirable but may be necessary depending on your sock shade spectrum.
Taking vagueness into account, my normal greedy algorithm will still run in O(n2) time in the worst case but linearly on average. More advanced algorithms are also discussed by Parikh. et. al. which eliminate the possibility of unmatched socks at the expense of some additional calculations but who has time for that?
It really makes a lot of sense. If my sock matching criteria is vague enough, on average, I'll find a match in linear time. The problem is that I just have such high standards. The solution to that is simple. I just have to consume alcohol in the morning in order to impair my judgment enough to get to class on time. Problem solved.









