Thread: Contest - Traveller's Dilemma

  1. #16
    Registered User
    Join Date
    Jan 2005
    Posts
    7,366
    Cool, thanks. I got working on this and it's really amazing how who wins really depends on the other entries.

    I am going to enter, but I want to wait to submit my entry based on how many other people enter. I've got three different strategies that win at different times based on which other strategies I enter in my test tournament.

    The more people that enter the better, because it is funner and more interesting. And as far as I can tell a complicated solution might not have a better chance than a simple one depending on the other entries.

  2. #17
    Anti-Poster
    Join Date
    Feb 2002
    Posts
    1,401
    Quote Originally Posted by Daved View Post
    Cool, thanks. I got working on this and it's really amazing how who wins really depends on the other entries.
    Heh, it really is. At first it seems like such a simple thing, and yet the more you play with it, the more stuff seems to emerge. Simple programming dealing with challenging concepts.

    Here's the code I'll be using to simulate. Please look it over; I'd rather not skew the contest in any way with a bug on my part.
    If I did your homework for you, then you might pass your class without learning how to write a program like this. Then you might graduate and get your degree without learning how to write a program like this. You might become a professional programmer without knowing how to write a program like this. Someday you might work on a project with me without knowing how to write a program like this. Then I would have to do you serious bodily harm. - Jack Klein

  3. #18
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,612
    I'm in. Good luck to the rest of you!

  4. #19
    Registered User
    Join Date
    Dec 2005
    Location
    Canada
    Posts
    267
    I don't really understand this problem...
    What's the advantage of picking 2?
    How does picking 100 put you in a disadvantageous position? if you did, wouldn't you get a minimum of 98?

    OS: Windows 7, XUbuntu 11.10, Arch Linux
    IDE: CodeBlocks
    Compiler: GCC

  5. #20
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,612
    Quote Originally Posted by h_howee View Post
    I don't really understand this problem...
    What's the advantage of picking 2?
    How does picking 100 put you in a disadvantageous position? if you did, wouldn't you get a minimum of 98?
    The winner gets their pick plus a bonus in points, and the loser gets the other's pick minus the bonus value (as a penalty) in points. Therefore, picking the bottom number ensures points for yourself and your opponent will score low, and picking the top number is only safe while the opponent's guess is significantly large.

  6. #21
    Registered User
    Join Date
    Jan 2005
    Posts
    7,366
    >> How does picking 100 put you in a disadvantageous position? if you did, wouldn't you get a minimum of 98?

    You get a minimum of 2 less than the winning number, which is the smaller of the two numbers, so by picking 100, you will either get 100 (if the other person picked 100) or you'll get two less than the other numbers, whatever that is.

    If you pick 100, it's impossible to get 98.

  7. #22
    Tropical Coder Darryl's Avatar
    Join Date
    Mar 2005
    Location
    Cayman Islands
    Posts
    503
    I will enter, but I have a request also.

    Can also add a void init(int number_of_players) function to the class?

  8. #23
    Anti-Poster
    Join Date
    Feb 2002
    Posts
    1,401
    Quote Originally Posted by Darryl View Post
    Can also add a void init(int number_of_players) function to the class?
    I'm less inclined to change the interface since entries have already been submitted. Which reminds me of something I forgot to specify...please make sure your class implements a parameterless constructor, as that will be the one I call to populate the player vector. I'll add that to the rules also.
    If I did your homework for you, then you might pass your class without learning how to write a program like this. Then you might graduate and get your degree without learning how to write a program like this. You might become a professional programmer without knowing how to write a program like this. Someday you might work on a project with me without knowing how to write a program like this. Then I would have to do you serious bodily harm. - Jack Klein

  9. #24
    Registered User
    Join Date
    Jan 2005
    Posts
    7,366
    While you're adding to the rules you might consider disallowing the use of srand and just promise anybody who wants to use random numbers that srand will be seeded prior to the construction of their class.

  10. #25
    Anti-Poster
    Join Date
    Feb 2002
    Posts
    1,401
    Quote Originally Posted by Daved View Post
    While you're adding to the rules you might consider disallowing the use of srand and just promise anybody who wants to use random numbers that srand will be seeded prior to the construction of their class.
    Ha...that'd be wonderfully devious. Good call. Since I can't edit the post with the rules any more, be sure to check http://fluff.thejefffiles.com/coding/travellersdilemma/ for the most recent version. I'll put a link in my sig also.
    If I did your homework for you, then you might pass your class without learning how to write a program like this. Then you might graduate and get your degree without learning how to write a program like this. You might become a professional programmer without knowing how to write a program like this. Someday you might work on a project with me without knowing how to write a program like this. Then I would have to do you serious bodily harm. - Jack Klein

  11. #26
    Anti-Poster
    Join Date
    Feb 2002
    Posts
    1,401
    In addition to the above changes, I've prohibited the use of file I/O to persist data between simulations.

    When you submit an entry, be sure to specify whether you'd like to have multiple copies of your entry in simulations that allow multiple entries or not. If you submit multiple entries, be sure to designate one as your primary entry.

    [edit] The judging code contained a one-off bug resulting in incorrect round-robin schedules. The updated code can be found on the contest site.

    [edit2] After running some testing with random number of turns per round, I tend to think we might want to use random number of turns per game instead.

    Consider the case with three players: your code, a really challenging piece of code, and a fairly dumb piece of code (fortunately, nothing like that's been submitted yet). If your code plays the challenging code for an extended time, you and the challenging code may be tied. Then suppose that you play the dumb code for a short amount of time, while the challenging code plays the dumb code for a long amount of time. The challenging code would be able to pump more points out of the dumb code than you would.

    Making it random per game eliminates any random bias.
    Last edited by pianorain; 06-18-2007 at 11:03 AM. Reason: Found a bug in the judging code
    If I did your homework for you, then you might pass your class without learning how to write a program like this. Then you might graduate and get your degree without learning how to write a program like this. You might become a professional programmer without knowing how to write a program like this. Someday you might work on a project with me without knowing how to write a program like this. Then I would have to do you serious bodily harm. - Jack Klein

  12. #27
    Anti-Poster
    Join Date
    Feb 2002
    Posts
    1,401
    Less than a week left. Anyone else finished an entry?
    If I did your homework for you, then you might pass your class without learning how to write a program like this. Then you might graduate and get your degree without learning how to write a program like this. You might become a professional programmer without knowing how to write a program like this. Someday you might work on a project with me without knowing how to write a program like this. Then I would have to do you serious bodily harm. - Jack Klein

  13. #28
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,210
    Guess I should get around to submitting the one I wrote awhile ago when this was new.

  14. #29
    Tropical Coder Darryl's Avatar
    Join Date
    Mar 2005
    Location
    Cayman Islands
    Posts
    503
    does the upperbound, lowerbound, and bonus change each turn or each round?

    **edit** nevermind - figured it out...submitting my entry now
    Last edited by Darryl; 06-25-2007 at 10:35 AM.

  15. #30
    Registered User
    Join Date
    Jan 2005
    Posts
    7,366
    I'll submit before the 30th.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Expression Evaluator Contest
    By Stack Overflow in forum Contests Board
    Replies: 20
    Last Post: 03-29-2005, 10:34 AM
  2. Obfuscated Code Contest
    By Stack Overflow in forum Contests Board
    Replies: 51
    Last Post: 01-21-2005, 04:17 PM
  3. WANTED: Contest Master
    By kermi3 in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-23-2003, 10:15 PM