One time during my grad student days I had dinner.
Unbelievable, yes, but true.
With a friend. Yes, even more incredible, but true.
At a restaurant. Now I’m really pushing it, aren’t I?
Well, ok, since we’re over the top, I might as well go the whole hog and say it was even a fancy restaurant. One of those places where, as you dine, a happy violinist in shiny tux and a big smile comes by and plays a nice tune.
I used to say that’s a great idea to distract you from realizing that the food was awful. When you’re poor you have to wear your wit to keep warm.
I had initially resisted the suggestion to eat there. But my dinner companion said that they were gonna have a magician that day. Their violinist had gotten sick from the previous night’s dinner. It was usually on the house for them. I’m guessing he wasn’t happy. Or smiling.
I like magic. So I went. Sure enough, no sooner than I’d washed down my first mouthful with a large gulp of affordable water, a short friendly dude in a tall hat came by and asked if I’d like to see a trick.
Would I ever? So I said “Absolutely” which was my Ph.D. advisor’s favorite word. Before he took me on as his student.
I used to think I was pretty bright. But this guy did a trick that had me completely stumped. With cards, no less. Try as I might I couldn’t figure out how he did it.
Then I did some quick mental calculations.
“Ah…” I thought. “That’s how it works. A 10% chance that he’d flub it, which would be about one of ten customers. And when that happens, he’d distract you quickly with a follow-up trick so you’d forget he messed up.
Even if he doesn’t have a pretty assistant.
And then something cool happened. He must have sensed what I was thinking. Magicians are like that. Now magicians never do the same trick twice. Even to different people. Yes, magicians are like that.
But this short dude adjusted his tall hat and said “You know what? I’m gonna do this trick again. I’m gonna do your friend now.”
He did it. With the same awesome effect. My friend wasn’t into magic as much as I was. So he just smiled. Which I always thought was a great cover up for bewilderment. But me? I was floored. What are the odds that the trick works twice in a row? It’s the probability that it succeeds both times. And 90% percent squared is just 81%. That means one in five pairs of customers could be disappointed. Double the risk of embarrassment. I doubt a professional entertainer would accept that.
Even for dinner on the house.
So how did he do it? The inquisitive me couldn’t resist. So I posted my take on the whole thing on the Quora of those days – USENET. I said that I just saw an amazing trick and “here is my oh-so-clever take on how it’s done. And can anyone do better than that?“
Professional magicians are tech savvy. They were on the Internet long before many of you discovered it. Usenet days. Maybe they had a hand in conjuring it up. One of them responded to my post the very next day.
He said I was clever. No magic there.
But then he said that the pro magicians were cleverer. That they’d never do a trick that didn’t work 100% of the time. They take no risks.
He said he could tell me how it’s actually done if I was interested. But that it would snuff out a tiny bit of magic from my life.
I said “Absolutely.”
I was way too brilliant then. And way too young. And way too stupid. Now I like to believe I’m only one of those.
So he broke it down for me. One email. One sentence. That’s all it took to kill the magic.
That trick has never been the same for me since. But I got to appreciate the compassion of magicians more.
When they ask “Was it good for you?” they don’t mean it like when we say “Was it good for you too?” I know what they’ve given up.
That’s what I told my students recently. They had to generate random and unique ID numbers for a million pets – Random numbers ranging from 1 to ten million. So if you were to guess a random ID, you’d only have a 10% chance of finding an actual pet with that ID. They were working on a Pet Store app.

And one more thing… the distribution of IDs to pets had to be uniform. Not all bunched up in some range. Or you could simply assign the first million numbers to your million pets. And of course, two pets can’t have the same ID. That’s what unique means, right?
That what makes it interesting for them. Coming up with a scheme to assign uniformly random IDs to a bunch of pets. Without conflict.
It’s simple. But they’re beginners. Some students try to concoct fancy schemes. Some of these are quadratic. “Look up each ID before issue to see if it has been used” for instance. That’s a good baseline response. Ripe for a suggestion to make it faster. To make it linear.
But some say they’ll just do random IDs without checking. “It’s gonna be unique 90% of the time. What’s the problem?”
Probably not the right time to ask whether they’d settle for a 90% (B+) in the final. But here’s where I bring out the magician story. It’s not enough to be correct 90% of the time. You need to be right always.
The story makes them appreciate proofs.
At the very least, it gets them thinking about algorithm correctness. What it means to provide guarantees that a program does what it says it does.
One of them says that’s why we trust computers more than we do humans.
Some humans.
&
And oh, if you’re curious about that magic trick, you can see my sloppy version of a similar one on YouTube. I did it for my students.

Does Google translate
All knowledge is ultimately grounded in direct experience. This is a fundamental postulate of epistemology. That’s why learning a language exclusively from a dictionary is futile. Some words –
Today I taught my class about recursion in computer science. As a precursor to this important topic, I also review the concept of Mathematical Induction. For those not in STEM, even if symbolic logic isn’t your cup of tea and Math isn’t your forte, please read on. I promise not to meditate on the Math in the topic. Instead I will focus on the Fun of it. This article contains digested material from various sources, classical and modern, laid out in lay terms for bedside reading.


If you’ve had one (which you probably have), you know EXACTLY what I mean.
I unabashedly admit that I have had anxiety meltdowns many times in the past. As a grad student, I delighted in my discovery that making lists of things to get done helped somewhat, but promptly realized that it was no panacea. Pretty soon, I’d found myself with an overwhelming list of TO DO items that were never getting done – there simply was no good reason to start at any particular task. Of course, I could rationalize that I must start somewhere and that getting one thing done was better than getting nothing done at all. But that was the rational and discriminative mind speaking, even tragically conscious of the fact that it was unable to spur the sweating body into action.
Anxiety meltdowns are crippling. We find our feeling mind to be completely aware of what needs to get done, and yet the body is too paralyzed to act. We are forced to watch with increasingly despondent anticipation of impending doom even as the torture of involuntary inaction is inflicted upon our most beloved one – our own self. Enough to make even a cold-blooded Bolton bastard shiver in his socks!
The answer that helps the anxious ones is clear when we admit that we have once been victims of the same affliction ourselves. Then we think back to how we came to address the situation and pass on the learned knowledge to the next generation so they can also put it to good use.
As always, this is best illustrated using an analogy of an unforeseen physical setback. Of course, nothing can be done about sudden calamities. An unexpectedly sudden stroke, heart attack outta the blue or a devastating accident – these are things we have no control over, and need to learn to accept in order to carry on. That’s a different skill which is not the subject of this article. Here, we’re concerned with the non-sudden calamities. Those that happen with sufficient warning. Suppose a man has survived a heart attack. We find that he is usually acutely aware of any symptoms that might suggest the onset of the next one after the fact. When he notices one, he doesn’t ignore it. He doesn’t wait until the symptoms mushroom into a full-blown attack. He seeks medical attention promptly to put it to rest, yes?
Sometimes age brings wisdom. With reflection and insight born of wisdom we can see and evaluate situations for what they’re really worth, and consider the value they bring to our lives. But being young comes with its handicaps. Because every situation and experience is so new, the mind is completely overwhelmed by them leaving little if any time at all to reflect. Here is where it helps to meditate. By training your conscious mind to calm down, you get an opportunity to peer into its inner workings. You get to see and observe the life cycle of your personal experiences and evaluate them. You discover new ways to tackle painful situations. You learn to identify common patterns at an intuitive level so you can respond 


Starting trouble is all too real, and getting older and wiser doesn’t make it less ubiquitous, although it equips one with strategies for overcoming it. Writers have a writer’s block. Painters have a painter’s block. And sculptors have, well, a block. I’m not especially proud of that last pun, but I wrote it down as part of a content dump for this article, and so I’m gonna let it stay to make a point later.
Programmers are no different from any other artists when it comes to starting a project. When you have a clean slate, it’s tough to know just where to begin. Even in large projects involving several teams and millions of lines of code, individual programmers often find themselves in a similar situation when they sit down to write one or more smaller self contained modules for which they are responsible.
An aspiring and promising African American writer, Jamal Wallace, befriends the reclusive writing legend William Forrester. During a time when Wallace is struggling to get started on a school project, Forrester tries to get him started by having him type in the first few words of one of Forrester’s old essays. The essay blossoms into something original and splendid, but also lands Wallace in hot water for plagiarism.
In the process of doing this, many students reported that they gradually edit the program to suit their needs. This morphing process picks up momentum to the point that the program eventually undergoes fundamental changes to result in the required solution. 
I have been holding mindfulness meditation practice sessions during the 10 minutes before each of my 8am lectures (usually twice a week) since Week 2. When we started, we didn’t talk about mindfulness at these sessions, but actually did it. Any mindfulness related discussions were to happen on the 




e are proud to be an inclusive and welcoming educational institution. Nobody who comes knocking on our doors is denied an opportunity to learn for the wrong reasons. These are reasons irrelevant to the course work or the requirements to master it – reasons like ethnicity, nationality, sexual orientation or identification, and even physical or mental challenges that get in the way of a full appreciation of the subject matter. We boast one of the best accommodation centers of all colleges in the country that goes out of its way to make sure that each of our students is given the greatest opportunity to learn. Equity is not only our interest and focus. It is our mission.
Science or Math is as universal as any other scholarly pursuit. Nobody has a better claim to it than anyone else. And to drive the point home, I decided that I would come to class dressed in my traditional Indian garb and lecture in it. What I’m wearing in the picture is called a
embarrassment” they said. “Let’s put together a committee to get to the bottom of it. Why does our team infallibly lose to HP’s?”
e that’s more scalable than my walking around frenetically to find out who was stuck and who wasn’t. That’s when I realized that Elaine Haight’s pair programming suggestion would work wonders in this situation.
Finally, I sweeten the deal by turning the whole classroom exercise into a kind of low-stress game/race by offering Extra Credit (