由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Quant版 - 大家来做一道题吧
相关主题
An interview question about probability.【Probability】求pdf
simulation problem求教一个random walk题
[合集] 一道概率题,被问倒了。old probability Q
问一个convergence of random variables的问题[合集] brain test
Risk Neutral probability[合集] 出一道题做做吧 (转载)
一个概率题interview question
请教上周Credit Suisse的一个题(probability)Wiki 战争(修改版) (转载)
一道有关risky bond survival probability 的面试题请教大牛:不读完master学位影响大吗?
相关话题的讨论汇总
话题: door话题: prize话题: doors话题: first话题: select
进入Quant版参与讨论
1 (共1页)
t****g
发帖数: 35
1
There are four doors, and a prize of $1000 is placed behind one of these
doors.
First, you randomly choose a door, which has 25% chance of selecting the
prize door.
Second, someone opens a door which is not the door you chose and not the
door with the prize. Third, after seeing the empty door, you are asked if
you want to switch to another door.
Write a program to simulate this game 100,000 times and calculate the
probability of choosing the prize door if you switch your initially selected
door.
(Bonus question) As a follow up, how does the probability change if there
are 20 doors instead of 4? what if there are 1,000 doors and 13 of them
have $1,000 prizes?
用Matlab可以编的
g*****k
发帖数: 623
2
这要模拟干吗?直接有公式解

selected

【在 t****g 的大作中提到】
: There are four doors, and a prize of $1000 is placed behind one of these
: doors.
: First, you randomly choose a door, which has 25% chance of selecting the
: prize door.
: Second, someone opens a door which is not the door you chose and not the
: door with the prize. Third, after seeing the empty door, you are asked if
: you want to switch to another door.
: Write a program to simulate this game 100,000 times and calculate the
: probability of choosing the prize door if you switch your initially selected
: door.

t****g
发帖数: 35
3
题目要求模拟....

【在 g*****k 的大作中提到】
: 这要模拟干吗?直接有公式解
:
: selected

d*****e
发帖数: 7368
4
my simulation gives 0.37337
I am a newbie here, not in matlab, but in C.
Where is the equation/formula?
a*******1
发帖数: 1554
5
P(get the prize) = P(get the prize|select wrong door at first)*P(select
wrong door at first)
= P(get the prize|select wrong door at first)*(3/4)
= (1/2)*(3/4)
= 3/8
因为如果一开始选对了那么换了之后就错了,所以要拿奖前提是开始选错了。既然开始
错了,对方又开了一个错的,那么剩下两个其中一个是对的,所以1/2
for 20 doors
P(get the prize) = P(get the prize|select wrong door at first)*P(select
wrong door at first)
= P(get the prize|select wrong door at first)*(19/20)
= (1/18)*(19/20)
= 0.052778
for 1000 doors with 13 prizes,
P(get the prize) = P(get the prize|select wrong door at first)*P(select
wrong door at first)+P(get the prize|select right door at first)*P(select
right door at first)
= P(get the prize|select wrong door at first)*987/1000+
P(get the prize|select right door at first)*13/1000
=(13/998)*(987/1000)+(12/998)*(13/1000)
= 0.013013
给我包子吧!!!
t****g
发帖数: 35
6
怎么给包子,你的算法是在第二个知道那个门后不是钱的前提下的,其实我知道怎么算
,只是不会编程

【在 a*******1 的大作中提到】
: P(get the prize) = P(get the prize|select wrong door at first)*P(select
: wrong door at first)
: = P(get the prize|select wrong door at first)*(3/4)
: = (1/2)*(3/4)
: = 3/8
: 因为如果一开始选对了那么换了之后就错了,所以要拿奖前提是开始选错了。既然开始
: 错了,对方又开了一个错的,那么剩下两个其中一个是对的,所以1/2
: for 20 doors
: P(get the prize) = P(get the prize|select wrong door at first)*P(select
: wrong door at first)

d*****e
发帖数: 7368
7
thanks, it's very clear.

【在 a*******1 的大作中提到】
: P(get the prize) = P(get the prize|select wrong door at first)*P(select
: wrong door at first)
: = P(get the prize|select wrong door at first)*(3/4)
: = (1/2)*(3/4)
: = 3/8
: 因为如果一开始选对了那么换了之后就错了,所以要拿奖前提是开始选错了。既然开始
: 错了,对方又开了一个错的,那么剩下两个其中一个是对的,所以1/2
: for 20 doors
: P(get the prize) = P(get the prize|select wrong door at first)*P(select
: wrong door at first)

A****s
发帖数: 129
8
编这个不是很简单吗?

【在 t****g 的大作中提到】
: 怎么给包子,你的算法是在第二个知道那个门后不是钱的前提下的,其实我知道怎么算
: ,只是不会编程

f*******y
发帖数: 52
9
I think the simulation should be run under two scenarios: switch and not
switch. Then you can get two probabilities and compare.
1 (共1页)
进入Quant版参与讨论
相关主题
请教大牛:不读完master学位影响大吗?Risk Neutral probability
Fama finally got the nobel prize!一个概率题
一道比较有意思的题请教上周Credit Suisse的一个题(probability)
[合集] 谁能给我提点建议一道有关risky bond survival probability 的面试题
An interview question about probability.【Probability】求pdf
simulation problem求教一个random walk题
[合集] 一道概率题,被问倒了。old probability Q
问一个convergence of random variables的问题[合集] brain test
相关话题的讨论汇总
话题: door话题: prize话题: doors话题: first话题: select