Subscribe to the Blog Feed (RSS)

On Free-Energies and “Higher-Learning”

This tiny post was originally conceived to appear in  “Really Cool Derivations“, the working title for an unpublished study companion meant to pain young upper middle-class students from semi-orthodox Indian families who weren’t romantic enough to indulge in the arts and were consequently conscripted into training for entrance exams conducted by elite institutions of “higher-learning”. It assumes that the reader  is already familiar with Thermodynamic terminology, and believes in the First Law, among other things.

Allow me to guide you through your technical “higher-learning” experience with the following example.

You begin by realizing that an easy and efficient way to prepare for IIT-JEE is to memorize a set of equations such as:

Delta E = T Delta S - P Delta V + mu Delta N

Then, you memorize what name each variable is referred to as.
(S = Entropy, mu = Chemical Potential, and so on.)

And then, you memorize the “conditions” under which the use of an equation is valid, such as “reversible processes for the above case”. Then you look for the same key words in the question being posed, choose the correct equation, plug-in values, and compute some number. Presto, now you are in college, have met some intellectual lecturers and intelligent peers, have been exposed to the larger portion of the real world, have realized that you don’t know jack, have a library, the internets, and accessible “consultants” at your disposal, and are suddenly faced with an abundance of free time. And then, you tend to grow a brain.

Read the rest of this post »

Blink, Morse

In the novel *Cryptonomicon*, one of the lead characters finds himself implicated in a (comical) drug bust, and is placed in a jail cell under the watchful (electronic) eyes of hi-tech eavesdroppers. It’s a scene out of a spy novel (although *Cryptonomicon* isn’t quite that), minus the secret agents, plus one savvy Unix sysadmin. He’s given his laptop, to boot.

The rest of this lead-up contains spoilers, so skip to the image if you’re the ear-cupping-and-yelling kind.

The conspirators don’t pull punches; they’re replicating the prisoner’s laptop screen in an adjacent cell with a Van Eck phreaking setup- so everything he sees, they see. Or do they?

Food, bedding, and a computer- it sounds far too pleasant a way to imprison an inveterate hacker, so he proceeds, ostensibly, to hand over the information they need, carrying out some phony cryptanalysis in the process. And then he conjures a little script, writing out small pieces of code to a file at intermittent intervals. When executed, this script reads out text files (the Real Thing) by flashing the LEDs on his keyboard in morse.

CC-licensed keyboard images are hard to find.

Wow. Using intractably complex technology to simulate simple tasks is a fascinating idea, if only because it goes against design. It’s the joy of complete control over a programmable machine- articulated amazingly well in this extract (from Cory Doctorow’s Little Brother):

If you’ve never programmed a computer, you should. There’s nothing like it in the whole world. When you program a computer, it does *exactly* what you tell it to do. It’s like designing a machine — any machine, like a car, like a faucet, like a gas-hinge for a door — using math and instructions. It’s awesome in the truest sense: it can fill you with awe.

Flashing text in Morse off a keyboard LED is the sort of thing I can’t read without wanting to do myself. So I did.*

Internet, meet Morseblink. Assuming even that you’re not digging for gold in the Philippines with several governments seeking your hard drive for forgotten world war II treasures, it’s still perfect for those someone-over-shoulder moments- or minutes- when you’re trying to give the impression of being at work and want to continue catching up on your feeds.

If you know Morse, that is. At least it gives that oft-ignored scroll-lock LED something to do, the poor thing. (Alternatively, you could relegate that annoying system beep to scroll-lock by having it flash instead.It’s an old idea)

It’s fully customizable, if your binary encoding of choice happens to be different. Alternatively, you could use it to practice your Morse, which is all I’ve found it useful for (yet).

You can download it here (written in Perl 5.8, should run on all *nix systems).

Below the cut: Some usage tips and a refresher on the Morse code.

Read the rest of this post »

June 7, 2009 • Tags: , , • Posted in: Karthik's • One Comment

“Why are you producing so few red blood cells today?”

An interesting note from six months ago that I never got around to posting. ’tis a bit vague, but then so is the source. Besides, I like to think that nebulousness has its share of merits- trickster makes this world, after all.

***

A while ago, it was thought that the trick to making a machine play chess well was to extend how far down the branching network of possible moves it could examine. Irrespective of how far they can look ahead, though, skilled human chess players can confidently confound (or at least match) most chess programs of today.

Why?

I found a fascinating account of this puzzler involving AI and human thinking in (where else?) GEB. Apparently, the reason for this was known from the 1940s; If you’ve ever played chess- or play regularly but with skill befitting a two year old, you’ll come to appreciate the reason immensely.

Chess novices and chess masters perceive a chess situation in completely different terms. The results of the Dutch psychologist Adriaan de Groot’s study (from the 1940’s) imply that chess masters perceive the distribution of pieces in chunks. (Here’s a more recent description.)

There is a higher-level description of the board than the straightforward “white pawn on K5, black rook on Q6″ type of description, and the master somehow produces such a mental image of the board. This was proven by the high speed with which a master could reproduce an actual position taken from a game, compared with the novice’s plodding reconstruction of the position, after both of them had five second glances at the board. Highly revealing was the fact that masters’ mistakes involved placing whole groups of pieces in the wrong place, which left the game strategically almost the same, but to a novice’s eyes, not at all the same. The clincher was to do the same experiment but with pieces randomly assigned to the squares on the board, instead of copied from actual games. The masters were found to be simply no better than the novices in reconstructing such random boards.

The conclusion is that in normal chess play, certain types of situation recur- certain patterns- and it is on these high-level patterns that the master is sensitive. He thinks on a different level from the novice; his set of concepts is different. Nearly everyone is surprised to find out that in actual play, a master rarely looks ahead any further than a novice does- and moreover, a master usually examines only a handful of possible moves! The trick is that his mode of perceiving the board is like a filter: he literally does not see bad moves when he looks at a chess situation- no more than chess amateurs see illegal moves when they look at a chess situation. Anyone who has played even a little chess has organized his perception so that diagonal rook-moves, forward capture by pawns, and so forth, are never brought to mind. Similarly, master-level players have built up higher levels of organization in the way they see the board; consequently, to them, bad moves are as unlikely as illegal moves are, to most people. This might be called implicit pruning of the giant branching tree of possibilities. By contrast, explicit pruning would involve thinking of a move, and after superficial examination, deciding not to pursue examining it any further.

If you pause to think about this, it comes across as an utterly spellbinding revelation.

Read the rest of this post »

April 14, 2009 • Tags: , , • Posted in: Karthik's • 2 Comments

Hivemind - A Case Study

(On humanity’s first Internet collective conscience)

The following text has been composed in drab and condensed deep-voice-narrative and will seem boring to some due to lack of voice or background score. Use the hyperlinks to keep yourselves immersed. Be advised, this makes for one heck of a long read if done right.

Those of us who dwell in cyberpunk or philosophical Science-Fiction would be familiar with the concept of a “Collective Conscience”[1]. My favourite manifestations of the idea involve consistent but uncoordinated actions of independent individuals with no direct communication links to relay their actual intents to, or to seek approval of each other[2][3] (if that sounded redundant, you get the idea and may proceed further). Read the rest of this post »

August 26, 2008 • Tags:  • Posted in: Dileep's • One Comment

CUDA

I have two primary uses for personal computers.

By uses, I don’t refer to tasks that involve using a hammer where an orthopaedists’ tongs will suffice; Most modern desktops are far too overpowered for (relative to those below) simple tasks like web surfing and listening to music. (With two primary exceptions: The PC must not run Windows Vista or Firefox 2.0!)

By uses, I mean tasks that tax the machine to its limits, give it a nosebleed while ensuring you’re getting all you can from your hardware. In no specific order, they are (i) Gaming and (ii) Simulation (or equivalently, scientific computation). There’s also media encoding and the like, but the above are most relevant to my case.

These activities (appropriately reserved for vacation and study months) are unfortunately at odds with each other, even though they’re both “computation intensive”. Both involve loads of floating point operations; although I’m sure they have more in common than just that. But simulations have traditionally been CPU intensive activities, while graphics computations are handled almost exclusively by dedicated processors (GPUs) on graphics cards. Physics computations in games are handled by the CPU (or dedicated physics cards), but the GPU is still in charge of pushing pixels to the screen, receiving a major workout in the process.

In short,

A scheme of arrangements that is less then satisfactory when you consider this image doing the rounds of the Internet (Released by Nvidia):

gpu_die.jpg

That is a shot of the Nvidia GeForce GTX 280 (the latest in their series of GPUs as of June ‘08) next to a modern Intel dual core processor. The “Penryn” dual core processor has just over 410 million transistors; the GTX 280 has 1.4 billion! Larger transistor count doesn’t translate directly to better performance, though- the two are dissimilar in their architecture, purpose and degree of accessibility to the average user. But the latest GPU is, without a doubt, the most advanced piece of hardware you can buy off a shelf right now. And the most powerful piece of hardware in your PC is also the most esoteric, the most specific and the most underutilized.

Which, if I may digress briefly, reminds me of the years I spent pining for a capable graphics card so I could play computer games all day. What kept me from splurging on one of these monsters (GPUs have  outstripped the CPU in transistor count for years now) was that they were too exclusive, too special-purpose to warrant pawning your soul for. And pawn your soul you must, for these things don’t come cheap. Well, that and the fact that I was and am incumbent.

All this is set to change now.

Read the rest of this post »

June 23, 2008 • Tags: , • Posted in: Karthik's • One Comment

“Have Game?”

warshotsc.jpg

[Scroll to the bottom if the references are, um, alien]

It was three in the afternoon, and I was embroiled in an interstellar conflict of epic magnitude. No, really. Mengsk had ordered me to protect the Zerg from the Protoss expeditionary force so he could let them loose against the confederacy. (Why, of all the nerve!) Raynor had his doubts about Mengsk’s intentions, and I’d seen the whole opera go down six years ago- so I knew how things were going to turn out. So here I was, locking down dragoons upfront with my ghosts and bringing the marines wraiths in to finish the job while sneaking my cabal of siege tanks into the Protoss economy. Resources were limited, it was as much a crystal hunt as it was a Protoss purge- when the Mengsk machinations were abruptly interrupted by a cackling knock at my door.

The astute reader will have realized that I was deeply embroiled in a wargame of sorts, albeit a wargame with succinctly alien phraseology. Being interrupted in the middle of a Starcraft session is quite like having a member of the audience at a fencing bout walk up to you and land a swift kick at the back of your knees; sending you careening headfirst into the opponent’s pointy rapier. I paused the game and cleared my head, ensuring that I’d muttered everything apropos before I opened the door. My unwelcome guest was a grinning lad, dark and stocky with expectant eyes that shone fiercely in the glare of the afternoon sun.

“Have Game?”, he asked.

Read the rest of this post »

April 4, 2008 • Tags: , , • Posted in: Karthik's • 2 Comments

Speaker of Aether

So I’m sitting at my computer, immersed in a literature survey for my term project, listening to TOOL at full volume, when all of a sudden I hear a loud “dit-dit-dit-dit-deeeeet–ditditdit-dit—–dit——dit——dit”. Took me about three seconds to realize it’s coming from my speakers. So then I went, “ET!!! WOOHOOO- I KNEW IT!!!”

But, as some wise jack once said, “If wishes were horses, beggars would teleport”. I am of course referring to the noise certain old generation sound-systems tend to make when a nearby cellphone starts transmitting radio waves. Veterans will know that it’s a great way to predict phone calls before it actually rings. And some people have even attempted to make music with it. But one must wonder why it happens at all? A quick Google search will reveal a countless instances where the question has been addressed. Almost all of them appear in discussion forums, short, and insufficient and hand-wavy (to me at least). They all go, “Oh that’s just radio interference”. Even the Youtube video owner messes-up (”…an inch from your brain”?! :”Don’t try with headphones”?! What’s wrong with him!!!). Only a couple came close to helpful. But there are other things the speaker is trying to tell us. So this week, for my first post on RightShift, I’ve decided to listen closely.

The experiment involves recording and observation of sound patterns from a cellphone-speaker coupled system under various modes of operation, and an attempt to correlate to expected cellphone behavior. (You may skip to the comments section . . . now.)

THE APPARATUS:
1> My Cellphone
A SAMSUNG SGH-X160.
GSM phone with Dual Band (900/1800MHz).

2> My Speakers
Creative SBS 240, 20 KHz.

3> Standard issue aluminum foil.
Food wrapping variety. Unknown thickness. (The package didn’t say)

4> Sound-recording (Ubuntu sound recorder software, nameless chinese microphone), Imaging (GIMP) and track visualization tools (Snd 7.0).
Read the rest of this post »

March 14, 2008 • Tags: , • Posted in: Dileep's • 3 Comments

Who do you know?

So my college batch embarks on a most distressing adventure, one of creating an yearbook with expository information on everyone in the two hundred thirty strong ensemble. The venture is distressing because the few volunteers who’re organizing the data collection, formatting and printing process have had little time to sleep in the past few weeks.

The yearbook itself is likely to prove a nostalgic trigger for the part of our noggins that engages in such frippery, but at the moment, it comes across as a self-proclamation along the lines of “We are so awesome!”; a process of collective unrestricted self-aggrandizement. But this is besides the point.

The prime feature of the yearbook is a section dedicated to a description of each person by his/her peers, listing out why their world would have been markedly incomplete without the company of said individual. These were collected through comments on Orkut, and because everyone is uninhibitedly mopey on Orkut, some rather unlikely testimonials poured out, and poured out freely. The result was a large amount of objective data on one social community conveniently hoarded at one location online, a treasure trove for people looking to study social interaction quantitatively.

This is where I step in.

Below the fold: some surprisingly incoherent trends, a few non-funny disclaimers, and a categorical surrender by me to the statistics gods that be. And graphs! Because everything is more authentic with graphs.
Read the rest of this post »

March 10, 2008 • Tags: , , • Posted in: Karthik's • No Comments

The IF thing: resources

This is a short addendum to the post I wrote earlier detailing why you should play Interactive Fiction. (Humour the evangelist, go read!)

So how do you go about playing experiencing IF?

Pick up the phone booth and die is a starkly minimalist (even by IF standards) foot-in-mouth piece of non-sequitur that takes about a minute to play through; try it now.

Emily Short, one of the revered exponents of IF, has extensive guides on everything from how to play to how to write your own games (more on this later).

IF comes in packets called ’story files’, available at several places on the Internet. Baf’s guide documents the most comprehensive collection online. Several story files were linked to in The IF thing, but if you’ve never played IF before, try Dreamhold for the real deal.

You’ll need an interpreter to play them. You would have to install several interpreters to play IF written in different programming languages- fortunately, it’s simpler than that. There’s the kitchen-sink-and-then-some Spatterlight for the Mac OS X, and Gargoyle for Windows and Linux (Source).

Alternatively, Linux users can install frotz and t23run from your repositories, which will let you play most Interactive Fiction from the terminal. There’s something to be said for the benefits of being able to play IF at your machine over SSH; especially since those around you will think you’re working.

Many text adventures can also be played in your browser, if you wish to be spared the hassle of installation.

Other tidbits:

Quine’s letter

Willard Van Orman Quine was a mathematician and philosopher at Harvard known, apparently, for his wit, charm, and openness of mind. In Quine’s obituary, Morton White (a Professor Emeritus at the Institute of Advanced Study, Princeton) tells of the time when he (White) moved from Cambridge to Princeton, and his son Steve was missing multiplication in his Princeton school.
In a letter of 1953, Quine wrote to him saying:

“Since Stevie misses multiplication, he may enjoy gorging on this one. Well, so you have these two numbers, see, and you want to multiply one of them by the other. 0. K., so you write them down more or less side by side, as potential headings of two potentially parallel potential columns, roughly thus:

19 27

Then you go to work on the left one, cutting it in half. Write the half underneath. No fractions, though. If it was odd, just forget the fraction. If it was 58 .. 537, just put down 29 .. 268 as its half. That’s near enough. Then, under that in turn, put its half (ignoring, again, the fraction if any); and so on, until you get down to 1. That completes your left-hand column.

19 27

9

4

2

1

Then go to work on the right-hand number, making a column under it by exactly the opposite method: doubling each time. This could go on forever, but don’t let it. Keep your right-hand column lined up with your left-hand column, entry by entry, and stop as soon as you are opposite the bottom of your left-hand column.

19 27

9 54

4 108

2 216

1 432

0. K., so now you have the two columns side by side. The next thing to do is to start in on the right-hand column and cross out a lot of it. Cross out all the entries which have even numbers opposite them in the left-hand column. Keep only those entries in the right-hand column which have odd numbers opposite them in the left-hand column. All right, now add up the right-hand column, what’s left of it after all the crossing out. The result, unless I have made a mistake somewhere, is the answer to your original multiplication problem.

19 27

9 54

4 108

2 216

1 432

—–

513 [19 * 27 = 513]

It may be that this information reaches Stevie a bit too late to be altogether useful. If I had tipped him off earlier, he would never had had to learn the multiplication table.”

How does this work?

I first saw this a while ago at the Freakonomics blog- the comments section of the post was filled with solutions within a day. It’s not a hard puzzle to solve; shortly after I figured it out myself, I posed it to three of my hostel-mates. All of them figured it out in less than fifteen minutes.

Wikipedia has an explanation for this “Ancient Egyptian Multiplication“, but I’m going to document here the way I understand it, if only because I think my solution is elegant (albeit visibly equivalent to the others), and because I did it all-by-myself. Now would be a good time to stop reading and go figure it out yourself.

Details below the fold.
Read the rest of this post »

February 22, 2008 • Tags: , • Posted in: Karthik's • One Comment