9
0
This is based on this challenge and Geobits's/CarpetPython's idea to improve it:
For this challenge, the distance between two numbers is measured on a loop, so, for example, the distance between 0 and 999 is 1. This should prevent strategies like always picking the lowest or highest number from winning almost every time. The only other change is that the lowest number that can be chosen is now 0 instead of 1.
I'll summarize it here:
- Write a function in Java, Python, or Ruby that takes three arguments:
- the number of rounds played so far
- the number of players
- the numbers picked in the previous rounds, as an array of space-separated strings
- It should return an integer from 0 to 999, inclusive
- The score for a program each round is the sum of the square roots of the distances to the numbers each other program picked
- The program with the highest score after 100 rounds wins.
- One answer per person
The control program is here:
https://github.com/KSFTmh/src/
Leaderboard
NumberOne, by TheBestOne, is winning.
- NumberOne - 9700
- NumberOnePlusFourNineNine - 9623
- AncientHistorian - 9425
- FindCampers - 9259
- WowThisGameIsSoDeep - 9069
- Sampler - 9014
- SabotageCampers - 8545
Apparently, my camper sabotage...er(?) doesn't work very well.
Here are the full results: https://github.com/KSFTmh/src/blob/master/results-3
I think this is different enough to not be a duplicate.
By the way, this is my first time asking a question on Stack Exchange, so let me know if I'm doing something wrong.
4Do we really want a question this similar ? – Optimizer – 2015-01-31T20:13:03.500
5@Optimizer A few people in the comments seemed to think this was a good idea. Answers from the original will work very differently here, so I don't think it's a duplicate. – KSFT – 2015-01-31T20:14:11.447
I want to do this like the original, but I don't know how it worked, exactly. Did the person who posted the challenge run the control program to find the scores? – KSFT – 2015-01-31T21:05:05.317
As the original question had a major loophole I wouldn't close this one. It might worth a meta topic to discuss if "fixing" a question is allowed if it considerably improves it's value. Unrelated but what if the answer would be also different thanks to the modification? – randomra – 2015-01-31T21:06:40.823
Thanks KSFT for organising this improved challenge. I have been AFK. As I understand it, the control program calls each answer program each round with the history of the previous calls (but I have not read the code). This may mean that you need to install a variety of obscure compilers and interpreters on your machine. You should also make sure the code does not do anything hostile before you run it. The output of the control program should provide the information for a leader board. – Logic Knight – 2015-02-01T02:28:59.810
1The credit for suggesting the challenge should go to @Geobits. I just agreed with him. – Logic Knight – 2015-02-01T02:31:36.097
@CarpetPython Should I run the control program with all of the submissions each time a new answer is submitted? – KSFT – 2015-02-01T03:18:27.590
@KSFT I am new to this leaderboard business. I would guess once per day or more often if more entries are added or changed (if your time allows). It should be up to you. – Logic Knight – 2015-02-01T03:22:30.417
You have probably already thought of this, but the controller's distance calculation needs to change to something like
sum(sqrt(min(1000-abs(x-y), abs(x-y))) for y in others)to implement the wrap-around feature. – Logic Knight – 2015-02-01T05:12:45.877@CarpetPython What I did was really long, but basically the same as that. I don't know Java very well, but I'm pretty sure it'll work right. – KSFT – 2015-02-01T05:14:28.710
We need "Keep your distance on a sphere" for the next question :). – kennytm – 2015-02-01T17:36:35.933
@KennyTM That's a good idea. I might post that if I ever get the controller for this one working. – KSFT – 2015-02-01T17:59:07.917
1Mmm. It seems that a constant number wins again. I am curious as to why that is. Could we see the 600 output numbers in the question, or on github or pastebin? I suspect some of our predictors have bugs. Possibly mine :-( – Logic Knight – 2015-02-02T03:07:34.603
Until when will the challenge run? I.e., a certain date – Sanchises – 2015-02-02T18:27:08.750
@KennyTM How about on a toroid? The distance function would be much simpler. – TheNumberOne – 2015-02-03T02:12:34.407
@TheBestOne Ooh, I like that idea. What other shapes would work? Would these be closed as duplicates? – KSFT – 2015-02-03T03:19:31.657
I suspect all puzzles using this idea will suffer from the same problem. The fixed point solutions will win. Predictors will stay away from the fixed points and crash into each other, ensuring the fixed points win. We would need a rule change to reward movement. – Logic Knight – 2015-02-03T03:28:54.123
@KFST A toroid is equivalent to a rectangle with wrap around its edges. I expect they would. – TheNumberOne – 2015-02-03T03:55:33.237
1@CarpetPython A simple change would be to compute the distance between the points from last around in addition to the points from this round. – TheNumberOne – 2015-02-03T03:57:29.000
@CarpetPython I had an idea about how to do that, actually. What if scores hare calculated based on distsance to numbers chosen in previous rounds, too? – KSFT – 2015-02-03T03:57:52.153
@TheBestOne Wow – KSFT – 2015-02-03T03:58:27.473
@CarpetPython/TheBestOne Should we use just one previous round or all of them? If we use just one round, what about the first round? If we use all previous rounds, should scores be multiplied in earlier rounds to compensate for the higher scores in later rounds because there are more points? – KSFT – 2015-02-03T04:03:29.710
Why the downvote? – KSFT – 2015-02-03T06:13:23.987
Am I allowed to add my own answer? – KSFT – 2015-02-07T02:32:58.977
I am no expert on the rules here, but it is fine with me. I have added (non competitive) answers to many of my challenges, and nobody has complained. – Logic Knight – 2015-02-08T15:36:08.283
The latest run seems to prove that camping is the best solution. Unlike most KOTH challenges, this one rewards being predictable. Rewarding predictability will mean the results will be, errr, predictable. Including previous numbers will just motivate campers to slowly (and predictably) move slightly each turn. – Logic Knight – 2015-02-09T05:17:01.740
I find it amusing that my answer has only 1 upvote. I think I wouldn't it upvote either. :) – TheNumberOne – 2015-02-10T20:03:20.577
By 'Python', do you mean Python 2, Python 3, or both? – ASCIIThenANSI – 2015-04-09T14:51:26.973
@ASCIIThenANSI Python 2 will definitely work, but I'm not sure about Python 3. – KSFT – 2015-04-09T15:16:29.583