Micromass' big simulation challenge

N,r,k): #finds the probability that the rumor will return to the first person after r generations in k runs count = 0 for i in range(k): if rumorReturns(N,r) == 1: count+=1 return count/k#exampleN = 1001 #number of peopler = 3 #number of generationk = 10000 #total number of runsprint(prob(N,r,k)) #probability that the rumor returns in one generation#COMMENT: The probability depends on the value of r and the amount of runs
  • #36
mfb said:
Your calculation would assume that you always sell 60 newspapers if you buy 60, which is clearly not true.
Ack! Indeed. @micromass - I got the right answer by the wrong method...
 
Physics news on Phys.org
  • #37
Newspapers... using numbers from Chestermiller and the described approach, here is the expected profit for each case:
40: 689.36
50: 797.125
60: 840.765 <- best
70: 765.38
80: 607.195
90: 372.285
100: 103.31
 
  • Like
Likes Chestermiller
  • #38
mfb said:
Newspapers... using numbers from Chestermiller and the described approach, here is the expected profit for each case:
40: 689.36
50: 797.125
60: 840.765 <- best
70: 765.38
80: 607.195
90: 372.285
100: 103.31
Wow. You're fast!
 
  • #39
News.png


Gotta sell it to the news stand guy...
:cool:
 
Last edited:

Similar threads

4
Replies
116
Views
16K
2
Replies
42
Views
7K
3
Replies
101
Views
12K
4
Replies
105
Views
13K
3
Replies
74
Views
9K
3
Replies
77
Views
11K
Replies
83
Views
11K
Replies
57
Views
10K
2
Replies
62
Views
10K
Back
Top