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 的大作中提到】![](/moin_static193/solenoid/img/up.png) : 【 以下文字转载自 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 的大作中提到】![](/moin_static193/solenoid/img/up.png) : 【 以下文字转载自 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 | | w******g 发帖数: 67 | 6 在网上看到的题目,还没面试呢:(
【在 l******f 的大作中提到】![](/moin_static193/solenoid/img/up.png) : 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 的大作中提到】![](/moin_static193/solenoid/img/up.png) : 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 的大作中提到】![](/moin_static193/solenoid/img/up.png) : 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 的大作中提到】![](/moin_static193/solenoid/img/up.png) : 在网上看到的题目,还没面试呢:(
| s********7 发帖数: 52 | 10 double integral abs(y-x) for x,y~U[0,1].
result is 1/3 | | | 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 的大作中提到】![](/moin_static193/solenoid/img/up.png) : 在网上看到的题目,还没面试呢:(
| w*********l 发帖数: 1337 | 12 这个很直观啊。楼上什么夹克比看的我云里雾里的。就是一个E(|X2 - X1|)
【在 s********7 的大作中提到】![](/moin_static193/solenoid/img/up.png) : 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 的大作中提到】![](/moin_static193/solenoid/img/up.png) : 在网上看到的题目,还没面试呢:(
| s****i 发帖数: 216 | 14 答案是1/3 ?
想象一个二维坐标系, 在0-1的正方形内, 每个点(x,y)分别代表两个points在直线的
长度, \int
|x-y| dxdy =1/3
What
【在 w******g 的大作中提到】![](/moin_static193/solenoid/img/up.png) : 在网上看到的题目,还没面试呢:(
| p*****k 发帖数: 318 | | M*****y 发帖数: 666 | 16 strong agree! zan
【在 D**u 的大作中提到】![](/moin_static193/solenoid/img/up.png) : 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.
|
|