# twisting brain puzzler!!!

jasperdash
Posers and Puzzles 14 Jul '10 13:55
1. 17 Jul '10 13:23
yay
2. 17 Aug '10 16:36
Forget the math: If P kills E, A gets first shot at P (2/3 success chance) PLUS another chance if P misses A on the return: P's chances of survival are thus less than 1/3.

If P misses E: If A kills E (2/3 chance), P then has the first shot at A (better chance of survival than the other way around...at least 1/3). If A misses E, E will kill A, and it is P's turn (at exactly 1/3 chance, since E will then kill P with certainty if P misses E).

So P needs to miss E on purpose.
3. 19 Aug '10 22:15
Originally posted by jasperdash
YES!! you are right banana king!

and if you mean the book Jasper Dash and the Flame Pits of Delaware, i have read that. if you mean read in general, then yes.
ðŸ˜², after all of the nice math done by PBE6, you choose to award the answer to banana king and his poor spelling? No offense intended to either you or Banana.

Also, at forkedknight, how did you run this simulation? I am interested ðŸ˜²
4. 19 Aug '10 22:16
Originally posted by camilli
Forget the math: If P kills E, A gets first shot at P (2/3 success chance) PLUS another chance if P misses A on the return: P's chances of survival are thus less than 1/3.

If P misses E: If A kills E (2/3 chance), P then has the first shot at A (better chance of survival than the other way around...at least 1/3). If A misses E, E will kill A, and it i ...[text shortened]... e, since E will then kill P with certainty if P misses E).

So P needs to miss E on purpose.
What if Poor, being such a poor shot, misses at missing, and is then screwed over by Average ðŸ˜€!
5. forkedknight
Defend the Universe
20 Aug '10 19:17
Originally posted by range blasts
ðŸ˜², after all of the nice math done by PBE6, you choose to award the answer to banana king and his poor spelling? No offense intended to either you or Banana.

Also, at forkedknight, how did you run this simulation? I am interested ðŸ˜²
It's a python script I whipped up. If there was a way to post it without losing all formatting, I would.
6. 21 Aug '10 13:073 edits
Originally posted by forkedknight
It's a python script I whipped up. If there was a way to post it without losing all formatting, I would.
After many experiments, I found a fairly good way to indent code in postings was to insert the word quote in square brackets where the indentation level needed to be increased, and insert the word /quote in square brackets where the indentation level needed to be decreased.

The method has a side effect that, as well as changing the indentation, the rhp formatter automatically inserts a new line after each quote or /quote. Therefore, for perfect results, you should delete one new line from the input after each of these. The method is not perfect because sometimes there is not a corresponding new line to delete in the input text, however this does not greatly mess up the result.

see my posting:

for an example of the result (when the method is applied to a perl program).
7. 23 Aug '10 16:17
the key to this puzzle is to analyse what e will do. if he gets to shoot he will shoot A as this gives him a 2/3 chance of winning vs. 1/3 if he shoots P. therefore A will be gone after e shoots his first shot.

if A and E are still alive after P shoots[ie P missed whoever he shot at], A has to shoot E because he knows if he does not kill E he will be dead because E will shoot him if P does not shoot E first. therefore P knows that he will get to shoot again as long as A survives because he knows E will shoot and eliminate A on the first shot. therefore P has to shoot E.
8. 23 Aug '10 16:31
the key to this puzzle is to analyse what e will do. if he gets to shoot he will shoot A as this gives him a 2/3 chance of winning vs. 1/3 if he shoots P. therefore A will be gone after e shoots his first shot.

if A and E are still alive after P shoots[ie P missed whoever he shot at], A has to shoot E because he knows if he does not kill E he will be dead because E will shoot him if P does not shoot E first. therefore P knows that he will get to shoot again as long as A survives because he knows E will shoot and eliminate A on the first shot. therefore P has to shoot E.
9. forkedknight
Defend the Universe
23 Aug '10 18:42
#! /usr/bin/python

import random
import sys
import math

random.seed()
accuracy = {'P': 0.33333, 'A': 0.66667, 'E': 1}
strategy = {'P': ['E','A'], 'A': ['E','P'], 'E': ['A','P']}

trials = 100000
winners = []

#players = ['A','E','P'] #uncomment for player P to miss first
players = ['P','A','E'] #player P shoots first

for i in range(trials):

remainingplayers = set(players)
while len(remainingplayers) > 1:[quote]
for player in players:[quote]
# print player
if player in remainingplayers:[quote]
randnum = random.random()
hit = randnum < accuracy[player]
# print "hit", hit
s = strategy[player]
if hit:[quote]
if s[0] in remainingplayers:[quote]
remainingplayers.remove(s[0])

else: