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

Home > Probability
Pass the beer (Posted on 2013-04-09) Difficulty: 3 of 5
Suppose you and a bunch of friends are sitting around a table.
There are N of you.
You have a jug of beer in front of you, which no one has yet tasted.
So you take a swig of it, and then pass it to your left or right with probability 1/2.
Now suppose your neighbor does the same---he/she takes a swig of it and passes it to his/her left or right with probablity 1/2.
Each player continues in this fashion.
Because the beer is moving back and forth randomly around the table, it may be a while before some people get to taste the beer for the first time.

Which person around the table is most likely to be the last one to try the beer?
Is it a person near you or far from you?
(Assume that the jug is bottomless, and never runs out.)

Source: Math fun facts

No Solution Yet Submitted by Ady TZIDON    
Rating: 3.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution computer solution | Comment 1 of 8

RANDOMIZE TIMER
defdbl a-z
CLS
DIM lastPosCt(12)
FOR tr = 1 TO 100000000
    REDIM had(12)
    had(6) = 1: hadCt = 1
    location = 6
    DO
        delta = SGN(2 * RND(1) - 1)
        location = location + delta
        IF location > 12 THEN location = location - 12
        IF location < 1 THEN location = location + 12
        IF had(location) = 0 THEN had(location) = 1: hadCt = hadCt + 1
    LOOP UNTIL hadCt = 12
    lastPosCt(location) = lastPosCt(location) + 1
    IF tr MOD 1000000 = 0 THEN
        FOR i = 1 TO 12
            PRINT lastPosCt(i);
        NEXT
        PRINT
        IF INKEY$ > "" THEN PRINT: RANDOMIZE TIMER: PRINT
    END IF
NEXT tr
PRINT: PRINT
PRINT lastPosCt(12);
FOR i = 1 TO 5
    PRINT (lastPosCt(i) + lastPosCt(12 - i)) / 2;
NEXT
PRINT

The program simulates starting at position 6, as in 6 o'clock; the opposite side is 12, as in a clock face.

After 100 million trials, where at human-randomly chosen points the pseudo-random number generator was re-randomized, the following set of statistics appeared.

The statistics for the final resting place, from 1 to 12 respectively are:

9102018  9009604  9081630  9053443  9144911  0  9145662  9052964  9081760  9009555  9102281  9216172

Due to symmetry we can average opposite sides:

    12     1 and 11   2 and 10  3 and 9   4 and 8    5 and 7
 9216172  9102149.5  9009579.5  9081695  9053203.5  9145286.5
 


The last person to get the beer is at 12, directly opposite the start.

The second most frequent are the two immediately adjacent to the start.

Then comes immediately adjacent to the opposite point, part of the same buildup to the opposite.

Then there seems to be a minor bump halfway around at 3 o'clock and 9 o'clock.

Edited on April 9, 2013, 7:38 pm
  Posted by Charlie on 2013-04-09 18:34:01

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 (0)
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