Redian新闻
>
学术版求教: a simple probability(?) question
avatar
学术版求教: a simple probability(?) question# Joke - 肚皮舞运动
F*3
1
Every time a man can step to his left side or right side. 50% chance on each
side.
Question: how far is the man from his original position after 1000 steps?
I thought the answer is zero, but it's not.
I even wrote a two line code to test it out. The result was not zero, but I
still don't understand.
Please help. It drives me crazy...
avatar
v*s
2
布朗运动,和sqrt(T)成正比

each
I

【在 F**********3 的大作中提到】
: Every time a man can step to his left side or right side. 50% chance on each
: side.
: Question: how far is the man from his original position after 1000 steps?
: I thought the answer is zero, but it's not.
: I even wrote a two line code to test it out. The result was not zero, but I
: still don't understand.
: Please help. It drives me crazy...

avatar
F*3
3
why it's 布朗运动?
And my results don't seem to 成正比 with sqrt(steps). Anything I miss here?

【在 v*****s 的大作中提到】
: 布朗运动,和sqrt(T)成正比
:
: each
: I

avatar
p*u
4
平均值是零,方差不是

each
I

【在 F**********3 的大作中提到】
: Every time a man can step to his left side or right side. 50% chance on each
: side.
: Question: how far is the man from his original position after 1000 steps?
: I thought the answer is zero, but it's not.
: I even wrote a two line code to test it out. The result was not zero, but I
: still don't understand.
: Please help. It drives me crazy...

avatar
g*r
5
楼上正解。
方差=steps
avatar
k*2
6
关键是你这个how far,是距离,而距离永远是正的。所以这个题求的
是|x|的expectation value, 而不是 x 的expectation.
比方说就走两步,那么几种可能:LL,LR,RL,RR.
其中各1/4几率,其expectation:
2(LL)×1/4 + 0(LR+RL)×1/2 + 2(RR)×1/4 = 1
而不是0。
走1000步,只有很小的概率是左右各500步,其他的绝大多数概率都是正数,
所以expectation不可能是0。

each
I

【在 F**********3 的大作中提到】
: Every time a man can step to his left side or right side. 50% chance on each
: side.
: Question: how far is the man from his original position after 1000 steps?
: I thought the answer is zero, but it's not.
: I even wrote a two line code to test it out. The result was not zero, but I
: still don't understand.
: Please help. It drives me crazy...

avatar
T*u
7
markov chain
avatar
F*3
8
你这个解释我能理解,可是实际不是|x|,而是x啊
在我的code里面,RR会是-2而不是2
但是我的结果也不是零
而且我的结果确实是和steps正相关,虽然(看起来)不是线性或者平方根

【在 k*******2 的大作中提到】
: 关键是你这个how far,是距离,而距离永远是正的。所以这个题求的
: 是|x|的expectation value, 而不是 x 的expectation.
: 比方说就走两步,那么几种可能:LL,LR,RL,RR.
: 其中各1/4几率,其expectation:
: 2(LL)×1/4 + 0(LR+RL)×1/2 + 2(RR)×1/4 = 1
: 而不是0。
: 走1000步,只有很小的概率是左右各500步,其他的绝大多数概率都是正数,
: 所以expectation不可能是0。
:
: each

avatar
v*r
9
they already todl you the answer, the variance is linear of steps.

【在 F**********3 的大作中提到】
: 你这个解释我能理解,可是实际不是|x|,而是x啊
: 在我的code里面,RR会是-2而不是2
: 但是我的结果也不是零
: 而且我的结果确实是和steps正相关,虽然(看起来)不是线性或者平方根

avatar
f*g
10
恩,那证明你的2-line code有bug

【在 F**********3 的大作中提到】
: 你这个解释我能理解,可是实际不是|x|,而是x啊
: 在我的code里面,RR会是-2而不是2
: 但是我的结果也不是零
: 而且我的结果确实是和steps正相关,虽然(看起来)不是线性或者平方根

avatar
F*3
11
呵呵,我也觉得,不然太不可思议了

【在 f*****g 的大作中提到】
: 恩,那证明你的2-line code有bug
avatar
n*r
12
debug很简单啊, 你把1000换成2, 看看跑出来x的期望是不是0.

【在 F**********3 的大作中提到】
: 呵呵,我也觉得,不然太不可思议了
avatar
v*r
13
不一定是bug, steps 越多,std 越大 (more flat),你跑出来的平均值的方差也大,
所以你看到它也有变化.要增加仿真次数。
try this: steps=1000; x=sum((rand(10000,steps)-0.5)*2,2); mean(x)

【在 F**********3 的大作中提到】
: 呵呵,我也觉得,不然太不可思议了
avatar
l*s
14
螃蟹步走不远,改前后走就能走的远了:)
avatar
i*a
15
每一步是Bernoulli trial X1 = (-1,1), p=0.5.
能走多远是 S = X1+X2+...Xn.
S 的均值是0, 方差是n. E(S) = 0, Var(S) = n
S 是二项分布,n 足够大,S趋近正态分布 S ~ N(0,n)
每次实验限定n, 比如 n = 10000.
重复此实验m次, 比如 m = 1000.
每次实验结果是以0为中心的正态分布。结果取到0,但概率很小,可以估算为0.004。
所以取0,很不常见,一千次实验大概能看到4次。但可以估算一定范围的概率。比如-
100,到 100 的概率是 0.7.
总之,均值是0,不代表能取到0,因为样本很大。 数值变大,是方差变大的表象。
avatar
s*m
16
贴code吧

【在 F**********3 的大作中提到】
: 你这个解释我能理解,可是实际不是|x|,而是x啊
: 在我的code里面,RR会是-2而不是2
: 但是我的结果也不是零
: 而且我的结果确实是和steps正相关,虽然(看起来)不是线性或者平方根

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。