o******l 发帖数: 3125 | 1 【 以下文字转载自 Quant 讨论区 】
发信人: ontravel (ontravel), 信区: Quant
标 题: 面试题: 过马路的问题
发信站: BBS 未名空间站 (Sun Oct 17 15:43:24 2010, 美东)
在一条马路上,每秒钟有车通过的概率是p,
只有在连续三秒钟没有车通过才能横穿马路。
问恰好要等4秒整才可以过马路的概率。 |
D******n 发帖数: 2836 | 2 什么叫等四秒整?
无论等多久,多会有被撞死的可能,lol。 |
b*******t 发帖数: 117 | 3 P[第一秒有车,第二,三,四秒没车]=p*(1-p)^3 |
o******l 发帖数: 3125 | 4 一边凉快去
【在 D******n 的大作中提到】 : 什么叫等四秒整? : 无论等多久,多会有被撞死的可能,lol。
|
o******l 发帖数: 3125 | 5 没有那么简单吧,
面试官说是要考虑第4秒以后的情况,
还要考虑第4秒以前的情况。
用Y表示有车通过,N表示没有车通过。
一个字母代表一秒钟的时间。
那么只要3个N连在一起,就可以横穿马路了。
下面几种情况都可以不用等到第4秒
NNN
YNNN
YYNNN
NYNNN
可能还有其他情况。
我当时面试的时候没有做出来。
【在 b*******t 的大作中提到】 : P[第一秒有车,第二,三,四秒没车]=p*(1-p)^3
|
l*********s 发帖数: 5409 | 6 wishing our multivariate homework could be so easy |
Q****r 发帖数: 7340 | 7 (1-(1-p)^3)*p*(1-p)^3
恰好要等4秒,就是说,等待的第四秒不能通过,就是说目前有车,那就是p
前面三秒也要等,就是说,这秒内一定有车,1-(1-p)^3
四秒过后可以过,就是说,后面3秒内都没有车 (1-p)^3
【在 o******l 的大作中提到】 : 没有那么简单吧, : 面试官说是要考虑第4秒以后的情况, : 还要考虑第4秒以前的情况。 : 用Y表示有车通过,N表示没有车通过。 : 一个字母代表一秒钟的时间。 : 那么只要3个N连在一起,就可以横穿马路了。 : 下面几种情况都可以不用等到第4秒 : NNN : YNNN : YYNNN
|
D******n 发帖数: 2836 | 8 ft,我理解为,过马路需要3秒,所以要连续三秒没有车才过得去。。。。
【在 Q****r 的大作中提到】 : (1-(1-p)^3)*p*(1-p)^3 : 恰好要等4秒,就是说,等待的第四秒不能通过,就是说目前有车,那就是p : 前面三秒也要等,就是说,这秒内一定有车,1-(1-p)^3 : 四秒过后可以过,就是说,后面3秒内都没有车 (1-p)^3
|
Q****r 发帖数: 7340 | 9 是啊,3秒没车的概率(1-p)^3
但是前面要等待,如果要等n秒,那么第n秒肯定有车了,不然可以提前走了。也就必须
有个p
至于n-1秒前如何,肯定不会存在有连续的3秒
如果n=3,就很简单,第三秒有车,前两秒无所谓有车不,但是后面三秒没有车
所以是p(1-p)^3
如果n=4,那么第四秒有车,前面三秒至少有一辆车那就是1-(1-p)^3
最后是(1-(1-p)^3)*p*(1-p)^3
如果n>4,又要难了,第n秒有车,难度在n-1内,没有连续的三秒空档
【在 D******n 的大作中提到】 : ft,我理解为,过马路需要3秒,所以要连续三秒没有车才过得去。。。。
|
Q****r 发帖数: 7340 | 10 不懂你的意思
不就是连续三秒没有车子么
你从第一秒开始过,三秒,也就过完马路了
【在 D******n 的大作中提到】 : ft,我理解为,过马路需要3秒,所以要连续三秒没有车才过得去。。。。
|
|
|
D******n 发帖数: 2836 | 11 那是会有机会被撞死啊。每一秒钟都有车来。
【在 Q****r 的大作中提到】 : 不懂你的意思 : 不就是连续三秒没有车子么 : 你从第一秒开始过,三秒,也就过完马路了
|
P****D 发帖数: 11146 | 12 干想了一下没有动笔,“没有连续的三秒空档”这个情况好多,随着N的增大越来越多。
怪不得这个题卡在4秒。
【在 Q****r 的大作中提到】 : 不懂你的意思 : 不就是连续三秒没有车子么 : 你从第一秒开始过,三秒,也就过完马路了
|
k*******a 发帖数: 772 | 13 这个就是statistical inference 第三章的习题呀。 |
w*****e 发帖数: 806 | 14 statistical inference-Caella & Berger Section 3.3
http://www.exampleproblems.com/Solutions-Casella-Berger.pdf
page 28.
3.3 In the seven seconds for the event, no car must pass in the last three
seconds, an event with probability (1 − p)^3. The only occurrence in
the first four seconds, for which the pedestrian does not wait the entire
four seconds, is to have a car pass in the first second and no other car
pass. This has probability p(1 − p)^3. Thus the probability of waiting
exactly four seconds before starting to cross is [1 − p(1 − p)^
3](1 − p)^3. |
r*******e 发帖数: 510 | 15 这个不就是书上的作业嘛。
【在 o******l 的大作中提到】 : 没有那么简单吧, : 面试官说是要考虑第4秒以后的情况, : 还要考虑第4秒以前的情况。 : 用Y表示有车通过,N表示没有车通过。 : 一个字母代表一秒钟的时间。 : 那么只要3个N连在一起,就可以横穿马路了。 : 下面几种情况都可以不用等到第4秒 : NNN : YNNN : YYNNN
|
r*******e 发帖数: 510 | 16 这个不就是书上的作业嘛。
【在 o******l 的大作中提到】 : 没有那么简单吧, : 面试官说是要考虑第4秒以后的情况, : 还要考虑第4秒以前的情况。 : 用Y表示有车通过,N表示没有车通过。 : 一个字母代表一秒钟的时间。 : 那么只要3个N连在一起,就可以横穿马路了。 : 下面几种情况都可以不用等到第4秒 : NNN : YNNN : YYNNN
|
g********d 发帖数: 2022 | 17 赞。
书有没有电子版的?
waiting
)^
【在 w*****e 的大作中提到】 : statistical inference-Caella & Berger Section 3.3 : http://www.exampleproblems.com/Solutions-Casella-Berger.pdf : page 28. : 3.3 In the seven seconds for the event, no car must pass in the last three : seconds, an event with probability (1 − p)^3. The only occurrence in : the first four seconds, for which the pedestrian does not wait the entire : four seconds, is to have a car pass in the first second and no other car : pass. This has probability p(1 − p)^3. Thus the probability of waiting : exactly four seconds before starting to cross is [1 − p(1 − p)^ : 3](1 − p)^3.
|
o******l 发帖数: 3125 | 18 how about no car pass at 1, 2, 3,and 4 second?
这种情况没有包括在答案里呀
~~~~~这种情况没有包括在答案里呀
waiting
)^
【在 w*****e 的大作中提到】 : statistical inference-Caella & Berger Section 3.3 : http://www.exampleproblems.com/Solutions-Casella-Berger.pdf : page 28. : 3.3 In the seven seconds for the event, no car must pass in the last three : seconds, an event with probability (1 − p)^3. The only occurrence in : the first four seconds, for which the pedestrian does not wait the entire : four seconds, is to have a car pass in the first second and no other car : pass. This has probability p(1 − p)^3. Thus the probability of waiting : exactly four seconds before starting to cross is [1 − p(1 − p)^ : 3](1 − p)^3.
|
l**********9 发帖数: 148 | |
s*******e 发帖数: 1385 | 20 前三秒至少有一辆车通过,第四秒有车通过,后三秒没有车,应该是这样吧
【在 o******l 的大作中提到】 : how about no car pass at 1, 2, 3,and 4 second? : 这种情况没有包括在答案里呀 : : ~~~~~这种情况没有包括在答案里呀 : : waiting : )^
|
|
|
o******l 发帖数: 3125 | 21 书上的答案不对吧?
【在 r*******e 的大作中提到】 : 这个不就是书上的作业嘛。
|
k*******a 发帖数: 772 | 22 这个答案是错的。。。
waiting
)^
【在 w*****e 的大作中提到】 : statistical inference-Caella & Berger Section 3.3 : http://www.exampleproblems.com/Solutions-Casella-Berger.pdf : page 28. : 3.3 In the seven seconds for the event, no car must pass in the last three : seconds, an event with probability (1 − p)^3. The only occurrence in : the first four seconds, for which the pedestrian does not wait the entire : four seconds, is to have a car pass in the first second and no other car : pass. This has probability p(1 − p)^3. Thus the probability of waiting : exactly four seconds before starting to cross is [1 − p(1 − p)^ : 3](1 − p)^3.
|
s*****t 发帖数: 987 | |