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 ...
随机推荐
- 热爱工作 发财机会大增(这里不是选择软件还是硬件的问题,是自己的性格和追求的问题)——当你的老板不如你懂行的时候,还赚的盆满钵满的时候,你就可以考虑独立了 good
爱工作 发财机会大增 [ 油老板 ] 于:2011-02-09 06:39:41 复:1269077 认真回顾发主贴以来的三年半,俺觉得对于想发财的上班族来说,认真工作,刻苦钻研是发财的重要保证. 为 ...
- Windows打印体系结构之Print Spooler概念与架构
Windows打印体系结构之Print Spooler概念与架构Windows 思杰之路(陶菘) · 2016-09-06 22:07 房子好不好,对我而言始终都是肉体的栖居.对于灵魂,我从来不知道该 ...
- 技巧:Linux 动态库与静态库制作及使用详解
技巧:Linux 动态库与静态库制作及使用详解 标准库的三种连接方式及静态库制作与使用方法 Linux 应用开发通常要考虑三个问题,即:1)在 Linux 应用程序开发过程中遇到过标准库链接在不同 L ...
- Vim--写在开始
这是Vim的学习记录,结合Vim使用技巧一书.
- [LeetCode] 237. Delete Node in a Linked List 解题思路
Write a function to delete a node (except the tail) in a singly linked list, given only access to th ...
- Raid1源代码分析--一些补充
Raid1的源码的读.写.同步,在本系列博客中都已经分析完成.除了barrier机制要专门拿出来分析(下一篇会写)以外,有一些问题值得思考和注意,分析如下. 1.freeze_array是如何做的? ...
- SRM 600 DIV1
A 按位讨论,取最小值; B 数据范围不大,首先要确定枚举角度; 状压枚举palindromes的列比较科学; 列确定后,目标就是求获得rcnt行的最小代价: dp[i][cnt]表示扫描到第i行,已 ...
- Nginx缓存解决方案:SRCache
前些天帮别人优化PHP程序,搞得灰头土脸,最后黔驴技穷开启了FastCGI Cache,算是勉强应付过去了吧.不过FastCGI Cache不支持分布式缓存,当服务器很多的时候,冗余的浪费将非常严重, ...
- CURD
CURD是一个数据库技术中的缩写词,一般的项目开发的各种参数的基本功能都是CURD. 它代表创建(Create).更新(Update).读取(Read)和删除(Delete)操作. CURD 定义了用 ...
- c++ THUNK技术
这里想说的是:代码中的关键点为用指令jmp pFunc跳转到你想要运行的函数pFunc. 指令"jmp xxxx"占5个字节,代码中用了个一字节对齐的结构体struct Thunk ...