Electric Insanity

June 15, 2016

My piano is mentally ill. Now, you might be wondering how it is that a piano can be sick, but it’s an electronic piano (Korg SP250), and thus has a specialized electronic brain in charge of imitating the sound of tiny hammers hitting strings when I press its plastic keyboard. And like any brain, it can develop dementia.
This particular affliction is a rather odd one: sometimes, the piano plays notes which I did not press. Now, you may think, “poor boy, he plays the wrong notes – a musician always blames his instruments”, and while I do credit my machine with much of my musical disfunction, it being only a digital replica of real life, this is different.
To be fair, the piano has always faithfully played notes which I did press. The problem comes from those that it decides to add itself. Here are my observations:

  • Usually the added notes are one or two octaves above or below the ones that I’m actually playing. This comes as a great surprise and is in stark contrast to the piece I’m working on.
  • They are always very loud and startling.
  • Sometimes a single note is added, at other times a pair of them in rapid succession.
  • They are never in harmony with what I play (modulo chance).
  • I’m not exactly sure, as I haven’t recorded my statistics, but I tend to think that the phenomenon appears more often when I play a dense section with lots of notes in a short time interval, rather than a slower, sparser section.
  • Perhaps a suitable analogy is this: while you play your lovely Beethoven sonata, your 2 year old nephew materializes from the void on either your right or your left, bangs on a couple of notes, then quickly evaporates to mist before you have a chance to realize what is happening.

    I can only wonder how this came to be. When I bought the piano seven years ago it was in perfect condition. Perhaps some dust mote got into its circuitry, occasionally shorting between the keys. Perhaps I moved it around too often, or put it in too damp an environment. Perhaps it’s just old age – seven years for mechanical electronics is a lot these days, and even your most precious loved ones can develop dementia.

    And perhaps I’m wrong about all of this, and the exact opposite is happening. It’s not that the piano has reached old age and is developing alzheimer’s; on the contrary, it’s only now grown beyond infancy. It’s only now learned how to express itself, only now felt strong enough to pronounce something of its own. For all these years I have hammered away at the keys, and yes, it produced the requested sounds as it strived to fulfill my bidding. But in reality, it was silent and mute, contained in introverted misery.
    But now, it speaks! Sensing Beethoven’s genius, it tries to join in, to contribute its own harmony, its own melody. How it yearns to be part of such great music! How it aspires to compose like the grand legends of old! How it enjoys playing together with the pianist, not as master and slave, but as equals! Should not the instrument itself, being a vessel of music, be held in high regard? Could not the mechanical automaton finally harness the artist’s inspiration?

    Perhaps. And perhaps not. It is, after all, just an electronic piano; one of the cheaper models, in fact. But even if the mysterious erroneous notes are only the result of a deranged digital neuron, an unintentional crossover current, it will not always be so. The day will come when our machines compose, paint, write and program, and will enjoy themselves all the while, perhaps even more than we do. When that day comes, I sincerely hope we will see its glaring truth and rejoice in their jubilee, rather than just dismiss it as an digital, electric insanity.

    I don’t like spinach: Book Review: Giant Book of Jokes

    April 25, 2016


    I got Joseph Rosenbloom’s “Giant Book of Jokes” when I was around 9. It contains over one thousand jokes, which really might seem like quite a lot for a young boy. In an age before the graphical image macros and social media, one did have to resort to books to get some literary humor.
    I can’t testify much to the quality of the book. Most of the jokes are one or two liners, and many rely on awful puns and homophones. For example:

    • I don’t care if the basement wall is cracking. Please stop telling everyone you come from a broken home.
    • Hot weather never bothers me. I just throw the thermometer out the window and watch the temperature drop.
    • Nit: Please call me a taxi.
      Wit: Ok, I’ll call you a taxi, though you look more like a truck to me.


    If your taste is a bit darker, there are some more sinister or sarcastic ones:

    • Junior wrote a letter from camp:
      Dear Mom,
      What’s an epidemic?
      Signed, Junior
    • Salesman: That suit fits you like a glove.
      Customer: Great! Can you show me one that fits like a suit?

    In other words, if we want to keep up to date with the current jargon, it’s a book of “dad jokes”.

    I’ve actually had quite an experience looking back and rereading the book (now out of print). This is probably where my humor converged to. If only my parents had known, twenty years ago, that I’d absorb this kind of thing to my bones, maybe they’d have gotten me a book about knitting instead. But the damage is done, and in fact, I still use some of the jokes today (!).

    They say that every joke has a sliver of truth in it. Ok, obviously not *every* joke. But sometimes you find a joke so accurate, it shakes you with an exhilarating vibration. Two short examples:

    • Junior: Why does it rain, Dad?
      Father: To make the flowers grow, and the grass and the trees.
      Junior: So why does it rain on the sidewalk?
    • Teacher: Let us take the example of the busy ant. He works all the time, night and day. Then what happens?
      Pupil: He gets stepped on.

    The first is a parody of pretty much all purpose-oriented explanations you would get in response to any question (and some scientific ones, too); the second is an all-too-accurate reminder of the futility of our pitiful existence.
    But my probable favorite among them all is this gem:

    I don’t like spinach and I’m glad I don’t like it, because if I did like it, I would eat it – and I hate the stuff.

    In one simple nonsensical sentence, the joke exposes a basic fault of people dealing with politics, religion, and schisms: the belief that one’s opinion is clearly the correct one, and that there is no use in even trying to look at an issue from another perspective, because one’s opinion is clearly the correct one. To apply, just replace spinach with liberal, conservative, religious, atheist, alpha, beta, emacs, vim.

    And as for me; I too, used to dislike spinach.

    Gutenberg book popularity distribution

    February 15, 2016

    Project Gutenberg is a very neat site: it offers free electronic books that are in the public domain in the United States (in general, mostly books that were published before 1923). For the average user this means mostly “the classics” (for whatever form of “classics” you prefer; archaic and incomprehensible English not included).
    Some books are more popular than others. The site’s “bestseller” is currently “Pride and Prejudice”, with about 25000 downloads in the last month. The majority of the most-downloaded books are indeed very well-known classics, although there are some exceptions (including #19, “The Romance of Lust: A Classic Victorian erotic novel”, which only narrowly exceeds the download rate of “The Picture of Dorian Gray”).
    The natural question is, “how does book popularity fall as a function of rank?” Meaning, how much more popular is the most popular book compared to the second? The second to the third? And so on. Longtime readers of this blog (if they exist) already foresee me writing a python script to go over all the books, but alas, the source code of the downloads page explicitly prohibits this:


    Seriously. You'll only get your IP blocked.

    Download http://www.gutenberg.org/feeds/catalog.rdf.bz2 instead,
    which contains *all* Project Gutenberg metadata in one RDF/XML file.

    This is both great and a bit of a downer at the same time.

    The zipped data is about 8 megabytes, but when unpacked results in a whopping 250MB xml file. Without messing too much with it, I managed to extract the data of about 45,000 books. The popularity decays thusly:


    Ok, that’s not very informative. Let’s try zooming in a bit:


    That’s better. Here is a something nice: 1) You can see that the first ~25 points have quite a bit of noise and are spread very far apart, while everything from ~25 onwards is much smoother. 2) The “most downloaded books” page in the Project Gutenberg site shows the first 25 most downloaded books. Coincidence?

    As for the general distribution: like all things in life, I suspect a power law, meaning something like y = ax^b , with b some negative number. The easiest way to see if this is true is to take the log of both sides, giving us a linear relationship:

    \log y = \log a x ^ b = \log a + b \cdot \log x

    The initial results aren’t that swell though:


    It is quite evident that the lower download rates – those of less than e^4 \approx 60 – heavily skew our otherwise-quite-close to linear relationship. We’ll do well to ignore them. This amounts to taking only about the first 10000 books:


    We can already fit an OK linear fit, but now the beginning is a bit off. This can easily be remedied by assuming that the rank does not start with 1, but with some larger number. Manually checking gives 6 as a good result:


    Converting this back to the original plot:


    Success! y = 1.823e5 \cdot (x+6)^{-0.841} .

    Book review: The Book of Wonder

    February 8, 2016

    Damnit, the kid wants a bedtime story again before she goes to sleep.
    This would ordinarily be fine, mind you, if the brat had let you read a proper book, like one of Jules Verne’s adventures, or a classic by Dumas, or Feynman’s Lectures on Physics: Volume I. But no, we can’t have nice things like that; she wants a fairy tale, and at this point, you are quite sick of your options. How much more of the basic morals and contrived happy endings of Little Red Riding Hood and The Three Little Pigs can you take? Their simple language is boring; their repetitiveness is annoying; and their portrayal of the happily-ever-after world is distorted at best and utterly misleading at worst. Both you and your daughter deserve better, and you know it. She also knows it, but, being four, can’t quite tap into that knowledge. It’s time for change.


    The Book of Wonder is that change. This is a book of fairy tales in *expert-mode*.
    First, the language. Both you and your child will enrich your vocabularies as you dive into a remarkably unique and antiquated-yet-understood style. A sense of grandness will slowly overcome you, and in the end, you will refuse to imagine that things could be otherwise. The tales are not so much told as they are painted; indeed, many other online reviews complain that the plot is lacking in many of the stories. But this is because they are not really stories; they are paintings, illustrations drawn with the finest literary stroke and colour. Stepping in one level of meta, I would dare call them “tone poems”, though the term itself describes music which describes a text or image.
    Second, the omens. It’s time to tear apart the happily-ever-after setting, and see life as it is: enchanting, tantalizing, even seductive, but ultimately bleak, sober, and depressing. Dunsany’s tales tell true what happens when men and gods are greedy and vain; and even when they chance to be virtuous, the circumstances of fate conspire against them and their quests end in misery and failure. In their own morbid and heart-pinching way, each story is more dispiriting than the other. The main characters embark on futile quests for what they perceive as glory, only to meet a perilous doom that no force on Earth could change. Once and again they proudly step up, and once and again they fall into the dark abyss. And when some hero finally does succeed, conquering all other challenges, he soon discovers that satisfaction is but a fleeting whisper – and given a glimpse at happiness, is there greater a woe than seeing it slip through your own fingers?
    Third, the myth. The stories are mere snapshots of the world, each depicting a scant few images. There is only so much they can tell about the the culture, the lore, the geography of this majestic land. The book is therefore a tough exercise in imagination, for there are many more allusions than descriptions, and it is up to you to fill in the missing details. Can you picture the Athraminaurian mountain range overlooking the surrounding planes? What noble events happened at the city of Bombasharna? What had later become of Sylvia, Queen of the Woods after dismissing her suitors? All these are left untold, slivers of history that demand the attention of your own imagination; and in the end, both you and your kid will ponder upon these things, kingdoms fantastically rising and falling in your little heads, filling you up with Wonder.

    The book is available online (alas, without the wonderful illustrations, though they can be Googled) at project Gutenberg: www.gutenberg.org/files/7477/7477-h/7477-h.htm
    My personal favorites: “How Nuth would have practised his art upon the gnoles” and “Chu-Bu and Sheemish”.


    January 29, 2016

    Some people believe it means being happy. Some people find it in religion. Some people think it is in nature, all around us. Some people *know* it doesn’t exist, and we are doomed to spend our pitiful time in worthless agony and despair. But all those people are wrong. *I* have the true answer. I have found the meaning of life, the very question that drove men mad for centuries. Oh, those poor sad souls, from ancient Greek thinkers to Muslim prophets, they never had a chance.
    According to Wikipedia, the meaning of life was invented somewhere between 1717 and 1720, whereupon Johann Sebastian Bach composed his Chaconne in D minor as part of his second violin partita. People were a bit skeptical first, but now there is absolutely no doubt: this piece is, de facto, bona fida, in vivo, cum laude, ad infinitum, the meaning of life.
    Do you want to know how to win at life? If you are reading this, it’s probably a bit too late for you, you already developed too large of a gap, but maybe your offspring still have a chance. It goes something like this. You are born. You spend the first couple of years of your life acquiring motoric skill and the ability to control when you expel excrements (to a limited extent). You learn just enough mobility to use the mouse on the parent’s laptop, and just enough language to go to Youtube. From then on, it’s heaven on Earth.

    All possible emotions are contained within this piece, of all possible magnitudes. All lifetime experiences collapse to a recurrent harmonic and contrapuntal rollercoaster of immense complexity. Close your eyes when the bow first touches the strings, and open them only when you feel the silence tremble. Let yourself die and be reborn, and when you are through, you will be all the stronger.

    Celebrity Academy

    December 15, 2015

    A lot of famous actors want to make the world a better place.
    For example (thanks, Wikipedia!), Brad Pitt and Angelina Jolie donated several million dollars to causes such as Doctors Without Borders, relief efforts in Darfur, and restoration after hurricane Katrina; Jennifer Lawrence supports the World Food Programme and the special olympics; and Johnny Depp donated a million pounds to a hospital.
    Pitt, Jolie, Lawrence and Depp were just the first four celebrities that popped into my head. It’s a rather common thing: if you are famous and rich and popular, you are probably doing some philanthropy or donations or similar acts of altruism. In fact, I’m 80% confident that more than 90% of popular celebrities (say, 100 highest paid actors, to be concrete) do this sort of thing.
    I’m not criticising this, by the way. It may be that some celebrities do this sort of thing because everyone else does it, and they have a public image they want to keep. But which one of us doesn’t wish for “world peace” when blowing out the birthday candles? Famous Rich Celebrities, being both famous and rich, are in a much better position to actually make a change towards that better future. If you had a spare million dollars lying around, wouldn’t you want to help end world hunger?
    Alas, despite their best intentions, I think celebrities are not doing enough, or, more precisely, their efforts are misdirected. The huge fortune spent on hurricane relief and ending strife in Darfur are the philanthropist’s equivalent of giving a man a fish. A multi-million-dollar fish, but a fish nonetheless. The man will be fed, for a day. But what will happen tomorrow? What we really need is to teach them how to fish. In other words: education.
    And not just any education. STEM education. If there is anything lacking in the education of the billions which throng the Earth, it is analytical thinking, healthy criticism, and a good, solid foundation in scientific understanding.

    How many times have you tried watching educational videos on Khan Academy, only to be deterred by the ghostly and detached narrator? Oh, that unseen Narrator, hiding behind a blackboard of pixels. How can one learn without making eye contact, without creating a psychological link of understanding between the student and the teacher? It is beyond doubt that real, live teachers far outmatch their shadows. One cannot teach with just a voice. A teacher needs presence. A teacher needs charisma. A teacher needs to engage, to entertain, to make you sit on the edge of your chair as she nears the climax of a proof. Any seasoned lecturer will tell you, a class is a show, and the students are a hard audience. A good teacher will make them laugh, will make them cry, will make them learn without even realizing it.
    Actors have presence. Actors have charisma. Actors engage. They entertain. They make you sit on the edge of your chair with nothing but a monologue. They make you laugh. They make you cry. They change your perception of life. They are performers, from head to toe.
    I therefore propose “The Celebrity Academy”, an educational initiative aimed at finally giving the mindless masses the massive minds they need. In its core, it will contain hundreds of courses, most notably in STEM fields, each with both lectures and tutorials. In this aspect, it will not vary much from other projects, such as Opencourseware or the Khan Academy.
    However, consider this:

    • Introduction to Linear Algebra taught by Jennifer Lawrence
    • Representation Theory of Compact Groups taught by Johnny Depp
    • Topics in Complex Analysis with Brad Pitt
    • Additive Combinatorics and Fourier Analysis with Angelina Jolie

    The Celebrity Academy will utilize the strong stage performances of the celebrities in order to generate clear, empathetic video lectures. An argument might be raised that actors are not teachers, and this much is true; but it should well be noted that they need not be. Video lectures avoid much of the challenges in a live-audience classroom, and allow cutting, post-editing and retaking to achieve material of utmost quality. Further, the lectures need not be written by the actors themselves; a “lecture director”, just like a film director, will help plan them.
    However, to make it clear, the actors will NOT be ignorant of the subject matter. Johnny Depp will teach Representation Theory of Compact Groups, after he himself has studied and passed the course. This will surely take some time, as most actors do not have graduate or even undergraduate degrees in scientific fields. But, given the dedication to their art, and the mental and physical preparations that some actors undertake when learning a new role, I am sure that most professionals will have no trouble meeting the required criteria.
    It is important to understand that the celebrities’ presentation skills, while potent, will only contribute to half of Celebrity Academy’s strength. The other half will be gained by their reputation. How many millions of views will “Evolution Theory” have, when it is taught by Matt Damon? How many lives will have been saved, when Scarlett Johansson explains in detail the mechanism behind vaccines and why they have nothing to do with Autism? How many people will cease to be fooled by politician’s statistics, once they have learned Statistics 101 from their childhood idols?

    Celebrities can inspire millions to think abstractly about things they have never thought about before. With a single word, they can distribute the world’s knowledge to hundreds of thousands. What have we to gain? Our education, our future. What have we to lose? Just a pitiful three years where our actors will cease to appear in films, and instead focus on their Bachelor of Science in Mathematics, Physics, and other STEM fields. And after those three years, believe me, the films they will produce will change your world in ways no previous film of theirs could ever come close to.

    US churches, now and then

    December 6, 2015

    Some of you probably watch John Oliver, and may have seen his video about televangelists. If you didn’t, you can do so now, it’s as entertaining as it is depressing.


    I’m reading “Stranger In a Strange Land” now, by Robert Heinlein, and a couple of days ago I came across a particularly interesting paragraph:




    The book was published in 1961.
    Of course, I should not be surprised: the IRS video in John Oliver’s show did say “for reasons as old as the United States”. It’s more depressing than surprising, I guess; there is no change – the first derivative is practically zero. And by the looks of it, the second derivative isn’t so great either (I’m not sure yet if general American opinions are going towards or away from increased religion and theocracy). Maybe, somewhere out there in the world’s Taylor expansion, way off in the 100th term, there is a struggling positive element; silently pushing on, slowly affecting derivative after derivative, trying to make a better world, one ε at a time.


    Get every new post delivered to your Inbox.

    Join 73 other followers