Minority Opinions

Not everyone can be mainstream, after all.

Archive for August 2011

Gatekeeping Nightmare

leave a comment »

I just woke up from a dream, and couldn’t relax enough to sleep again.  The big problem is that it was entirely too realistic.

The company posted on the break room wall a financial document, listing contributions to various projects and the income they generated.  (That this was a scrollable document on paper, I attribute to dream logic.  That such a document would never actually be produced, I attribute as much to the impossible accuracy and understanding required as to the culture of privacy about actual salaries.)  My supervisor then turned and named me as one of the top generators for the company, and said that upper management would like to see me in a sort of “gatekeeper” role.  That scared me awake.

I can’t dispute either statement.  I do generate a lot of code for the company: Commit logs show my name about half the time, for six- to ten-man teams.  (We do have a woman on the team, but she’s QA; her contribution is bug reports, not code.)  Granted, that’s largely because I commit in smaller chunks, probably because I treat the commit log as part of my knowledge pool, but my name also shows up on massive swaths of the annotate command.  I also have two major areas of responsibility: the “old” product line (meaning the one that makes us money while we work on the one that the sales team promised would be ready by now), and integrating our three product lines with all but one of our clients.  Combined that with a few minor responsibilities within other areas, and we get a lot of talk about clearing my plate.

Granted, there’s a wrinkle in that I don’t actually write the product that we’re selling.  I only write the delivery mechanism.  And the old creation mechanism, but it’s been superseded by a new one that I hardly ever touch due to the language it’s written in.  For very good reasons, despite the pain.  That leaves my team entirely symbiotic with the content development team, which is one very good reason the financial report could never be written honestly.

Neither can I dispute the gatekeeper part.  I can see my future in my own supervisor, who has been managing instead of coding since about the time I was hired.  What code I’ve seen from him has been good, but he’s been needed to explain technical realities to the grand visionaries who dictate the company’s future.  He also has the ability to recognize good code, which has probably saved my job on a few occasions.  I’m absolutely certain he would like me to teach what I do to the rest of the team.

I’m nearly as certain that I simply can’t do it.  I’ve tried to teach at church, at school, and at work; every experience has been closer to disaster than success.  My best teaching experiences are thought-provoking comments in a discussion led by another; even then, I have failed to comply with a request to repeat myself.  As a guide for a self-directed learner, I’ve been halfway decent, but that’s less about sharing what I do than the path that I took to learn it myself.

The worst times have been when I was asked for a “brain dump” in front of a blank whiteboard.  After a few minutes of incoherent rambling, I can sometimes elicit a real question that can only be answered by looking at the code.  Even the simple questions that I field on an almost daily basis, frequently from the help desk, usually require a code scan, because I simply don’t keep that level of detail in my head.  What I do keep in head is a basic overview of how the code flows, a set of guidelines for its ideal state, and a set of places and methods to look stuff up.

Perhaps I could be a decent pair-programmer, which would give me a chance to show what I do.  There would be some major frustration, particularly over the choice of editor, but I might possibly be able to work something out with a willing partner.  Simple delegation, however, has proven beyond my capabilities.  Either my wingman is frustrated with the lack of direction, or I’m frustrated with the lack of quality, or my supervisor is frustrated with the lack of progress.  If it’s faster to do it myself than to explain how to do it, then why exactly am I delegating?

Granted, that’s probably why I have responsibility for two major areas of the code base.  I’m the only one who knows how they work, and I don’t know how to explain it except by guiding someone through the code itself.

Written by eswald

29 Aug 2011 at 5:57 am

Posted in Employment

Feasibility Results

leave a comment »

I’ve been able to run through the full combinations for two-, three-, and four-candidate ballots, with specific winners for the plurality and/or Borda Count methods.  The last one in particular is a huge mess of data, but some interesting patterns emerge.

The first thing of note is that a problem is never infeasible solely due to a plurality winner, except in the two-candidate cases.  That means that under the most commonly used voting method, if there are more than two candidates, the winner may have very little to with the actual preferences of voters.  As we saw in the AC>AD>BC>BD>CD” href=”https://eswald.wordpress.com/2011/07/19/abacadbcbdcd/”>very first case, a candidate can win even when it would lose to each of the others in a one-on-one situation.

Borda, on the other hand, isn’t nearly so susceptible to such messiness.  There are still over eleven thousand four-candidate preference permutations that can be manipulated to have more than one winner, but that’s less than half of them.  Fewer than two thousand admit more than two winners, and fewer than a hundred can swing all four ways.  In addition, the potential Borda winners in each permutation frequently participate in cycles on the preference graphs, meaning that they’re each in the Smith set.

Not always, however.  In particular, the Condorcet criterion counter-example listed on Wikipedia was reproduced exactly, but with different names, in the AB>CA=CB,A row.  For my next trick, I would like to figure out when exactly a non-Smith candidate can win a Borda election, and exactly how bad those results feel.

Sometime I’ll also compare the pairwise methods (Ranked Pairs, Beatpath, River, Minimax, and Kemeny-Young) to each other, but at least part of that work has already been done.  Meanwhile, I’m spending a ridiculously large amount of processing power on the five-candidate ballots, just to ensure that my four-candidate results remain valid.

Written by eswald

23 Aug 2011 at 10:07 pm

Posted in Mathematics

Replacing the solver

leave a comment »

So the problem that broke GLPK has yielded to another solver.  My main delay was that the documentation isn’t exactly clear about what exactly to install, particularly on Linux, for the other available solvers.

The PuLP home page mentioned COIN, which seems to be a closely related project, so I thought I would at least try it.  Of the relevant-looking PyPI entries, the most obvious didn’t install.  Ubuntu had a whole list of coinor packages, so I installed the one that didn’t start with lib or end with -dev, -doc, or -dbg.  It didn’t work.

It did, however, point me to the right place, by complaining about a missing cbc command.  Yet again, I can thank the command-not-found package for letting me know exactly what I needed from that point.  And wonder of wonders, my problem gets solved in less than a second.

So, now I know that AB>CD>BC can be solved for any of the four winners, for either plurality or the Borda count.  Now I just have to remember why I wanted to know that.  Or perhaps it will suffice to run it over all twenty-six thousand permutations, and see what comes up.

And whether anything else breaks.

Written by eswald

16 Aug 2011 at 10:08 pm

Posted in Technology

3D Wish

leave a comment »

An article I read a few months ago was describing ways to improve 3D movies.  Later, while playing Ocarina of Time on the 3DS, the bit about texture came to mind.  As an early 3D game on what could now be considered an underpowered platform, it does as much as it can with very little.  The characters are well-drawn, but the scenery tends to be blocky straight walls with very flat textures.  It’s mostly forgivable, except for the vines.  The texture lets you climb up them, except that there’s no texture to see.  In 2D it’s forgivable, though occasionally surprising; in stereo vision it’s very jarring.

Read the rest of this entry »

Written by eswald

9 Aug 2011 at 10:02 pm

Posted in Technology

Breaking GLPK

leave a comment »

Soon after last week’s post, I discovered what I had been doing wrong: I had failed to get the negative terms into the PuLP models, so my program was solving something completely different than it claimed to be working on.  Since then, I’ve had great success with many of my problems, returning results almost immediately.

Unfortunately, I’ve found one problem where GLPK crunches for days, without accomplishing anything.  That defeats the whole reason for using it:  I don’t really care about the optimal solution, but I care very much about finding either a solution or determining the infeasibility of the problem in a reasonable time.  Preferably within a minute, but anything more than a day is ridiculously unreasonable.

The problem in question is AB>CD>BC Borda-B.  That’s not a complete pairwise matrix, but simply an exploration into the types of situations where a Borda winner can differ from Condorcet methods.  It expands to eight inequalities over twenty-four variables:

AB > BA: abcd + abdc + acbd + acdb + adbc + adcb + cabd + cadb + cdab + dabc + dacb + dcab > bacd + badc + bcad + bcda + bdac + bdca + cbad + cbda + cdba + dbac + dbca + dcba
BC > CB: abcd + abdc + adbc + bacd + badc + bcad + bcda + bdac + bdca + dabc + dbac + dbca > acbd + acdb + adcb + cabd + cadb + cbad + cbda + cdab + cdba + dacb + dcab + dcba
CD > DC: abcd + acbd + acdb + bacd + bcad + bcda + cabd + cadb + cbad + cbda + cdab + cdba > abdc + adbc + adcb + badc + bdac + bdca + dabc + dacb + dbac + dbca + dcab + dcba
AB > CD: abcd + abdc + acbd + acdb + adbc + adcb + cabd + cadb + cdab + dabc + dacb + dcab > abcd + acbd + acdb + bacd + bcad + bcda + cabd + cadb + cbad + cbda + cdab + cdba
CD > BC: abcd + acbd + acdb + bacd + bcad + bcda + cabd + cadb + cbad + cbda + cdab + cdba > abcd + abdc + adbc + bacd + badc + bcad + bcda + bdac + bdca + dabc + dbac + dbca
Borda-B > Borda-A: abcd + abdc + -1*acbd + -3*acdb + -1*adbc + -3*adcb + 3*bacd + 3*badc + 3*bcad + 3*bcda + 3*bdac + 3*bdca + -1*cabd + -3*cadb + cbad + cbda + -3*cdab + -1*cdba + -1*dabc + -3*dacb + dbac + dbca + -3*dcab + -1*dcba > 3*abcd + 3*abdc + 3*acbd + 3*acdb + 3*adbc + 3*adcb + bacd + badc + -1*bcad + -3*bcda + -1*bdac + -3*bdca + cabd + cadb + -1*cbad + -3*cbda + -1*cdab + -3*cdba + dabc + dacb + -1*dbac + -3*dbca + -1*dcab + -3*dcba
Borda-B > Borda-C: abcd + abdc + -1*acbd + -3*acdb + -1*adbc + -3*adcb + 3*bacd + 3*badc + 3*bcad + 3*bcda + 3*bdac + 3*bdca + -1*cabd + -3*cadb + cbad + cbda + -3*cdab + -1*cdba + -1*dabc + -3*dacb + dbac + dbca + -3*dcab + -1*dcba > -1*abcd + -3*abdc + acbd + acdb + -3*adbc + -1*adcb + -1*bacd + -3*badc + bcad + bcda + -3*bdac + -1*bdca + 3*cabd + 3*cadb + 3*cbad + 3*cbda + 3*cdab + 3*cdba + -3*dabc + -1*dacb + -3*dbac + -1*dbca + dcab + dcba
Borda-B > Borda-D: abcd + abdc + -1*acbd + -3*acdb + -1*adbc + -3*adcb + 3*bacd + 3*badc + 3*bcad + 3*bcda + 3*bdac + 3*bdca + -1*cabd + -3*cadb + cbad + cbda + -3*cdab + -1*cdba + -1*dabc + -3*dacb + dbac + dbca + -3*dcab + -1*dcba > -3*abcd + -1*abdc + -3*acbd + -1*acdb + adbc + adcb + -3*bacd + -1*badc + -3*bcad + -1*bcda + bdac + bdca + -3*cabd + -1*cadb + -3*cbad + -1*cbda + cdab + cdba + 3*dabc + 3*dacb + 3*dbac + 3*dbca + 3*dcab + 3*dcba

My naïve solver gets into a cycle that doesn’t look like it will complete, so I wouldn’t be surprised to find that there is no solution to this.  What does surprise me is that the solver isn’t telling me so.  My Handbook of Mathematics seems to explain how to determine infeasibility, so a computer ought to be able to, right?

Is there a better program that I should be using instead?

Written by eswald

2 Aug 2011 at 8:09 pm

Posted in Uncategorized

Tagged with ,