2013 Year in Reverse

Dear reader, as another year comes to a close, it is perhaps wise that we should take a few moments to reflect on what we learned here at An Algorithmic Lucidity in 2013—the year that was!

In the year 2013, this blog saw 103 posts and (at press time) 40 comments. Among these—

We heard a poem about why you should hire me. We surveyed a few numbers between 0 and 1. (Friend of the blog Grognor told me that the funniest part was the explicit disclaimer that the list was non-exhaustive. I replied that not everyone knows about the diagonalization argument—but considering this blog's, um, selective audience, maybe my readers do—all five of you!) We mentioned some hidden costs of talking about stuff. We noted that some words have substrings which are other words. I wrote a series about my experiences studying web development at App Academy (9 8 7 6 5 4 3 2 1). I pasted my first attempt at an OKCupid profile. We observed that I'm a moron. Books arrived in the post. We mused on the nature of personhood and implemented some classic algorithms: the Ford-Fulkerson technique somewhat clumsily in Ruby, quicksort in the form of a letter to a fictional horse, and Huffman coding in Python. We lamented the nature of existence, noticed the non-observance of an unusual tradition, and heard a poem about watching a motion picture by someone you met at university. Three problems with unsolicited advice were discussed, as was the role of bases in the theory of vector spaces, and the subjective indistinguishability of propaganda and other forms of instruction.

Continue reading

Fortune

"They're going to pay you X dollars a year? But that's fantastic! You're rich!"

"I don't like the way you say that. You make it sound as if I had won the lottery."

"Lottery, new job, what's the difference? Good fortune should be celebrated."

"Not like that. If they're going to pay me X dollars a year, that means I have one year to create X dollars of economic value. It's a serious responsibility."

Cover Letter

Beset by nights of torment,
Bent to keep your site performant,
Beneath the moon aloft there then appear
Beautied forms so gallant who
Beseech the gods of Talent to
Bequeath a junior software engineer!

You need someone specific,
One computer-scientific,
Who can complete the team at [Company Name],
Whose reputation takes repose
In repos replete with code which shows
[They put the other candidates to shame].

From graph theory to jQuery,
And matters in between,
My code Pythonic, words unironic,
I greet you through this screen
And ask, if just to highlight it,
If you've positions I might fit,
With pretense shed entirely.
I then said, "Hire me."

Thinking About Writing

"I've been thinking about writing a novel."

"I don't understand."

"I said, I've been thinking about writing a novel. What's there not to understand?"

"The phrase thinking about writing. Is that even grammatical? And if so, what could it possibly mean?"

"What? It's perfectly gram—oh, I get it. Fine. No hedging: I am going to write a novel!"

"Sorry, I still don't get it. I know what it means to have written something, or to be at a keyboard writing something. But to be going to write something, in the unobservable future? Even if the concept is coherent—and I'm not sure it is—how could you possibly know?"

Highball

"Now remember: when you're negotiating salary and they press you for a number, do not reveal your BATNA. Give them an unrealistically high estimate and make them negotiate down. Now practice on me."

"Ahem. Well, sir or madam, given my demonstrated expertise and the value I could create for this company, I think a fair starting salary would be ... sixty thousand."

"No, no, no! I said—"

"Per day."

"Uh ... that's a little too—"

"In Bitcoin."

Computing the Powerset

Suppose we want to find the powerset of a given set, that is, the set of all its subsets. How might we go about it? Well, the powerset of the empty set is the set containing the empty set.

\mathcal{P}(\emptyset)=\{\emptyset\}

And the powerset of the union of a set S with a set containing one element e, is just the union of the powerset of S with the set whose elements are like the members of the powerset of S except that they also contain e.

\mathcal{P}(S\cup\{e\})=\mathcal{P}(S)\cup\{t\cup\{e\}\}_{t\in\mathcal{P}(S)}

So in Clojure we might say

(require 'clojure.set)

(defn include-element [collection element]
  (map (fn [set] (clojure.set/union set #{element}))
       collection))

(defn powerset [set]
  (if (empty? set)
    #{#{}}
    (let [subproblem (powerset (rest set))]
      (clojure.set/union subproblem
                         (include-element subproblem
                                          (first set))))))