tetris11 , (edited )
@tetris11@lemmy.ml avatar
  1. Everyone tosses three coins, and posts it in the chat
    • If a player tosses three of the same, they have to toss again.
  2. Everyone chooses the mode coin from their neighbour, and adds it to their stack
  3. Each player, with 3+N coins, picks the mode coin in their own collection.
    • Ideally: the player's own bias, is outweighed by the other player's biases.
  4. The final coin is the mode of all players coins.
spoiler
from numpy import median
from pprint import pprint

players = {"p1" : [1,0,1],  ## playing fair
           "p2" : [0,0,1],  ## cheating
           "p3" : [1,1,0],  ## cheating
           "p4" : [1,1,0],  ## cheating
           "p5" : [0,0,1]}   ## playing fair
print("Initial rolls:")
pprint(players)

get_mode_coin = lambda x: int(median(x))
get_all_mode_coins = lambda x: [get_mode_coin(y) for y in x]

for play in players: ## Players add the mode coin from their neigbours
    players[play] = players[play] + get_all_mode_coins(players.values())
print("First picks:")
pprint(players)

for play in players: ## Players collapse their collections to mode
    players[play] = [get_mode_coin(players[play])]
print("Last modes:", players)

print("Final choice:", get_mode_coin([x for x in players.values()]))

Which as you can see, is no better than simply picking the median coin from the initial rolls. I thank you for wasting your time.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • asklemmy@lemmy.ml
  • test
  • worldmews
  • mews
  • All magazines