Pick two points at random from the interior of a unit square, what is the expected distance between them?
My solution is as folllowing.

This integration is hard to solve. I googled it, and found the result is 1/3*ln(1+sqrt(2)) + 1/15*(2+sqrt(2)) = 0.52140543..
please see the link below.
http://mathworld.wolfram.com/SquareLinePicking.html
http://www.stat.columbia.edu/~liam/teaching/4109-fall10/chapter4.pdf
Pick two points at random from the interior of a unit square, what is the expected distance between them?的更多相关文章
- 《Focus On 3D Terrain Programming》中一段代码的注释二
取自<Focus On 3D Terrain Programming>中的一段: bool CTERRAIN::MakeTerrainFault( int iSize, int iIter ...
- LeetCode 528. Random Pick with Weight
原题链接在这里:https://leetcode.com/problems/random-pick-with-weight/ 题目: Given an array w of positive inte ...
- [LeetCode] Random Point in Non-overlapping Rectangles 非重叠矩形中的随机点
Given a list of non-overlapping axis-aligned rectangles rects, write a function pick which randomly ...
- python入门(四):字符串、编码、random
1.字符串 字符串基本有两种类型,str和bytes >>> s="a" >>> type(s) <class 'str'> ...
- day 5 模块导入、常用模块os shutil sys commands subprocess hashlib json pickle zipfile traceback random datetime
os: os.getcwd() 获取当前工作目录,即当前python脚本工作的目录路径 os.chdir("dirname") 改变当前脚本工作目录:相当于shell下cd os. ...
- Time vs Story Points Estimation [转]
One of the most common questions we get is whether to estimate in time or points. It seems like poin ...
- CodeForces 577E Points on Plane(莫队思维题)
题目描述 On a plane are nn points ( x_{i}xi , y_{i}yi ) with integer coordinates between 00 and 10^{6} ...
- 算法教程(3)zz
First off, we can use our Line-Point Distance code to test for the "BOUNDARY" case. If the ...
- (转)Let’s make a DQN 系列
Let's make a DQN 系列 Let's make a DQN: Theory September 27, 2016DQN This article is part of series Le ...
随机推荐
- INNO setup 制作安装包
1.获取SQLserver安装路径vardbpath:string;rtn:boolean;rtn := RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWA ...
- 8.2.1.13 Multi-Range Read Optimization 多个range 读优化
8.2.1.13 Multi-Range Read Optimization 多个range 读优化 读记录使用一个range scan 在一个secondary index 可以导致很多的随机磁盘访 ...
- 【转】[教程]隐藏ActionBar中的MenuItem
原文网址:http://blog.csdn.net/appte/article/details/12104823 有时候我们需要在不同的时候改变ActionBar中MenuItem的项数,或者隐藏某些 ...
- Andoid实现手动绘图
public class MainActivity extends Activity { int width,height; private GameView gameview; private Ca ...
- js原型继承深入
js采用原型继承来实现类的派生,但是原型链再深入点,我们又知道多少呢,现在不妨往下看: 先来一个原型继承: var M1 = function() { this.param = "m1's ...
- HDU_2016——数据的交换输出
Problem Description 输入n(n<100)个数,找出其中最小的数,将它与最前面的数交换后输出这些数. Input 输入数据有多组,每组占一行,每行的开始是一个整数n,表示这 ...
- openstack neutron debugs lists
- cocos2d-x 3.0 画图节点——Node
***************************************转载请注明出处:http://blog.csdn.net/lttree************************** ...
- jQuery的简单应用
时隔多日, 终于我又有时间来浏览些新知识了, 并不是偷懒什么的, 只是真的好忙, 看似闲暇的时间总是冒出一些模糊而又不得不做的事情, 今日终于我又有时间了, 可以看下jQuery了, 并根据自己的了 ...
- js中时间戳与日期转换-js日期操作
常用的一些日期操作. 用js获取一个时间戳. <script type="text/javascript"> var date = new Date();//当前时间 ...