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

Home > Just Math
Monkey Business (Posted on 2004-04-30) Difficulty: 4 of 5
Suppose someone comes onto the site and is bored. That person starts spreading the rumor that levik is a monkey at exactly noon (on day 1) by sending an e-mail to one random person.

Then, each person sends an e-mail about this rumor (at exactly noon, on day 2) to one person. They can send it to anyone on perplexus (but themselves), even if that person already knows the rumor, or even if it was the person who told them about it.

Each successive day at noon, everyone that knows about the rumor sends a message to one other random person.

On average, on what day will everyone know about the rumor if there are 40 people (including the one that spread the rumor initially) at perplexus while the rumor is still spreading?

What if there were x people at perplexus while the rumor is still spreading?

No Solution Yet Submitted by Gamer    
Rating: 3.5000 (4 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
re: solution | Comment 2 of 11 |
(In reply to solution by Charlie)

Simulation result to confirm case of 40 people:

A simulation of 100,000 trials accumulated a total of 992,472 days, for an average of 9.92472 days in each trial.

The program is:

FOR trial = 1 TO 100000
  REDIM person(1, 40)
  person(0, 1) = 1: recd = 1
  person(1, 1) = 1
   FOR p = 1 TO 40
     IF person(0, p) THEN
      person(1, p) = 1
       r = INT(RND(1) * 40 + 1)
      LOOP UNTIL r <> p
      IF person(1, r) = 0 THEN
        person(1, r) = 1: recd = recd + 1
      END IF
     END IF
   NEXT p
   FOR p = 1 TO 40
    person(0, p) = person(1, p)
   dayCt = dayCt + 1
  LOOP UNTIL recd = 40
  trials = trials + 1
  IF trials MOD 1000 = 0 THEN
   PRINT dayCt, trials, dayCt / trials
NEXT trial

  Posted by Charlie on 2004-04-30 14:47:22
Please log in:
Remember me:
Sign up! | Forgot password

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

Copyright © 2002 - 2019 by Animus Pactum Consulting. All rights reserved. Privacy Information