Brilliant Hunger Games Programming Competition

Main post link -> https://brilliant.org/competitions/hunger-games/

Hi all,

You may have received an email announcing our upcoming game theory themed programming competition. If you have any questions, feel free to direct them into this thread. You may have noticed that we now have a competitions page in the header. You can now look here for information about any special events and competitions we host that deviate from our weekly problem sets. As future competitions happen they will be announced in discussions, via email, and appear on that page.

We hope our Hunger Games serve as a fun way to explore the principles of Game Theory and give you all a break from the pursuit of the single integer answer.

Have fun!

Edit (7/22): Good questions from this thread have been collected and answered in the FAQ for easier reading.

#ComputerScience #BrilliantCompetitions #Math

Note by Peter Taylor
7 years, 11 months ago

24 votes

  Easy Math Editor

This discussion board is a place to discuss our Daily Challenges and the math and science related to those challenges. Explanations are more than just a solution — they should explain the steps and thinking strategies that you used to obtain the solution. Comments should further the discussion of math and science.

When posting on Brilliant:

  • Use the emojis to react to an explanation, whether you're congratulating a job well done , or just really confused .
  • Ask specific questions about the challenge or the steps in somebody's explanation. Well-posed questions can add a lot to the discussion, but posting "I don't understand!" doesn't help anyone.
  • Try to contribute something new to the discussion, whether it is an extension, generalization or other idea related to the challenge.
  • Stay on topic — we're all here to learn more about math and science, not to hear about your favorite get-rich-quick scheme or current world events.

MarkdownAppears as
*italics* or _italics_ italics
**bold** or __bold__ bold

- bulleted
- list

  • bulleted
  • list

1. numbered
2. list

  1. numbered
  2. list
Note: you must add a full line of space before and after lists for them to show up correctly
paragraph 1

paragraph 2

paragraph 1

paragraph 2

[example link](https://brilliant.org)example link
> This is a quote
This is a quote
    # I indented these lines
    # 4 spaces, and now they show
    # up as a code block.

    print "hello world"
# I indented these lines
# 4 spaces, and now they show
# up as a code block.

print "hello world"
MathAppears as
Remember to wrap math in \( ... \) or \[ ... \] to ensure proper formatting.
2 \times 3 2×3 2 \times 3
2^{34} 234 2^{34}
a_{i-1} ai1 a_{i-1}
\frac{2}{3} 23 \frac{2}{3}
\sqrt{2} 2 \sqrt{2}
\sum_{i=1}^3 i=13 \sum_{i=1}^3
\sin \theta sinθ \sin \theta
\boxed{123} 123 \boxed{123}

Comments

I'm working on a sample test engine here: https://github.com/ChadAMiller/hungergames

One corner of the rules I'm not certain about: is it possible to go to negative food? That is, if I have 6 food left in a 3 player game can I still hunt twice (but still die if the other players don't hunt)?

Chad Miller - 7 years, 11 months ago

I think I may have found a bug:

self.attempts += self.P-1
reputation_list = tuple(p[2]/self.attempts for p in self.players)

The rules say that: Each player has a reputation RR, which is defined as R=HH+SR=\frac{H}{H+S}, where HH is the number of times you chose to hunt and SS is the number of times you chose to slack (not hunt).

Although players start with 0 reputation, I think that's only for the first round. Afterwards, the reputation is not R=HH+S+(P1)R=\frac{H}{H+S+(P-1)}, but R=HH+SR=\frac{H}{H+S}.

Enric Boix - 7 years, 11 months ago

Are you saying it's right iff I switch those two lines? Because I think you might be right. Just waking up, but I'll look at it later.

Chad Miller - 7 years, 11 months ago

@Chad Miller Well, switch those two lines and guard against a ZeroDivisionError that is

Chad Miller - 7 years, 11 months ago

@Chad Miller I replaced those lines with:

if self.round == 1:
    reputation_list = tuple(0 for p in self.players)
    strategies = [p[0].hunt_choices(self.round, p[1], 0, m, reputation_list) for p in self.players]
else:
    reputation_list = tuple(p[2]/self.attempts for p in self.players)
    strategies = [p[0].hunt_choices(self.round, p[1], p[2]/self.attempts, m, reputation_list) for p in self.players]

self.attempts += self.P-1

Enric Boix - 7 years, 11 months ago

@Enric Boix Yes, that looks correct. I've also merged someone else's fix on the github repository, so the repo is now correct (I'm going to be aggressive about posting issues over there)

Chad Miller - 7 years, 11 months ago

Chad, thank you so much for your testing environment and the ready-to-submit Player class. Made it very comfortable to participate.

Donald Duck - 7 years, 10 months ago

Hey Chad, I forked your repo, and my partner Tim and I have re-factored some stuff. It makes the code more modular, and re-writes Game.py. It's probably less efficient, but I think it's more readable.

https://github.com/jknielse/hungergames-1

Jake Nielsen - 7 years, 10 months ago

I took a closer look. I don't think I'll be merging it, though I definitely like some individual ideas (in particular, I think the GamePlayer class is better than the current global variable/tuple-based solution). While I'm not obsessing over performance, my gut feeling is that storing the entire game history as a list for the duration of the game is too loose.

On a couple specifics that I think would be strict improvements: defining your own add for reduce is generally slower than from operator import add which is generally slower than sum. Rather than defining a Print method, you can overload __str__ or __repr__ so that your classes work sensibly with the builtin print.

Chad Miller - 7 years, 10 months ago

@Chad Miller Great feedback. Thanks Chad. As you can tell, I'm not much of a python person :b

Jake Nielsen - 7 years, 10 months ago

Awesome, I'll have a closer look tomorrow.

Chad Miller - 7 years, 10 months ago

If you modify the script to give a comma-separated output, it will be easier to read the results in a table and plot/analyze them.

Giovanni Dall'Olio - 7 years, 10 months ago

You noted that your class fails the test script. Wouldn't that imply that it will also fail in the actual competition, or am I missing something?

By the way, you can have negative food during the round. See this comment.

Tim Vermeulen - 7 years, 11 months ago

It fails the test script because the test script assumes that the actual entry is named "Player". A submitted solution could fix that problem with two lines of code.

Chad Miller - 7 years, 11 months ago

@Chad Miller Alright, thanks a lot for creating this, it looks really great.

Tim Vermeulen - 7 years, 11 months ago

Oh, and thanks for the link, I missed that the first time. The implementation should be correct otherwise, barring bugs.

Chad Miller - 7 years, 11 months ago

@Chad Miller I did edit my reaction once, adding the link, so that might explain. ;-)

Tim Vermeulen - 7 years, 11 months ago

"If after any round you have zero food, you will die and no longer be allowed to compete." I guess according to the rules, you're fine just as long as you have more than zero food by the time the round ends. Unless there's some sort of thing in the hunting function that doesn't let you hunt if you have zero or less food. I doubt it though, I think they'd be explicit about that sort of thing.

Brock Brown - 7 years, 10 months ago

Right, they've confirmed in the FAQ that negative food during a round is fine, including initiating hunts with negative food.

Chad Miller - 7 years, 10 months ago

Whenever my algo returns huntdecisions in which the number of elements are greater than the input-ed number of playerreputations your engine seems to make it unbeatable.

Thaddeus Abiy - 7 years, 10 months ago

Huh? What is it doing in that case?

Chad Miller - 7 years, 10 months ago

@Chad Miller It's just that I am given no warning whenever my Player accidental gives out a huntdecisions list with more decisions than it should have. Weirdly,it sometimes affects the success of the algorithm.Once the player won every run I did but when I corrected the size of the huntdecisions list it reverted to its usual sucky performance/

Thaddeus Abiy - 7 years, 10 months ago

@Thaddeus Abiy Oh, yeah, zip discards excess length of the longer list so that's probably why. I don't want to mess with the repo until github fixes whatever bug makes pages take 10 minutes to load for me, but I was thinking of throwing in an assert so that the program blows up by default if the player returns invalid hunt_decisions. That's technically different from how the server will behave but I assume most people would like to catch that in testing.

Chad Miller - 7 years, 10 months ago

@Chad Miller the assert is a good idea,this bug can be misleading..but only five days left anyway so I guess it doesn't matter much.

Thaddeus Abiy - 7 years, 10 months ago

  1. What does it mean tournament fashion more precisely? How many players per tournament? Who advances to the next stage? (winner, survivors, top K remaining players)? How many stages before the final?

  2. Can you submit more than one solution? (For e.g. I would like to submit one that will play to win and one that will play to survive)

  3. Is it allowed or disallowed to collude with other algorithms (potentially your other submissions, submissions of your friends, etc.) based on agreements outside the game? (e.g. make 1 out of 100 a 'winner' and have the other 99 just help this chosen winner)

  4. Are we allowed to try to deduce from the information presented who the other players (randomly permuted) are?

  5. Are we allowed to break your PRNG (e.g. assume you use a standard a*X+b modulo p) to figure out all future randomness in the game?

  6. Are we allowed to communicate (i.e. broadcast) to all other players before the submissions are made (e.g. make threats/offers or ensure that certain information is common knowledge)?

Thanks!

Salutations to all!

Mircea Digulescu - 7 years, 10 months ago

Reposting for visibility: how much time will our program get before your server decides that it is stuck in a loop and kills it? Along the same vein, what is the ram usage cap?

Jake Nielsen - 7 years, 11 months ago

"After a large number of rounds, there will be a small chance each additional round that the game ends"

Any clarification on this point? I read this as after some fixed number of rounds N, for each round number > N there is some fixed probability P that the round will be the last.

Does P increase as the rounds go on? Any hint as to how N and P will be determined?

Jim Peerless - 7 years, 10 months ago

Yeah I have no clue how this is supposed to work either I think you're right. Wait I'll go check the FAQ.

Tanishq Aggarwal - 7 years, 10 months ago

I think that the staff does not want us to know how this works exactly, because we could then calculate the probability of the game ending each round, which we can use in our algorithms. I think we are supposed to not know at which round the game ends.

Tim Vermeulen - 7 years, 10 months ago

@Tim Vermeulen There is no specification on what N and P are. Thanks to the exponential distribution in statistics it's possible to calculate an ending round right off the bat (so one RNG roll), with the distribution behaving exactly the same as if you manually rolled with some probability P each round. I actually do this in my implementation.

Chad Miller - 7 years, 10 months ago

@Chad Miller You might mean a geometric distribution. http://en.wikipedia.org/wiki/Geometric_distribution

Patrick Steele - 7 years, 10 months ago

@Patrick Steele Correct, but I couldn't find a random.geomvariate(). I could have rolled my own, but I doubt the difference between that and my "round the exponential" is significant.

Chad Miller - 7 years, 10 months ago

Can we use another programming language other than Python ?

Vincentius Indramawan - 7 years, 11 months ago

We are currently evaluating the feasibility of allowing java as well. We'll be able to firmly answer this question shortly. Other languages are not planned at the moment.

David Mattingly Staff - 7 years, 11 months ago

Please tell us soon!

Rahul Nahata - 7 years, 11 months ago

@Rahul Nahata The competition will be Python only. This is done to put everyone on an even platform as Python is simple to learn and it's a design competition, not a language competition.

David Mattingly Staff - 7 years, 11 months ago

@David Mattingly How does allowing languages other than Python turn it into a "language competition". It seems to me that strategy decides the victor, not the language that strategy was implemented in.

Jeffrey Lund - 7 years, 10 months ago

@Jeffrey Lund It is and was incredibly easy to learn - I only found out about this competition 2 days ago, nor had I even seen python before then, and the large majority of my time was spent making and refining my algorithm, not learning and implementing python.

Jeremy Schmid - 7 years, 10 months ago

It's incredibly easy to learn too, so considering you're in Data Structures 4, you should have no problem completely understanding the constructs of Python.

Tanishq Aggarwal - 7 years, 11 months ago

Do you have a 'simulator' that would allow us to test our hungry programs?

Brigham Stevens - 7 years, 11 months ago

Right now we have a test script that you can use to verify your code is functional.

David Mattingly Staff - 7 years, 11 months ago

I created one and it's hosted on Github at https://github.com/CaptSullivan/HungerGames

Brady Sullivan - 7 years, 10 months ago

I think there's something that needs more clarification.

"Each round, your tribe can save some time and hunt extra food if enough people opt to hunt. Each round, a random integer m, with 0<m<P(P−1) will be chosen. If the total number of hunters is greater than or equal to m for the upcoming round, then everyone in the tribe gets 2(P−1) extra units of food after the round, which means that on average everyone gets 2 units of food per hunt. Before each round, you will find out the value of m" I think the bold portion should be sum of hunts of all player, right?

And in the sample code, "number_cooperators: integer, how many players chose to cooperate over the last round." What is cooperation? It is not defined. Moreover, what does it means that a player cooperated? Is is something like he did at least one hunt?

Thanks in advance :)

Another question about the word "average": Why would that be an average of 2? If the threshold is reached, then everyone gets exactly 2 per hunt, otherwise everyone gets exactly 0. Also there is no possibility to gain more than 2 extra food, so the actual average over the whole game is some number between 0 and 2. Am I missing something?

Sebastian Werhausen - 7 years, 11 months ago

Correct. The bold portion means "sum of the number of times players chose to hunt in that round". We'll adjust the language to make it clearer.

As for number_cooperators: cooperator means you hunted. So this number is precisely the sum of the number of times players chose to hunt in the round. We'll modify the language here as well to streamline terminology.

David Mattingly Staff - 7 years, 11 months ago

rather than numbercooperators, would numberhunts not be better?

William Cole - 7 years, 11 months ago

@William Cole We changed the terminology to be more streamlined.

David Mattingly Staff - 7 years, 11 months ago

Hey, Peter.

First off, I really love this new Competitions feature. Some of the most recent updates to Brilliant show that you guys are dedicated to making this website better and better and that's great :)

I read through the rules for Hunger Games and just had one question: I have been a member of Brilliant for a few months now and I have two friends with whom I'd like to make a team. Unfortunately, they do not have accounts on Brilliant. Am I still allowed to form a team with them and submit my team's code through my account, or do they have to also make accounts (or are they maybe not even allowed to play)?

Sotiri Komissopoulos - 7 years, 11 months ago

Your friends can definitely team up and play with you! Anyone with a Brilliant account can participate, and anyone who can beg, borrow, or steal time on a computer can create a Brilliant account. Please have them create accounts on Brilliant. They can do so directly on the Hunger Games page: https://brilliant.org/competitions/hunger-games/

If you are logged out or do not have an account when you see that page, hitting the "start playing" button prompts you to a sign up page. Just send your friends the link.

We want teammates to all have accounts on Brilliant, as it provides a layer of verification that the people who submit code, or supposedly submit code, are in fact who they say they are and not impostors, bots, cylons etc... With money prizes on the line this is important. It also provides us a way of informing all members of a team of the status of their algorithm in the competition, as opposed to just you.

Have fun and may fortune smile upon your strategy :)

Peter Taylor Staff - 7 years, 11 months ago

Thanks for the information :) I'll relay it to my prospective teammates.

Sotiri Komissopoulos - 7 years, 11 months ago

Clarification:

Is my food counted only at the end of the round? What will happen if I have negative food during the round, but manage to make my food positive at the end of the round?

Nguyen Tuan - 7 years, 11 months ago

Food is only counted at the end of the round.

David Mattingly Staff - 7 years, 11 months ago

By "end of the round", do you mean before or after the evaluation of whether total round hunts ('h's) > m?

Jonathan Tseng - 7 years, 11 months ago

@Jonathan Tseng after. if the bonus puts you into positive food, you'll survive to play the next round.

David Mattingly Staff - 7 years, 10 months ago

Just for clarification: What are the specifications of the target computer (Python version, processing power, etc.)?

Tanishq Aggarwal - 7 years, 11 months ago

Python version would be nice to have indeed. I assume it's 3.x since test code uses print as a functions (can be done in 2.x too, but is necessary for 3.x).

Anssi "Miffyli" Kanervisto - 7 years, 11 months ago

we officially support 2.7 actually

David Mattingly Staff - 7 years, 11 months ago

@David Mattingly Are there any options or modules disabled/enabled that we should know about? (Sorry about the terminology if it's wrong; I don't spend too much time coding in Python)

Tanishq Aggarwal - 7 years, 11 months ago

@Tanishq Aggarwal The standard library and SciPy and PyPy are available. I'm pretty sure that it's.

Brady Sullivan - 7 years, 10 months ago

Python version is 2.7, processing power is "enough", i.e. worrying about our specifications should not be a concern

David Mattingly Staff - 7 years, 11 months ago

Brilliant is awesome!!!

Jordi Bosch - 7 years, 11 months ago

Request: Can we receive the actual tester code so that we can test our algorithms against others on our own local development machines?

Tanishq Aggarwal - 7 years, 11 months ago

I'll probably be writing one before too long. I can post it on github and put a link here if you'd like.

Jake Nielsen - 7 years, 11 months ago

You might also want to look at mine: https://github.com/ChadAMiller/hungergames

Chad Miller - 7 years, 11 months ago

@Chad Miller Score! I'll have a look at this when I get home today.

Jake Nielsen - 7 years, 11 months ago

I wrote one last night. It's fairly simple and straight forward. Should also be easy to read if you want to tinker with it. https://github.com/CaptSullivan/HungerGames

Brady Sullivan - 7 years, 10 months ago

Since my git repo is picking up steam, I'd like to clarify a couple things to make sure we aren't leading each other astray:

-If we use an OOP solution, is it expected that our player class be called Player? Is it ok if that class inherits from another class in the same file? Are there any limitations on imports (from the standard library)?

-Will all players be in the same tribe? Or do we stay in one tribe for some rounds, then the survivors get merged with another tribe later? Or is it possible that some players will never be in the same tribe with other players?

Chad Miller - 7 years, 10 months ago

good points. Also:

  • My biggest gripe is the public goods part of the rules. First of all, you only have a very small influence on this until late game. And second, since it benefits everyone equally, there is almost never a reason to change your hunting choice to participate.

I suggest a change: Give the extra 2 per hunt only to the actual hunters. This would make it in 50% (in case m follows a linear distribution) of cases worth the "investment", which means maximum unpredictability for dumb programs. This also opens up a whole new layer of depth: you would have to estimate the propability of number of hunts reaching the threshold. Also this would improve the next issue:

  • The food costs/bonuses are very skewed towards stackers. I get that a better player would win vs pure stacker, but only marginally so, which flattens the skill curve. Because of this, chance will play an unnecessary big part of the deciding factor.

I would suggest a slight change of numbers. maybe make cooperating more beneficial, and/or consider the change to the public goods rule as stated above

  • I, again, strongly argument for imposing runtime and memory limitations.

Sebastian Werhausen - 7 years, 10 months ago

  • My biggest gripe is the public goods part of the rules. First of all, you only have a very small influence on this until late game. And second, since it benefits everyone equally, there is almost never a reason to change your hunting choice to participate.
Why yes, that's true!

(Assuming of course everyone is playing to win the game cause they want that $1000. Oh, and assuming that we are silly enough to not necessarily reward someone who had a great strategy to ensure survival with one of those other $1000 prizes...winning guarantees you a $1000 prize, playing to win does not necessarily increase your chances of one of the other prizes.)

Decisions, decisions!

David Mattingly Staff - 7 years, 10 months ago

@David Mattingly $1000 is hell of a motivator tho ;)

By the way, the other 4 grand prizes. Do you give them to four most interesting/smart/innovative algorithms on avarage or do you have one for "Best game theory analyzing" and/or "Best choices on avarage" etc?

Anssi "Miffyli" Kanervisto - 7 years, 10 months ago

@Anssi "Miffyli" Kanervisto It's a mix of the performance of their algorithm, logic, game theory analysis, and presentation. We don't have pigeonholed categories.

David Mattingly Staff - 7 years, 10 months ago

@David Mattingly I'm all for elegant code, ideas, algorithm and stuff. But this sounds like an appeal to write an inefficient program (trying to unreasonably boost the public goods option). Is that wanted? If so, maybe that should be clarified.

I understood the prize section as a decision help if many of the last programs are equally good and are more or less seperated by chance

Sebastian Werhausen - 7 years, 10 months ago

@Sebastian Werhausen No, it's not an appeal. People can write whatever they want and we're not going to reward "inefficiency", where we've defined efficiency as how well you meet your stated goals.

As an example, assume the stated goal is to win (which will be the default). Then someone may design a strategy that assumes certain things about how the population plays (call it population A) and constructs a winning strategy. However, that strategy may be a losing strategy if the population plays differently (population B). Therefore that strategy is not completely robust and so not completely "efficient" in that it doesn't always reach the stated goal. It is however, eligible for the win prize.

Alternatively, someone could say that their stated goal is to win the t-shirt. They may construct a beautiful strategy with analysis that will never win against A or B, but will at least survive vs. both. This strategy is efficient in that it always reaches its goal. That goal won't make it eligible for the win prize, but it still may be worthy of one of the other awards. We don't want to pre-judge this aspect. How well you do in the game is certainly part of the other awards, but not all of it. So while there is an aspect of "judging help" between equally good algorithms separated by chance, that is not the only thing the extra awards can be for.

In terms of game play, all I will do is caution you against the assumption that everyone is playing to win the game. Some may be just playing to survive, and this may make them view the public good option differently, as they don't really care how you do, only how they do.

David Mattingly Staff - 7 years, 10 months ago

@David Mattingly Fair enough, that cleared it up. thanks

Sebastian Werhausen - 7 years, 10 months ago

To be clear, P is recalculated per round, correct? I.e., if the round starts with 300 players and one player dies, P=299 in the subsequent round?

On winning, the rules state, "The winning algorithm is guaranteed to receive the Grand Prize." What if P players all die, resulting in the end of the game? Who is declared the winner? The one with the "least" negative score? What if there are ties?

Geoff Little - 7 years, 10 months ago

This needs to be clarified on the rule page. I am confused as well. I would assume so.

Brady Sullivan - 7 years, 10 months ago

From a previous response from Staff, YES, it is the living players at the start of the round.

Brady Sullivan - 7 years, 10 months ago

From the FAQ.

If the last N players all die in the same round or N players have the same food at the end of the game, then reputation will be used as the tiebreaker, with the highest reputation winning. If there is still a tie, then the winning prize will be split.

So if N players die at the end and they are all left with -1 food, then reputation will be used to break the tie. Those with the same reputation will split the grand prize.

David Mattingly Staff - 7 years, 10 months ago

I have made a pdf to explain my strategy as stated in "The algorithm (and separate document, if any) should be submitted", but in the submission form, I can only post 1 files... Where should I put this separated document ?

Jonathan Nifenecker - 7 years, 10 months ago

What about a .zip or .rar file?

Arturo Vial Arqueros - 7 years, 10 months ago

zip or rars will probably not be allowed, but we've modified the form to allow a second upload which should be a pdf, txt or md (markdown) file. If you have already uploaded a non-python file, please reupload following the new conventions (One python file and one pdf txt or md file) or your submission will probably not be entered into the competition.

Sam Solomon Staff - 7 years, 10 months ago

When is code going to be run?

Leonardo Daher - 7 years, 10 months ago

Let the games begin!Let\ the\ games\ begin!..Two hours to go,but it's almost midnight here.Im hitting the sack.

Thaddeus Abiy - 7 years, 10 months ago

And may the odds be ever in your favor. Just had to say it :D

Anssi "Miffyli" Kanervisto - 7 years, 10 months ago

Hello, some questions about the rules.

1) 0<m<P(P−1) This means that 'm' can be higher than 'P' ?

2) "then everyone in the tribe gets 2(P−1) extra units of food after the round, which means that on average everyone gets 2 units of food per hunt"

Everyone in the tribe or the tribe receive the bonus? If is everyone so the average is higher than 2 units.

Thank you.

Patric Dexheimer - 7 years, 11 months ago

  1. Yes, mm can be higher than PP, but the bonus applies when the total number of hunts is at least mm, not the total number of hunters. The maximal total number of hunts is P(P1)P(P-1), as everyone (P)(P) gets P1P-1 chances to hunt.

  2. If everyone gets 2(P1)2(P-1) units, then that is 22 units per (potential) hunt, as everyone has P1P-1 chances to hunt.

Tim Vermeulen - 7 years, 11 months ago

So that would imply if I and you were players in the tribe, then in each round, there will be two hunts which includes us. For if it was not like that, then there should have been (P2)\binom{P}{2} hunts.

Sri Kanth - 7 years, 11 months ago

@Sri Kanth In order for the bonus to apply, the total number of hunts needs to be at least mm. That number of hunts is first counted for each individual, and then added together. So, there is just one hunt which includes us. If at that moment, we both choose to hunt, it's counted once for me and once for you, so twice in total. If only one of us chooses to hunt, then the total number of hunts (which will be compared to mm) is only incremented by one.

Tim Vermeulen - 7 years, 11 months ago

@Tim Vermeulen The confusing part is that even though we are part of one common hunt (the group activity), the scheme considers it as two 'hunts' (the individual activity). Anyway thank you for the clarification.

Sri Kanth - 7 years, 11 months ago

But it says that everyone gets the bonus. And this 2(P−1) will always result in 1.9... per player. So why just said 2 per player? I´m missing something? (Or is everyone that hunt this turn?)

Patric Dexheimer - 7 years, 11 months ago

@Patric Dexheimer Everyone can hunt P1P-1 times. So if you get 2(P1)2(P-1) food, that's 22 food per (potential) hunt.

Tim Vermeulen - 7 years, 11 months ago

It should also be noted that you get the bonus food regardless of whether or not you hunted.

William Cole - 7 years, 11 months ago

This. Is. AWESOME!

Steven Wang - 7 years, 11 months ago

I love this competition.

Lokesh Sharma - 7 years, 11 months ago

Is there a check on ip's of the player who partecipates to the game? To prevent the creation of many account and that the same player submits more codes...this'll be unfair of course ;)

Luca Bernardelli - 7 years, 11 months ago

A couple of questions:

  • Is computational time or memory limited?
  • in huntoutcomes(foodearnings): is foodearnings a list in the same order as the order of reputations the hunt decision is based on? i.e. playerreputations in hunt_choices()? So you get the outcome of every of your hunt decisions explicitly?
  • Am I right under the assumption that there is no pre-round, or simulation, or any kind of other way of testing your program before the the competitions actually begins?
  • Also: randomizing the reputation list means there is no explicit way of tracking a history of hunt choices or outcomes vs a specific player, right?

Sebastian Werhausen - 7 years, 11 months ago

I'm bumping this. It's really, really, really important to know what the limits are regarding computation time and memory limits. They will have limits to these to keep people from sending them things like:

while true: pass

or

i = 0 while true: k[i] = "stuff" i++

Jake Nielsen - 7 years, 11 months ago

Do not worry about time limitations or ram usage at the moment. We will try to be very lenient and not implement any hard caps. Algorithms that appear to be taking a long time or using tremendous amounts of ram will be inspected by staff before a decision is made to kill it, and a great algorithm that simply takes a long time/uses lots of memory will not be killed. This is, after all, an analysis competition, not a programming competition for algorithm speed or efficiency.

That said, if we found an algorithm like yours above, it would be removed, with prejudice.

David Mattingly Staff - 7 years, 10 months ago

  • I have no idea to be honest. However I can't imagine there would be any exessive calculating in algorithms' logic if done in a smart manner(?)
  • huntoutcomes list is in same order as the given rep list in huntchoices (See "Sample Code")
  • No idea. However one could assume there will be not since there hasn't been any info about that. However things may change. You could always write your own Hunger Games code and run your algorithm on that, if that's allowed.
  • Yes. I'd say it's impossible to track people in this game in any reliable way. Best you can do is to compare reps of last round, hunters of last round and new reps together and even then there's high possibility your code chooses wrong rep <-> player.

Anssi "Miffyli" Kanervisto - 7 years, 11 months ago

You can test your program for common mistakes using a script, see the Sample Code section.

Tim Vermeulen - 7 years, 11 months ago

Is reputation rounded, or is it just casted as a type double?

Grant Braam - 7 years, 10 months ago

When must submissions be made by. Midnight on Saturday 17th or midnight on Sunday 18th? And what time zone (I'm based in Hong Kong)?

Like all good students I like leave things to the last minute...

Charlie Morris - 7 years, 10 months ago

I just put up a timer, basically, the form will be disabled when the next set of problems is released on midnight sunday (UTC).

Sam Solomon Staff - 7 years, 10 months ago

Hi Guys, I have a clear idea how my logic should be and it is a very simple one. That should not be too difficult to program, but given the looming deadline, I finally lost my last hope that I would teach myself enough Pyton to code it myself alone, without help...

Basically my inspiration is sourced from the inventor of this "iterative prisoners dilemma tournament" concept = Robert Axelrod and its first winner = Anatol Rapoport.

Tit for Tat (TfT) was the simplest of the algorithms in in the first incarnation of such tournaments 30 odd years ago - and surprisingly the most successful one... round after round despite evolving competition!

I have a hunch that it should still fare well, simple and elegant.

Can anyone help me to convert this verbal logic into Pyton code.. or... Also happy to team up with any volunteers to for a virtual team ;)

OPTION 1 (preferred) * If you are meeting with your partner for the very first time = Hunt * If you meet the same partner again in the future: remember what was his behavior to you last time and play it back (H for H , S for S)

As you can see the algorithm is not using the partners (formal, general) reputation score but using the reputation from your point of view only.. You may say that you are not penalizing your partners for the "sins" that they have committed elsewhere (or for previous old defects to you. You don't hold grudge) This algorithm just replicates Anatol Rapoport's original TfT in the "Hunger Games" universe... Curious how this logic will fare...

OPTION 2 If option 1 is too difficult to realize, I can settle with this one as well.. Should be much simpler and I guess should be a 1 line of code: * Take your partners reputation score (e.g. 0.9) * Use this as an input to randomly decide to hunt (90 % probability) or slack (10 % probability)

More clever things can be done.. but I will stick to the simplicity and the ancient wisdom..

http://en.wikipedia.org/wiki/TheEvolutionof_Cooperation <quote> In summary, success in an evolutionary "game" correlated with the following characteristics: Be nice: cooperate, never be the first to defect. Be provocable: return defection for defection, cooperation for cooperation. Don't be envious:: be fair with your partner. Don't be too clever: or, don't try to be tricky. </quote>

Hope I am not breaking any rules by revealing a source from wikipedia (or my my logic for that mater) in the discussion board. If I am, accept my apologies. I am just following the TfT logic by heart. (be nice and cooperate!) and this includes cooperating with the ideas as well. Also let me declare, in the (unlikely) case that my entry is successful, I will donate the prize to my alma mater, in the true spirit of brilliant.org: promoting education and science... http://en.wikipedia.org/wiki/AnkaraScienceHigh_School

Thank you for the gentle soul who can help me with the Pyton coding in advance..

All the best, good luck in the competition!

Hakan

H. Yasli - 7 years, 10 months ago

The players are shuffled every round, so your OPTION 1 as described requires information you don't have.

OPTION 2 is already implemented in my GitHub project as FairHunter if you want to see what the source code looks like (it's in bots.py, inheriting from a base class in Player.py). And you're right, it's a 1-line comprehension not counting imports.

Chad Miller - 7 years, 10 months ago

Very, VERY nice comment/post. The best alongside Chad's hunger games simulator post. I am sure this is what Brilliant staff was after when one of them said they even encourage to discuss about the best tactic. Like Chad side, first option requires one to connect players from last round with current round. It's not impossible especially after many rounds (50 or so, depends on how many players), but it can still be unreliable. Altho I am sure somebody implemented this kind of tactic already considering there is like 120 algorithms already participated (!!!), From what I have learned during force-test simulations (10 games of 50 players in ~7sec), from all simpler bots like one you described it performs a lot better. Could be just the fact I am using clones of same algorithms in one game and there's lack of proper algorithms, but it still wins other algorithms by a long shot.

Anssi "Miffyli" Kanervisto - 7 years, 10 months ago

I think a good distribution of players is 2 of a "smart" algorithm (hopefully your player), 4 of the Bounded Hunter, 4 of the Fair Hunter, 4 of the Alternator, 15 Pushovers, 70 Maximum Rep Hunters, 100 Average Hunters, and 75 Freeloaders. That's my own intuition; use this information at your own discretion.

Tanishq Aggarwal - 7 years, 10 months ago

@Tanishq Aggarwal This configuration takes ~30 seconds (verbosity=false) on my single-core 1.6 GHz machine with 2GB RAM (although RAM doesn't matter a whole lot.)

Tanishq Aggarwal - 7 years, 10 months ago

What do you suppose the turn-around time will be once all of the submissions are in?

Jake Nielsen - 7 years, 10 months ago

There will be "what happens next" post/email tomorrow with all this information.

David Mattingly Staff - 7 years, 10 months ago

According to my analysis, your earnings in a single round does not depend on who you hunt with, only how many times you hunt. Given a population PP, a number of hunt choices HH, and a number of opponent hunt choices GG, the net earnings ΔS\Delta S for a round is ΔS=3GH2P\Delta S = 3G - H - 2P, no matter how the HH hunts (and PHP-H slacks) are aligned with the GG opponent hunts (and PGP-G opponent slacks). Can anyone else confirm this?

It's interesting because it means deciding how often to hunt and who to hunt with are two distinct problems, at least before tracking becomes a possibility. The algorithm should a) find an optimal value for RR (in general) and HH (this round), and b) distribute "sick" choices to players who might be winning. If RR has been selected correctly, then the winning players are the ones with reputations close to RR, so those are the ones not to hunt with.

Suppose that the population as a whole is roughly centered around the optimal reputation. A particular player who maintains this median reputation may perform very well absolutely, and if, in addition, this player targets opponents at the median reputation, it may be able to outperform other players, as well.

Jeffrey Milloy - 7 years, 10 months ago

Looks right. Basically what these equations are saying is this: Your opponent's hunting with you is worth +3 to you, and their slacking with you is worth 0 to you. Your hunting with them is worth -1 to you, and your slacking with them is worth 0 to you. There's a -2 base payout (or 0 if a hunt bonus is awarded).

So, unless you can track individuals, what you're really looking at is trading your own hunts to the tribe in return for hunts from the tribe. It's worth trading three of your own hunts to get one hunt from the tribe. And, unless individuals can track you (and most probably can't), it doesn't matter who you give food to.

(Being able to track individuals' food would be interesting. Then, you'd want to copy the #1 guy's reputation, while at the same time starving as many top guys as possible so you could decrease their ranking relative to yourself. I wonder what kind of population dynamic this would lead to? Everyone with the same score? A constant churning of the leaderboard?)

Christopher Johnson - 7 years, 9 months ago

You can know who has the most food, but you can suspect.

Jeffrey Milloy - 7 years, 9 months ago

I ran some simulations using a bot that followed approximately this algorithm and it did surprisingly well. Your analysis here takes some of the surprise out of the result.

Another odd thing I found is that there were really two end-game equilibria: one where everyone starves, and one where everyone has more food than they know what to do with. The break-even point seems to be around a 50:50 hunt:slack ratio, where if the average among everyone is below that, everyone will eventually starve, and above, there is ridiculous amounts of food for everyone. Different bots flourish in each environment, so it will be interesting to see whether the starting conditions are primarily cooperative or hostile.

Jake Conway - 7 years, 9 months ago

You mean your reputation does not depend who you hunt with, just how many times you hunted? Your earnings of course depend on who you hunt with. If you chose to hunt 3 times in a round and your opponents slacked you are -9, if all of them hunted you are at 0 (did not gain anything, but did not loose anything either). But you are right that decisions how many times to hunt in a round and who to hunt with are two different decisions. Whether or not you get a bonus depends on how many times you hunted and of course how many times others hunted, not who you hunted with; whether you loose -3 per hunt or not depends on who you choose to hunt with.

Irina Guilman - 7 years, 9 months ago

If people chose how many times to hunt in a round regardless of the value of m, then the sum of hunts in a round for all players can approximated by a normal distribution. But for each player probability of hunting likely depends on m, it's not just the reputation.

Irina Guilman - 7 years, 9 months ago

@Irina Guilman

  1. Why do you say that the sum can be approximated by a normal distribution? I honestly don't know how I would have a hypothesis about that.

  2. I agree that many players probability of hunting will depend on mm. I'm still not convinced that any player who wants to win, i.e. outperform other players, would hunt more or less depending on mm. If anyone can shed some light on this, I would greatly appreciate it.

Jeffrey Milloy - 7 years, 9 months ago

@Jeffrey Milloy If the goal is first place, your dependence on m is precisely the degree to which you believe other players' strategies will depend on m.

Chad Miller - 7 years, 9 months ago

@Chad Miller This you can approximate, after each round you are told how many players chose to hunt depending on m. (So you can approximate the distribution)

Irina Guilman - 7 years, 9 months ago

@Chad Miller That's appealing, but I'm just not sure. At the end of the day (i.e. nn rounds), my (non-bonus) earnings is entirely determined by

S=3i=1nGii=1nHi2i=1nPiS=3\sum\nolimits_{i=1}^n G_i - \sum\nolimits_{i=1}^n H_i - 2 \sum\nolimits_{i=1}^n P_i.

If I end up with a reputation of R=i=1nHi/i=1nPiR=\sum\nolimits_{i=1}^n H_i / \sum\nolimits_{i=1}^n P_i, it doesn't matter if each choice of HiH_i was positively correlated with the mim_i, inversely correlated with mim_i, normally distributed (about RPiRP_i), or all the same (RPiRP_i).

Certainly mm obscures your ability to tell how GG depends on RR, and you might want to factor it out when choosing a target value for RR. But that wouldn't adjust any particular HiH_i based on mim_i in a given round.

The average effect of mm on GG will move the target RR up or down, but I again, I wouldn't adjust any particular HiH_i; I would only care about the specific effect of mim_i on GiG_i in order to learn to subtract it out.

Jeffrey Milloy - 7 years, 9 months ago

@Jeffrey Milloy The best strategy is probably a combination of the two: 1) Go for the bonus. When expected total number of hunts is near m, you probably need to hunt k number of times. (The distribution you can approximate from observations - you are told the number of hunts depending on m and when the bonus was hit - as well as theoretically by approximating as conditional normal distribution or as Poisson) 2) Adjust your reputation to maximize the number of times players hunt with you. For other players decision whether or not to hunt with you depends either on your reputation/relative ranking or once, they choose how many times they will hunt depending on m, again actual hunting partners choice depends on your reputation/relative ranking. This you can approximate experimentally, after each hunt you are given the number of hunts and how many chose to hunt with you. The ration depends on your reputation/or relative ranking.

Irina Guilman - 7 years, 9 months ago

@Jeffrey Milloy If each player had a constant (i.e independent of m) probability of hunting, then for each player the distribution of the number of hunts is binomial. For large n's and small probabilities, the sum of binomial distributions can be approximated by normal. That's for constant probabilities though, and for each player probability of hunting likely depends on m and reputation of other players.

Irina Guilman - 7 years, 9 months ago

@Irina Guilman Ah, I see what you mean. I don't think that "independence from m" means "constant probabilities". I think we could list a lot of strategies that do not depend on m, but are also not constant.

Jeffrey Milloy - 7 years, 9 months ago

@Jeffrey Milloy If probability of bonus is near 0 (you're sure you won't get the bonus even if you hunt), your best strategy is slacking, because slacking is better than hunting. If probability of bonus is near 1 (you're sure you are getting the bonus anyway), your best strategy is hunting, because slacking is a better strategy. It makes sense for you to hunt (k number of times) if probability of getting a bonus actually depends on your hunting. (given m and strategy of other players).

Irina Guilman - 7 years, 9 months ago

@Irina Guilman Typo: your best strategy is slacking, because slacking is a better strategy.

Irina Guilman - 7 years, 9 months ago

Hmmm. Your earnings do not depend on who you hunt with, only the number of times you hunt and the number of times your opponents hunt with you. Let me give you an example with 4 players (P=3P=3). Let's say I decide to hunt twice (H=2H=2), and it turns out that 1 opponent decided to hunt with me (G=1G=1). My claim is that ΔS=3GH2P==5\Delta S = 3G - H - 2P = = -5, no matter who you hunt with. Consider these alternatives:

1 hh, 1 hs, 0 sh, 1 ss     ΔS=1(0)+1(3)+0(1)+1(2)=5\implies \Delta S = 1(0) + 1(-3) + 0(1) + 1(-2) = -5

0 hh, 2 hs, 1 sh, 0 ss     ΔS=0(0)+2(3)+1(1)+0(2)=5\implies \Delta S = 0(0) + 2(-3) + 1(1) + 0(-2) = -5

Let me take this a step farther, and say that your earnings across two rounds do not depend on how many times you and your opponents hunt in each specific round, only in the total hunts in the two rounds. That is, given HiH_{i}, Hi+1H_{i+1}, GiG_{i}, and Gi+1G_{i+1},

ΔSi+ΔSi+1=3(Gi+Gi+1)(Hi+Hi+1)2(Pi+Pi+1)\Delta S_{i} + \Delta S_{i+1} = 3(G_{i} + G_{i+1}) - (H_{i} + H_{i+1}) - 2 (P_{i} + P_{i+1})

so if you want to maintain a reputation of say 75%, it doesn't matter if you hunt 100% in round ii and 50% in round i+1i+1 or 80% in round ii and 70% in round i+1i+1 or 75% in both rounds. Of course, Gi+1G_{i+1} is not actually fixed at round ii and (probably) depends on how your choice of HiH_{i} affects your reputation Ri+1R_{i+1} in round i+1i+1.

Jeffrey Milloy - 7 years, 9 months ago

@Jeffrey Milloy Wait, actually you are right. Your choices do affect the other players though, you have a choice of who you will try to eliminate.

Irina Guilman - 7 years, 9 months ago

I have a question. Is this fine with copyright laws? I mean, isn't the Hunger Games a registered trademark of some publisher or film company?

Tanishq Aggarwal - 7 years, 11 months ago

We believe it to be fine under fair use laws. A community of math and science enthusiasts, throwing a competition where algorithms compete for "food" is not going to be confused with the best-selling books and movie.

Peter Taylor Staff - 7 years, 11 months ago

Haha that's funny. Okay. Doubts assuaged.

Tanishq Aggarwal - 7 years, 11 months ago

Oh my God, what amazing Brilliant works :)))

Andrias Meisyal - 7 years, 11 months ago

what can we do if we do not know the programming language (python) in which we have to write the program

Sahil Goyal - 7 years, 11 months ago

Write in English. Add parentheses and colons. Now you have python.

Nathan Zhang - 7 years, 11 months ago

I'd recommend this.

Tim Vermeulen - 7 years, 11 months ago

I recommend the book "Dive Into Python," which the author has made available for free online. It is targeted towards "experienced programmers," and will help you build a solid understanding quickly.

Nathan King - 7 years, 10 months ago

It's incredibly easy to learn. You're in Data Structures 2, and it will probably take you around 3 weeks if you sit down and learn Python to master the language. In fact, if you're familiar with some other language, grasping the basics of Python should only take you a day at a maximum.

Tanishq Aggarwal - 7 years, 11 months ago

No one truly masters a computer language in 3 weeks. Mastering a language means understanding every single detail of it and how it works in the computer. Source: I'm a college student in computer sciences.

André Madeira Cortes - 7 years, 10 months ago

@André Madeira Cortes Good point, but you can gain a good working knowledge of python in 3 weeks (or less) if you are logically oriented and starting with no programming experience, and if you have any programming experience in any other language, it should be way less than 3 weeks (a few days perhaps) to be able to write decent python code.

Sam Solomon Staff - 7 years, 10 months ago

@Sam Solomon That, I agree with, you may learn enough to code well, especially with good sources that do explain how the language works (and not just "write this and the result with be this!").

I was only "annoyed" (not really, but you know what I mean) by the word "master".

André Madeira Cortes - 7 years, 10 months ago

@André Madeira Cortes Sorry. I think the phrase I should've used was "be well versed".

Tanishq Aggarwal - 7 years, 10 months ago

Am I allowed to import random?

Andy Jiang - 7 years, 11 months ago

Yes.

Jake Nielsen - 7 years, 11 months ago

Is P bounded by a constant, or instead, in round 1, will it be equal to the total number of players in the competition?

Carmelo Piccione - 7 years, 10 months ago

P is always the current number of players (see: section II, "Hunts")

Chad Miller - 7 years, 10 months ago

I'm just concerned about performance with polynomial time algorithms over the number of players. I don't have a great way to predict the size of P, and I don't want my algorithm to be ejected for running too slow if P is larger than I anticipated.

Carmelo Piccione - 7 years, 10 months ago

@Carmelo Piccione Or worse, exponential time algorithms over the number players!

Carmelo Piccione - 7 years, 10 months ago

@Carmelo Piccione I doubt any reasonable/logical code is too slow for this. Even my own code made in python for simulating this game runs 50 games of 100 players (dumb algorithms) with max 10000 rounds in under ~30 seconds. Edit: It's also said in rules the game will be ran in "tournament" fashion, so I guess there will be many little games instead of one big.

Anssi "Miffyli" Kanervisto - 7 years, 10 months ago

https://brilliant.org/i/h0CPoQ/

For Practice Problem 5, unless I'm mistaken (which I easily could be), it looks like the practice problem is wrong. Chuck's optimal strategy is cooperate on round 1 and defect on round 2, which gives him 0 + 8 = 8 points total. This strategy is better than any strategy involving defecting on the first round, so he will always cooperate on the first round no matter what the bonus A is.

Is the problem incorrect, or am I missing something here?

Michael Dickens - 7 years, 10 months ago

Actually, it asks what should A be so that every strategy involving Chuck cooperating in the first round, is better or equal than every strategy involving Chuck deflecting in the first round

A Former Brilliant Member - 7 years, 10 months ago

I was wondering this too myself, and just thought I misunderstood some of the English wrong in my head. Indeed if Chuck first chooses to cooperate (0) and then defect (8) he gains 8. I am now even more confused after I checked my answer which was 'right'.

Anssi "Miffyli" Kanervisto - 7 years, 10 months ago

What did you answer? We might deduce from that what the intended question is.

Tim Vermeulen - 7 years, 10 months ago

@Tim Vermeulen Not going to post the answer here, but the question could be something like "What should be the award A so that Chuck prefers cooperating on both rounds instead of defecting on both rounds"

Anssi "Miffyli" Kanervisto - 7 years, 10 months ago

@Anssi "Miffyli" Kanervisto Thanks, got it right. Something else that bothers me about this question is that they're not asking for the smallest possible AA, but just any AA. So A=100A=100 should be right as well, as Chuck then still is 'at least as satisfied with cooperating as with defecting'.

Tim Vermeulen - 7 years, 10 months ago

@Tim Vermeulen Myeeah, it could be little bit more accurate. PS/Offtopic: You Dutch people are simply just awesome :D

Anssi "Miffyli" Kanervisto - 7 years, 10 months ago

@Anssi "Miffyli" Kanervisto Heh, thanks :p

Tim Vermeulen - 7 years, 10 months ago

I think Mihail's rewording of the question makes it a much better match for the correct answer. I was totally confused and thinking along the same lines as MIchael D, until I read Mihail's comment.

Simon E - 7 years, 10 months ago

we're adjusting this problem. It's not phrased in the way we wanted it to be.

David Mattingly Staff - 7 years, 10 months ago

Somehow I can't find any other way to beat the player that always slacks in my simulation of the environment. The payoff table my team constructed gives slacking to be the pure strategy and the only Nash Equilibrium (there is no mixed strategy as well). On a round to round basis, there is no way to beat someone who always slacks. We may have misinterpreted the game rules so we are requesting for a clarification over the hunts mechanism.

Victor Phan - 7 years, 10 months ago

Slacking is surely the best thing to do in a certain round, but for the long run, you might want to hunt, because that boosts your reputation. You want a high reputation because (hopefully) others are more likely to hunt with you if your reputation is high.

Tim Vermeulen - 7 years, 10 months ago

If your reputation is high then others should think you are likely to hunt and they will slack. Because if you hunt and they slack they can earn one food without doing anything.

Ibraheem Moosa - 7 years, 10 months ago

@Ibraheem Moosa And if your reputation is too low, other players will slack against you, which is fine if everyone slacks, but if two people are willing to cooperate and hunt with high enough reputation, they could beat you by slacking against everyone lower. Thus the essence of the challenge.

Michael Riley - 7 years, 10 months ago

In 2 players, always slacking is unbeatable. It's not with more. A strategy of "slack unless paired with someone tied for the highest reputation" will beat any number of slackers as long as at least two players are doing it.

Chad Miller - 7 years, 10 months ago

Will there be any way to test whether our agents function (and thrive) before the deadline?

Christopher Hever - 7 years, 10 months ago

Yes and yes.

Tim Vermeulen - 7 years, 10 months ago

What I mean is will there be any way to test our agents against other competitors' agents before the deadline?

Christopher Hever - 7 years, 10 months ago

@Christopher Hever You mean you want to test your program against the competitors' programs before the deadline and modify it if it's not good enough?

Tim Vermeulen - 7 years, 10 months ago

@Tim Vermeulen Yes, that's exactly what I mean. Will there be a venue to do this through brilliant.org?

Christopher Hever - 7 years, 10 months ago

@Christopher Hever That's kind of like asking if you can see the answers before taking the test.

Chad Miller - 7 years, 10 months ago

@Chad Miller It would be if I got to see how superior agents work and copy their strategies. Since that's not what I have in mind, it isn't.

Christopher Hever - 7 years, 10 months ago

@Chad Miller Not really... this is not unusual in machine learning competitions. It's reasonable for there to be some "training" set or "training period". Even in competitive game theory competitions, there's often an exploratory period. It's hardly "seeing the answers" before taking the test.

EM Lazzarin - 7 years, 10 months ago

@Em Lazzarin I think one of the 'problems' we have to deal with during making our algorithms is trying to find a way to deal with any and every situation rationally. Training period doesn't make sense, since everybody will just change/tweak their algorithms and your algorithm's observations aren't valid anymore. Plus this isn't machine learning competition even tho many of us will use it.

Anssi "Miffyli" Kanervisto - 7 years, 10 months ago

@Em Lazzarin I think that this "training period" is the fact that you are guaranteed at least 100 rounds, and in all probability will get many more.

William Cole - 7 years, 10 months ago

What happens in the event of a large 1st place tie?

Jake Nielsen - 7 years, 10 months ago

Love this competition, combines some of my favorite things (game theory, programming, competing and prizes!). I would be excited to see an evolutionary game theory variant of this in the future, where successive generations inherit a "family" identifier (able to recognize your own "offspring/parents", but not necessarily which family others belong to), and a family reputation.

Michael Riley - 7 years, 10 months ago

Hi, I was wondering if there were any guidelines for nomenclature of classes, since the validator specifically looks for a class named 'player'

Charlie Hoyt - 7 years, 10 months ago

It seems like you should just name your class Player upon submission. Whatever you name it during testing shouldn't matter.

EM Lazzarin - 7 years, 10 months ago

It's confirmed in the FAQ that the class should be named Player. This is the primary reason I adopted that convention in my github repo.

Chad Miller - 7 years, 10 months ago

thanks for the clarification! May I suggest putting a link to the FAQ in the large menu for the competition page along with Home ... Backstory so competitors will be able to find that page more easily

Charlie Hoyt - 7 years, 10 months ago

"Each round, a random integer m, with 0<m<P(P−1) will be chosen."

Is the random integer, m, chosen from a uniform distribution?

Cosmin Clapon - 7 years, 10 months ago

yes

David Mattingly Staff - 7 years, 10 months ago

My teacher got me to do this and I am only 12. I do not understand any of this stuff. Please can someone tell me what this is in a simplified form?!?

Imogen Brodaty - 7 years, 10 months ago

Wow, I was skateboarding and surfing when I was 12 haha... I'm impressed... Do you have any specific questions? Do you know how to program?

Jordan Bubica - 7 years, 10 months ago

Yes I totally agree, this site is insane! Hanging around here is not good for my confidence!

Pontus Hultkrantz - 7 years, 10 months ago

What is the actual input in this game?

  1. Do input the amount of players?

  2. When i get the amount of players (P) do i input characters 'h' and 's' P-1 times for each of P players or just for 1 after each round?

  3. How do i know how many rounds are there and what is the chance that i get another round after all of them end?

  4. Did i get this right: after every period of hunting if both go they get 0 food, if none goes hunting both of them lose 2 food and if one goes and one stays they get: 6+026+22=34=1 \frac{6+0}{2} - \frac{6+2}{2} = 3-4 = -1 ? Shouldn't that mean that they should always go hunting?

Djordje Marjanovic - 7 years, 10 months ago

1) described in the sample code 2) described in the sample code 3) the probability of any round ending is "small". It's very intentional that you never know if the game is about to end or not 4) If one goes and one stays, the one that goes spends 6 while the slacker only spends 2, but they both get 3 back. So the hunter gets -3 while the slacker gets +1. The goal is to try to get other people to hunt with you.

Chad Miller - 7 years, 10 months ago

In simple game theory terms, the dominant strategy is to always hunt, but the equilibrium for the game (in the simplest case of two players) is to always slack.

Tanishq Aggarwal - 7 years, 10 months ago

Can you explain your reasoning for calling "Always hunt" dominant?

Chad Miller - 7 years, 10 months ago

@Chad Miller It's the dominant strategy because if both players hunt they receive the least loss (or most gain, which ever way you would like to view it) from all possible outcomes. However, both players realize that whatever the other plays, it is always better to slack, so the equilibrium strategy for both players is to always slack.

Tanishq Aggarwal - 7 years, 10 months ago

@Tanishq Aggarwal Isn't the dominant strategy what's always best for you personally? i.e. always slack, because whatever the other does, slacking maximizes your gains.

Tim Vermeulen - 7 years, 10 months ago

@Tanishq Aggarwal That's not what "dominant" means in game theory terms. That would be "superrational". "Always slack" is a strictly dominant strategy in the two-player game.

Chad Miller - 7 years, 10 months ago

Well... Do rounds begin at round 1 or at round 0? Just to be sure. By the way, does someone have an idea of what the initial population will be? There were more or less 700 people who answered the first exercise problem, do you think that would be a good indicator? Or are there people who plan to participate and did not answer it (like me...) and/or people who answered it and do not plan to participate???

Esteban Gomezllata - 7 years, 10 months ago

The first round number we send to hunt_choices is 1.

Sam Solomon Staff - 7 years, 10 months ago

If we go with the OOP solution, can we define and assume access to global-level functions or should we stuff them all in our class.

e.g. if I want to write:

def mean(X):
    return sum(X)/len(X)

Do I have to put it in my class and call self.mean or can I leave it global and just call mean

Chad Miller - 7 years, 10 months ago

That should work though I haven't extensively tested it. I believe python is pretty good about figuring out what information different objects should have (and preventing unintended access (for instance, if someone had def sum(x, y): in their code, it wouldn't override python's default sum function for other people).

Sam Solomon Staff - 7 years, 10 months ago

will it use importlib like in the tester.py script? If so I could probably figure out the answer myself within the day.

Chad Miller - 7 years, 10 months ago

@Chad Miller I don't want to go into specifics, but it will be similar to importlib. If your code works with something like that it should work.

To be clear, what I did test was that you can define a function outside of the Player class and have it be called from within a method of Player class, what I didn't test were any of the conditions where there could be unintended access or something like that (which I'm pretty sure is not an issue).

Sam Solomon Staff - 7 years, 10 months ago

That email was helpful. 118 is a good reference number.

Justin Wong - 7 years, 10 months ago

How does my reputation effect my outcome in the games?

Siam Habib - 7 years, 11 months ago

If I understood well, you could choose to hunt or not hunt a player according to his reputation. If a player has a reputation of 1 he has always hunted, while if it's 0 he never did it!

Luca Bernardelli - 7 years, 11 months ago

So I have a few weeks to learn programming... ok! I love the picture under "Backstory"; did Brilliant staff create it?

Justin Wong - 7 years, 11 months ago

Yep, that was us! :)

Suyeon Khim Staff - 7 years, 11 months ago

Well, seriously I am a big enthusiast of programming, but a thing hinders me here. Can I write the code in pure JAVA language?? That would be of great help.

A Brilliant Member - 7 years, 11 months ago

If you know Java well, learning enough Python for this project should be very easy.

EM Lazzarin - 7 years, 11 months ago

I have a suggestion to improve the competition and make it more Hunger Games-like. In the books, everyone knows that there are 24 competitors. Can the number of competitors be locked, say, a day before the submission deadline so that this can be told to competitors? (I was planning to include this in my algorithm)

Tanishq Aggarwal - 7 years, 11 months ago

In your algorithm, you can use the number of opponents, e.g. by taking the length of the list of reputations.

Tim Vermeulen - 7 years, 11 months ago

No, I mean as in total number of competitors in the entire competition.

Tanishq Aggarwal - 7 years, 11 months ago

@Tanishq Aggarwal Wouldn't that be the number of opponents plus one?

Tim Vermeulen - 7 years, 11 months ago

@Tim Vermeulen Oh. Does this mean that every round we are playing everyone else who has ever submitted code and is still in the competition?

Tanishq Aggarwal - 7 years, 11 months ago

@Tanishq Aggarwal Yes.

Tim Vermeulen - 7 years, 11 months ago

I really want to partake in this competition but have no Python experience. I'm very well versed in Matlab, and I think those skills would cross over. Does anyone have a suggested tutorial or book that I could use to familiarize myself with Python?

Nick Wood - 7 years, 11 months ago

I just saw that someone posted an answer to another similar question. This was already posted. If anyone has anything else that would be great.

Nick Wood - 7 years, 11 months ago

That page is pretty good if you have prior programming experience, so I'd recommend giving it a try. If you have the time, try Codecademy.

Tim Vermeulen - 7 years, 11 months ago

@Tim Vermeulen Thanks! I'll be sure to do that.

Nick Wood - 7 years, 11 months ago

How do you know which tribe you're in?!

Oscar Harmon - 7 years, 11 months ago

Isn't that irrelevant? All you know about others in the same tribe/game is their reps and number.

Anssi "Miffyli" Kanervisto - 7 years, 11 months ago

I think that everyone is in the same tribe.

Tim Vermeulen - 7 years, 11 months ago

Also, can anyone direct me to a really in-depth guide to installing and running python. I'm lost here D=

Nick Wood - 7 years, 11 months ago

I personally started from here

Anssi "Miffyli" Kanervisto - 7 years, 11 months ago

The rules note that to start, players will have 300(P-1) units of food. Considering the fact that there is bound to be much more than 50 teams/individuals, isn't that too little for this competition? With 61 teams, each team receives 5 food units, and nobody can hunt, rendering the competition essentially over.

Jonathan Tseng - 7 years, 11 months ago

Everyone gets 300×(P1)300 \times (P-1) units of food, not 300/(P1)300 / (P-1).

Tim Vermeulen - 7 years, 11 months ago

Okay, wow; embarassing reading fail on my part. Thanks.

Jonathan Tseng - 7 years, 11 months ago

@Jonathan Tseng That's okay :)

Tim Vermeulen - 7 years, 11 months ago

Everyone will get 300(P-1) food. Since you can lose a maximum of 3 food per hunt, and have P-1 hunts per round, no player should die before round 100. Especially since the bonus foods come into play

Sebastian Werhausen - 7 years, 11 months ago

I'd like to have some clarification to this too. From what I understood with my high school mathematics "300(P-1)" means "300 * (number of players - 1)". So if there were 61 players, each of them would gain 300 * (61-1) = 18000 units of food. This sounds ridiculously high amount for food per player altho number of hunt choices and change in food per round rises too. I just assume I understood something wrong.

Anssi "Miffyli" Kanervisto - 7 years, 11 months ago

Why ridiculously high? It just means that there will be more than 100 rounds for every player, in case you loose -3*60 = -180 food per round. The big number of rounds is useful to find the best algorithm and not just a casuality.

Luca Bernardelli - 7 years, 11 months ago

That's correct, there will likely be many, many rounds.

Tim Vermeulen - 7 years, 11 months ago

So, if I don't know any programming languages, could I learn python fast enough for this? Second question, say the tribe qualifies for extra food (through the m thing), then if I don't hunt but my partner does, do we both get plus 2, or would it just be factored into who ever hunts? Like, we normally get (0/2)-2 each if no one hunts, would we still get that, or would we get (4/2)-2? Third question, do we have to decide when we write our code what we are going to do each round, or every round we enter some variable or other into our code and decide then?

Rebecca Held - 7 years, 11 months ago

Rebecca: I would say it's not impossible in principle. Your best bet is probably to find a beginner's Python 2 tutorial (Learn Python the Hard Way is my favorite) and run through that until you understand all the sample code posted here. I'd say the math is harder than the programming.

Chad Miller - 7 years, 11 months ago

  • Python isn't a shortcut to programming but it's one of the easiest ways to start.
  • Results of hunt rounds and public good awards are seperated. Every player gets the coop award if total sum of hunts >= m, no matter what they chose.
  • You don't enter any extra variables / code mid game. Your code has to survive on its own without outside help.

Anssi "Miffyli" Kanervisto - 7 years, 11 months ago

Most of this competition is primarily math, as Chad said. You can even just construct simple flowcharts which are purely logical thinking diagrams. Find someone in school who's a computer whiz, pair up with him/her for the competition and get him/her to put your logic into code.

Tanishq Aggarwal - 7 years, 10 months ago

Sounds like taking advantage of people for selfish motives. What if we don't find any "computer whizzes"?

Justin Wong - 7 years, 10 months ago

@Justin Wong I don't think "selfish" is a bad thing in this context. Tanishq isn't saying "ask a programmer to do the whole thing for you" so much as "if you can figure out the math but not the programming, maybe you can team up with someone who can do the programming but not the math"

Chad Miller - 7 years, 10 months ago

Are there means to ensure that the "Southampton Strategy" described in the Prisoners' Dilemma wiki page is illegal? The basic idea of the strategy is to submit different Players that conspire together to ensure a specific Player wins. Is this permissible or not?

EM Lazzarin - 7 years, 11 months ago

It is not allowed, but even if you'd try, you wouldn't succeed: you don't know with who you are hunting, just their reputation.

Tim Vermeulen - 7 years, 11 months ago

That's not quite true - the Southampton Strategy involves using a certain number of rounds to send a "signal" fellow conspiring Players so that they can identify each other with some high probability. So, yes, you can probably find out if you happen to be playing with any conspiring Players.

EM Lazzarin - 7 years, 11 months ago

@Em Lazzarin In a Prisoner's Dilemma tournament, you can know that the player you're paired with is the same player you were paired with last round. This game has no such guarantee unless it is down to 2 players (in which case there is no longer any need to collude)

Chad Miller - 7 years, 11 months ago

@Chad Miller Ah, so the order of player_reputations may change from round to round?

EM Lazzarin - 7 years, 11 months ago

@Em Lazzarin Yes, it is randomized every round.

Chad Miller - 7 years, 11 months ago

@Chad Miller Doesn't this make strategies based on modeling individual Players on the fly impossible? This changes the game significantly. Might be worth pointing out more explicitly in the rules (unless I missed it).

EM Lazzarin - 7 years, 11 months ago

@Em Lazzarin It's in the section about "Reputation". I'm pretty sure the game is trivial without that feature even if it weren't broken by outside collusion.

Chad Miller - 7 years, 11 months ago

@Chad Miller I thought that the game as it is would be quite trivial too, but your engine helped me to see that's nonsense: rather than submitting what I thought was a good algorithm, I might be better off submitting one of the sample algorithms. :p

Tim Vermeulen - 7 years, 11 months ago

@Em Lazzarin You don't know who your conspiring players are, so you would have to signal everyone. That doesn't help them though: the next round everyone is shuffled and they have no clue who you are. So I'm pretty sure it's very improbable that some guys could do it.

Tim Vermeulen - 7 years, 11 months ago

@Tim Vermeulen It would be easy to signal by manipulating your reputation. Have one entry programmed to hunt with a particular ratio of hunts, and have 100 other entries always hunt with that reputation and never hunt with another reputatation. It's a valid concern.

Eric Yoder - 7 years, 10 months ago

@Tim Vermeulen Signaling everyone isn't a problem at all, since they won't know what pattern to look for. But if there's shuffling in player_reputation, then it's too difficult.

EM Lazzarin - 7 years, 11 months ago

@Em Lazzarin sometimes...

David Mattingly Staff - 7 years, 10 months ago

They shuffle the player array every round, and you don't get any information about any given partner except their reputation. This makes it very difficult if not impossible to keep track of any individual player between rounds.

Chad Miller - 7 years, 11 months ago

If we re-sort the reputation list, will our answers correspond to the resorted list or the original?

Adrian Obleton - 7 years, 11 months ago

The list of hunt_decisions you return will be matched up to the order of player_reputations the host sent you, so if you re-sort it you should keep track of which is which so you can match opponents up correctly before returning.

Also regarding Chad's comment: everyone's reputation_list is unique to them (since they aren't in it) so it is mutable and doesn't hurt anything if they change it (except it may cause their own results to be different than they intended, though I guess it may be a useful tactic to do some in place modification of the reputation_list).

All arguments sent to Players are either ints (passed by value), floats (passed by value) or not used at all in the host (outcomes and player_reputations (both are created using a list comprehension in the function arguments to make it clear that it shouldn't be used internally))

Sam Solomon Staff - 7 years, 11 months ago

ok, thanks for clarifying; it means my github simulation is wrong. I've opened an Issue about it.

Chad Miller - 7 years, 11 months ago

You're only returning your strategy, so the game will almost certainly assume you meant your answers to correspond with the original.

As an aside, I would hope reputation_list is something immutable and not an actual list lest someone break it. ;)

Chad Miller - 7 years, 11 months ago

Is the first round round #0, or round #1?

Enric Boix - 7 years, 11 months ago

Never mind, I just reread the rules. It's round #1.

Enric Boix - 7 years, 11 months ago

in the sample code, the function huntchoices takes as an argument the list playerreputations, it is explained that player_reputations is the list of floats, the reputations of all the remaining players in the game. Does this include self. And when generating the output does hunting with self influence anything?

A Former Brilliant Member - 7 years, 11 months ago

In game rules it's mentioned you have a chance to hunt every other remaining player, so your rep will not be in the list.

Anssi "Miffyli" Kanervisto - 7 years, 11 months ago

i cannot understand what we have to do do we have to play game or write python ??? help please

M Ali - 7 years, 11 months ago

You have to write a code to play the game for you. The code will decide wether or not you will hunt or slack. (I'm pretty sure)

Rebecca Held - 7 years, 11 months ago

Just double checking, we will get 2 bonus food every time we come to a new partner in a round?(cause we see everyone once every round) Or is it at the end of each round we get 2 bonus food?

Rebecca Held - 7 years, 11 months ago

No no no. Every round, random value m is selected in between 1 and players * (players-1). If total number of hunts (eg. sum of "h"s of every player) is equal or higher than m, every player no matter what they chose gets 2 * (players-1) food. If there were 11 players in total, each of them would get 20 food as an award.

Anssi "Miffyli" Kanervisto - 7 years, 11 months ago

I'm unclear about this. I believe that this is more accurately described as:

if total number of hunts(sum of 'h's of every player) is greater than or equal to m, then the tribe receives 2 * (players-1) food to be evenly distributed to each player.

I believe this is true based on "which means that on average everyone gets 2 units of food per hunt. "

Brett Cassedy - 7 years, 10 months ago

@Brett Cassedy It discusses this in the FAQs, everyone gets 2(P-1) food if the total number of hunts for that round is greater than or equal to m.

Michael Riley - 7 years, 10 months ago

Can you please clarify what happens when I decide to slack, and the other decides to hunt? If I understood correctly, this is the only case in which I can get a positive amount of food. The other player will spend 6 units of food to hunt, and I will spend only 2 because I slack. The hunt made by the other player will bring a total of 6 units of foods, which will be divided among us. So, the net changes will be -6 + (6/2) = -3 for the other player, and -2 + (6/2) = +1 for me.

Is this reasoning correct?

Giovanni Dall'Olio - 7 years, 10 months ago

Yes. Also remember public goods if sum of all hunt choices is above m.

Anssi "Miffyli" Kanervisto - 7 years, 10 months ago

When can we submit?

I gather there is now way to know for sure how much food each (or some) of the other players have left before each round?

Mircea Digulescu - 7 years, 10 months ago

If I submit my code and revise it, can I submit again, overwriting my initial submission?

Geoff Little - 7 years, 10 months ago

Yes, we'll explain that better in instructions on the form tomorrow, but yeah, the form can be updated until the submission deadline (I will make a countdown timer on that page at some point for the deadline).

Sam Solomon Staff - 7 years, 10 months ago

What exactly is probability in regards to Page 3 (Games with mixed strategies) of the training exercises? Are the probabilities showing that player 1 has a 25% chance of playing c and playing d with a 75% chance?

Kenneth Rhee - 7 years, 10 months ago

As I understand, it says in the long run player one will play c 25% of the time and d 75% of the time.

Ibraheem Moosa - 7 years, 10 months ago

If the nash equilibrium shown on training exercise 3 is -2,-1 and it states that player 2 would play C with probability 2/3, how is it possible that player 2 would play C with a higher chance? Shouldn't player 2 be playing D since -2,-1 is the nash equilibrium for this problem?

Kenneth Rhee - 7 years, 10 months ago

@Kenneth Rhee I think in this case there is no Nash equilibrium and certainly -2,-1 is not Nash equilibrium as both of them do better by switching.

Ibraheem Moosa - 7 years, 10 months ago

Hey ! do we need to write the same variable names as told in examples ? Or can we create our own ?

Priyansh Sangule - 7 years, 10 months ago

All objects and function exposed back to our host need to have the given names. Internal to your own code you are free to use whatever you want.

David Mattingly Staff - 7 years, 10 months ago

Are we allowed to use Python's standard library? Any modules in there that we aren't allowed to use?

M K - 7 years, 10 months ago

From the FAQ:

The standard library is available for use for the most part, but using things like open and inspect to try to gain access to information you shouldn't already have access to in memory or on the disk etc, will not be allowed. Numpy and scipy will be available.

Anssi "Miffyli" Kanervisto - 7 years, 10 months ago

When it says Scipy, does it mean the scipy stack or just the scipy library? a.k.a. Can I use pandas?

Dean Miller - 7 years, 10 months ago

Are all players in one tribe together, or are there multiple tribes?

(This has been asked before, but has not been clearly answered by anyone from Brilliant.)

If you want to win, it is an important distinction. If we are all in one tribe, then there is at best very marginal incentive to go for the extra food goal, and none for players who think they are winning.

Jeffrey Milloy - 7 years, 10 months ago

As of now, we are all in the same tribe. This could change later if there are incredibly too many players, in which case (from what I understand) we will only compete within our tribe, and then the winners/survivors from each tribe go on to a second round. (I could be mistaken, since I'm working from memory and too lazy to click over to the FAQ's or further down in the discussions...)

Michael Riley - 7 years, 10 months ago

It has been answered by the staff, in the FAQ.

Tim Vermeulen - 7 years, 10 months ago

Thanks. I see that there are not multiple tribes in one competition.

I want to add another voice to those strongly encouraging that this be changed, for this competition or for subsequent competitions should they exists. The game would be significantly more interesting. It sounds like the competition-as-designed is relying on some players playing to survive, yet rewarding players who win. (Since the non-winner rewards are entirely subjective, they don't incentivize either strategy and must be ignored from this perspective). I can see no reason to care about m while trying to win

Jeffrey Milloy - 7 years, 10 months ago

@Jeffrey Milloy Right now, for better or worse, the competition rules are fixed. I know the argument you are making, it's a good one. But...let me make two comments:

  • There is a tangible reward for surviving. Some submitted algorithms have already chosen this reward path.
  • Cryptic comment time: you have missed something subtle but very useful about the hunting bonus mechanic, both collectively and individually. And that's all I'm going to say, irritating as I'm sure it is. I don't want to make you mad, but I also don't want others reading to think that it's the end of the story.

David Mattingly Staff - 7 years, 10 months ago

@David Mattingly I have a plan to incorporate the hunting bonus beneficially, which should perfectly work by theory. That's all I'm going to say as well.

Tanishq Aggarwal - 7 years, 10 months ago

@Jeffrey Milloy I agree. If the bonus for a certain player would be proportional to the number of times he hunted in that round, it would make it a lot more interesting.

Tim Vermeulen - 7 years, 10 months ago

Does anyone know about how many people will be competing?

Eric Yoder - 7 years, 10 months ago

It will be announced in the first round itself as everyone plays together in every round (with the exception of the algorithms that have been eliminated). Behind that deadline I have no clue.

Tanishq Aggarwal - 7 years, 10 months ago

Just to be sure: The foodearnings elements in huntoutcomes() are the sum of: earned food (0,3 or 6) MINUS food needed (2 or 6) PLUS possible coorperation reward (0 or 2). correct?

Sebastian Werhausen - 7 years, 10 months ago

No. The "cooperation reward" (or "public good") is an additional lump sum that is 2(P-1), where P is the total number of players. It is not conditional on hunting or not. It is simply a lump sum given to everyone if the threshold (total number of hunts > m) is achieved.

EM Lazzarin - 7 years, 10 months ago

Are you sure? It says

The amount of food you have for the next round will be current_food + sum of all entries of food_earnings

but a little bit lower:

The amount of food you have for the next round will be current_food (including food_earnings from hunt_outcomes this round) + award

I guess the second one makes more sense, but this should be fixed in the sample code then

Sebastian Werhausen - 7 years, 10 months ago

@Sebastian Werhausen What you just quoted agrees with what I said. What is the confusion about?

The amount of food you have next round is currentfood + sum(foodearnings) + publicgoodaward, where publicgoodaward is 0 if totalhunts < m and 2(P-1) if totalhunts > m.

EM Lazzarin - 7 years, 10 months ago

@Em Lazzarin the two quotes are contradicting. Particularly the first one is wrong if i get the definition right

Sebastian Werhausen - 7 years, 10 months ago

@Sebastian Werhausen food_earnings is a list of integers where each item is the result for an individual hunt (each item is one of -3, -2, 0, 1). The position in food_earnings corresponds to the position of the reputations passed into hunt_choices as player_reputations.

Your current food after the round/public award are calculated is the sum of all items in food_earnings plus your previous food, plus the public award as stated in both of the quoted strings (although the second quote doesn't explicitly mention that food_earnings is a list, it doesn't say it isn't a list either, it just says that element should be "taken into account" to determine your next round starting food at that stage in execution).

Sam Solomon Staff - 7 years, 10 months ago

@Sam Solomon Yes. But "The amount of food you have for the next round will be currentfood + sum of all entries of foodearnings" is still wrong. Not trying to nitpick, i just want to point out that the formulation is wrong, and some people might slip over it.

Sebastian Werhausen - 7 years, 10 months ago

@Sebastian Werhausen Oh, okay, I see what you mean. We were both confused because you were referring to food_earnings in your original comment which is not the slight "omission".

Sam Solomon Staff - 7 years, 10 months ago

@Sam Solomon Right, well the error could have been in the definition of food_earnings, I wasn't sure. But thanks for fixing.

Sebastian Werhausen - 7 years, 10 months ago

I just realized it's theoretically possible to track algorithms throughout the game. Although an algorithm cannot track other algorithms precisely through the first few rounds, the precision will increase as the rounds increase. I've already written this algorithm, and it's purely based on tracking reputations and matching expected patterns to the given player pattern, so if two or more algorithms share the same reputations throughout the game, it will never precisely be able to determine which algorithm shows which reputation. (Always slacking/always hunting algorithms is an example of this category of indeterminate algorithms.)

Tanishq Aggarwal - 7 years, 10 months ago

Yes, it's possible yet not worth the risk IMO. Even after high number of rounds reps of players could "overlap" and you can't reliably connect player <-> rep. However, whole tracking thing opens up new options.

Anssi "Miffyli" Kanervisto - 7 years, 10 months ago

You can let your code determine how much they overlap, and if it's pretty clear that some reputation is from the same player as some earlier reputation, then you can decide to do something with it.

Tim Vermeulen - 7 years, 10 months ago

@Tim Vermeulen Yeah. For example, consider two players P1P_1 and P2P_2 which are different from my own algorithms. If P1P_1 has a reputation of, say, 0.5 in round 500 and P2P_2 has a reputation of 0.4 in round 4, and so far I've noticed that P1P_1 generally slacks and P2P_2 generally hunts, it should be pretty straightforward after a certain amount of rounds to discern between the two players if their reputations windup being the same. Of course, if they end up with the same reputation after a few rounds they have been playing different strategies, but an algorithm should be smart enough to detect these patterns over a few hundred rounds.

Tanishq Aggarwal - 7 years, 10 months ago

Is the range of M calculated on the total number of players at the start of the game or the total number of living players? Same question for the awards.

Brady Sullivan - 7 years, 10 months ago

living players at the start of the round

Michael Riley - 7 years, 10 months ago

Can someone help me? I wanna know if it is possible to keep track of players.For example, I wanna know the player's hunt decisions.

Leonardo Daher - 7 years, 10 months ago

I don't think it's possible to know each players choices. Instead it might be possible to estimate the numbers of hunts and slacks by comparing the reputation between adjacent rounds. This has been discussed below. E.g. consider three players at start of round tt, with reputations (unsorted) Rt=[0.20 0.55 0.21]R_t = [0.20~ 0.55~ 0.21]. At round t+1t+1 you are given (randomized order) Rt+1=[0.53 0.21 0.22]R_{t+1}=[0.53~ 0.21~ 0.22]. You can guess that element/position two in RtR_t and element one in Rt+1R_{t+1} belong to the same player, i.e. 0.550.530.55 \to 0.53. For this to work the changes in reputation between two rounds must be small and overlaps shouldn't exist which would make it difficult for you to distinguish players, i.e. is it 0.200.210.20 \to 0.21 or is it 0.200.220.20 \to 0.22?

The formula for calculating reputation is given in the rules and might be used to estimate the number of hunts/slacks when you, more or less successfully, have tracked a player.

Pontus Hultkrantz - 7 years, 10 months ago

Thanks for the advice. But do the reputations change during a round? Does the list refresh during the round or only at the end of the round?

Leonardo Daher - 7 years, 10 months ago

@Leonardo Daher Reputations do not change within a round. You are only passed the information about players reputations at the beginning of the round.

Michael Riley - 7 years, 10 months ago

@Michael Riley So, if I have a list like this in the beginning of the round {0.21 , 0.30 , 0.62}, if the third guy's reputation change before I hunt with him the list won't refresh?

Leonardo Daher - 7 years, 10 months ago

@Leonardo Daher Reputation is only updated between rounds. So you don't know what the third guy did with the first two guys (except indirectly when you get the next reputation list)

Chad Miller - 7 years, 10 months ago

@Chad Miller The problem is, the list will be randomized and if I write a code to recognize which player is which, the chances of success in the beginning are low. Do you think it's worth the risk?

Leonardo Daher - 7 years, 10 months ago

@Leonardo Daher Depends on how often you get it right and how bad your strategy is if you get it wrong. :)

Chad Miller - 7 years, 10 months ago

Hunts vs. slacks is simple to calculate. Note that hunts+slacks=total number of plays=current round number-1. As R=HH+SR=\frac{H}{H+S}, hunts=reputation*(current round number-1) and slacks=current round number -1 - hunts. This, in theory, provides a mechanism to be able to track players through the game but not perfectly, since two algorithms may have the same reputation (and probably will).

Tanishq Aggarwal - 7 years, 10 months ago

@Tanishq Aggarwal Don't forget that hunts+slacks is increased by the number of players alive during that round.

To help you out and since I won't have the time to participate: First we have that reputation at start of round tt is calculated as: Rt=HtHt+St.R_t = \frac{H_t}{H_t+S_t}.

Let NtN_t and PtP_t be total number of hunts/games you have played and the number of players alive at start of round tt, respectively. Then

Nt=Ht+St=i=1t1(Pi1)N_t= H_t+S_t = \sum_{i=1}^{t-1}(P_i-1)

and

Rt+1=NtRt+htNt+Pt1,R_{t+1} = \frac{N_tR_t+h_t}{N_t+P_t-1}, where 0htPt10\leq h_t \leq P_t-1 is the number of times you choose to hunt in round tt.

You can also calculate stuff like the maximum range of Rt+1R_{t+1} as the difference of the reputation if you become a hunter 100% of times (ht=Pt1h_t=P_t-1) minus if you become a hunter zero times (ht=0h_t=0).

range(Rt+1)=Rt+1maxRt+1min=Pt1Nt+Pt1. range(R_{t+1}) = R_{t+1}^{max}-R_{t+1}^{min} = \frac{P_t-1}{N_t+P_t-1}.

Good luck!

Pontus Hultkrantz - 7 years, 10 months ago

@Pontus Hultkrantz Ahhh I should have seen this. Now I have to rework my algorithm. But thank you!

Tanishq Aggarwal - 7 years, 10 months ago

Hey, can I use the import command to import the random file? import random Is this allowed, or do we need to restrict the program to just 1 file?

Kunaal Joshi - 7 years, 10 months ago

What happens if a program get kicked out of the competition (eg. time-out, or some irregular behaviour)? It will suddenly die (so we should also expect random deaths) or it get substituted by some fixed strategy (eg. "always hunt", "chose at random", or "pick a random player, and replicate his moves for this turn")? Or the competition restart from scratch with that program removed?

Carlo Piovesan - 7 years, 10 months ago

Before we run the full competition we will do a brief burn in and algorithm inspection to weed out algorithms that are completely broken, try to hack the game, or are totally error filled. "Bad strategy" will not be weeded out of course. If you pass this initial inspection, but your algorithm hangs or has a problem later in the game, you will not be kicked out. However, if there is a time out or error that prevents your algorithm from returning a properly defined set of choices in a round, then for that round you will be treated as an 'always slacker' by the host but remain in game.

David Mattingly Staff - 7 years, 10 months ago

I was wondering if, within a round. the choices array and the reputation array had the same order of contestants. I know the reputation array is shuffled for every round, but I was wondering if we had knowledge over the distribution of reputations or if we knew the actual reputation of the other contestant as a prior for every decision.

Marc-André Legault - 7 years, 10 months ago

You know the reputation of any player before you choose to hunt/slack with them. You get a list of reputations, and you return a hunt/slack decision for each of those players, in the same order.

Chad Miller - 7 years, 10 months ago

Hi. First time on brilliant.org. Great challenge!

However, I have observed some weird behaviour. This is assuming we allow negative food. One player gets kicked out because his food gets to 0 Now the game continues until there are only two players left. Both have 1 food. Both defect. So now they have both -1 food.

In each case, the winner is the person who has the most food when the game ends.

Does that mean the player that died first wins?

Carlos Freund - 7 years, 10 months ago

see the faq for the rules in case of a tie

David Mattingly Staff - 7 years, 10 months ago

Can we submit and then resubmit later before the deadline? Or in other words, can I decide to submit something now but improve it later if I have the time?

Chad Miller - 7 years, 10 months ago

Yes, that is perfectly fine, we decided to allow that because we didn't want to disadvantage people who submit early (which we would like people to do so that can do more performance testing of the host and stuff like that).

Sam Solomon Staff - 7 years, 10 months ago

From what I understood you can submit more than once, 'overwriting' the last submission.

Anssi "Miffyli" Kanervisto - 7 years, 10 months ago

I'm just a little confused about the food. Is it all in a big tribal pool of food, shared with everybody as resources are demanded, or does each person have 300(P-1) foods. For example in a 101 player game would you have 300,000 food units, or would the entire tribe?

Joseph Moore - 7 years, 10 months ago

Never mind, I understand the reasoning behind the number. But does P change as players die? I assume it must, because the hunts would have to change number.

Joseph Moore - 7 years, 10 months ago

No, each player is given an original amount of food dependent on the original amount of players. That's it. They then either earn food through hunts or by achieving the cooperation threshold. The value of the threshold, however, is dependent on the number of players in the round in which the threshold was achieved.

Tanishq Aggarwal - 7 years, 10 months ago

@Tanishq Aggarwal I'm pretty sure this is not correct. The description of the public good reward implies that P is indeed the current number of players rather than the original number.

Chad Miller - 7 years, 10 months ago

does the reputation list include your own reputation, or just everybody else's.

Joseph Moore - 7 years, 10 months ago

Everyone else's.

Chad Miller - 7 years, 10 months ago

At the end of the round, which function gets called first: huntoutcomes or roundend?

Andy Brown - 7 years, 10 months ago

hunt_outcomes comes first, then round_end

Sam Solomon Staff - 7 years, 10 months ago

I don't have experience in Python, and I would like to take my decisions based on the last round's food_earnings. How can I do that?

Leonardo Daher - 7 years, 10 months ago

You could save that list as a global list, which you can access the upcoming round. I believe the sample code shows how to do that. Does that answer your question?

Tim Vermeulen - 7 years, 10 months ago

Thank you, but can you give me an example of how to do that?

Leonardo Daher - 7 years, 10 months ago

@Leonardo Daher You want to look at the parts using global or self in the sample code, depending on how your overall solution looks.

You could have a variable last_food_earnings and just store food_earnings to that every round beyond the first.

Chad Miller - 7 years, 10 months ago

@Chad Miller Thank you!

Leonardo Daher - 7 years, 10 months ago

@Chad Miller Python is not my primary language, but I've noticed from experience that to retain a proper copy of a list, it is safer to do

self.last_food_earnings = list(food_earnings).

Otherwise self.lastfoodearnings will hold the address of the list, and so if the host modifies the contents of food_earnings, your list will also be updated.

Could you tell me if I'm mistaken?

Daniil Lukin - 7 years, 10 months ago

@Daniil Lukin Brilliant staff has mentioned elsewhere that we can mutate whatever lists we are passed without hurting anything; apparently they'll be passed as comprehensions. But you're right to think about this as a general rule. food_earnings[:] also works.

Chad Miller - 7 years, 10 months ago

@Chad Miller You are correct that what we pass you won't be changed or used by us so you can do whatever you want with it.

Also, while [:] works, it's not the most readable thing. Using ipython and %timeit, copying a list of 1000 integers takes the same amount of time with either method, so readability should probably win the tie-breaker. (actually, a bit of further testing showed with a 100000 integer list, it is slightly faster to copy a list with list() and with a 100 integer list, is is faster to copy a list with [:])

Sam Solomon Staff - 7 years, 10 months ago

@Leonardo Daher Sure. Look at code sample 4, and then where it says that you can add instance variables there, just type

self.last_food_earnings = []

and each time you get new food earnings, you type

self.last_food_earnings = food_earnings

which you can access anytime you want.

Tim Vermeulen - 7 years, 10 months ago

@Tim Vermeulen Thanks a lot!

Leonardo Daher - 7 years, 10 months ago

If I resort the reputation list, my huntdecisions list will be assigned to the original list right? Or the huntdecisions will be resorted just as the reputation list?

Leonardo Daher - 7 years, 10 months ago

The game will assume your responses come in the same order as the reputation. So if you sort the reputations list for some reason, you need to keep track of the original order so you can return the answer properly.

Chad Miller - 7 years, 10 months ago

Thanks, but I have no idea of how to do that

Leonardo Daher - 7 years, 10 months ago

@Leonardo Daher There are ways, but I'd first consider either not sorting the list at all. Without knowing the other details of your algorithm the next best thing I can think of is to copy the list and sort the copy, keeping the original intact so you know how to order your final answer.

Chad Miller - 7 years, 10 months ago

@Chad Miller Thanks, that was helpful

Leonardo Daher - 7 years, 10 months ago

During the course of the game, is Shell (or whichever program that is going to be used) going to be restarted at any time? It's for how "deep" global variables can be defined.

Alex Giordano - 7 years, 10 months ago

Can we use Python's itertools module?

Mihai Maruseac - 7 years, 10 months ago

Yes! Encouraged even, since it's often the fastest way to do things.

Sam Solomon Staff - 7 years, 10 months ago

Can I use python 3.3, or must I stick with 2.7?

Bernard Zhi Yi Teo - 7 years, 10 months ago

All your code needs to be compatible with Python 2.7, as that's what the actual engine runs.

Tim Vermeulen - 7 years, 10 months ago

Hi. How can I keep the number of total hunts and slacks till round n? I'm trying to update the number of hunts and slacks like this: thetotalnumber += len(playerreputations) But it seems to not work(?) since in each new round "thetotal_number" will be new(?)... What's the solution?! Thanks.

Pedram Shakerinava - 7 years, 10 months ago

It may be that it is not a global variable. Make sure to call "global thetotalnumber" before using it, otherwise it will be considered a local variable, and it will be destroyed at the end of each turn, to be created anew the next one... At least that's what I think the problem is...

Esteban Gomezllata - 7 years, 10 months ago

If you're using a class, you want self.the_total_number. if not, you need a global declaration as Esteban pointed out.

Chad Miller - 7 years, 10 months ago

I want to make sure all my variables and numbers are divided as floats, not integers. I know adding

from __future__ import division

in the very beginning is a solution. Is it OK to do that?

Daniil Lukin - 7 years, 10 months ago

Should work just fine.

Sam Solomon Staff - 7 years, 10 months ago

Thank you!

Daniil Lukin - 7 years, 10 months ago

I'm quite confused with this contest "If the sum of the number of times players choose to hunt is greater than or equal to m for the upcoming round, then everyone in the tribe gets 2(P−1) extra units of food after the round, which means that on average everyone gets 2 units of food per hunt. Before each round, you will find out the value of m."

So even if you don't choose to participate in the hunt you will get the 2 bonus food?

m < people who hunt(everyone gets 2 food bonus)

if your partner dont hunt

you hunt
 -6 +3 +2 = -1

you dont hunt
-2 +2 = 0

if your partner do hunt

you hunt
 -6 +6 +2 = +2

you dont hunt

-2 +3 +2 = +3

m > people who hunt(no one gets bonus)

if your partner dont hunt

you hunt
 -6 +3 =-3

you dont hunt
 -2 = -2

if your partner do hunt

you hunt
 -6 +6 = 0

you dont hunt
-2 +3 = 1

So, it seems that in all cases you benefit more from slacking, I feel like I'm missing something here...

Tianle Dai - 7 years, 10 months ago

It's true slacking is the best option always in short term, however this is why they added reputation to game: Others can 'starve' slackers while hunting with eachother => slackers die first. However this depends on how many (hopefully 99%) of the algorithms do this to slackers. Also award is 2 * (amountofplayers - 1), not just 2. And yes, everybody gets the award no matter what they chose.

Anssi "Miffyli" Kanervisto - 7 years, 10 months ago

Ok, what about the bonus food when number of hunters are greater than m? Why is this useful? I feel since everybody gets equal amount of bonus food wouldn't that be the same as no one gets the bonus food? Is this just to help slackers survive longer or something?

Tianle Dai - 7 years, 10 months ago

@Tianle Dai I think it's for people who aim for survival. If enough algorithms opt for hunting for more awards then it rises chances of survival in general, thus giving us more t-shirts.

Anssi "Miffyli" Kanervisto - 7 years, 10 months ago

@Tianle Dai There's another reason it's useful too, just in terms of figuring out how you are doing in the game relative to everyone else...

David Mattingly Staff - 7 years, 10 months ago

So I'm a newborn programmer, vulnerable and naive to everything here. I got a rough introduction to Python and feel I can write a playable code, even if it terribly fails strategy-wise. I looked at people's testing engines and am lost. How do I test my Python file using a testing thing? (ie, what buttons to click where, etc.)

Justin Wong - 7 years, 10 months ago

Justin, my email address is on my github repo if you would like me to elaborate on the instructions that are already there.

Chad Miller - 7 years, 10 months ago

ahhh i can't... under your profile it has a link that is a blue text "{email}", and when i click it goes to microsoft outlook where it doesn't get your email. It just has "{email}" with no blue and it is useless. Helllp someone... And I use yahoo anyways... My basic question: How to import tester script so I can test my code? I have python and stuff downloaded and working. -In case it makes a difference, I don't have a Github account. Does making one make a difference in viewing your email?

Justin Wong - 7 years, 10 months ago

@Justin Wong oh, I thought it was public. maybe it wasn't.

You shouldn't need to import anything. Simply run python from the base directory of the project, e.g. python unittests.py You can reach me at [email protected]

Chad Miller - 7 years, 10 months ago

How exactly will the variables be updated, i.e. How will player_reputations be updated?

Also, will it be possible to obtain what your partner lastplayed by simply creating a lastplayed variable, and asking for input. Basically, how can we learn what are partner last played, because in a real life situation, we would be able to know what they last did, and then decide based on that. So how can we learn what are partner last did?

Alex Oro - 7 years, 10 months ago

I am not sure what you mean with that first question... players' reputations update after every round (see game rules for more info on that), and during next hunting round shuffled lists of these reputations are sent to players. Player reputations list is always in randomized order so you can't directly connect certain rep and/or certain decision from last round to certain player. Best you can is to compared reputations from last round with new ones and 'connect' them.

Anssi "Miffyli" Kanervisto - 7 years, 10 months ago

sir can we submit a code in C++

Priyanka Sahu - 7 years, 10 months ago

Only python is allowed. See FAQ

Anssi "Miffyli" Kanervisto - 7 years, 10 months ago

why is reputation needed in hunger games????????

Vidit Jain - 7 years, 10 months ago

otherwise the best choice would be slack

Jason Kang - 7 years, 10 months ago

Hi,

Is the deadline today end of the day, or tomorrow end of the day? (ie. by the end of the day Saturday or by the end of the day Sunday)

Irina Guilman - 7 years, 10 months ago

There's a counter on "submit code" page.

Anssi "Miffyli" Kanervisto - 7 years, 10 months ago

I feel like this has been asked before, but I can't find a clear answer. What is the starting reputation that is passed to each player at the first round of the game?

Sam Zeng - 7 years, 10 months ago

0

Chad Miller - 7 years, 10 months ago

It's a boring algorithm but based on my simulations and my math/population assumptions (which could be wrong) I wouldn't be surprised if a 100% hunter (i.e. pushover) wins this thing. There are a lot of populations where a pushover is optimal.

Jordan Bubica - 7 years, 10 months ago

I would be pretty surprised. I think one of the first things that people would consider is to exploit the pushovers.

Jake Nielsen - 7 years, 10 months ago

It's a goofy thing, but nearly every naive strategy I could come up with (including some people have already said they submitted as their answer) overrates reputation. But I predict that despite overrating reputation, few people will go for maximizing their reputation because Pushover is so transparently exploitable.

Chad Miller - 7 years, 10 months ago

@Chad Miller How are you determining when reputation is being overrated?

Christopher Johnson - 7 years, 9 months ago

@Christopher Johnson Analytically. I didn't post all of it in my writeup, but the parts about the "Mole" give a picture of how surprisingly easy it is for such a strategy to be exploited by a strategy that maintains reputation by hunting with the slackers.

Chad Miller - 7 years, 9 months ago

I don't think I've ever seen Pushover win in any of the dozens of simulations I've done. The only way I could see it happening is if everyone (or at least, a majority?) submitted strategies that only hunt with individuals who have a reputation of 1, and slack with everyone else.

Plus, I'm assuming the organizers won't accept Pushover, Freeloader, or Alternator, since they gave those away in their test kit. In fact, I've been assuming the organizers will include those three strategies as part of the tribe, and simply disqualify them in the (exceptionally unlikely) event that any of them get first place. That's just my guess though; I could be (and probably am) wrong!

Christopher Johnson - 7 years, 10 months ago

Plus, I'm assuming the organizers won't accept Pushover, Freeloader, or Alternator, since they gave those away in their test kit. In fact, I've been assuming the organizers will include those three strategies as part of the tribe, and simply disqualify them in the (exceptionally unlikely) event that any of them get first place. That's just my guess though; I could be (and probably am) wrong!

  • They never stated this so I can't see this being true. It would actually be unfair if this is true in my opinion.

  • I'm not sure how many people are going to submit simple strategies like "fair hunter". But if there are greater than 33% fair hunters, and a large majority of the remaining population doesn't penalize you for having a high rep, than a pushover will win. This sort of population is probably unlikely but it shows how valuable it is to get people to hunt with you.

Jordan Bubica - 7 years, 10 months ago

@Jordan Bubica It'd be unfair to first place, since they said that whoever ends with top ranking is guaranteed first place. However, they're pretty vague about who wins second through fifth place. I highly doubt they'd choose someone else's copy of one of their own algorithms for those spots, since there will be so many other submissions that are more original, more interesting, and a better demonstration of the abilities this contest purports to test. But, again, this is just my guess. I would certainly not hold it against the organizers to choose their own algorithms; it's their contest and their money--they can do what they want with it.

If the FairHunters have anyone to slack against (which they will if the average reputation is < 1), they'll almost certainly end up with more food than any Pushover. Only if the population is packed with MaxHunter-type strategies will Pushover stand a chance at winning.

Christopher Johnson - 7 years, 9 months ago

@Christopher Johnson If the FairHunters have anyone to slack against (which they will if the average reputation is < 1), they'll almost certainly end up with more food than any Pushover. Only if the population is packed with MaxHunter-type strategies will Pushover stand a chance at winning.

  • This is wrong... Let me ask you a question. In a large field with exactly 34% FairHunters, and 66% slackers (whom which the fairhunters will always slack against), what do you think the optimal strategy would be?

Jordan Bubica - 7 years, 9 months ago

@Jordan Bubica I don't understand. I thought we were discussing the hypothetical strength of Pushover. What does a population that has no Pushovers in it have to do with that?

Christopher Johnson - 7 years, 9 months ago

@Christopher Johnson His point is that he just described a lineup where Pushover is the best response strategy.

Chad Miller - 7 years, 9 months ago

How do I sign up for this Hunger Games competition??? My friend and I are interested in this concept and wish to enter next year!!!

Sanketh Premdas - 7 years, 8 months ago

Can we use C++ for this purpose?

Edward Elric - 7 years, 11 months ago

Nope,Python only

Thaddeus Abiy - 7 years, 11 months ago

Students have exams in August, might want to consider postponing the deadline till mid Sept (i.e. before the start of the next semester)

Imran Aslam - 7 years, 11 months ago

Totally depends on the country you're in, I'd say.

Tim Vermeulen - 7 years, 11 months ago

Yes I agree with Tim. The academic year in the United States starts in early September.

Tanishq Aggarwal - 7 years, 10 months ago

@Tanishq Aggarwal Actually, it starts Aug 12 for me. But I have summer work and beginning-of-school work...

Justin Wong - 7 years, 10 months ago

Hey, Just wanted to ask a question which is already answered in FAQ. Would it be okay if we use other languages to make the game, but without using none of the advanced function/perks the other languages have. Cause for people just learning programming, they wouldn't have that much knowledge about the advance features and I just guess that it would also be fair if we are allowed to write in a language we are comfortable in. Obviously you can check the code and see if it uses advanced functions and just eliminate that from the competition, cause myself am still learning c++ and it would be bad if I had to learn 2 languages at once i.e Python

Dhanin Asarpota - 7 years, 10 months ago

They have always answered "No." to this question, but you have a good point. I remember how I was afraid of Python 'corrupting' my programming skills with Java (no need to define data types etc).

Anssi "Miffyli" Kanervisto - 7 years, 10 months ago

Learning two languages at once shouldn't be a real detriment. If anything, concepts from one language can help inform the other.

EM Lazzarin - 7 years, 10 months ago

Dhanin: I first learned to program on C and I don't think Python would be that hard to pick up. There's a definite learning curve if you want to use more advanced stuff, but you can write Python code that basically looks like garbage-collected C if you want.

Chad Miller - 7 years, 10 months ago

I don't think it is a matter of advanced functions/perks. I believe its a matter of being able to run everyone's submissions together. If it's not in the same language, the program they are using to run the competition won't be able to recognize your code. I could be mistaken on this, but either way, if they allow C++, then why not Java, or Fortran, or any other of the hundreds of languages out there that other people are more comfortable in.

Michael Riley - 7 years, 10 months ago

Can anyone tell me about the various variable names for the specific ones ? Also, How to cooperate with other players in the game ?

Priyansh Sangule - 7 years, 10 months ago

You cooperate by hunting. What variable names are you talking about?

Brady Sullivan - 7 years, 10 months ago

the list of reputations shouldn't be randomized

Leonardo Daher - 7 years, 10 months ago

The game is trivial if everyone can track everyone's food.

Chad Miller - 7 years, 10 months ago

Is it really that trivial? Seems like it breaks down to the original prisoner's dilemma and you should just use some variant of tit for tat

Jordan Bubica - 7 years, 10 months ago

@Jordan Bubica That isn't trivial? :) It's debatable whether that's the correct strategy, or if it's something more like "hunt iff the person I'm paired with has food less than or equal to mine", but either way it's essentially impossible for anyone to win assuming a certain threshold of competence.

Chad Miller - 7 years, 10 months ago

@Chad Miller I agree, tit for tat is trivial... The fact that it's debatable seems like it's a little less trivial but either way, this adds a new twist to things

Jordan Bubica - 7 years, 10 months ago

If we all submit the code for a "Slacky" strategy, we will all get a t-shirt from Brililant. Please click "Vote Up" to this post if you are going to submit a slacky strategy :-).

Giovanni Dall'Olio - 7 years, 10 months ago

Are you sure this is true? :)

David Mattingly Staff - 7 years, 10 months ago

If we all play as hunters, then somebody could take advantage of this, and win by playing as the only slacky. If we all play as slackers, then we will all die at the same time, but there is no way that an hunter can beat us. We all win if we collaborate to not collaborate.

Giovanni Dall'Olio - 7 years, 10 months ago

@Giovanni Dall'Olio All players go under zero food at once. -> Game ends. -> Check final player food -> no one has positive food -> I have enough t-shirts to wear a new one every day for years.

Seriously though, we'll put in some explicit rules about ties (which this would be) as someone else had a similar question.

David Mattingly Staff - 7 years, 10 months ago

@Giovanni Dall'Olio One hunter wouldn't be able to beat a group of slackers, but two hunters would. They would just only hunt with each other.

Tim Vermeulen - 7 years, 10 months ago

That would end quickly. Everybody hunting every turn, however, would make sure everybody survives.

Anssi "Miffyli" Kanervisto - 7 years, 10 months ago

I had to give it a try :-). Anyway, we will all die quickly, but according to the rules, we will get the t-shirt anyway.

Giovanni Dall'Olio - 7 years, 10 months ago
×

Problem Loading...

Note Loading...

Set Loading...