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

  • Math Proof Training and Practice
4
Replies
116
Views
15K
  • Math Proof Training and Practice
2
Replies
42
Views
6K
  • Math Proof Training and Practice
3
Replies
101
Views
11K
  • Math Proof Training and Practice
4
Replies
105
Views
12K
  • Math Proof Training and Practice
3
Replies
74
Views
9K
  • Math Proof Training and Practice
3
Replies
77
Views
10K
  • Math Proof Training and Practice
3
Replies
83
Views
10K
  • Set Theory, Logic, Probability, Statistics
Replies
2
Views
1K
  • Math Proof Training and Practice
2
Replies
57
Views
8K
  • Math Proof Training and Practice
2
Replies
62
Views
8K
Back
Top