Posers and Puzzles

Posers and Puzzles

  1. Joined
    24 Jan '09
    Moves
    5514
    17 Jul '10 13:23
    yay
  2. Joined
    03 Feb '05
    Moves
    59458
    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. Behind the computer.
    Joined
    01 Apr '07
    Moves
    29058
    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. Behind the computer.
    Joined
    01 Apr '07
    Moves
    29058
    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. Standard memberforkedknight
    Defend the Universe
    127.0.0.1
    Joined
    18 Dec '03
    Moves
    16173
    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. Joined
    26 Apr '03
    Moves
    26716
    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:
    http://www.redhotpawn.com/board/showthread.php?threadid=119240&page=3#post_2256356

    for an example of the result (when the method is applied to a perl program).
  7. Joined
    29 Oct '08
    Moves
    114264
    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. Joined
    29 Oct '08
    Moves
    114264
    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. Standard memberforkedknight
    Defend the Universe
    127.0.0.1
    Joined
    18 Dec '03
    Moves
    16173
    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:

    remainingplayers.discard(s[1])
    [/quote][/quote][/quote][/quote]

    winner = remainingplayers.pop()
    # print "winner", winner
    winners.append(winner)[/quote]

    print 'P: ', float(winners.count('P'😉) / trials
    print 'A: ', float(winners.count('A'😉) / trials
    print 'E: ', float(winners.count('E'😉) / trials
Back to Top