Thursday, March 25, 2010

Computer Graphics

As part of my course on computer graphics this semester the class has been writing a ray tracer. The details of ray tracing aren't really worth going into, instead I'd rather share a picture (more technically a rendering) that is the result of my work.


If you are particularly learned, you'll recognize this figure as the Mandelbrot set. In case you didn't recognize it, at least you will in the future! This version in particular is really an abuse of the ray tracing engine we've developed; typically other much more efficient means are used to generate an image. However in using the ray tracer I'm able to generate images that simply couldn't be done with the more traditional methods. For instance, this rendering uses a reflection model to add an additional layer of the delicious recursiveness that characterizes fractals. Though you could do the same given the more traditional code, simply having the code alone versus a ready-made rendering program allows me to color the actual Mandelbrot set, which is almost always left black:



For the sake of completeness, here's a more traditional ray traced image that specifically includes a good variety of capabilities a ray tracing engine made in a single undergraduate semester has:


As you can tell, my cylinder code still has some issues that need to be resolved.

Tuesday, March 23, 2010

By the Numbers

I presume most people recognize that there is a vague connection between statistics and probability, but, having taken a course in probability theory, I'd be willing to bet the farm that very few people realize the full breadth of intimacy between the two. This is true in particular because despite having studied both, I'd count myself as one amongst the naive. From the outset probability is simply difficult, and often counter-intuitive. Not only does probability proceed in ways contrary to our intuition, it does so in such an amazingly tricky way! Maybe it is a function of how easy it starts out: given a typical six sided die, most everyone knows that the chance of guessing which number comes up is one in six. Easy enough, you pick one side out of a total 6, so the probability is 1/6. The common understanding of probability stops there, for the simple reason that any situation even marginally more complicated than that becomes remarkably more logically and mathematically sophisticated. Suppose I'm flipping a coin and you're guessing the results. For some reason you're having terrible luck and you've guessed wrong 10 times in a row, what's the probability that you guess the next flip wrong as well? Think about it for a minute and when you've logically arrived at what must certainly be the answer, highlight the following space for the answer:  1/2

Next, try to logically deduce the probability of guessing incorrectly for 10 coin flips in a row. Answer:   1/1024

It only gets so much worse from there, to the extent that I'm really not confident I could present the correct answers myself! Even admitting that I can't help but try for one more. Assume that 4 out of 5 people prefer Crelm toothpaste. What's the probability that from a selection of 5 people 4 of them prefer Crelm? Answer (I think): 256/625

The important notion here is that a probability says something both nebulous and concrete about reality. If a truly random die is thrown 6 million times, in all likelihood each number will have come up about 1 million times. If 4 out of 5 people really do prefer Crelm, then the chance that a randomly selected person prefers Crelm is 4/5 or 80%. As much as we all like to think that the statistics don't apply to us (because we're special), if the statistics are accurate there's no way to escape them. Most of the time this is a banal statement, as when referring to whether or not you prefer Crelm--either way it's not exactly a big deal. But then... there are the other statistics. "Around 50% of US marriages end in divorce" can be a pretty hard pill to swallow for a couple walking down the aisle. I have reason to believe the number of couples who'd figure they end up on the successful half of that statistic while exchanging vows is much higher than 50%--clearly if they thought it wasn't going to last they'd probably not be entering the commitment in the first place. Similarly, doubting the success of the marriage from the outset probably isn't going to increase the chance of a favorable outcome. What's left is an awkward position, objectively maybe the best one can think is that at least the odds aren't as bad as they could be, better than any casino game. However marriage is a particularly special case for a number of reasons, the primary one being the shift in locus of control which is applicable to all interpersonal relationships; though a bit less severe, anyone who's been dismayed by the lack of a second date (etc.) knows the score. To be fair the actual divorce rate changes based on many factors, where 50% is just the overall rate. The lowest divorce rates are found in each of the following categories: first marriage, atheist or agnostic, age 30 or older, residing in the Northeast and no cohabitation prior to marriage.

Uncontrollable statistics naturally lead to other more personally manageable probabilities. For instance, 28% of car accidents in the US happen while at least one of the drivers is using a cell phone. This is the part where I reiterate: we love to think we're special and that the statistics don't apply to us, but it just doesn't work that way. We are all special, I'm fully on board with that, but that doesn't grant any of us statistical immunity. Using a cell phone while driving (even with a hands-free headset) substantially increases the chance that you will be in a car accident, which could result in your death, or, arguably worse, the death of another/others with the accrual of manslaughter charges and the lifelong burden of knowing that you've killed someone. It's very simple: while the car is in gear, your phone doesn't exist. There are absolutely no excuses.

Friday, March 19, 2010

Technology II: State of an Art

For today's exercise, please read the following passage and give the question at the end a sincere and thoughtful rumination. Once you feel you've thoughtfully ruminated enough, watch the video.

Imagine a modern machine, one that could be called a robot, that consists of a three fingered hand mounted at the end of an arm with a range of motion similar to our own and a single camera. Given the present state of technology, which any sensible person would describe as "quite advanced," what might this arm to be capable of?




It is astounding, yes, no less should have been expected, but there is something a bit backwards about it. Traditionally machines are constructed and used because they can do some certain task vastly better than we are able to. Naturally the machine's form and means of manipulation don't resemble ours in the slightest, otherwise we'd probably not have needed it in the first place. A good number of years ago, enchanted by the ideas of Isaac Asimov, I had a strong interest in androids--humanoid robots. But even before I knew the beginning of the true technical challenges behind building an android I realized something: a person desiring to make a passable humanoid machine would save themselves a lot of effort and greatly increase their probability of success by doing so the old fashioned way, that is by seeking a viable mating partner and letting nature run its course. At the time the thought was conceived mostly as a joke, and though it's still humorous, it's also quite sensible--practically speaking I think we have more than enough roughly human shaped objects with adequately human like capabilities. Nonetheless it is almost certain that many will continue attempts to build an android, and it's far from difficult to imagine that one day a result could be described as nothing other than successful. However one thing will remain true even then, even when androids exceed our capabilities: the human form can't do everything. No matter how dexterous or sophisticated, our fat fingered mechanical offspring won't be able to manipulate the atoms of a molecule unaided; even less technical, these two handed automatons will have just as much trouble as we doing the work of three hands. This will be a small victory for three handed people as they will get to remain not yet obsolete longer than the rest of us, at least for the few moments it takes to add one more hand to the robot. All silliness aside (well ok just most of it), there's clearly a huge number of tasks which won't benefit from the superhuman but still human capacity of these imaginary androids unaugmented. This represents a significant relief since we aren't stuck waiting for these super androids to come along (which nonetheless probably isn't too far off, though given the rate of technological progress, relatively probably quite a ways off). In summary, I've basically stated in a very roundabout way that we are free to continue to augment our own similarly limited mechanics the same as we have since the invention of the first tool; we can use our already inconceivably sophisticated body of technology to extend and enhance our capabilities. Case and point, the da Vinci surgical robot. Surgeons are essentially required to have superior motor control as even the slightest irregular movement could result in a fatality. However, no matter how talented the person holding the knife with intent to open you up, there is a fundamental biological limitation to the amount of accuracy they are capable of. Rather than just hoping their home life isn't distracting them and that their cup of coffee wasn't abnormally strong that morning, the da Vinci confers peace of mind with a laundry list of features specifically designed to maximize precision by counteracting the inherent imprecision of human hands. There are over 700 worldwide, and though it is only approved for a limited number of procedures, the number is expected to continue increasing as rapidly as it has been. While it's already on it's second version, I think it's a safe bet that further enhancements will be rapidly forthcoming. Of course, the proof is in the numbers, and the numbers are unambiguous--given the choice between traditional and robot assisted surgery, choose the latter! Here's a video of it peeling a grape on live television:


In conclusion, I'm compelled to once again say the same thing I've said previously: over the past few decades in particular we've been developing foundational technologies. Because each of these have such vast potential for application, the first and most obvious few applications took hold and found success. Being as we are focused on a multitude of things wholly different from the vastness of yet unrealized and incredible possibilities that these technologies enable, it is natural to unconsciously assume that what we see is more or less the extent of what technology can offer, but this tacit assumption is, in my opinion, absolute rubbish. In particular the most overlooked and underutilized technology is cheap and powerful microprocessors; everyone knows that desktop processors keep getting more powerful without getting more expensive, but the bit of interest is that the processors of yesteryear continue to get smaller and cheaper. This fact in itself isn't unacknowledged, actually there's a well known meme that suggests a common calculator found in a high school today has more processing power than the space shuttle that delivered the Apollo astronauts to the moon and back. The overlooked bit is that that little processor can do an awful lot more than help with algebra homework. Like what? Well, I have a video demonstration of one such device, but before you watch it consider that the processor in the device shown is essentially as powerful as a 1986 state of the art desktop that cost $6500 (the Compaq Deskpro 386), can be had for around $3, and is smaller than a dime. The whole device could probably be made wholesale for under $10.

Thursday, March 11, 2010

Electronic Music

Vitalic is a musician that constructs and delivers frequent variations in air pressure in a manner with a rather more contemporary lineage than what I've shared prior.

Thursday, March 4, 2010

Ramachandran on the encephalon

Vilayanur Ramachandran is a neurologist. What's more is that he has a very keen insight, and a particularly effective ability to communicate. Given that the nervous system (including the brain) is naturally and rapidly a profound topic of consideration, such a person as Ramachandran could really make 20 minutes intriguing. Well it was 23 actually, but I'm willing to wager nobody in the room wanted him to stop.