awk is made for this, but it took me a few minutes to whip this up in java. I figured if numeric polls are used in the future, this can be used as a code-base. The indentation isn’t coming through, but any IDE will fix that for you.
This doesn’t work on arbitrary numeric entry polls, but for those, you can gather the statistics as you go along, putting it in the GATHER loop
EDITED to fix serious bug.
usage: paste this into PollStat.java, compile it.
then run
java PollStat < poll.csv.txt
So far, the winners are endoself and army1987. I wasn’t far off.
~~~~~
import java.io.*;
import java.util.*;
public class PollStat {
public static void main(String[] args) {
try {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String line = br.readLine();
int[] counts = new int[12]; // PUT NUMBER OF POLL OPTIONS HERE
int end, begin;
int linen = 0;
while (line != null && line.charAt(0) == ‘#’) {
line = br.readLine();
linen++;
}
while (line != null) { // GATHER LOOP
linen++;
end = line.lastIndexOf(“\”,\”″);
begin = line.lastIndexOf(“\”,\”″, end-1);
try {
line = line.substring(begin+3, end);
} catch (Exception e) {
System.out.println(“At line number “+linen+”:”);
e.printStackTrace();
System.exit(1);
}
Integer c = Integer.parseInt(line);
counts[c]++;
// For arbitrary numeric responses, don’t use counts.
// just continuously gather your statistics. Alternately, make a list of Doubles or something.
line = br.readLine();
}
br.close();
int total = 0;
int resp = 0;
int[] numbers = new int[]{100, 64, 41, 26, 17, 11, 7, 4, 3, 2, 1, 0}; // PUT POLL OPTIONS HERE
for (int i = 0; i < c.length; i++) {
System.out.println(numbers[i]+”: “+counts[i]);
total += numbers[i] * counts[i];
resp += counts[i];
}
System.out.println(“total: “+total);
System.out.println(“average: “+((double)total)/resp);
} catch (IOException ioe) {
ioe.printStackTrace();
System.exit(2);
}
}
}
Not really—if you check out the wiki page this type of poll is meant for discrete options, not for numbers or probabilities. For probabilities the “poll:probability” type should be used, which does automatically compute averages and medians.
Dunno… If you treat it as a zero-sum game (i.e. you don’t only want your answer to be close to 80% of the average answer, but you also want other people’s answers to be far from it) it’s not obvious to me that you should vote 0.
Dunno… If you treat it as a zero-sum game (i.e. you don’t only want your answer to be close to 80% of the average answer, but you also want other people’s answers to be far from it) it’s not obvious to me that you should vote 0.
I was granting for the purpose of responding that loup-vailant’s clear assumption that normal game theory principles apply—each agent is interested only in the payoffs to itself to the exclusion of all else and the payoffs are such that it gets 0 for being wrong and >0 for being right.
It so happens that my own actual response (100%) doesn’t conform to those assumptions. In fact my original reply to:
Minimize the expected square of the distance between your answer and 80% of the mean of the answers chosen:
… was “No”, and my original reply to loup-vaillant pontificated about the complete lack of payoff to any of the radio buttons. However I abandoned that point because the point about it not mattering whether the other guy is using CDT or TDT actually matters (somewhat).
In this game (ie. with an actual assumed payoff for correct and no negative payoff for other’s success) the Nash equilibrium (and the outcome that a group of all CDT agents would pick) also happens to be pareto optimal. In fact, it outright gives the maximum possible payoff to every individual. Even inferior decision theories can pull that off.
Yes, but whichever decision theory you’re using, you need to be ready for the few people voted for 100. Someone’s going to do something to ruin it for everyone. And it wasn’t just a few who ruined it—vs rirelbar jub’q ibgrq yrff guna sbegl bar ibgrq mreb, gur nirentr jbhyq or nyzbfg rknpgyl rvtug.
It’s rot13, a shift cipher typically used around here to obscure spoilers and spoiler-like information. Cut and paste it into rot13.com, install the d3coder extension for Chrome or something similar for another browser, or (if you like tedium) decipher it yourself.
Minimize the expected square of the distance between your answer and 80% of the mean of the answers chosen: [pollid:8]
I see a ‘Total 123’ but the table and chart only show 2 votes. The raw data also have 123 entries.
Yeah, it looks like there’s something seriously broken about this poll code. I’m seeing 159 total votes, and only 13 visible votes.
Total 139, chart shows 0 votes...
Hey everyone, I just voted, and so I can see the correct answer. The average is 19.2, so you should choose 17%!
Of course that’s what you’d say...
Or maybe that’s what I want you to think I’d say...
The noise in my simulations quickly drown out any actual logic and the markov chain reaches its stable distribution.
So what did you guess then?
I guessed “the only winning move is not to play”
(I didn’t guess. rationalization: I didn’t want to do the thinking, and can’t see the results anyway)
A function to automatically compute the averages should be implemented.
awk is made for this, but it took me a few minutes to whip this up in java. I figured if numeric polls are used in the future, this can be used as a code-base. The indentation isn’t coming through, but any IDE will fix that for you.
This doesn’t work on arbitrary numeric entry polls, but for those, you can gather the statistics as you go along, putting it in the GATHER loop
EDITED to fix serious bug.
usage: paste this into PollStat.java, compile it. then run
So far, the winners are endoself and army1987. I wasn’t far off.
~~~~~
Not really—if you check out the wiki page this type of poll is meant for discrete options, not for numbers or probabilities. For probabilities the “poll:probability” type should be used, which does automatically compute averages and medians.
Ahrgh, if only everyone was running TDT…
Or UDT. Or CDT. Or EDT.
Dunno… If you treat it as a zero-sum game (i.e. you don’t only want your answer to be close to 80% of the average answer, but you also want other people’s answers to be far from it) it’s not obvious to me that you should vote 0.
I was granting for the purpose of responding that loup-vailant’s clear assumption that normal game theory principles apply—each agent is interested only in the payoffs to itself to the exclusion of all else and the payoffs are such that it gets 0 for being wrong and >0 for being right.
It so happens that my own actual response (100%) doesn’t conform to those assumptions. In fact my original reply to:
… was “No”, and my original reply to loup-vaillant pontificated about the complete lack of payoff to any of the radio buttons. However I abandoned that point because the point about it not mattering whether the other guy is using CDT or TDT actually matters (somewhat).
In this game (ie. with an actual assumed payoff for correct and no negative payoff for other’s success) the Nash equilibrium (and the outcome that a group of all CDT agents would pick) also happens to be pareto optimal. In fact, it outright gives the maximum possible payoff to every individual. Even inferior decision theories can pull that off.
Yes, but whichever decision theory you’re using, you need to be ready for the few people voted for 100. Someone’s going to do something to ruin it for everyone. And it wasn’t just a few who ruined it—vs rirelbar jub’q ibgrq yrff guna sbegl bar ibgrq mreb, gur nirentr jbhyq or nyzbfg rknpgyl rvtug.
Forgive me for being new to the site, but I’ve see this kind of writing
in several places. How is it translated back to readable English?
It’s rot13, a shift cipher typically used around here to obscure spoilers and spoiler-like information. Cut and paste it into rot13.com, install the d3coder extension for Chrome or something similar for another browser, or (if you like tedium) decipher it yourself.
thanks!
That would be why this subthread was based on a lament.