Slashdot Mirror


TopCoder, Math, and Game Programming

reiners writes "DevX.com has an interesting interview with David Arthur (dgarthur), the 2003 TopCoder Collegiate Challenge winner. Arthur discusses many interesting topics: the similarities between TopCoder problems and math problems, why TopCoder performance is positively correlated with 'real-life' programming performance, and why game programming is where the action is."

19 of 236 comments (clear)

  1. programming 3D rendering engine by stonebeat.org · · Score: 4, Interesting

    programming 3D rendering engine. that is where all the action is. i learned more about linear algebra while writting 3D rendering libraries, then i did during the course of my degree. :)

  2. Language of Choice by avdi · · Score: 4, Interesting

    I find it interesting that a math double-major, who's considering becoming a math professor, uses C++ as his language of choice, with Java coming second. Not Lisp, not Scheme, not Haskell - C++.

    I'm not sure what conclusion to draw from that fact, I just find it interesting.

    --

    --
    CPAN rules. - Guido van Rossum
    1. Re:Language of Choice by Lairdsville · · Score: 2, Interesting
      a math double-major, who's considering becoming a math professor, uses C++ as his language of choice

      A good friend of mine recently finished a PhD in Maths and decided to start his career in the IT industry. Having never done any computer science, he did a six month course in C++ and then a six month course in Java and found that Java was much easier for him. He said that he never felt that he fully understood C++, but he topped the class in Java. I am sure he could have done well in C++ if he had worked at it, but he has gone on to work as a very successful Java developer.

      I think the Language of choice depends on the context, and the conclusion I draw from these annecdotes is that Java is good for industry and C++ is good for academia.

    2. Re:Language of Choice by Anonymous Coward · · Score: 1, Interesting

      you got that backwards. Academia is in love with Java.

      Industry still relies on C/C++

    3. Re:Language of Choice by jgerman · · Score: 3, Interesting
      Kids aren't taught functional languages in college much anymore. You can go through all four years, get a degree and know very little about even imperative programming. Object Orienting caught on at schools when it was at the height of it's buzzword curve and hasn't let go yet.


      I'm sure I'm not the only one working in the industry that's had to deal with poorly educated fresh out of college employees. Kids that only know one langauge, and one way of doing things.
      OTOH I don't believe I learned much from college, it was the reading and coding I did on the side.


      I wish when kids chose CompSci as a major, the first thing they got was a copy of Knuth, Godel Escher and Bach, the Planiverse, and the Turing Omnibus. (There are obviously others I'm leaving out for instance Programming Pearls, Hackers, ext.) I think it would go a long way towards a better Comp Sci education.

      --
      I'm the big fish in the big pond bitch.
    4. Re:Language of Choice by Multiple+Sanchez · · Score: 2, Interesting

      I find that LISP programmers tend to think more verbally than C++ programmers, who think more numerically. LISPies construct ideas verbally, parenthetically. C++ programmers think in a manner more closely in line with machines: operation, operation, operation. Am I making this up? In my C++/3D engine-type courses, the guys and occasional gals fit the compsci stereotype more closely: dungeons and dragons, late nights playing Quake. In my LISP courses, usually AI/GA/GP, there were a lot of guys/gals taking poetry minors.

      I might add that nearly all of the C++ guys were x86ers. Among the prefix notation/parenthetical set of students, there were a lot of school-of-Jobs fanatics and I-*heart*-Woz shirts.

      Or was I imagining it? Anyone else find this to be a reasonable thumbrule?

    5. Re:Language of Choice by Carnivorous+Carrot · · Score: 2, Interesting

      Ok, this "Topcoder" site should hire some of its own contestants to reprogram its site. Problems so far looking around:

      1. Little popup that puts up the red button to enter the competition areas has the bottom line (warning about DON'T CLOSE THIS WINDOW!) chopped off.

      2. Actual coding window when scrolling upward has graphic artifacts and you must highlight the scraggly area and dehighlight to make it look good.

      3. Went back later, window with red button hasn't gotten as far as displaying the red button (only displaying "Java stuff loading" or whatever. Half an hour and counting.

      And I'm not even looking for problems. They're leaping up and barfing in my face.

      --
      "Has [being a kidnapped teenage girl, raped repeatedly for months] changed you?" - Katie Couric to Elizabeth Smart
  3. Re:Real World vs. Top Coder... by targo · · Score: 2, Interesting

    I would look at a Top Coder victor the same way I would look at someone who can answer trivia questions correctly. The experience is incredibly valuable, but I wouldn't say that they are parallel at all. Most of the questions and tests are biased against people who have experience doing competitions. A veteran programmer would probably perform 10x better in a real world environment, and is much more valuable than a TopCoder winner who is still in school... but I could be wrong.

    Actually it's not as simple as that. In order to be successful in TopCoder competitions, one has to be a rather smart person (in fact the 2001 winner is "the smartest guy in the world"), with good analysis, generalization and abstraction skills, and above all, a quick thinker. The problems are not trivial to dissect, and time pressure is strong.
    So for a long term employment (3+ years), I would rather hire a young successful TopCoder participant (one can always gain experience but not smarts) than a regular but experienced guy.

  4. how about encryption? by qortra · · Score: 5, Interesting

    It really depends on how you define "action". Encryption seems to me to be even more exciting a field. It isn't as glamorous as game programming, but the math involved is amazingly interesting (advanced number theory, primality), and good encryption tends to last for longer than good game engines.

    3D rendering is not entirely about math (probably a lot more to do with studying the brain and how people generally interpret images that they see). Encryption however is ALL math. Anyhow, that's my 2 cents.

  5. Re:good thing by Anonymous Coward · · Score: 3, Interesting

    Yup. There wasn't a challenge. I did them for awhile. When they used to pay for all competitions, I learned it was better to stay in the bottom ranks. There you could take a room on one question, the easiest because all you needed were language tricks. When it was just Java, this basically meant that you learned all of java.util and java.lang packages. Basically my strategy boiled down to this:

    1. Read the easy question.
    2. Recall the Java class/method that shortcutted the problem.
    3. Write 3-5 lines of code (not including the class and method header).
    4. Score near max points and be done before everyone else and sit for the rest of the round.
    5. Challenge round, slam the people that tried to finish as fast as you. Chances are these people made a mistake and if you knew the problem, you knew what to look for right away.

    Most of the time I'd also just open the last two questions so I knew what to expect if someone did finish them, but the bulk of the people in the lower rooms would never even get to finish them in the allotted time, if they did, you could almost always count on it being wrong. So long as I didn't answer the big questions and let my scores inflate, I never moved out of those rooms and I never saw a point in it. The only point I saw in getting to the higher rooms was to make the invitational. Yeah I'd love to win $100,000 but at 1 in 64 kids (back a year and a half), my odds weren't that good anyway even if I thought I was talented enough to win (which I know I'm not).

    This is not real world coding and I would NOT encourage colleges to become involved in Topcoder because most of their philosophies go directly against what professors are trying to instill in up and coming programmers. You are not encouraged to design, comment, test or even read the problem thoroughly in these competitions because it all costs you valuable points. Whether or not these are valuable skills in the real world, I'm still growing up and learning.

  6. nobody talks about the actual problems? by lingqi · · Score: 4, Interesting

    well after 69 comments (hehe), there has not been a SINGLE one discussing the competition problems, all three of which are quite interesting.

    especially the hard one, probably, because my mind is drawing a blank on how to have it implemented... (no i didn't cheat and look at the solution).

    heh, actually they go like this:

    *easy* - okay, i can think of a algorithm. probably not the fastest thing in the world, but it should work out.
    *medium* - have a haze of an idea on what an algorithm might look like. with enough caffine it MIGHT solidify.
    *hard* - at least I understand the problem, but curses on the restrictions of a binary tree =)... no idea on algorithm that would finish executing before the end of the universe. (granted, only 50 elements, so maybe it's possible brute-force)

    Damn; this is exactly how /. lowers productivity. making people spending way too much brain power on stuff that's completely unrelated and time consuming. heck; i might lose sleep over this.

    --

    My life in the land of the rising sun.

    1. Re:nobody talks about the actual problems? by cpeikert · · Score: 3, Interesting

      well after 69 comments (hehe), there has not been a SINGLE one discussing the competition problems, all three of which are quite interesting.

      I'll take a shot.

      Ironically, I find the "easiest" one the hardest. I can think of a brute-force O(n^4) algorithm, but it's not pretty.

      The medium problem seems to be straight-up dynamic programming.

      Sadly, the "hard" problem is also straight-up dynamic programming, and is well-known. It's very lame that they chose this problem -- I'm pretty sure it's in CLR (Cormen, Leiserson, Rivest "Introduction to Algorithms"), and it's definitely considered in many other sources.

      Overall, these questions don't seem to be testing for breadth of knowledge, or even ability to think creatively. They all have essentially cookie-cutter answers.

      Coding up correct answers under time pressure is another matter, of course. I give all the credit in the world to someone who can crank out the code and test out all the corner cases properly.

    2. Re:nobody talks about the actual problems? by lingqi · · Score: 2, Interesting

      i don't think you need O(n^4) - though i must say, since it's limited to 50 nodes, even at n^4 it's pathetically small.

      anyway, I think it's probably faster to (for every node n)

      1) compile a list of nodes going out of n
      2) compile a list of nodes coming into n
      3) for every node m not associated to n (complement of (1)+(2), find its list nodes that it has relations with, and find the intersection of the sets
      4) profit!

      well, 250 points only, but i think the above should get you on your way at a lot less than O(n^4). unless i got some costs wrong for some of the operations (i am having doubts about the intersect).

      --

      My life in the land of the rising sun.

    3. Re:nobody talks about the actual problems? by White+Shadow · · Score: 2, Interesting

      Yeah, that's the problem. Except there is no farmer and the restriction on what animals can be left alone together only applied to the boat (so you could lave a bad combination on either shore).

      Oh, BTW, you get 8 seconds for your solution to run, so brute forcing all combinations would take way too long. In more concrete terms, this means you want something with a time complexity less than about 50 million.

    4. Re:nobody talks about the actual problems? by lingqi · · Score: 2, Interesting

      Since you already have every pair of nodes that are not connected, checking for the connectedness of intersects should be a walk in the park beacuse you are checking against list the first. I don't think that's O(n^2). It's more like O(however many intersect pairs you got)...

      Unless the list of intersects (however many intersect pairs you got) is bound by n^2... hmmmmmmm...

      haha, alright. I concede. you see why I am only the rank of "armchair computer programming contest participant."

      p.s. I have to say, though, that the amount of connectedness amongst the nodes do tricky things - because if very few nodes are connected to eachother, that would give you a huge list to check previously (near n^2), but you would have nearly no neighbors, and vice versa. Even in the middle case (which I assume the worst), this should still limit the algorithm's O down. a little.

      or so my gut tells me. heh.

      --

      My life in the land of the rising sun.

  7. Topcoder by dmh20002 · · Score: 2, Interesting

    The top level guys competing in topcoder are some of the smartest guys you will ever meet. Whoever thinks they are a coder, go ahead and try a competition. Its free and they do it a couple of times a week. See if you can even get the easy problem right. I dare you.

    p.s. Topcoder also has the best Java client side applications going. Their competition arena application/applet is a masterpiece.

    no i don't work for them. Yes I have competed.

  8. Occaml - Language of Choice for the Mathematicians by Taco+Cowboy · · Score: 2, Interesting



    Say what you want, but for the math gifted, most of them will code in Occaml, or one of the Meta Languages (ML), if they ever come across them.

    --
    Muchas Gracias, Señor Edward Snowden !
  9. Re:Basis Transforms by Mooncaller · · Score: 2, Interesting

    If students were taught how to visualise the math they are suppose to be learning, they would pick it up much faster. You will find that ALL people who are good with math have a natural capability for visualizing the concepts. It is my firm belief that visualization technique can be taught. I have done just this while tutoring. I found Linear Algebra extremely easy because it was so visual.

  10. Re:Fascinating reading by CognitivelyDistorted · · Score: 2, Interesting
    Hi, David. Congratulations on your win. Don't worry about Slashdotters, they're like this to everybody, out of envy. Hell, everyone who knows me considers me an excellent programmer, I'm not interested in contests, and I'm not an asshole, but I still felt urges to put you down. I'm just mature enough to recognize the source of those urges and suppress them.

    I'm sure you know that the skills you demonstrated in the contest are only a small part of the skills needed by a professional coder. I'm also pretty sure you'd make a great coder. On the other hand, based on what I've heard about you, I suspect you're too smart to be just a game programmer or something like that, and that better things are in store for you. Of course, coding is still a lot of fun, good preparation for management or research, and a decent profession. Whatever you decide to do, thanks for stopping by on Slashdot, and best wishes.