29 Feb

Principia Mathematica

This month finds me in Illinois, teaching a computer programming course to a class of new hires. Teaching the material, observing the students, and working through the sample problems has caused me to reflect on my own path that has lead me to this point—and how, in many ways, I never really thought I would be in this position.

In school, I always dreaded my math classes. I was often frustrated by the homework, lost during class instruction, and was prone to sub-par grades on exams. My algebra class taught me that I could usually grasp the material one unit too late, when the rest of the class had moved on to new topics. My geometry class instilled in me a strong aversion to proofs and showing my work. Algebra 2 was an exercise in barely squeaking by, although Ms. Bromley’s teaching method was one that actually did click with me. Pre-calculus was a change in pace: Mr. Harward’s class was one in which it was impossible for any student to coast—he could smell a checked-out student a mile away, and knew how to put them on the spot. I grasped things better in that class, and even though I was handy with graphing equations (and was deeply struck by the magic known as synthetic division) I still failed to really see any forest through the trees. I continued to wonder what this elusive “calculus” nonsense was all about. A tantalizing clue came in a physics class, when, while most of the students were struggling to compute an object’s acceleration with only the velocity given, one advanced student announced smugly that “it’s easy if you know calculus.”

Before diving into calculus, I took the final pre-requisite: trigonometry. I never memorized my unit circle chart properly. But that class changed me in very significant ways. Thanks to a fellow student, I discovered the potential of my TI-86 calculator. At first I used it as a shortcut to convert between radians and degrees, but I soon discovered I could program it to turn decimals into fractions, simplify radicals, and do all sorts of tasks I would otherwise have to do by hand. When I moved on to advanced placement calculus, I had a toolkit that I was sure would serve me well. I was confident I could make my calculator do my bidding, thereby sparing me the busywork that would doubtless be required by the teacher.

I was wrong. Derivatives, integrals, and limits slapped me silly, and my home-brewed calculator apps left me feeling like I was riding a go-kart on the interstate. In the tradition of my algebra class, I found myself again grasping the material consistently one unit too late, and looking longingly at my calculator to rescue me from functions, chain rules, and theorems I was being subject to. I floundered through that year, and surprised myself by completing the AP exam with a barely passing mark.

As I got into college, I hoped my calculus experience would serve me well, and I ambitiously enrolled in a college calculus course. When I failed the pre-requisite placement exam and got transferred into a remedial trigonometry class, I was crestfallen. The following semester, I signed up for an Intro to Computer Programming course, thinking that my TI-86 wizardry would make it a breeze. When the teacher introduced the object-oriented paradigm to us in the language of Java, my head hurt. This looked nothing like TI-BASIC! What was a method? A class? An object? Why couldn’t any teacher, TA, or fellow student explain this in a way that made any sense to me?

I completed the year with failing marks in both Mathematics and Computer Science, and determined it was time to chart a new course. One in the humanities, maybe. Or in media arts. But this math and computers stuff was not for me.

As I regrouped for my sophomore year, I knew I had to rectify the grade situation, so I committed myself to retaking these two classes. Not to make peace with them, or give them a second chance, but just to seal the transaction, and be ready to move on. I spent extra time in the math lab. I would get extra help from computer savvy friends as I did my Java assignments. I disposed of the expectations I had come with the first time, and just paid my dues, did as I was told, and got through it. I got A’s in both classes that semester, and was ready to move on.

But something had happened to me during that time. Instead of seeing math and programming as a series of tasks to be accomplished, I had started to see them as a functional framework of tools used to both describe and solve conceivable problems found in the natural world. I was finally able to both think and work in the abstract.

Memories of past math classes flowed back to mind. In pre-algebra, I had learned about π. The value you will always get when you divide any perfect circle’s circumference by its diameter. I thought of all the circular forms in the universe: planets, stars, atoms… each one has π lurking in its structure. This elusive number is hard-wired into every circular form in the universe, and somehow, humans have discovered the means to unveil its value:

{4}sum{k=0}{infty}{{(-1)^k }/{2k+1}}

This mathematical expression, a sum of an infinite series, has been known to humans for centuries. What I found most signficant, however, is that I could write an approximation of this expression—limited only by time and memory constraints—in Java code:


I also remembered learning about φ in geometry. It is the value that forms the basis for the golden ratio, and can be used to produce the Fibonacci sequence. It describes countless forms found in the mineral and biological worlds.

{1+sqrt{5}}/2

The principles of design and aesthetics I had learned in art classes and a brief exploration of 3D modeling have the golden ratio—and therby φ—encoded into themselves at every turn. And now on the computer, by employing mathematical formulae and a recursive function, I could approximate the value of φ:


I furthermore reflected on my introduction to calculus, and recalled learning about Euler’s number: e. The basis for the fundamental exponential function: f(x) = ex. This is the only function whose slope is always equal to its x-value; ergo, it is its own derivative. Using limits, the value of e is computable with an elegant mathematical expression:

lim{n{right}infty}{(1+{1/n})^n}

All of these constants existed in the universe long before any human discovered them, or even before any natural object was around to manifest them. Mathematics, and its ability to be represented and expressed with digital processes, took on a mysterious appeal that I previously did not know.

With fresh eyes, and a new vantage point, I decided to major in Information Systems. The curriculum took me into advanced enterprise system development, business calculus, and landed me a part time job programming web applications on campus. My eyes were opened to the utility of reusable functions; to the efficiency of object-oriented and relational models; and to the mobilizing effect of multi-dimensional arrays and matrices. My personal projects continually expanded my grasp of both technical and functional concepts, and upon graduation, I began my career in technology consulting.

Now I find myself having come strangely full circle. I’m teaching a class of new-joiners the very same things I miserably failed at nearly a decade ago. When they wonder about the applicability of the course material by asking “when are we ever going to use this?” I wish I could adequately convey to them the power of the abstract, the elegance of the uninstantiated model, and the infinite possibilities encapsulated inside a robust formula.

As I consider how computer programming provides the means to bring theoretical and mathematical abstractions into functional processes, I am reminded of the early founders of western thought, and how they were constantly philosophizing about the balance between the material and the conceptual. Plato favored the abstract, and explained why:

Arithmetic has a very great and elevating effect, compelling the mind to reason about abstract number, and rebelling against the introduction of visible or tangible objects into the argument.

—Plato, “The Republic”

I continue to see the wisdom in his appeal to mathematics as an all encompassing language and framework through which nearly all other problems may be approached. I wonder what Plato would think of the innovations of the past century, and if he would be pleased that the mathematical abstractions he was so fond of have gained new life inside of computer processes and simulations. Mathematics constitutes the most primitive and elementary generic concepts of all, and yet is the lens through with nearly all other disciplines can be viewed. This idea was cleverly articulated by XKCD:

The more I spend time studying the intricacies of abstractions, formulas, models, ideas, and concepts, I am repeatedly brought back to a sense of wonder that these things exist outside of time and space, matter and mass, in a realm where moth and rust does not corrupt. Yet somehow, these abstractions still require some sort of medium in order take life in the natural world: in human neurons, in ink on paper, on magnetic tape, in an electromagnetic wave, running through a silicon chip, in a stream of photons, in fluctuation of air pressure, or etched in stone.

The medium is only as relevant as its ability to store and transfer the abstraction which is contains. And that is where this new age of technology proves to be a serious game-changer. Never in the history of humanity have ideas been more readily stored, transferred and processed. Formulas devised by Euclid and Newton can now not only be expressed on paper, but for the first time, can be instantiated and computed by means other than a human mind: computers give a palpable breath of life that heretofore could only be given by cranial capacity and perhaps by some crude mechanical devices like the abacus.

That is what draws me to information sciences and technology.  When I write code, I feel like I’m giving wings to ideas that previously existed only in the abstract, platonic world of imagination and dreams.  When I make use of cloud-based networks and backup my files, I sense that data is more than the material on which it resides. When I transfer data or employ a network of any sort, I consider the fact that I am manipulating intangibility by means of  the very fabric of space-time itself.  And then the bigger picture comes into view.  The central questions of ontological philosophy gain new depth when we see that humans now have the ability to harness the non-material world in very powerful ways.  Somehow, the study of mathematics—arguably the purest of all disciplines—expressed in the digital, programmatic confluence of the abstract and the concrete, seems to me to hold the key to furthering our understanding of the nature of the universe, and our place in it. When we are able to discover universal constants or other mathematical truths that describe the very substance of reality, we become part of a metaphysical archaeological adventure taking us out of our current scope into a timeless, spaceless, formless reality where the very laws of existence itself are defined.

Where does it come from, this quest? This need to solve life’s mysteries when the simplest of questions can never be answered? Why are we here? What is the soul? Why do we dream? Perhaps we’d be better off not looking at all. Not delving, not yearning.But that’s not human nature. Not the human heart. That is not why we are here. Yet still we struggle to make a difference, to change the world, to dream of hope, never knowing for certain who we will meet along the way. Who among the world of strangers will hold our hand, touch our hearts, and share the pain and triumph?

—Mohinder Suresh, Heroes, Season 1, Episode 23

I believe that the answers to the world’s most profound questions lie in the continued exploration of mathematics and computational technology. Increasing our understanding of the horizon where heaven meets earth, mind meets body, abstract meets concrete, thought meets deed, dream meets reality, idea meets implementation, and spirit meets substance will open new doors, create new paths, and lead us to new, previously unknown—and currently inconceivable—heights.

Why didn’t my middle school pre-algebra teacher just tell me so?

07 Feb

Useful PHP Utilities

Throughout my PHP coding and programming  projects, I have become accustomed to PHP’s wide variety of built-in functions that come in handy in all kinds of situations.

There are, however, a few functions that I wish were built-in, but are not.  So, I’ve been the change I want to see, and I wrote two functions that I now include in almost every project I undertake.  I place these in the global space, and am consequently able to treat them as if they were built-in.  The functions are: contains and grab.

Contains

This function answers the question: “Does X contain Y?” or, rephrased: “Is Y found in X?”  The process is actually quite simple, so the bonus of this function is that it wraps the procedure together in a form that takes two (2) string parameters: a haystack and a needle.  If the needle is found in the haystack, it will return a boolean value of true, otherwise it will return false.

Grab

This function is a way of extracting substrings from larger strings.  Similar processes are performed by the preg_match family of functions, but grab requires no knowledge or use of regular expressions.  Three (3) parameters are needed: the text delimiter on the left ($front), the text delimiter on the right ($back), and the source string in which the sub-string is to be found ($source).  The function returns the first string it finds in between the provided $front and $back delimiters.  If you are seeking to extract a sub-string which occurs at the beginning or end of the source string, you can provide null for either $front or $back.

I hope you find these functions as useful as I have!

29 Jan

KPOPCON’12

News 1 Comment by KC

I was one of the privileged participants to attend the very first KPOPCON held at U.C. Berkeley.  This begs the immediate question: “K-Pop, really?”


I suppose that providing some background and context is in order. My introduction to Korean music began in 2003, when I began my mission to Korea. Despite strict regulations governing missionaries’ musical consumption, there were some instances where being exposed to “worldy” local music was unavoidable.  Street-side dancing girls would herald in the opening of any new local business with blaring PA systems.  Missionaries in Korea were required to take public transportation–ubiquitous radio notwithstanding–nearly everywhere we went.  Sometimes the old-timer bus drivers would insist on playing nothing but “trot” on the radio, but often there would be Top-40 and Bubble-gum Pop.  It was welcome exposure and insight into the pop-culture world that the Korean masses were immersed in; in an attempt to reach out and meet new people, I would occasionally ask a fellow bus-rider what song was playing on the radio.  This proved to be an easy ice-breaker, and evoked great surprise in the Koreans (not too many forigners seemed to pay attention to their music.)  Best of all, it left me with a growing list of artist names and song titles that I would someday look up, listen to, and remember the moment I first heard each song: in its natural habitat on a bus travelling through the Korean cityscape or countryside.

Upon my return from Korea, I amassed a respectably-sized collection of Korean music, and became interested in a handful of artists that I kept up on quite faithfully.  However, even though I would make a point to ensure I had the lastest album of a particular set of artists, I remained more or less unplugged from the greater K-Pop scene, and was consequently unaware of the new rising stars.  When I saw the poster for KPOPCON on a San Francisco newsstand, I knew it was time for a refresher course.  So I registered for the conference.

The conference was well organized, and went quite smoothly.  It was interesting to see the demographics of those interested in Korean music; there seems to be a new wave of youthful Americans who idolize Korean pop stars, and wish they could speak Korean so they could soak up the content uninhibited.  This is an odd juxtaposition to the Korean youth I met in Korea who idolized the Backstreet Boys and N*Sync, and wished they could only speak English to understand the songs better.

The conference’s keynote speakers were Joyce Kim and Susan Kang, who were instrumental in the creation and development of the KPOP english news juggernaut known as Soompi.  I suppose that should have been a social network and news portal I was familiar with, but I am ashamed to say it was not.  After some cursory reading and poking around, it seems to be the one-stop shop for all K-Pop news, gossip, reviews, and discussion.  The plentitude of new discoveries on Soompi will surely help me keep current on the latest releases, and keep tabs on the noteworthy artists.  One surprise at the conference was an unannounced workshop with Richard Choo, who has been one of the biggest movers a shakers in bringing Korean talent to American stages.  He was the producer of the K-Pop Masters concert at Vegas’ MGM Grand last Thanksgiving, and has tons of insight to share about working with artists and the US-based fans alike.

So why do I care about any of this?  It must have to do fragments of my identity that I left in Korea. As I rode the trains and busses through Incheon and Gyeonggi-do, with the K-Pop melodies soaring into the air from the radio, I remember being fueled with a sense of renewed energy, and felt a deepening connection with the people and culture that I grew to know and love.  In so many ways, K-Pop is the international music equivalent of a box of twinkies : factory-produced, made according to strict recipe, pre-packaged in a colorful label, has no nutritional value to speak of, yet is deliciously tantalizing, and finds its way back into snacks, meals and picnics time after time, year after year.  So when I crank up a new K-Pop tune, even one I havn’t heard before, I’m brought back to a sense of exotic familiarity that is both exciting and nostalgic. And I reconnect with a part of myself that is by no means lost, but that doesn’t get as much air time as it once did.  And now I know what to look for, and where to look for it: here’s one by a new artist called IU, who according to Soompi’s top 50 list, has the number one K-Pop hit for December 2011: “You & I.”

Switch to our mobile site