Wednesday, January 25, 2012

iPictureShow

It occurred to me that the last few products Apple has introduced all start with the letters i and p (iPod, iPhone, iPad).  Does this mean that they will continue this tradition when they introduce their new TV product and call it iPictureShow?

Thursday, January 19, 2012

Flux capacitor

Back to the future is a wonderful sci-fi film that is funny and light-hearted. I have seen the movie many times and I always chuckled when they mention the term "Flux Capacitor".  It sounded like someone took two random technical words and mashed them together.  In the movie, an elderly scientist tells the protagonist that the Flux Capacitor is what makes time travel possible.  From high school physics, we know that a capacitor is an electronic device used to store energy, and it is used in almost every electronic device, whether they are analog or digital.  Examples where capacitors are useful include audio filters, power line regulators, and dynamic memory (DRAM).  The basic design of a capacitor consists of two plates with a dielectric in between.  Applying a potential difference on the plates create an electric field between the plates where electrical energy is stored.  The strength of the electric field E is the potential difference V across the plates divided by the distance d between the plate. The electric flux Φ in the capacitor is the strength of the electric field E multiplied by the area A of the plate.  For a fixed voltage drop V across the plates,  Φ = VC/ε is proportional to the capacitance C.  Thus one can argue that the normal capacitor that we all know is in fact a flux capacitor!

In recent years, there have been advances in creating ultracapacitors or supercapacitors, i.e. capacitors that can store a large amount of energy. Some of these capacitors that are available today can have an energy density of up to 30Wh/kg.  Imagine that we have 10 kg of such capacitors. If we can fully charge them and then discharge them within 0.89 milliseconds, we would have an average power surge of 300Wh /0.89x10-3s = 1.21348 Gigawatts which should be sufficient to activate the time machine!

Sunday, January 8, 2012

Left or right?

I always wondered why various professions and technical fields have different names for left and right.  For instance, in optometry, OD (Oculus Dexter) and OS (Oculus Sinister) stands for right eye and left eye respectively.  Dexter and Sinister are the Latin words for right and left.  On a ship, the left and right side of the boat for someone on the ship facing the front of the ship are called port and starboard respectively.  My guess for the reason to introduce these terms is that when two people are facing each other and communicating it is not clear whose left and right sides are meant.  The following story told by my wife's aunt could also be another reason why such terms are used.  During a driver's test, the following exchange occurred:
Examiner: "Turn left at the intersection."
She: "Turn left, right?"
Examiner: "Right."
She turned right at the intersection and failed the test.

There are similar terms for other sides of an object as well.  For instance, the terms bow and stern are used to denote the front and back of a ship respectively and dorsum and ventrum denote the back and front sides of upright animals such as humans (or the upper and lower side of animals such as fish).

Saturday, January 7, 2012

Random thoughts on 2012

With the beginning of a new year, my thoughts went to what 2012 will bring.  I just read several articles that make me hopeful in 2012.  First, there is a blog entry in Design News by Alexander Wolfe postulating that engineering and engineers will be more appreciated.  Second, the latest issue of IEEE Spectrum has a Top Tech special report for 2012, and several of the innovations showcased are truly game-changing.  I am especially intrigued by the life sciences related innovations, such as the bionic legs, bionic eye, and automated medical diagnostic tool based on the Watson supercomputer.

On an another note, 2012 is the Alan Turing year, celebrating a century of Alan Turing's birth.  Turing made significant contributions to artificial intelligence (Turing test), theoretical computer science (Turing machine and uncomputable functions), cryptography (Breaking the Enigma code) and mathematical biology (Turing patterns and morphogenesis).  Speaking of computers, we recently visited the excellent Computer History Museum in Mountain View, CA and I am amazed how much progress has been made in computing within a single (human) lifetime.  To wit, I have owned several pieces of the (somewhat obsolete) artifacts that are on display in the museum, including a Commodore VIC-20 computer with an audio cassette tape drive, 5-1/4 inch and 3-1/2 inch floppy disks, abacus, dot matrix printer, and a sliderule.  I told my son that he should keep his old portable game machines and mp3 players, as they will invariably wind up in the museum someday.

Several cycles starts (ends) in 2012.  For instance, in 2012 the Mayan long count calendar will reach the end of a Baktun cycle which occurs every 394 years or so.  The sun reaches its peak in solar activity in 2012 as part of a 11-year cycle.

Some other fun facts about the year 2012:
  1. 2012 is a leap year and contains a leap month in the Chinese lunar calendar.  
  2. 2012 has 5 Wednesdays in February.
  3. 2012 has exactly 3 Friday the 13th.

Saturday, September 24, 2011

Operator precedence

At the back of the box of a popular brand of hot chocolate mix are several activities for children and one of them is to determine the average number of mini marshmallows in a serving of hot cocoa by solving the equation 3+2x4÷2-3x7-4+47.  My son happily evaluates this equation from left to right and came up with the answer 92 which is the same as the answer given at the bottom of the box.  My wife took a look at what he was doing and said: "Wait a minute, that is not the way we were taught in school. There is a precedence of operators, multiplication and division before addition and subtraction."  Furthermore, when the part of the equation contains both multiplication and division, the evaluation proceeds from left to right.  Similarly for addition and subtraction.  Using this rule, the correct answer is 3+(2x4÷2)-(3x7)-4+47 = 29 (which coincidentally is 92 reversed), a much smaller number of marshmallows.  It is not clear how the rule of operator precedence evolved, but the development of computer programming languages such as FORTRAN necessitates this disambiguation of the syntax of mathematical equations (see the webpost here).

Sunday, January 30, 2011

How do you say 293?

Everyone time I learned a new language, sometimes I feel like I have to learn a new number system as well. Consider the number 293. In my mother tongue, Chinese, 293 is written as 二百九十三, which literally means "two-hundred-nine-ten-three". Thus the positions of the digits 2 and 9 are denoted by the words for "hundred (百)" and "ten (十)" respectively. Then when I learned Dutch, 293 is written as "twee honderd drieënnegentig" which literally means "two-hundred-three-and-ninety". Instead of reading the number from left to right, I have to mentally insert the unit digit (3) before the decade digit (9). This took me a while to master. Then when I learned French, 293 is written as "deux cents et quatre-vingt-treize", which literally means "two-hundreds-and-four-twenty-thirteen". I mainly use English these days, which luckily write the number similar to Chinese syntactically.

Saturday, September 18, 2010

Childhood magic

The science fiction writer Arthur C. Clarke (who incidentally predicted the geostationary communication satellite in 1945) once famously said, "Any sufficiently advanced technology is indistinguishable from magic." One example I like to use in this regard is the music or video player. It would have seem incredulous to someone from the early 19th century that a spinning disk or cylinder can record music and speeches. Similarly if you tell someone from the early 20th century than you can record hours of moving pictures on a tiny disk, they would find that magical. Even today, it seems incredible to me that you can records hours of movies or 1000's of songs on a device no bigger than a postage stamp. One fascinating aspect of the multimedia player and recorder is the amount of technology involved, spanning mathematics (some of them discovered thousands of years ago), physics and engineering, but that's a discussion for another time.

I had similar experiences as a child when I learned of various puzzling phenomena in science and mathematics. The amazement only deepens when I became older and understood the reasons behind the magic. Let me delineate some examples here.

1. My first computer was a Commodore VIC-20. This is a wonderful machine with features that were quite advanced at the time for a home computer. It outputs in color and has polyphonic sound capabilities. During one of our experiments with sound, my brother and I made two of the sound generators generate tones at frequencies that are almost the same. The result was surprising and quite remarkable to us! We heard a sound whose intensity undulates, like a siren. It is magical how the superposition of two pure tones can create such a strange sound effect. Only year later did I discover that this is a phenomena known as beat frequencies. Mathematically, we can expressed the pure tones generated by the sound generator as a sinusoidal wave of the form sin(2π x frequency x t). The summation of two sinusoidal waves is an exercise in high school trigonometry:

sin(a) + sin(b) = 2sin(0.5(a+b))cos(0.5(a-b))

Given two tones of different frequencies, their superposition results in:

sin(2π f1 t) + sin(2π f2 t) = 2sin(2π 0.5(f1+f2)t)cos(2π 0.5(f1-f2)t)

Thus the result is a sinusoidal wave whose frequency is the average of f1 and f2 with the magnitude modulated by a sinusoidal wave of frequency 0.5(f1-f2). If f1 and f2 is close enough and the difference |f1-f2| is small enough that the magnitude modulation is at a frequency that we can distinguish aurally, then this is what the siren-like undulation of the amplitude is about. This is shown in the following figure where the second waveform has a frequency that is 10% higher than the first waveform and the sum of these two sinusoidal waves of slightly different frequencies is shown at the bottom of the figure:2. In a series of books to introduce young children to science and mathematics, I found an article that was truly amazing to me. It describes a simple device for measuring distances between you and a far away object. Most of the time we measured distances using a ruler or a tape measure, but that is not feasible for far away objects. There are sonar measurement devices that bounces ultrasound off an object and measure the time it took for the sound to come back, but that is too high tech. No, this device was simply a piece of paper with markings on it!

To measure the distance from you to, say a tree, you hold the paper with your outstretched arms and close your right eye. You line up the tree with the reference mark "0". Then you close your left eye and open your right eye. The position of the tree on the paper will be the distance. It is as simple as that! Pure magic! The underlying principle behind this cute little device is the parallax principle and can be described in the following bird's eye view (pardon my crude drawing skills):


In essence, your right eye and your left eye will line up the tree with the paper at different spots. How far the markings on the papers need to be is simply a matter of trigonometry.  The parameters you need will be the length of your arms L (or more accurately the distance from your eyes to the paper) and the distance between your eyes s.  In particular, the congruent triangles show that the distance to the object D is related to the distance p on the paper between the left and right eye view via the following equation p = s(D-L)/D.
Such an elegant solution to the problem of measuring distances.  One drawback of this approach is that the resolving power decreases as the distance increases.  As D → ∞, we see that p → s, i.e. all the lines on the paper are bunched up towards the end.

3. Once upon a time, I spend my summers working for a family friend's grocery store and restaurant and there was an avuncular gentleman there who proposed the following enticing offer. He said: "I'll give you Nafl. 100 (Nafl or Florin is the official currency of the Netherlands Antilles) if you can solve the following problem. There are 3 houses and 3 utilities (electricity, water and gas). Each house needs a connection to all 3 utilities. Draw me a set of lines connecting each of the 3 houses to each of the 3 utilities without any of the lines crossing each other."
This seems simple enough. So I spent the next couple of weeks trying to solve this problem, drawing maps on reams of scratch paper. Trying hard as I might, I cannot come up with a solution. It was very frustrating because many times I thought I had the solution, and only not being able to place one final connection. Now I know that the problem is impossible. In mathematical terms, the graph I am trying to draw is the complete bipartite graph K3,3 and this is impossible to draw on a piece of paper without some lines crossing each other since the graph K3,3 is not planar.  In fact the graph K3,3 is an important part of the necessary and sufficient conditions for a graph to be planar.

4. One interesting math trick I learned was how to take fifth root of large integers.  The trick goes as follows.  Ask your friend to pick a 2 digit number and input that into a calculator.  Then raise that number to the fifth power and show you the answer.  Within seconds, you can tell your friend which 2 digit number he or she picked.  The main ingredient of the trick is the fact that any integer raised to the fifth power has the same last digit as itself.   This interesting number theoretical fact is actually easily shown using basic number theory.  In mathematical terms, the result we are trying to show is
x5 ≡ x  mod 10
It is clear that the fifth power of an even number is even and the fifth power of an odd number is odd, i.e.
x5 ≡ x  mod 2
According to Fermat's (little) Theorem (not to be confused with the celebrated Fermat's Last Theorem that took more than 350 years to solve):
x5 ≡ x mod 5
Since 2 and 5 are relatively prime, this implies that x5 ≡ x  mod 10
To complete executing the trick, one needs to memorize the fifth powers of 10, 20, ..., 90.   Because raising a number to the fifth power is a monotonically increasing operation, this allows one to determine between which of the 2 decades the 2 digit number lies and thus determine the first digit of the number.  The last digit one would read off from the last digit of the fifth power. 

Monday, March 29, 2010

Screensavers

My son recently installed a screensaver on his computer and this leads me to reminisce about the screensavers I have seen over the years. In the distant past, computer screens were all built using cathode ray tube (CRT) technology, where a beam of electrons is accelerated to hit a screen of phosphor causing a release of photons lighting up the screen. One drawback of such screens is that in heavily used areas of the screen the phosphor will lose its ability to release photons after a while. If one continues to display the exact same image on the screen for an extended period of time, this would cause the image to be burned-in at the display. Common places where you see this phenomenon is in ATMs and Airport terminals.

To prevent burn-in of personal computer displays, screensavers were created, which are programs that are activated after several minutes of inactivity to constantly change the images displayed on the screen, in order to wear down the phosphor more evenly. One of the earliest screensavers for PCs is the flying toaster screensaver, where toasters are flying across the screen. Since then the screensaver has become much more sophisticated (e.g. displaying fractals and other beautiful patterns based on mathematical equations) and has been used for a myriad of tasks, including advertising, display of news (e.g. PointCast), photo slideshows (e.g. Picasa) and collaborative computing (e.g. World Community Grid) to help solve various important problems in the world today. Since most computer screens today are based on LCD technology, the problem of screen burn-in is less of a problem (but could still exist). However screensavers are still popular since they create a useful diversion to mundane computing tasks.

Back to the screensaver that was installed on my son's computer. This screensaver is associated with a popular video game, and when the screensaver starts, the logo of the game is displayed at a fixed location at the center of the screen with a scrolling star field in the background. This is exactly the kind of burn-in prone images the screensaver is trying to prevent. So it seems we have reached full circle!

Saturday, September 19, 2009

Mirrors without a face

I noticed something peculiar while standing in my bathroom. When I look at the corner of the room where the wall mirror and the mirror of the medicine cabinet meet, I cannot see most of my face no matter how I turn my head. The following figure shows the mirror arrangement.


Two mirrors at a 90 degree angle form a corner reflector and it has the property that light striking it will be reflected back in the same direction parallel to the source light. This is the same principle behind bicycle reflectors. Because there is a gap between the two mirrors, there will be a minimum distance between an incoming lightbeam and the parallel outgoing lightbeam. If this distance (shown as d) is larger than the distance of one eye to the opposite side of my face, then I will not be able to see my face, now matter how I turn my head (unless I stare directly into one of the mirrors).

Monday, August 17, 2009

Tea around the world (or at least Europe)

The word for "tea" in several European languages is pronounced the same as the letter "T" in the same language. I have verified this for English (tea), Dutch (thee), Spanish (té), and French (thé), and I am sure there are others. I wonder if this is coincidence or there is some other (historical) reason behind it?