Question about a simple game
|
04-23-2019, 11:05 PM
(This post was last modified: 04-24-2019 01:55 AM by Albert Chan.)
Post: #3
|
|||
|
|||
RE: Question about a simple game
(04-23-2019 08:09 PM)Namir Wrote: I = 0.5*T^2 + T = T*(T/2 + 1) That can't be right ... If T=1, expected iterations *only* 1½ ? Tried Lua simulation, expected iterations vary so much that the linear term can not be predicted. Code: function loops(t) lua> average(loops, 10, 1000) -- 5 times: 640 633 651 584 628 ≈ 627 lua> average(loops, 20, 1000) -- 5 times: 2450 2433 2360 2492 2438 ≈ 2435 lua> average(loops, 40, 1000) -- 5 times: 9606 9680 9687 9690 10083 ≈ 9749 9749 / 2435 = 4.00, so curve shape should be N = K T^2 K = N/T^2 = 9749 / 40^2 = 6.093 N = 6.093 T^2 However, for small T, the curve does not fit quite right. lua> average(loops, 1, 1e6) --> Expected iterations for T=1 ~ 9.26 T/sqrt(N) = sqrt(1/6.093) = 0.405 0.405 is roughly the standard deviation of rand(0,1) - rand(0,1) MTB > rand 1000 C1-C2; SUBC> uniform 0 1. MTB > let C3 = C1-C2 MTB > describe C3 Code: N MEAN MEDIAN TRMEAN STDEV SEMEAN C3 looks triangular. Below histogram from Minitab command: hist C3 Code: -1.0 4 * |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
Question about a simple game - Namir - 04-23-2019, 08:09 PM
RE: Question about a simple game - Thomas Okken - 04-23-2019, 08:38 PM
RE: Question about a simple game - Albert Chan - 04-23-2019 11:05 PM
RE: Question about a simple game - Albert Chan - 04-24-2019, 02:14 AM
RE: Question about a simple game - Namir - 04-24-2019, 03:15 AM
RE: Question about a simple game - Albert Chan - 04-24-2019, 02:25 PM
RE: Question about a simple game - Namir - 04-24-2019, 03:14 PM
RE: Question about a simple game - Namir - 04-24-2019, 03:10 PM
|
User(s) browsing this thread: 2 Guest(s)