All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Probability
Poker Game (Posted on 2012-09-07) Difficulty: 3 of 5
A game of poker is played where there are 3 players and each player starts with 2 coins. At the beginning of each hand, every player bets 1 coin and the winner of the hand gets his own coin back in addition to all the bets placed by the other players (for example, in the case of 3 players each betting 1 coin, the winner will receive 2 coins in profit). Now assume the winner of a hand is determined at random (e.g. with 3 players the chance of winning is 1/3). Also assume that once a player reaches 0 coins he/she is out. Determine the expected number of hands that will be played in the match.

No Solution Yet Submitted by Chris, PhD    
Rating: 4.0000 (3 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
simulation verification | Comment 3 of 4 |

DEFDBL A-Z
DIM rct(2 TO 150)

FOR trial = 1 TO 1000000
    FOR player = 1 TO 3: amt(player) = 2: NEXT
    rounds = 0
    DO
        rounds = rounds + 1
        DO
            winner = INT(3 * RND(1) + 1)
        LOOP UNTIL amt(winner) > 0
        FOR player = 1 TO 3
            IF player <> winner THEN
                IF amt(player) > 0 THEN
                    amt(player) = amt(player) - 1
                    amt(winner) = amt(winner) + 1
                END IF
            END IF
        NEXT
        count = 0
        FOR player = 1 TO 3
            IF amt(player) > 0 THEN count = count + 1
        NEXT
    LOOP UNTIL count = 1
    rct(rounds) = rct(rounds) + 1
    roundcount = roundcount + rounds
    IF trial = 1000000 THEN
        FOR i = 2 TO 99: PRINT rct(i);: NEXT
        PRINT roundcount / trial
        OPEN "poker game sim.txt" FOR OUTPUT AS #2
        FOR i = 2 TO 99: PRINT #2, rct(i);: NEXT
        PRINT #2, roundcount / trial
        CLOSE 2
    END IF
NEXT trial

Counts of number of trials out of one million that used x hands, starting with x=2 and extending through x=99, the highest that occurred:

 332712  0  0  166895  0  124848  0  94137  0  70294  0  52537  0  39752  0  29647  0  22436  0  16474  0  12761  0  9376  0  6959  0  5307  0  3975  0  2952  0  2263  0  1677  0  1213  0  1010  0  698  0  499  0  420  0  291  0  214  0  141  0  144  0  98  0  69  0  61  0  30  0  20  0  21  0  18  0  14  0  5  0  7  0  5  0  6  0  4  0  2  0  2  0  0  0  1  0  0  0  2  0  1  0  1  0  1 
 
There was an average of 8.006072 hands per match over the million hands.


  Posted by Charlie on 2012-09-07 16:17:46
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (14)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information