May 6, 2010

Social Golfer problem

One summer I spent working with a professor, the father of a friend heard my plans and remarked (to my friend, not to me)

I can't think of anything less intellectually stimulating than writing computer code for 7 hours a day.

After some thinking, my guess was they were probably confusing programming with data entry. Moments like these make me realize how much I take computer literacy for granted, especially among older folk. The Supreme Court makes similar mistakes, to much lulz.

I frequently find it helpful then to describe a problem that we work on, since lots of them can be easily described without mathematical notation. One of these has been a real hair-puller these last few days, called the Social Golfer Problem.

Problem Statement


The premise is this: you're organizing a golf tournament with 9 people in it. They play every week in groups of 3, and want to play for three weeks.

Here's the catch: they are social golfers, meaning if possible, they never want to play with the same people twice. Your job is to organize the tournament; you have to arrange who plays with whom every week.

So rather than use names, we'll just use numbers. The first week could look something like this:


 Group 1Group 2Group 3
Week 11   2   34   5   67   8   9


Since players 1, 2, and 3 are playing together in the first group, next week you need to organize the tournament a little differently to make sure 1 isn't in a group with 2 or 3, 5 isn't in a group with 4 or 6, and so on. A complete tournament schedule might look like this:

 Group 1Group 2Group 3
Week 11   2   34   5   67   8   9
Week 21   4   72   5   83   6   9
Week 31   5   92   6   73   4   8

So here's the question: could you organize a tournament like this with 100 people, in groups of 10, for 10 weeks?

Because if you could, you could get published in a Computer Science paper. Whether or not its even possible to schedule such a tournament is an open problem.

For Solving Hard Problems, we have to write a program that takes three numbers

  • g - the number of groups in a week.

  • s - the size of each group.

  • w - the number of weeks.


and either prints a schedule for a social golfing tournament, or tells you its impossible.

It's a really cute problem. Hopefully in a few days, when it's done and gone, I can write about how I wrote the program. In the meantime, how would you go about it?

May 2, 2010

The Gods must be crazy!





Over 60% of the video online containing Paul was only uploaded in the last month. Here's another! I'm acting in Mt. Olympus, a new Brown TV show with some really wonderful people involved.


The premise is that the Greek Gods come down every once in a while from Mt. Olympus to let off some steam. During one visit, Hestia, who guards the hearth (and source of their Godly powers) leaves it unattended to take a break, and their powers vanish! What will they do in as students in a college that looks suspiciously like Brown?



I play Hermes, the messenger of the Gods. He's a trickster, and mostly serves as comic relief. The gods go through a number of identity issues when they lose their powers and learn to become mortal, but Hermes is really just there to have the best time he can.

There's about 2:40 introduction with the classroom scene. I'm mostly in the opening sequence after that, until about 5:00. The rest of the episode is quite fabulous, and I've made lots of great friends working on this. Keep watching until after the credits for More Paul™! It was that clip that left my family speechless when I got the rough cut of it over Spring Break.

Also, some of the music (namely the party music that comes in when I enter the dark room at 3:20) was done by a very talented friend I met at Brown, Mr. Andrew Underberg. I remember asking him for a recording of his midterm project in an Electronic Music class we took 4 years ago, because it really stood out as excellent (sadly, I can't find it on his site and lost it in a hard drive death...).

(also, I've updated the post on the Pope and Catholicism, providing reasons why I am so angry, with lots of links substantiating my original sentiment).

April 30, 2010

I read the news

If you aren't head-explodingly outraged with the Catholic church, you aren't paying enough attention (or, alternatively, you're incapable of independent thought).

With that in mind, this video tickled me (language NSFW).





Unsurprisingly, I agree with the Hitchens/Dawkins initiative to have the Pope brought to court.

Edit: I realize this was an inflammatory post, especially since I don't provide any links to what's going on, or the conversation in place. Here are a few articles that guided my understanding:

  • Andrew Sullivan in invaluable in this discussion, as a compassionate Catholic who isn't afraid of following the truth where it lies. He's written a great article for The Times that lays it all out pretty well.

  • Sullivan continues with more damning (literally, I hope) facts. The Vatican's response so far has been along the lines of calling this 'petty gossip,' seemingly unaware that the documented rape of hundreds children (and documented ignoring of calls for help) does not constitute gossip. It is fact, and there is a difference.

  • How have Church representatives responded? By blaming the Jews, blaming the gays, and when that didn't work, blaming those slutty children who were totally asking for it.

  • This has raised the question, can the Pope be fired? As in, suppose tomorrow we find out he also burned orphanages, uses performance-enhancing drugs, was in Arizona illegally, and was actually not even Catholic. Could the Vatican defrock him? Turns out, they can't. Surprisingly, the Catholic hierarchy has no real systems for accountability.

  • Some bishops do step down, however. The timing suggests they're not so sorry that they did it as they are that they got caught.

  • Christopher Hitchins was on Bill Maher's show, and while both are polarizing atheists who don't generally resonate well with believers (they're pretty inflammatory), this video lays it out pretty simply: would you accept a child molester (or someone who aided one) in your company? In your country? Then why is this any different?



  • The Onion, a satirical publication, wins with the best headline though: Pope Vows to get Church Pedophilia Down to Acceptable Levels. The funny thing is, he hasn't even done this.

  • In a major breakthrough, however, the Vatican may apologize in some way shape or form in June. Again, I have a feeling this is only happening because we're making such a big stink about it, since the abuse has happened over the last century (at least) and nobody from their end has said a peep about it, other than blaming.


The Vatican, like Phil Donahue and most other shills, have demonstrated themselves to be incapable of owning up to this, and have only shown their incompetence by blaming others. The best defense of the Catholic Church came just this morning, by Nick Kristof of the New York Times.

He basically says "don't mock so hard or cruelly, because these idiots in the Vatican aren't the entire Catholic church; many priests and nuns on the ground give their lives selflessly in the true spirit of the organization, and the mockery/criticism belittles their unmatched generosity."

Dan Savage addresses this, and I more or less agree. Standard accountability models are necessary, but mockery (especially honest and well-produced mockery, as in the video at the top of the post) will accelerate the response from the Church while they continue to earn it. Until that response comes, the good, "real" representatives of the Catholic faith will not be represented by the organization they deserve to be, and the churchgoers will suffer as they always have.

Until then, regarding Ratzinger, fuck the motherfucker.

Edit 2 (5/3/2010): More from Andrew Sullivan, reflecting on the NYT summary published yesterday. I also left out the reporting on Marcial Maciel, the Legion of Christ, and other establishment blights that further illustrate how horrible the whole situation is (Sullivan, National Catholic Reporter).

Edit 3 (5/11/2010): Ratzinger finally says something more substantive. This doesn't put him off the hook for the scandals he's been a part of, and I'm still waiting for him to do something. Took long enough, but it's better than blaming outsiders or the victims.

April 29, 2010

Videos with me!

ME ME ME! <STOP>



MY GAME IS BETTER <STOP>



THE GAME I MADE WITH MY TEAM <STOP>



I WILL TRY TO WRITE MORE, FEWER VIDEO-ONLY POSTS <STOP> UNLESS OF COURSE YOU LIKE VIDEOS <STOP>

April 25, 2010

Patriotas!

I can write about Spring Weekend a bit later (this was the first and last time I'll do Spring Weekend as a student). In the meantime, I'll procrastinate by posting another favorite video. Sadly for you gringos, you have to speak Spanish to glean much meaning from it:




I used this as the basis for my first major project in an Electronic Writing course I took last year. Other works I did for the course are on the course wiki, my work including a programmatic riff on Pierre Menard, (this also used a text generator for grammar files I coded up), and my final project.

April 23, 2010

Video Games, and the failure of the word "Art"

Roger Ebert decided to revisit a topic that got him a lot of attention a few years ago, where he claimed that video games weren't art. Now he's strengthened his claim, stating that video games can never be art.

My reaction to this was mostly along the lines of Penny Arcade: there's nothing to see here. An older person who's never really played video games decides to classify them ungenerously. Whoop whoop.

And normally I would let it rest, but then PZ Myers decided to weigh in (he agrees with Ebert). Now PZ is all about thinking rationally, letting evidence trump prejudices, etc. So it surprised me greatly that he made such a claim with such little knowledge, and such poor understanding. It's very un-PZ.

Here are a few pennies for the conversation. This is really about two separate issues: not knowing about the medium you're criticizing, and more broadly, having a stupid question to begin with.

---
Regarding video games, there are a few major blunders in PZ's argument. PZ believes (emphasis mine):

Art is a kind of distillation and representation of human experience, filtered through the minds of its creators. A great painting or poem is something that represents an idea or emotion, communicated through the skill of an artist, to make you see through his or her eyes for a moment. Computer games just don't do that. No team sits down to script out a video game with the intent of creating a tone poem in interactive visual displays that will make the player appreciate the play of sunlight on a lake, for instance.

But they do, at least as much as producers of any other 'artistic' medium do. Compare Hideo Kojima's process with any filmmaker's. Look at the Flower example given in the TED talk that inspired the whole discussion. Stating that "this simply isn't something game makers do" is like an old Pythagorean stating that irrational numbers don't exist: it's simply not true, by very observable counterexample.

Even if you don't accept my examples (Ebert's discussions in particular are full of monkey-patches and amendments to definitions to ensure that no example is quite right), making a sweeping generalization about an entire expressive medium because someone hasn't done a specific project you prescribe (or template for a project) is simply bad logic. There's nothing stopping me from doing it myself, today, and poof! I've beaten your argument in its own, irrational territory.

PZ continues:

Video games will become art when replaying the performance becomes something we find interesting, when the execution of those tools generates something splendid and lasting. It just doesn't now, though. If you want to see something really boring, watch someone else playing a video game. Then imagine recording that game, and wanting to go back and watch the replay again sometime. That's where games fail as art, which is not to say they can't succeed as something comparable to a sport — we may want to explore the rules of a game at length, and repeatedly, and we may enjoy getting better at it. But no matter how well or how long you play a game, it's never going to be something you can display in your home as a representation of an experience.

To quote an old TA of mine, "isolated but incorrect assertion" on the "watching others play video games is boring." The only times I fire up video games is to watch strangers play Warcraft III, and Starcraft is on TV in Korea. YouTube is loaded with video game clips, and we know this is only for sporty demonstrations, not because the games have had a transformative effect on someone!

A less "sporty," more personal example: while growing up my siblings would often come into my room to watch me play Final Fantasy VII or Skies of Arcadia. They didn't have an interest in playing, but were very invested in my playing it for them. "It's like watching a movie, but better," they would say.

Finally, you also can't take this argument seriously when, if you follow it through, you see it enters a heads-I-win-tails-you-lose loop. You see, there are games where playing them and watching the outcome is very much an artistic experience: think Mario Paint, UmJammer Lammy, or the Everyday Looper. Then they would argue that the games themselves aren't art, that they are more akin to canvas, paint, etc. since they take the role of tools, and you only produce art when you play them, get the distinction? But here, PZ wants to classify them as art only if playing them is such an experience that you could hang on the wall. So the definitions he prescribes has it both ways so that he doesn't have to accept a new medium as being viable to the others.

---

Which brings us to the second major point: the whole argument is stupid because it concerns the biggest failure in the English language: the word "Art." The word is completely meaningless; its use almost always means someone trying to dodge a more difficult discussion involving more precise terms.

What is art anyways? Does it need to have an audience? Can anything be art in the right context? These questions are never answered because the word means whatever its listener wants it to mean at the moment they say it. Asking if X or Y is Art or High Art is like asking how many angels can stand on the head of a pin at one time: we can combine all we think we know about angels, pins, and the nature of standing, but it doesn't make the collection anything less than a clusterfuck of misunderstanding to no fruitful answer.

If I defecate into my hands and spread it on people around me, I'm a candidate to be institutionalized. But if I do the same in a theatre, and say I'm doing it for Art, I'm to be taken seriously and you should be more open-minded. The word Art, like God, is frequently invoked to tell people to stop thinking and allow idiocy to pass for proper, constructive thought.

So when I made arguments in the first section responding to PZ's quotes, I was a Copernican using what I knew to be weak Ptolemaic arguments to convince a stubborn Ptomaine who could hear nothing else. Just like the most reasonable answer to most "holy questions" is that there may simply be no God, the most reasonable answer to "can video games be art?" is usually "ask a better question, or clarify your terms."

April 20, 2010

Metaphors I use to describe software development.

Programming is Magic




You don't have to be much of a fantasy fan to have a conception of magic and wizards: with curiosity, hard study, and diligence, you can perform taxing and exacting actions to do something marvelous. After studying until you're old enough to have a white beard, you perform some sequence of actions that will turn a man into a toad.

We have magic, and it's programming. After much study, you can perform a very intricate mental task (the code a programmer produces is just an artifact of a much richer process) which yields impossible fruit.

And like magic, you have to do it just right. Compilers will annoyingly tell you it's Wingardium Leviosa, not Wingardium Leviosaaaa! The worst are spells that pass, but work incorrectly. You may end up spitting slugs.

Programming is the new literacy



It's very recent that reading and writing are expected skills, which we believe everyone has a right to learn. For hundreds of years, it was only scribes who could do it. The writing systems were themselves complex, it required privilege, education, and training before you could put anything to a tablet (and you lived very comfortably for it).

Somewhere in the last few thousand years, it's a basic skill everyone is expected to have. Knowing how to read and write isn't enough for a competitive, skilled job. You need to know how to write to even apply for one.

Programming is very new, and we're in the cave-painting phases of it. Long after I'm dead, programmers will look at today's languages and wonder how we bothered to endure it.

And like reading, once you learn it, worlds and worlds of intellectual exercise and stimulation open up as a result.

I'm with the authors of How To Design Programs in that I believe everybody should learn to design programs, just as we expect them to learn to read and do math.

On imperative vs. functional


Most programmers are imperative programmers, which I like to think of as boxers. They punch very hard, and very well. They have giant upper bodies, mean biceps, and when an obstacle presents itself, great programmers can take it down with a sustained set of punches.

Sadly, most boxers are a little brutish: there is an established and valuable boxing theory which consists of more than just punching hard. But few boxers take the time and discipline to learn it. Most will just punch as hard as possible, as close to center as they know. Boxers who study on the theory tend to be marvelous in combat.

In this world however, are people who do things a little differently. Functional programmers are mixed martial artists. At some point they got tired of punching, and learned to grapple. Learned to kick. They can still punch, but its not their favored solution, and for many their arms aren't quite so beastly for lack of practice.

Boxers judge the mixed martial artists using tests made for boxers, and deem it unworthy. When allowed to use pressure points or grapples, the mixed martial artist will generally win, but most spars are set to boxing rules.

But in the world of big biceps, a few boxers get curious, and wonder what the other side can teach.