由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Quant版 - 问道 面试题 (转载)
相关主题
若问一求导问题问两个GS面试题
[合集] 概率题求助问个题(algorithm)
一道题Is the joint-distribution of two normal R.V.s joint-normal?
expectation of brownian motion问一道面试题
[合集] 问个interview的brain tears问题面试题+1
[合集] 问个SDE 还是ODE,我也分不清楚_3道面试题问面试题
有啥好的normal distribution random variable的C代码?【Probability Problem】面试题
问一个time series的问题【Probability Problem】一道面试题
相关话题的讨论汇总
话题: beta话题: what话题: jacobian话题: line
进入Quant版参与讨论
1 (共1页)
w******g
发帖数: 67
1
【 以下文字转载自 JobHunting 讨论区 】
发信人: wyizhang (MM>美眉,MM=我的宝贝儿), 信区: JobHunting
标 题: 问道 面试题
发信站: BBS 未名空间站 (Wed Aug 18 20:54:55 2010, 美东)
Line segment between 0 and 1. Choose two points randomly on the line. What
is the average distance between them?
没有思路,谁给点提示或者参考,多谢。
n****e
发帖数: 629
2
假设期望是x
把0--1分成两部分:0--0.5--1
50%可能两点落在0.5的同一边 50%可能两点落在两边
落在一边的话 期望是x/2 落在两边的话 期望是1/2
therefore, x = 1/2*(x/2) + 1/2*(1/2)
x = 1/3

【在 w******g 的大作中提到】
: 【 以下文字转载自 JobHunting 讨论区 】
: 发信人: wyizhang (MM>美眉,MM=我的宝贝儿), 信区: JobHunting
: 标 题: 问道 面试题
: 发信站: BBS 未名空间站 (Wed Aug 18 20:54:55 2010, 美东)
: Line segment between 0 and 1. Choose two points randomly on the line. What
: is the average distance between them?
: 没有思路,谁给点提示或者参考,多谢。

f***a
发帖数: 329
3
More generic solution:
U~f(u),V~f(v), and X=U-V.
You want to find distribution of X.
Simply let Y=V.
since U,V are indedendent => f(u,v)=f(u)f(v)
=> g(x,y)=f(u(x,y),v(x,y))*|J(x,y)|, where J(x,y) is Jacobian transformation
matrix.
=> g(x)= /int g(x,y) dy
from here, you should have no problem to find the answer.
l******f
发帖数: 568
4
double integral
btw, which type of business you interviewed? IT? stat?

【在 w******g 的大作中提到】
: 【 以下文字转载自 JobHunting 讨论区 】
: 发信人: wyizhang (MM>美眉,MM=我的宝贝儿), 信区: JobHunting
: 标 题: 问道 面试题
: 发信站: BBS 未名空间站 (Wed Aug 18 20:54:55 2010, 美东)
: Line segment between 0 and 1. Choose two points randomly on the line. What
: is the average distance between them?
: 没有思路,谁给点提示或者参考,多谢。

w******g
发帖数: 67
5
多谢各位。
w******g
发帖数: 67
6
在网上看到的题目,还没面试呢:(

【在 l******f 的大作中提到】
: double integral
: btw, which type of business you interviewed? IT? stat?

s****n
发帖数: 1237
7
I know Jacobian should be right, but I couldn't get it. (haven't used this
for years :)
We know with u[0,1] for U and V, X=U-V is a triangle with centers (-1,0),(0,
1),(1,0).
However using Jocobian transformation,
U=X+Y, V=Y and |J(x,y)|=1
f(u)*f(v)=1*1.
g(x,y)=1*1 = 1, with Y=V in [0,1], we will get g(x)=1, which is not right.
What did I miss? 3ks

transformation

【在 f***a 的大作中提到】
: More generic solution:
: U~f(u),V~f(v), and X=U-V.
: You want to find distribution of X.
: Simply let Y=V.
: since U,V are indedendent => f(u,v)=f(u)f(v)
: => g(x,y)=f(u(x,y),v(x,y))*|J(x,y)|, where J(x,y) is Jacobian transformation
: matrix.
: => g(x)= /int g(x,y) dy
: from here, you should have no problem to find the answer.

f***a
发帖数: 329
8
You need include U,V regions in the density function.
f(u,v)=I(0
this
1,0),(0,
right.

【在 s****n 的大作中提到】
: I know Jacobian should be right, but I couldn't get it. (haven't used this
: for years :)
: We know with u[0,1] for U and V, X=U-V is a triangle with centers (-1,0),(0,
: 1),(1,0).
: However using Jocobian transformation,
: U=X+Y, V=Y and |J(x,y)|=1
: f(u)*f(v)=1*1.
: g(x,y)=1*1 = 1, with Y=V in [0,1], we will get g(x)=1, which is not right.
: What did I miss? 3ks
:

c******r
发帖数: 300
9
Use order statistics and the fact that uniform order stat follows beta
distribution, i.e.,
U(2) ~ Beta(2,1), U(1) ~ Beta(1,2)
E(U(2) - U(1)) = E(U(2)) - E(U(1)) = 2/3 - 1/3 = 1/3

【在 w******g 的大作中提到】
: 在网上看到的题目,还没面试呢:(
s********7
发帖数: 52
10
double integral abs(y-x) for x,y~U[0,1].
result is 1/3
相关主题
[合集] 问个SDE 还是ODE,我也分不清楚_3道面试题问两个GS面试题
有啥好的normal distribution random variable的C代码?问个题(algorithm)
问一个time series的问题Is the joint-distribution of two normal R.V.s joint-normal?
进入Quant版参与讨论
D**u
发帖数: 204
11
Connect 0 and 1 to make the line segment a circle. Let the connection be
point A, and the 2 random points be B and C.
By symmetry, the average distance between B and C is 1/3.

【在 w******g 的大作中提到】
: 在网上看到的题目,还没面试呢:(
w*********l
发帖数: 1337
12
这个很直观啊。楼上什么夹克比看的我云里雾里的。就是一个E(|X2 - X1|)

【在 s********7 的大作中提到】
: double integral abs(y-x) for x,y~U[0,1].
: result is 1/3

c*****w
发帖数: 50
13
L=|x1-x2|
Pr(L=x) ~ C*(1-x) where x is in [0,1) ==> C = 2 by normalization
==> E(L) = 1/3

【在 w******g 的大作中提到】
: 在网上看到的题目,还没面试呢:(
s****i
发帖数: 216
14
答案是1/3 ?
想象一个二维坐标系, 在0-1的正方形内, 每个点(x,y)分别代表两个points在直线的
长度, \int
|x-y| dxdy =1/3

What

【在 w******g 的大作中提到】
: 在网上看到的题目,还没面试呢:(
p*****k
发帖数: 318
M*****y
发帖数: 666
16
strong agree! zan

【在 D**u 的大作中提到】
: Connect 0 and 1 to make the line segment a circle. Let the connection be
: point A, and the 2 random points be B and C.
: By symmetry, the average distance between B and C is 1/3.

1 (共1页)
进入Quant版参与讨论
相关主题
【Probability Problem】一道面试题[合集] 问个interview的brain tears问题
面试题, make decision for two closed envelopes[合集] 问个SDE 还是ODE,我也分不清楚_3道面试题
solve an optimization model with integral as constraints (转载)有啥好的normal distribution random variable的C代码?
来问个JP Morgan的面试题问一个time series的问题
若问一求导问题问两个GS面试题
[合集] 概率题求助问个题(algorithm)
一道题Is the joint-distribution of two normal R.V.s joint-normal?
expectation of brownian motion问一道面试题
相关话题的讨论汇总
话题: beta话题: what话题: jacobian话题: line