Recently when we designed the problem set for the CMU Spring Invitational the topic of simulation problems came up. We had 10 problems, and not a single one was a simulation. It took us about 45 seconds to dismiss the concept of a simulation problem. Our team and coaches are all fervently against simulation problems.
The reason is really quite simple, simulation problems aren't interesting problems. They don't require any insight to solve them. All that is required is to accurately translate a set of (usually very complex) rules into code. The solutions tend to not be elegant. The console time needed to solve them is terrible. They are usually very long, and have enough special cases to force more than a couple of resubmissions.
While I think a majority of people will agree that simulation problems are not very interesting, we still have to deal with them. My view has shifted recently, I think that simulation problems are interesting because they are problems from world finals or regionals. We are going to have to compete with this problems, so we need to get better at them. Which of course begs the question, how can you get better at simulation problems?
I have yet to really try and get better at these, but that won't stop me from throwing around a few ideas. I think that solving a bunch of simulation problems will help, but not that much. Simulation problems are rarely similar to other problems, so solving one won't really help you in another one down the road.
Alan came up with, what I think is, a much better way to practice these problems. Assign one problem to your team/coaches every week. Everyone individually solves the problem (while attempting to still write code on paper and minimize console time), then everyone gets together and talks about how the implemented in and what cool tricks they used, and what tripped them up.
For these types of problems we don't need to get together to figure out how to solve them, but we can still get value out of seeing other people's ideas. I think what we will see is that most simulation problems, while lacking an elegant solution, have some solutions which are significantly easier to code and debug than other solutions.
I'm interested to see how much better we can get at simulation problems by putting some time in to practice on them. If anyone has put in a tone of time I would love to hear from them about how much better they are. My best guess is that we won't save too much on the amount of man hours it takes to solve the problem, but that we can cut the console time the problems take down significantly.
Sunday, April 12, 2009
Friday, April 10, 2009
ACM ECNA Regional 2008
I never wrote a blog post about how the regionals went down, so here goes. We came in as the B team from CMU. We had only practiced a couple times with the A team and they beat us both times, once by a narrow margin and the other by a big margin. I thought we were getting more practices in, but either way we were the underdogs.
I started the contest off really nervous. I started by reading problem C which was a pretty trivial problem. I was scared about accidentally jumping on too hard of a problem at the start, but after I few minutes I went for the terminal. The problem was pretty simple and I submitted it, only to get it back with a wrong answer. In the mean time Celestine who was assigned problems A and B started working on B, probably not what he should have started working on but it was a doable problem. Alan started on D and also got back wrong answer. 45 minutes in we had two wrong answers already, and no correct submissions.
Alan and I helped each other out debugging code while Celestine started on B. Eventually I fixed my bug and got our first correct answer 50 minutes in, and Alan followed with his problem 6 minutes later. Alan went for E, while I helped Celestine with B and started looking at the last few problems. Alan finished E pretty quickly while Celestine was having problems with B. I worked with Celestine to get B wrapped up and get the significant figures worked out. We turned in B and somewhat surprisingly got it right the first time.
I'm not sure when, but I think about now we decided that we weren't going to get all 8 problems, so we canned A and just went for seven. I wrote up my somewhat hacked together program for F, it worked first time but I really didn't think that it was going to. After we got it right we checked the scoreboard and saw that we were in the lead (which I think is a bug because looking at the submission times we were never actually leading). Celestine identified G has brute force (despite by disbelief) and he went to work on that. In the mean time I worked on H with Alan. We started with a pretty simple solution, but we found some counter examples and had to make it more and more convoluted. Thankfully the bounds on the problem were so small that an extra factor of n in the runtime didn't hurt.
Celestine submitted G and got it wrong. While he was debugging Alan went to type of H, and I helped Celestine debug. We found Celestine's bug which I think was something small like swapping his is and js in some nested for loops. We had fifteen minutes left to finish off H. The scoreboard was locked with an hour to go and the top 3 was us, the other CMU team, and Waterloo, all with 5 problems solved. Our tiebreaker was pretty horrendous with 4 wrong submissions and a really slow start. At that point I thought we had no chance of winning the contest.
Alan debugged his code while I watched him and Celestine worked on some test cases. The clock was slowly ticking down and we couldn't even pass the example test cases. With one minute left on PC^2 (which means less than 2 minutes actually) we finally passed the example test cases and turned in the code. We didn't bother typing up the example test cases until after. We put them in and everything seemed to work. The contest ended and we still hadn't gotten a response back. At this point Alan was shaking uncontrollably. I thought that even with the seventh problem we would be in second or third because of our tiebreaker.
Eventually we got our submission to H back correct. The other CMU team came in and asked us how many we solved (the scoreboard was still frozen) we had seven, they had six. At that point whether we won the regional or not we were going to the world finals. I was still pretty sure we hadn't won overall. When we got to the coaches area the scoreboard was up and CMU had gotten first and second. We were the only team to solve seven.
I have been wondering how lucky we got to win the contest. After the fact Waterloo challenged the fact that their submissions to B were wrong claiming that it was a round error. They used ieee rounding instead of the normal rounding. The problem should be setup so that doesn't matter. The other CMU team said their submission to H would have worked if they had gotten the tiebreaker right for which path to pick. Our submission to H could have easily gone the other way, but it all seemed to work out in our favor.
In the end there was a big chunk of luck that helped us, but I think out team strategy was more of the deciding factor. The decision to not even attempt A was pretty crucial to us. We didn't waste any man power on it, while the CMU team (and maybe the Waterloo team) spend some time trying to figure it out. I think out use of console time was done really well, we didn't do much debugging on the console, lots of team debugging on paper.
On the other side our problem selection was pretty horrendous. We got E (one of the 2 easiest problems) two hours into the contest. We started B as one of our first problems (which only two teams ended up getting). In the end though if you solve seven problems and no one else does it really doesn't matter how you solve those seven problems. This is also an example of how for a team solving most of the problems at a regional problem selection can't hurt you that much. Sure our time penalty got hit pretty bad, but it didn't make us solve fewer problems. If a team who was only going to solve 4 problems went after B as their first problem they will probably only end up solving 2 or 3 problems.
With that win we are off to Stockholm in a week. After a winter of practicing I think it is going to give us a trip to the next world finals. The previous CMU A team hasn't been practicing much at all. For them to compete with us at next year's regionals they are going to need to put in a ton of work. Thinking back if the regionals go the other way and we don't put in the practice over the winter we could have effectively lost this year's regionals, and next year's.
I started the contest off really nervous. I started by reading problem C which was a pretty trivial problem. I was scared about accidentally jumping on too hard of a problem at the start, but after I few minutes I went for the terminal. The problem was pretty simple and I submitted it, only to get it back with a wrong answer. In the mean time Celestine who was assigned problems A and B started working on B, probably not what he should have started working on but it was a doable problem. Alan started on D and also got back wrong answer. 45 minutes in we had two wrong answers already, and no correct submissions.
Alan and I helped each other out debugging code while Celestine started on B. Eventually I fixed my bug and got our first correct answer 50 minutes in, and Alan followed with his problem 6 minutes later. Alan went for E, while I helped Celestine with B and started looking at the last few problems. Alan finished E pretty quickly while Celestine was having problems with B. I worked with Celestine to get B wrapped up and get the significant figures worked out. We turned in B and somewhat surprisingly got it right the first time.
I'm not sure when, but I think about now we decided that we weren't going to get all 8 problems, so we canned A and just went for seven. I wrote up my somewhat hacked together program for F, it worked first time but I really didn't think that it was going to. After we got it right we checked the scoreboard and saw that we were in the lead (which I think is a bug because looking at the submission times we were never actually leading). Celestine identified G has brute force (despite by disbelief) and he went to work on that. In the mean time I worked on H with Alan. We started with a pretty simple solution, but we found some counter examples and had to make it more and more convoluted. Thankfully the bounds on the problem were so small that an extra factor of n in the runtime didn't hurt.
Celestine submitted G and got it wrong. While he was debugging Alan went to type of H, and I helped Celestine debug. We found Celestine's bug which I think was something small like swapping his is and js in some nested for loops. We had fifteen minutes left to finish off H. The scoreboard was locked with an hour to go and the top 3 was us, the other CMU team, and Waterloo, all with 5 problems solved. Our tiebreaker was pretty horrendous with 4 wrong submissions and a really slow start. At that point I thought we had no chance of winning the contest.
Alan debugged his code while I watched him and Celestine worked on some test cases. The clock was slowly ticking down and we couldn't even pass the example test cases. With one minute left on PC^2 (which means less than 2 minutes actually) we finally passed the example test cases and turned in the code. We didn't bother typing up the example test cases until after. We put them in and everything seemed to work. The contest ended and we still hadn't gotten a response back. At this point Alan was shaking uncontrollably. I thought that even with the seventh problem we would be in second or third because of our tiebreaker.
Eventually we got our submission to H back correct. The other CMU team came in and asked us how many we solved (the scoreboard was still frozen) we had seven, they had six. At that point whether we won the regional or not we were going to the world finals. I was still pretty sure we hadn't won overall. When we got to the coaches area the scoreboard was up and CMU had gotten first and second. We were the only team to solve seven.
I have been wondering how lucky we got to win the contest. After the fact Waterloo challenged the fact that their submissions to B were wrong claiming that it was a round error. They used ieee rounding instead of the normal rounding. The problem should be setup so that doesn't matter. The other CMU team said their submission to H would have worked if they had gotten the tiebreaker right for which path to pick. Our submission to H could have easily gone the other way, but it all seemed to work out in our favor.
In the end there was a big chunk of luck that helped us, but I think out team strategy was more of the deciding factor. The decision to not even attempt A was pretty crucial to us. We didn't waste any man power on it, while the CMU team (and maybe the Waterloo team) spend some time trying to figure it out. I think out use of console time was done really well, we didn't do much debugging on the console, lots of team debugging on paper.
On the other side our problem selection was pretty horrendous. We got E (one of the 2 easiest problems) two hours into the contest. We started B as one of our first problems (which only two teams ended up getting). In the end though if you solve seven problems and no one else does it really doesn't matter how you solve those seven problems. This is also an example of how for a team solving most of the problems at a regional problem selection can't hurt you that much. Sure our time penalty got hit pretty bad, but it didn't make us solve fewer problems. If a team who was only going to solve 4 problems went after B as their first problem they will probably only end up solving 2 or 3 problems.
With that win we are off to Stockholm in a week. After a winter of practicing I think it is going to give us a trip to the next world finals. The previous CMU A team hasn't been practicing much at all. For them to compete with us at next year's regionals they are going to need to put in a ton of work. Thinking back if the regionals go the other way and we don't put in the practice over the winter we could have effectively lost this year's regionals, and next year's.
Thursday, April 9, 2009
Prepping for World Finals vs. Purdue
The last two Mondays the world finals team scrimmaged against Purdue (who just barely qualified for world finals with a correct submission at the 300 minute mark). The first week was a synthetic set made up of 7 IOI finals problems. The problem set was incredibly hard. Normally when I start a hard problem set there are a few problems where I have some ideas of where to start working, on this set I had nothing. I think the key was getting people assigned to the right problems. Alan gave me a fun DP problem, and I gave him a DP problem on trees (just like an assignment he had just a few days before). That helped us break open the problem set a bit.
We managed to get four problems in five hours, which seems like a decent accomplishment. Purdue got 2 in 5 hours, and a third in the thirty minutes after the contest. I think we should have gotten a fifth, but I'm not complaining about four. I think partially IOI is a different type of set (the bounds are a lot larger on most problems), and partially it is simply a very hard set. I am clueless how some high schoolers knock down three of these problems in five hours.
We practiced by ourselves the next friday on another IOI set. Again getting four problems, but this time out of only four on the problem set.
This Monday it was back to practicing with Purdue, this time on a problem set with 11 problems from various European regionals. All of the problems were the hardest 2 or 3 from their regional. I had about the worst contest I have ever had. I had 5 submissions on problem J. The first was a simple swapping i/j which caused a runtime error, second was a few more implementation bugs, third was a bad assumption about the problem, the fourth was a worse assumption, and the fifth was correct. The other problem I got was a simple max flow, which I managed to mess up once.
Overall we got 6 of 11, as did Purdue, but we did so with a better time penalty. I think on a better day we really should be solving 8 problems on that set. We had a problem done with 10 minutes left that just had a stupid implementation bug in Dijkstra, and a bruteforceable problem we never got to.
These types of days scare me, because one bad day at world finals throws out all the practice you did. Just like running (my other big sport) being in the right mindset seems to be key to this. I think today I was too focused on speed and not enough on correctness, especially on my max flow submission. I have a shot at redemption next Monday when we add Duke into the practice. Individually I think we are a little better than Purdue, as a team I think we are a good bit ahead. I have no clue how good Duke is, but regional results and their lack of a larger number of high ranking TopCoder members suggests they aren't that good.
We managed to get four problems in five hours, which seems like a decent accomplishment. Purdue got 2 in 5 hours, and a third in the thirty minutes after the contest. I think we should have gotten a fifth, but I'm not complaining about four. I think partially IOI is a different type of set (the bounds are a lot larger on most problems), and partially it is simply a very hard set. I am clueless how some high schoolers knock down three of these problems in five hours.
We practiced by ourselves the next friday on another IOI set. Again getting four problems, but this time out of only four on the problem set.
This Monday it was back to practicing with Purdue, this time on a problem set with 11 problems from various European regionals. All of the problems were the hardest 2 or 3 from their regional. I had about the worst contest I have ever had. I had 5 submissions on problem J. The first was a simple swapping i/j which caused a runtime error, second was a few more implementation bugs, third was a bad assumption about the problem, the fourth was a worse assumption, and the fifth was correct. The other problem I got was a simple max flow, which I managed to mess up once.
Overall we got 6 of 11, as did Purdue, but we did so with a better time penalty. I think on a better day we really should be solving 8 problems on that set. We had a problem done with 10 minutes left that just had a stupid implementation bug in Dijkstra, and a bruteforceable problem we never got to.
These types of days scare me, because one bad day at world finals throws out all the practice you did. Just like running (my other big sport) being in the right mindset seems to be key to this. I think today I was too focused on speed and not enough on correctness, especially on my max flow submission. I have a shot at redemption next Monday when we add Duke into the practice. Individually I think we are a little better than Purdue, as a team I think we are a good bit ahead. I have no clue how good Duke is, but regional results and their lack of a larger number of high ranking TopCoder members suggests they aren't that good.
Tuesday, January 13, 2009
Tommy Angelo is my new hero
Elements of Poker by Tommy Angelo hit home with me really well. In the book he has an example about an archer training with some monk in Asia. The archer has spend a year and is not any better than he was. Finally one day the monk tells the archer to breathe in a certain way before shooting and finally the archer improves a ton. The archer had to endure the bad before he would be willing to really try something so stupid as breathing.
I think that story follows exactly what I went through reading the book. I have had a lot of problems with tilt and the book made a ton of sense to me. Just before going back to college I mocked my brother about going to a meditation, and didn't get it at all. Now I get controlled breathing. It really is just to get your mind off of everything.
Two other things really stuck with me. The first one is that just like playing better, quitting better is a poker skill that will help with your hourly. If you quit while still playing your A game and someone else waits until they are playing their C game you are going to win off of them. Quitting isn't something that the weak do, its a competition just like poker itself. Whoever quits better will win.
The other element that helped a lot was when you are all in consider what you should do if you lose when you are ahead. At that point you aren't tilted so make the decision that if you get sucked out on whether you will continue or not. That way you make the decision before you get tilted not after.
In the last two days (since reading the book) I am up $78 with an ROI of %30 just playing for about 3 hours. Its a sick hourly for someone playing the $11s. I'm only $90 away from the $22s!
I think that story follows exactly what I went through reading the book. I have had a lot of problems with tilt and the book made a ton of sense to me. Just before going back to college I mocked my brother about going to a meditation, and didn't get it at all. Now I get controlled breathing. It really is just to get your mind off of everything.
Two other things really stuck with me. The first one is that just like playing better, quitting better is a poker skill that will help with your hourly. If you quit while still playing your A game and someone else waits until they are playing their C game you are going to win off of them. Quitting isn't something that the weak do, its a competition just like poker itself. Whoever quits better will win.
The other element that helped a lot was when you are all in consider what you should do if you lose when you are ahead. At that point you aren't tilted so make the decision that if you get sucked out on whether you will continue or not. That way you make the decision before you get tilted not after.
In the last two days (since reading the book) I am up $78 with an ROI of %30 just playing for about 3 hours. Its a sick hourly for someone playing the $11s. I'm only $90 away from the $22s!
Monday, January 12, 2009
Bursting into the $11s
I finally made it fairly deep into the $11s (bankroll wise). I ended the day up 2-0 at the $6s and 7-4 and the $11s for a nice $39. My bankroll is up to $200 so I would have to lose 4 of the $11s before I would drop back down to the $6s. I'm really hoping that this is the last I'll see of the $6s, with another couple winning sessions I should be easily away from the $6s. I'm also closing in on being +ROI for the $11s (I'm 15-18 at them so far).
Monday, January 5, 2009
Poker Update
Yesterday I tilted off a 4 buyins at the $11s, I got the money in good for the first couple, lost then lost a few more. I didn't play that badly, but definitely not my A game. I did well at the $6s winning 16 out of 23. I took two shots at the $11s, got it all in really early in both one with 65% equity and the other with 80% and lost them both =/. I don't want to get into bad beat stories, but whenever I try a higher limit I seem to run bad at the start. I still think I'm massively +EV on the $11s so eventually I'll make it fully into them.
Don't Vote: Why I didn't and you shouldn't
If you, the reader, happened to vote in this election why did you do so? From a purely logical point of view the probability that one vote swings an election is minuscule. Sixty one percent of Americans voted in this election, but logically only a few should actually vote.
One of my many cynical views is that people have a need to feel that they are significant. The United States is a democracy and your vote counts, even if we all know that in reality doesn't. The other side of this argument is that we need something to blame for our problems. If you voted for the "correct" candidate and the country takes a turn for the worse its not your fault. You voted for the other guy!
What people fail to recognize is that while their vote doesn't count, that doesn't mean that they don't matter. The choices each of us make every day affect our lives more dramatically than a lifetime of voting. Voting does not make America great, voting has simply allowed for the preservation and creation of our rights. This country has been made strong by generations of citizens looking out for their own well being. The act of voting does not guarantee prosperity, only fighting for ones own personal well being can do that, and through that fight everyone gains.
So next election don't vote, spend that time pondering how you can make your own life better, and through that simple act you will accomplish the goal of voting, making everyone's lives better.
One of my many cynical views is that people have a need to feel that they are significant. The United States is a democracy and your vote counts, even if we all know that in reality doesn't. The other side of this argument is that we need something to blame for our problems. If you voted for the "correct" candidate and the country takes a turn for the worse its not your fault. You voted for the other guy!
What people fail to recognize is that while their vote doesn't count, that doesn't mean that they don't matter. The choices each of us make every day affect our lives more dramatically than a lifetime of voting. Voting does not make America great, voting has simply allowed for the preservation and creation of our rights. This country has been made strong by generations of citizens looking out for their own well being. The act of voting does not guarantee prosperity, only fighting for ones own personal well being can do that, and through that fight everyone gains.
So next election don't vote, spend that time pondering how you can make your own life better, and through that simple act you will accomplish the goal of voting, making everyone's lives better.
Subscribe to:
Posts (Atom)