由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - 没人讨论热门帖子里的两道概率题?
相关主题
regex 用DP做对不对啊?Amazon onsite interview
谁会做>??????????????????????????????????????一道电面题
T家店面问个问题
Interview Question这个面试题怎么做比较快啊?
GOOGLE 电面面经A Simple Question on Binary Search
Is this a DP problem?interview question
randomized quick sort的最坏情况时间复杂度bing的screening question,没回音了,帮忙看问题在哪
MS sdet面经 + bloomberg电面面经facebook telephone interview from careercup
相关话题的讨论汇总
话题: i1话题: i993话题: 坏人话题: 1e话题: pattern
进入JobHunting版参与讨论
1 (共1页)
c********t
发帖数: 5706
1
3. 一个城市有1百万人,里面有100个坏人,有一个摄像头,能够看出一个人是不是坏
人,但是它有1%的可能性说错,既把好人说成坏人,或者把坏人说成好人,问当一个摄
像头报警的时候,那个人有多少可能是个坏人
4.有一个色子,6个面,4个面是绿色,2个是红色,现在丢1000次,给三个pattern (1
) grrgrrrg, (2) rrgrrrg (3) grrgggr, 给这三个pattern出现的概率 排序
数学白痴,但挺感兴趣,想知道结果。
b*****u
发帖数: 648
2
3. my approach:
100 bad guy 999900 good guy
bad guy result: 99 bad 1 good,
good guy result: 9999*99 good, 9999 bad
so a correct bad will be of 99/9999 probability, which is less than 1%
f*******3
发帖数: 206
3
3是典型的bayes formula, 求conditional probability。
X:0 坏人, 1 好人
Y:0 报坏人, 1 报好人
已知 P(X=0)= 100/1M = 1e-4, P(X=1) = 1-1e-4 \approx 1, P(Y=1|X=0)=P(Y=0|X=1
)=0.01
求 P(X=0|Y=0) = P(X=0,Y=0)/P(Y=0)
= P(Y=0|X=0)P(X=0)/
P(Y=0|X=0)P(X=0)+P(Y=0|X=1)P(X=1)
= 0.99*1e-4/
0.99*1e-4 + 0.01*1
= 0.01
说明坏人绝对数量少,报错有概率的话,报警器可信型很低。
g**e
发帖数: 6127
4
这可是经典probability作业题啊,哈哈

=1

【在 f*******3 的大作中提到】
: 3是典型的bayes formula, 求conditional probability。
: X:0 坏人, 1 好人
: Y:0 报坏人, 1 报好人
: 已知 P(X=0)= 100/1M = 1e-4, P(X=1) = 1-1e-4 \approx 1, P(Y=1|X=0)=P(Y=0|X=1
: )=0.01
: 求 P(X=0|Y=0) = P(X=0,Y=0)/P(Y=0)
: = P(Y=0|X=0)P(X=0)/
: P(Y=0|X=0)P(X=0)+P(Y=0|X=1)P(X=1)
: = 0.99*1e-4/
: 0.99*1e-4 + 0.01*1

z****p
发帖数: 18
5
3. The is a standard Bayes rule problem:
event B: bad guy, P(B) = 1/1e4
event -B: good guy P(-B) = 1-1/1e4
event A: alarm
P(A|B) = 99%
P(A|-B) = 1%
P(B|A) = P(BA)/P(A) = P(A|B)*P(B)/[P(A|B)*P(B) + P(A|-B)*P(-B)]
...
4.
(1) 4*2*2*4*2*2*2*4/(6^8)
(2) 2*2*4*2*2*2*4/(6^7)
(3) 4*2*2*4*4*4*2/(6^7)

(1

【在 c********t 的大作中提到】
: 3. 一个城市有1百万人,里面有100个坏人,有一个摄像头,能够看出一个人是不是坏
: 人,但是它有1%的可能性说错,既把好人说成坏人,或者把坏人说成好人,问当一个摄
: 像头报警的时候,那个人有多少可能是个坏人
: 4.有一个色子,6个面,4个面是绿色,2个是红色,现在丢1000次,给三个pattern (1
: ) grrgrrrg, (2) rrgrrrg (3) grrgggr, 给这三个pattern出现的概率 排序
: 数学白痴,但挺感兴趣,想知道结果。

c********t
发帖数: 5706
6
和我想的差不多,不过我觉得最后结果是 99/(9999+99). 我被结果吓了一跳,不敢相
信准确率这么低啊。

【在 b*****u 的大作中提到】
: 3. my approach:
: 100 bad guy 999900 good guy
: bad guy result: 99 bad 1 good,
: good guy result: 9999*99 good, 9999 bad
: so a correct bad will be of 99/9999 probability, which is less than 1%

c********t
发帖数: 5706
7
多谢。
Bayes ......

【在 z****p 的大作中提到】
: 3. The is a standard Bayes rule problem:
: event B: bad guy, P(B) = 1/1e4
: event -B: good guy P(-B) = 1-1/1e4
: event A: alarm
: P(A|B) = 99%
: P(A|-B) = 1%
: P(B|A) = P(BA)/P(A) = P(A|B)*P(B)/[P(A|B)*P(B) + P(A|-B)*P(-B)]
: ...
: 4.
: (1) 4*2*2*4*2*2*2*4/(6^8)

f*******3
发帖数: 206
8
tree approach。concise and straightforward.

【在 b*****u 的大作中提到】
: 3. my approach:
: 100 bad guy 999900 good guy
: bad guy result: 99 bad 1 good,
: good guy result: 9999*99 good, 9999 bad
: so a correct bad will be of 99/9999 probability, which is less than 1%

h**6
发帖数: 4160
9
第四题显然不对,1000次这个条件没有用上。直观上理解,当掷的次数足够多时,所有
pattern的出现概率都接近1。

【在 z****p 的大作中提到】
: 3. The is a standard Bayes rule problem:
: event B: bad guy, P(B) = 1/1e4
: event -B: good guy P(-B) = 1-1/1e4
: event A: alarm
: P(A|B) = 99%
: P(A|-B) = 1%
: P(B|A) = P(BA)/P(A) = P(A|B)*P(B)/[P(A|B)*P(B) + P(A|-B)*P(-B)]
: ...
: 4.
: (1) 4*2*2*4*2*2*2*4/(6^8)

z****p
发帖数: 18
10
Sorry, I didn't read the problem carefully. Let me give it a second try:
Answer (the answer is not the probability or probability mass function for
the occurrences of the given pattern, but the expected number of occurrence
of the corresponding pattern--we can use that to tell which pattern is more
likely to happen than others):
(1) 993*4*2*2*4*2*2*2*4/(6^8)
(2) 994*2*2*4*2*2*2*4/(6^7)
(3) 995*4*2*2*4*4*4*2/(6^7)
Reasoning:
-Let's solve (1).
-Define an indicator random variable I1, so that I1=1 if the required
pattern occurs starting at position 1 (that is, it occurs at positions 1 to
8), and I1=0 if that didn't happen.
-Define an indicator random variable I2 similarly for position 2
-In total, define 993 indicator random variables.
-We can prove that the expected value for I1 to I993 are the same, namely, E
[I1]=...=E[I993]=4*2*2*4*2*2*2*4/(6^8).
-Define random variable I to represent the total number of the occurrence
-Obviously I = I1 + I2 + ... + I993
-It is hard to solve the probability mass function for I, because I1 ...
I993 are dependent.
-But we can solve E[I], which is the sum of E[I1] ... E[I993], and hence the
answer.

【在 h**6 的大作中提到】
: 第四题显然不对,1000次这个条件没有用上。直观上理解,当掷的次数足够多时,所有
: pattern的出现概率都接近1。

1 (共1页)
进入JobHunting版参与讨论
相关主题
facebook telephone interview from careercupGOOGLE 电面面经
amazon 一道题Is this a DP problem?
发面经,攒人品randomized quick sort的最坏情况时间复杂度
问个几道结构设计题MS sdet面经 + bloomberg电面面经
regex 用DP做对不对啊?Amazon onsite interview
谁会做>??????????????????????????????????????一道电面题
T家店面问个问题
Interview Question这个面试题怎么做比较快啊?
相关话题的讨论汇总
话题: i1话题: i993话题: 坏人话题: 1e话题: pattern