Here is an actual program (written in python) implementing the described experiment. It has two stages. The first part is just calibration intending to find out if the player is one boxing or two boxing. The second is a straightforward non iterated Newcomb problem. Some randomness is used to avoid the player to exactly know when calibration stops and test begin, but calibration part does not care at all if it will predict the player is a one boxer or a two boxer it is just intended to create an actual predictor behaving as described in Newcomb’s.
print "I will run some trial games (at least 5) to calibrate the predictor."
print ("As soon as the predictor will reach the expected quality level\n"
"I will run the actual Newcomb game. Be warned you won't be\n"
"warned when calibration phase will end and actual game begin\n"
"this is intended to avoid any perturbation of predictor accuracy.\n")
# run some prelude games (to avoid computing averages on too small a set)
# then compute averages to reach the intended prediction quality
# inecting some randomness in prelude and precision quality avoid
# anybody (including program writer) to be certain of when
# calibration ends. This is to avoid providing to user data that
# will change it's behavior and defeats prediction accuracy.
import random
# 5 to 25 calibration move
prelude = (5 + random.random() * 20.0)
# 90% accuracy or better, and avoid infinite loop
# we do not tell how much better to avoid guessers
accuracy = 1.0 - (random.random() * 0.1) - 0.01
# postlude is the number of test games where desired accuracy must be kept
# before running the actual game
# postlude will be a random number between 1 and 5 to avoid players guessing
# on the exact play time when percent will change, this could give them some
# hint on the exact final game time. It is possible the current postlude
# can still be exploited to improve cheater chances above intended predictor
# values, but it's just here to get the idea... and besides outguessing omega
# the cheater is only doing so in the hope of getting 100 bucks.
# How much energy does that deserve ?
postlude = 0
one = total = two = 0
while ((total < prelude) and (int(postlude) != 1)):
a = raw_input ("1 - One-box, 2 - Two-boxes : ")
if not a in ['1', '2']: continue
if a == '1':
one += 1
else:
two += 1
total += 1
print "current accuracy is %d%%" % int(100.0 * max(two, one) / total)
if (max(two, one) * 1.0 < total * accuracy):
if postlude != 0 :
postlude -= 1
else:
postlude = 1 + random.random() * 5.0
else:
postlude = 0
# Now prediction accuracy is good enough, run actual Newcomb's game
# prediction is truly a prediction of the future
# nothing prevents the user to choose otherwise.
#print "This is the actual Newcomb game, but I won't say it"
prediction = 1 if one > two else 2
finished = False
while not finished:
a = raw_input ("1 - One-box, 2 - Two-boxes : ")
if a == '1':
if prediction == 1:
print "You win 1 000 000 dollars"
else:
print "You win zero dollars"
finished = True
elif a == '2':
if prediction == 1:
print "You win 1 000 100 dollars"
else:
print "You win 100 dollars"
finished = True
Here is an actual program (written in python) implementing the described experiment. It has two stages. The first part is just calibration intending to find out if the player is one boxing or two boxing. The second is a straightforward non iterated Newcomb problem. Some randomness is used to avoid the player to exactly know when calibration stops and test begin, but calibration part does not care at all if it will predict the player is a one boxer or a two boxer it is just intended to create an actual predictor behaving as described in Newcomb’s.