Random Geometric Problems on [0, 1] 2

合集下载

python蒙特卡洛方法圆周率

python蒙特卡洛方法圆周率

python蒙特卡洛方法圆周率蒙特卡洛方法是一种基于随机数的数值计算方法,它通过使用随机数来模拟实际问题,并通过大量的随机抽样来近似计算问题的解。

其中,蒙特卡洛方法计算圆周率的方法是其中的一个经典应用。

蒙特卡洛方法计算圆周率的思路是通过在一个正方形内随机生成大量的点,然后统计落在圆内的点的数量,通过计算这两个数量的比值,并乘以4,即可得到一个近似的圆周率值。

我们需要创建一个正方形,并在其中随机生成大量的点。

假设我们将正方形的边长设置为2,那么它的面积就是4。

接着,我们随机生成一些点,这些点的横坐标和纵坐标都是在-1到1之间的随机数。

然后,我们需要判断这些点是否在圆内。

根据勾股定理,如果一个点的横坐标和纵坐标的平方和小于等于1,那么这个点就在圆内。

因此,我们可以计算每个点到原点的距离,然后判断这个距离是否小于等于1。

如果小于等于1,就说明这个点在圆内,我们将计数器加1。

我们可以通过统计落在圆内的点的数量和总的点的数量的比值,再乘以4,就可以得到一个近似的圆周率值。

这是因为,圆的面积是π,而正方形的面积是4,两者的比值就是圆周率π。

为了提高计算结果的准确性,我们可以增加随机点的数量。

当随机点的数量足够大时,计算得到的圆周率值就会越接近真实值。

下面是一个使用Python实现的蒙特卡洛方法计算圆周率的示例代码:```pythonimport randomdef monte_carlo_pi(n):count = 0for _ in range(n):x = random.uniform(-1, 1)y = random.uniform(-1, 1)distance = x**2 + y**2if distance <= 1:count += 1pi = 4 * count / nreturn piif __name__ == '__main__':n = 1000000pi = monte_carlo_pi(n)print("通过蒙特卡洛方法计算得到的圆周率值是:", pi)```在上述代码中,我们使用了Python的random模块来生成随机数。

几种M-TSP问题的解法

几种M-TSP问题的解法

之差越小(定义为级差)。但是,仅仅考虑级差是不够的,因为级差的大小与各巡视组所走
路程总和(所用总时间)有关,在考虑均衡系数时,应该考虑到各巡视组所走路程总和(所
-2-

用总时间)这一因素,总路程(总时间)越大所允许的级差应该可以大一些,于是在均衡系
数的分母中引入了总路程(总时间)的均值来平衡级差与总路程的关系。可见,均衡系数越
分组 第1组 第2组 第3组
表 1 遗传—蚁群算法得到的最佳巡视路线
巡视路线
乡镇数
村数
O-1-B-34-35-32-31-33-A-R-29-Q-30-2
4
12
8-27-24-23-21-25-M-O
O-2-5-6-7-E-9-F-10-12-H-14-13-G-11-
5
11
8-4-D-3-2-O
O-P-26-N-23-22-K-17-16-I-15-18-J-19-
-4-

基于以上分析,选择个体各个TSP回路路程中的最大值作为返回值,根据其中返回值大 小分配适应度值,返回值小的适应度大。
3.遗传操作 (1)选择 选择时以个体的适应度决定选择那个个体,以转轮法选择,对于适应度大的个 体被选中的可能性也越大。 (2)交叉 按照给定的交叉率,进行交叉操作。交叉时对从种群中选择的2个个体作为母 体进行交叉操作。 (3)变异 为了保持群体的多样性,避免遗传寻优陷人局部最优,可以对种群中的个体以 给定的变异率进行变异操作。变异操作就是对选中的母体上的某个基因的值进行随机改变, 这意味着被改变的基因对应的顶点被划人到另外一个回路中,而原来回路中不再包含该顶 点。设置变异率为0.007。 上面的遗传操作将产生新的个体,为保持每一代种群中个体的规模,在完成一代操作时, 要根据适应度的大小去掉适应度小的个体。这体现了遗传算法的适者生存的思想。 在以上算法的基础上,遗传代数设为 200 代,利用 Matlab 编程实现,得到了总路程尽 可能最短且各组尽可能均衡的巡视路线如表 1 所示。在最优的个体中,寻找最佳巡视路线的 蚁群算法的寻优过程如图 2 所示

求解L0最小化问题的几种方法

求解L0最小化问题的几种方法

求解L0最小化问题的几种方法一、引言在几次课程实验中,以数独问题为例介绍了L0问题的建模和将其松弛为L1问题的方法。

实际上,L0问题在图像重建、稀疏信号恢复、特征提取、压缩感知等诸多领域应用广泛,学界对该问题的求解也进行了深入的研究。

由于L0问题是典型的组合优化问题,是非凸的,直接对其求解计算量太大。

因此现有研究集中在对L0问题进行转化,将其松弛后进行求解。

典型的松弛方法是将其转化为L1问题[1]。

文献[2]以空间建模的方式说明L1问题是对L0问题最好的凸近似。

前几次课程实验中,也均通过求解L1问题来获得L0问题的解,从而实现数独求解。

然而,使用L1问题来近似L0问题的求解仍存在一些问题:一个是L1问题与L0问题的等价性,即某些情况下L0问题近似为L1问题时二者最优解不相同;另一个存在于工程应用中,即在噪声环境下做信号恢复时,L1问题对噪声比较敏感。

特别针对数独问题,由于可以确定稀疏水平为81,这一先验条件也没能应用于优化求解中。

本文介绍了几种求解L0范数最小化问题的方法,在不同程度上能够避免或改善上述问题。

下面分别予以描述。

二、L0问题概述及其L1近似考虑系统特征为N M ⨯的矩阵A ,系统方程为=Ax b ,其中b 为输出信号,x 为输入信号。

L0问题即输入信号的0范数最小化,是一种重要的信号重建的方法。

如下所示:min ..s t =x Ax b然而,直接对该问题进行求解时NP 难的。

最典型的求解方法是考虑使用如下的L1问题进行近似:1min ..s t =x Ax bL1问题是非凸的且存在一系列的线性优化方法进行求解。

文献[2]说明,L1问题是对L0问题最好的凸近似。

因此,L1近似成为常用的L0问题求解方法。

然而,L1问题与L0的等价性要求一定的条件,典型的条件包括零空间性质(Null Space Property, NSP )和受限正交条件(Restricted Isometry Principle, RIP )等[3]。

解析数论是使用数学分析作为工具来解决数论问题的分支

解析数论是使用数学分析作为工具来解决数论问题的分支

解析数论是使用数学分析作为工具来解决数论问题的分支。

微积分和复变函数论发展以后,产生了解析数论。

该学科的第一个主要成就是狄利克雷用解析方法证明了Dirichlet's theorem on arithmetic progressions。

依靠黎曼zeta函数对素数定理的证明是另一个里程碑。

解析数论是解决数论中艰深问题的重要工具,数论中有些问题必须由解析方法才能提出或解决。

中国的华罗庚、王元、陈景润等人在“哥德巴赫猜想”、“华林问题”等解析数论问题上取得世界公认的成就。

黎曼ζ函数Riemann zeta functionIn mathematics, the Riemann zeta function, named after German mathematician Bernhard Riemann, is a function of great significance in number theory because of its relation to the distribution of prime numbers. It also has applications in other areas such as physics, probability theory, and applied statistics. The Riemann hypothesis, a conjecture about the distribution of the zeros of the Riemann zeta function, is considered by many mathematicians to be the most important unsolved problem in pure mathematics.[1]DefinitionThe Riemann zeta-function ζ(s) is the function of a complex variable s initially defined by the following infinite series:As a Dirichlet series with bounded coefficient sequence this series converges absolutely to an analytic function on the open half-plane of s such that Re(s) > 1 and diverges on the open half-plane of s such that Re(s) < 1. The function defined by the series on the half-plane of convergence can however be continued analytically to all complex s≠ 1. For s= 1 the series is formally identical to the harmonic series which diverges to infinity. As a result, the zeta function becomes a meromorphic function of the complex variable s, which is holomorphic in the region {s∈ C : s≠1} of the complex plane and has a simple pole at s= 1 with residue 1.Specific valuesThe values of the zeta function obtained from integral arguments are called zeta constants. The following are the most commonly used values of the Riemann zeta function.this is the harmonic series.this is employed in calculating the critical temperature for a Bose–Einstein condensate in physics, and for spin-wave physics in magnetic systems.the demonstration of this equality is known as the Basel problem. The reciprocal of this sum answers the question: What is the probability that two numbers selected at random are relatively prime? [2]this is called Apéry's constant.Stefan–Boltzmann law and Wien approximation in physics.Euler product formulaThe connection between the zeta function and prime numbers was discovered by Leonhard Euler, who proved the identitywhere, by definition, the left hand side is ζ(s) and the infinite product on the right hand side extends over all prime numbers p (such expressions are called Euler products):Both sides of the Euler product formula converge for Re(s) > 1. The proof of Euler's identity uses only the formula for the geometric series and the fundamental theorem of arithmetic. Since the harmonic series, obtained when s= 1, diverges, Euler's formula implies that there are infinitely many primes. For s an integer number, the Euler product formula can be used to calculate the probability that s randomly selected integers are relatively prime. It turns out that this probability is indeed 1/ζ(s). The functional equationThe Riemann zeta function satisfies the functional equationvalid for all complex numbers s, which relates its values at points s and 1 −s. Here, Γ denotes the gamma function. This functional equation was established by Riemann in his 1859 paper On the Number of Primes Less Than a Given Magnitude and used to construct the analytic continuation in the first place. An equivalent relationship was conjectured by Euler in 1749 for the functionAccording to André Weil, Riemann seems to have been very familiar with Euler's work on the subject.[3]The functional equation given by Riemann has to be interpreted analytically if any factors in the equation have a zero or pole. For instance, when s is 2, the right side has a simple zero in the sine factor and a simple pole in the Gamma factor, which cancel out and leave a nonzero finite value. Similarly, when s is 0, the right side has a simple zero in the sine factor and a simple pole in the zeta factor, which cancel out and leave a finite nonzero value. When s is 1, the right side has a simple pole in the Gamma factor that is not cancelled out by a zero in any other factor, which is consistent with the zeta-function on the left having a simple pole at 1.There is also a symmetric version of the functional equation, given by first definingThe functional equation is then given by(Riemann defined a similar but different function which he called ξ(t).)The functional equation also gives the asymptotic limit(GergőNemes, 2007)Zeros, the critical line, and the Riemann hypothesisThe functional equation shows that the Riemann zeta function has zeros at −2, −4, ... . These are called the trivial zeros. They are trivial in the sense that their existence is relatively easy to prove, for example, from sin(πs/2) being 0 in the functional equation. The non-trivial zeros have captured far more attention because their distribution not only is far less understood but, more importantly, their study yields impressive results concerning prime numbers and related objects in number theory. It is known that any non-trivial zero lies in the open strip {s∈ C: 0 < Re(s) < 1}, which is called the critical strip. The Riemann hypothesis, considered to be one of the greatest unsolved problems in mathematics, asserts that any non-trivial zero s has Re(s) = 1/2. In the theory of the Riemann zeta function, the set{s∈ C: Re(s) = 1/2} is called the critical line. For the Riemann zeta function on the critical line, see Z-function.The location of the Riemann zeta function's zeros is of great importance in the theory of numbers. From the fact that allnon-trivial zeros lie in the critical strip one can deduce the prime number theorem. A better result[4]is that ζ(σ+ i t) ≠ 0 whenever |t| ≥ 3 andThe strongest result of this kind one can hope for is the truth of the Riemann hypothesis, which would have many profound consequences in the theory of numbers.It is known that there are infinitely many zeros on the critical line. Littlewood showed that if the sequence (γn) contains the imaginary parts of all zeros in the upper half-plane in ascending order, thenThe critical line theorem asserts that a positive percentage of the nontrivial zeros lies on the critical line.In the critical strip, the zero with smallest non-negative imaginary part is 1/2 + i14.13472514... Directly from the functional equation one sees that the non-trivial zeros are symmetric about the axis Re(s) = 1/2. Furthermore, the fact that ζ(s) = ζ(s*)* for all complex s≠1 (* indicating complex conjugation) implies that the zeros of the Riemann zeta function are symmetric about the real axis.The statistics of the Riemann zeta zeros are a topic of interest to mathematicians because of their connection to big problems like the Riemann hypothesis, distribution of prime numbers, etc. Through connections with random matrix theory and quantum chaos, the appeal is even broader. The fractal structure of the Riemann zeta zero distribution has been studied using rescaled range analysis.[5] The self-similarity of the zero distribution is quite remarkable, and is characterized by a large fractal dimension of 1.9. This rather large fractal dimension is found over zeros covering at least fifteen orders of magnitude, and also for the zeros of other L-functions.The properties of the Riemann zeta function in the complex plane, specifically along parallels to the imaginary axis, has also been studied, by the relation to prime numbers, in recentphysical interference experiments, by decomposing the sum into two parts with opposite phases, ψ and ψ*, which then are brought to interference. [6]For sums involving the zeta-function at integer and half-integer values, see rational zeta series.[O] ReciprocalThe reciprocal of the zeta function may be expressed as a Dirichlet series over the Möbius functionμ(n):for every complex number s with real part > 1. There are a number of similar relations involving various well-known multiplicative functions; these are given in the article on the Dirichlet series.The Riemann hypothesis is equivalent to the claim that this expression is valid when the real part of s is greater than 1/2. [O] UniversalityThe critical strip of the Riemann zeta function has the remarkable property of universality. This zeta-function universality states that there exists some location on the critical strip that approximates any holomorphic function arbitrarily well. Since holomorphic functions are very general, this property is quite remarkable.[O] Representations[O] Mellin transformThe Mellin transform of a function f(x) is defined asin the region where the integral is defined. There are various expressions for the zeta-function as a Mellin transform. If the real part of s is greater than one, we havewhere Γ denotes the Gamma function. By subtracting off the first terms of the power series expansion of 1/(exp(x) −1) around zero, we can get the zeta-function in other regions. In particular, in the critical strip we haveand when the real part of s is between −1 and 0,We can also find expressions which relate to prime numbers and the prime number theorem. If π(x) is the prime-counting function, thenfor values with We can relate this to the Mellin transform of π(x) bywhereconverges forA similar Mellin transform involves the Riemann prime-counting function J(x), which counts prime powers p n with a weight of 1/n,so that Now we haveThese expressions can be used to prove the prime number theorem by means of the inverse Mellin transform. Riemann's prime-counting function is easier to work with, and π(x) can be recovered from it by Möbius inversion.Also, from the above (specifically, the second equation in this section), we can write the zeta function in the commonly seen form:[O] Laurent seriesThe Riemann zeta function is meromorphic with a single pole of order one at s= 1. It can therefore be expanded as a Laurent series about s= 1; the series development then isThe constants γn here are called the Stieltjes constants and can be defined by the limitThe constant term γ0 is the Euler-Mascheroni constant.[O] Rising factorialAnother series development valid for the entire complex plane iswhere is the rising factorial This can be used recursively to extend the Dirichlet series definition to all complex numbers.The Riemann zeta function also appears in a form similar to the Mellin transform in an integral over the Gauss-Kuzmin-Wirsing operator acting on x s−1; that context gives rise to a series expansion in terms of the falling factorial.[O] Hadamard productOn the basis of Weierstrass's factorization theorem, Hadamard gave the infinite product expansionwhere the product is over the non-trivial zeros ρ of ζ and the letter γ again denotes the Euler-Mascheroni constant. A simpler infinite product expansion isThis form clearly displays the simple pole at s = 1, the trivial zeros at −2, −4, ... due to the gamma function term in the denominator, and the non-trivial zeros at s = ρ.[O] Globally convergent seriesA globally convergent series for the zeta function, valid for all complex numbers s except s = 1, was conjectured by Konrad Knopp and proved by Helmut Hasse in 1930:The series only appeared in an Appendix to Hasse's paper, and did not become generally known until it was rediscovered more than 60 years later (see Sondow, 1994).Peter Borwein has shown a very rapidly convergent series suitable for high precision numerical calculations. The algorithm, making use of Chebyshev polynomials, is described in the article on the Dirichlet eta function.[O] ApplicationsAlthough mathematicians regard the Riemann zeta function as being primarily relevant to the "purest" of mathematical disciplines, number theory, it also occurs in applied statistics (see Zipf's law and Zipf-Mandelbrot law), physics, and the mathematical theory of musical tuning.During several physics-related calculations, one must evaluate the sum of the positive integers; paradoxically, on physical grounds one expects a finite answer. When this situation arises, there is typically a rigorous approach involving much in-depth analysis, as well as a "short-cut" solution relying on the Riemann zeta-function. The argument goes as follows: we wish to evaluate the sum 1 + 2 + 3 + 4 + · · ·, but we can rewrite it as a sum of reciprocals:The sum S appears to take the form of However, −1 lies outside of the domain for which the Dirichlet series for thezeta-function converges. However, a divergent series of positive terms such as this one can sometimes be represented in a reasonable way by the method of Ramanujan summation (see Hardy, Divergent Series.) Ramanujan summation involves an application of the Euler–Maclaurin summation formula, and when applied to the zeta-function, it extends its definition to the whole complex plane. In particularwhere the notation indicates Ramanujan summation.[7]For even powers we have:and for odd powers we have a relation with the Bernoulli numbers:Zeta function regularization is used as one possible means of regularization of divergent series in quantum field theory. In one notable example, the Riemann zeta-function shows up explicitly in the calculation of the Casimir effect.[O] GeneralizationsThere are a number of related zeta functions that can be considered to be generalizations of Riemann's zeta-function. These include the Hurwitz zeta functionwhich coincides with Riemann's zeta-function when q = 1 (note that the lower limit of summation in the Hurwitz zeta function is 0, not 1), the Dirichlet L-functions and the Dedekind zeta-function. For other related functions see the articles Zeta function andL-function.The polylogarithm is given bywhich coincides with Riemann's zeta-function when z = 1.The Lerch transcendent is given bywhich coincides with Riemann's zeta-function when z = 1 and q = 1 (note that the lower limit of summation in the Lerch transcendent is 0, not 1).The Clausen function that can be chosen as the real orimaginary part ofThe multiple zeta functions are defined byOne can analytically continue these functions to then-dimensional complex space. The special values of these functions are called multiple zeta values by number theorists and have been connected to many different branches in mathematics and physics.[O] Zeta-functions in fiction。

nx.random_geometric_graph的用法

nx.random_geometric_graph的用法

nx.random_geometric_graph的用法一、概述nx.random_geometric_graph 是 NetworkX 的一种生成随机图的函数,主要基于平面上点的几何距离来连接节点,也称为基于几何距离的随机图生成器。

其生成的随机图常被用于测试网络算法和进行实验。

二、函数定义```python nx.random_geometric_graph(n, radius, dim=2, pos=None, p=2, periodic=False, seed=None)```参数:- n :图中节点的数量 - radius :表示点之间的最大距离。

- dim :表示空间的大小,例如dim=2表示空间为二维平面。

- pos :表示节点的位置,默认随机生成。

- p :好像是一个距离指数,决定边的形成情况,当p → ∞ 时,该随机图趋近于完全图,反之则趋近于星形图。

- periodic :表示是否使用周期性边界。

- seed :为随机数生成器设置一个种子。

返回值:生成一个随机图。

三、基本用法1.用法一:简单使用只需要指定节点的数量、半径以及维数即可得到这个随机图。

```python import networkx as nxn = 50 radius = 0.2 G =nx.random_geometric_graph(n, radius) ```2.用法二:搭配pos参数使用pos 表示节点的位置,可以指定节点在二维平面上分布的位置。

可以利用 numpy 库生成一些二维坐标作为参数传递,这种情况下我们不需要再指定维数和半径。

下面是一个例子:```python import numpy as np import matplotlib.pyplot as pltpos = np.random.rand(n, 2) # 在二维平面中随机生成n个坐标 G = nx.random_geometric_graph(n,pos=pos) nx.draw(G, pos, node_size=20,node_color='blue') plt.show() ```我们可以发现,节点在正方形的边界内随机分布,没有直接相连的节点。

概率论与数理统计(英文) 第三章

概率论与数理统计(英文) 第三章

3. Random Variables3.1 Definition of Random VariablesIn engineering or scientific problems, we are not only interested in the probability of events, but also interested in some variables depending on sample points. (定义在样本点上的变量)For example, we maybe interested in the life of bulbs produced by a certain company, or the weight of cows in a certain farm, etc. These ideas lead to the definition of random variables.1. random variable definitionHere are some examples.Example 3.1.1 A fair die is tossed. The number X shown is a random variable, it takes values in the set {1,2,6}. Example 3.1.2The life t of a bulb selected at random from bulbs produced by company A is a random variable, it takes values in the interval (0,) .Since the outcomes of a random experiment can not be predicted in advance, the exact value of a random variable can not be predicted before the experiment, we can only discuss the probability that it takes somevalue or the values in some subset of R.2. Distribution functionNote The distribution function ()F X is defined on real numbers, not on sample space.Example 3.1.3 Let X be the number weget from tossing a fair die. Then the distribution function of X is (Figure 3.1.1)0,1;(),1,1,2,,5;61, 6.if x n F x if n x n n if x <⎧⎪⎪=≤<+=⎨⎪≥⎪⎩Figure 3.1.1 The distribution function in Example 3.1.3 3. PropertiesThe distribution function ()F x of a random variable X has the following properties :SolutionBy definition,1(2000)(2000)10.6321P X F e -≤==-=.(10003000)(3000)(1000)P X P X P X <≤=≤-≤1.50.5(3000)(1000)(1)(1)0.3834F F e e --=-=---= Question : What are the probabilities (2000)P X < and (2000)P X =? SolutionLet 1X be the total number shown, then the events 1{}X k = contains1k - sample points, 2,3,4,5k =. Thus11()36k P X k -==, 2,3,4,5k = And 512{1}{}k X X k ==-==so525(1)()18k P X P X k ==-===∑ 13(1)1(1)18P X P X ==-=-=Thus0,1;5()(),11;181, 1.x F x P Xx x x <-⎧⎪⎪=≤=-≤<⎨⎪≥⎪⎩Figure 3.1.2 The distribution function in Example 3.1.53.2 Discrete Random Variables 离散型随机变量In this book, we study two kinds of random variables.Assume a discrete random variable X takes values from the set 12{,,,}n X a a a = . Let()n n P X a p ==,1,2,.n = (3.2.1) Then we have 0n p ≥, 1,2,,n = 1n n p=∑.the probability distribution of the discrete random variable X (概率分布)注意随机变量X 的分布所满足的条件(1) P i ≥0(2) P 1+P 2+…+P n =1离散型分布函数And the distribution function of X is given by()()n n a x F x P X x p ≤=≤=∑ (3.2.2)Solutionn=3, p=1/2X p r01/813/823/831/8two-point distribution(两点分布)某学生参加考试得5分的概率是p, X表示他首次得5分的考试次数,求X的分布。

python蒙特卡洛模拟计算圆周率可视化

1.介绍近年来,蒙特卡洛模拟成为计算机科学领域中一种常用的数值计算方法。

其原理是利用随机抽样的方法来进行数值计算,适用于许多领域,如统计学、物理学、金融学等。

其中,利用蒙特卡洛模拟计算圆周率是一个经典的案例,通过可视化的方式展示其计算过程,能够帮助人们更直观地理解这一方法的原理和应用。

2.蒙特卡洛模拟的原理1) 蒙特卡洛模拟是一种基于随机抽样的数值计算方法,其基本原理是根据概率统计的规律,通过大量的随机抽样来近似计算目标值。

在计算圆周率的例子中,可以通过在一个正方形内随机撒点,并统计落在圆内的点的比例来近似计算圆的面积,从而得到圆周率的近似值。

2) 蒙特卡洛模拟的核心思想是利用随机性来解决复杂的数值计算问题,通过大量的实验来获取目标值的概率分布和数值近似值,不需要从数学上精确求解,适用于复杂的、难以解析的问题。

3. Python 实现蒙特卡洛模拟计算圆周率1) Python 是一种简单易学、功能强大的编程语言,对于实现蒙特卡洛模拟具有良好的适用性。

它提供了丰富的数值计算、数据分析和可视化工具,能够方便地进行蒙特卡洛模拟的实现和可视化展示。

2) 利用 Python 实现蒙特卡洛模拟计算圆周率的过程如下:a. 创建一个正方形,并在正方形内随机生成大量的点,这可以通过 random 模块来实现。

b. 统计落在圆内的点的数量,以及总共生成的点的数量。

c. 根据统计得到的比例,即圆内点的数量与总生成点的数量之比,来近似计算圆的面积。

d. 根据圆的面积与半径的关系,计算得到圆周率的近似值。

3) 对于以上过程,可以使用 Python 的 matplotlib 库来进行可视化展示,将生成的点以不同颜色标记在正方形内,并将落在圆内的点用特殊颜色标注,以直观展示蒙特卡洛模拟的计算过程。

4. 可视化展示利用 Python 实现蒙特卡洛模拟计算圆周率的可视化展示效果如下图所示。

(此处插入一张利用 Python 可视化展示蒙特卡洛模拟计算圆周率的图像)5. 结论通过以上的可视化展示,我们可以清晰地看到蒙特卡洛模拟的计算过程:在正方形内随机生成大量点,并以圆为边界进行抽样,通过统计计算可得到圆的面积,从而近似计算出圆周率。

高级计量经济学习题及解答4

1≤i≤n
find this? ) is n−1 nx f (x|θ) = θn 0 0<x<θ otherwise .
Calculate the mean and variance of the mle. Compare the variance, the bias, and the mean squared error to those of the method of moments estimate. (c) Find a modification of the mle that renders it unbiased. 2
argument as in (a), we have E[Y ] = ρ(n − 1)E[s2 ] = ρ(n − 1)σ 2 , and Var[Y ] = (ρ(n − 1)) Var[s2 ] = ρ2 (n − 1)2 Thus MSE(Y ) = Var[Y ] + b(Y )2 = 2ρ2 (n − 1)σ 4 + ρ(n − 1)σ 2 − σ 2 = σ 4 [2ρ2 (n − 1) + (ρn − ρ − 1)2 ] ≡ f (ρ). Since f (ρ) = σ 4 [4ρ(n − 1) + 2(ρn − ρ − 1)(n − 1)] = σ 4 [4ρ + 2(ρn − ρ − 1)](n − 1) = 2(n − 1)σ 4 (ρn + ρ − 1), and f (ρ) = 2(n − 1)(n + 1)σ 4 > 0, 1 we see that f (ρ) achieve its minimum at ρ = . (f (n + 1)−1 = n+1 0.)
n i=1 (Xi

MATLAB概率统计函数(1)

MATLAB概率统计函数(1)第4章概率统计本章介绍MATLAB在概率统计中的若⼲命令和使⽤格式,这些命令存放于MatlabR12\Toolbox\Stats中。

4.1 随机数的产⽣4.1.1 ⼆项分布的随机数据的产⽣命令参数为N,P的⼆项随机数据函数 binornd格式 R = binornd(N,P) %N、P为⼆项分布的两个参数,返回服从参数为N、P的⼆项分布的随机数,N、P⼤⼩相同。

R = binornd(N,P,m) %m指定随机数的个数,与R同维数。

R = binornd(N,P,m,n) %m,n分别表⽰R的⾏数和列数例4-1>> R=binornd(10,0.5)R =3>> R=binornd(10,0.5,1,6)R =8 1 3 7 6 4>> R=binornd(10,0.5,[1,10])R =6 8 4 67 5 3 5 6 2>> R=binornd(10,0.5,[2,3])R =7 5 86 5 6>>n = 10:10:60;>>r1 = binornd(n,1./n)r1 =2 1 0 1 1 2>>r2 = binornd(n,1./n,[1 6])r2 =0 1 2 1 3 14.1.2 正态分布的随机数据的产⽣命令参数为µ、σ的正态分布的随机数据函数 normrnd格式 R = normrnd(MU,SIGMA) %返回均值为MU,标准差为SIGMA的正态分布的随机数据,R可以是向量或矩阵。

R = normrnd(MU,SIGMA,m) %m指定随机数的个数,与R同维数。

R = normrnd(MU,SIGMA,m,n) %m,n分别表⽰R的⾏数和列数例4-2>>n1 = normrnd(1:6,1./(1:6))n1 =2.1650 2.31343.02504.0879 4.8607 6.2827>>n2 = normrnd(0,1,[1 5])n2 =0.0591 1.7971 0.2641 0.8717 -1.4462>>n3 = normrnd([1 2 3;4 5 6],0.1,2,3) %mu为均值矩阵n3 =0.9299 1.9361 2.96404.12465.0577 5.9864>> R=normrnd(10,0.5,[2,3]) %mu为10,sigma为0.5的2⾏3列个正态随机数R =9.7837 10.0627 9.42689.1672 10.1438 10.59554.1.3 常见分布的随机数产⽣常见分布的随机数的使⽤格式与上⾯相同表4-1 随机数产⽣函数表函数名调⽤形式注释Unifrnd unifrnd ( A,B,m,n)[A,B]上均匀分布(连续) 随机数Unidrnd unidrnd(N,m,n)均匀分布(离散)随机数Exprnd exprnd(Lambda,m,n)参数为Lambda的指数分布随机数Normrnd normrnd(MU,SIGMA,m,n)参数为MU,SIGMA的正态分布随机数chi2rnd chi2rnd(N,m,n)⾃由度为N的卡⽅分布随机数Trnd trnd(N,m,n)⾃由度为N的t分布随机数Frnd frnd(N1, N2,m,n)第⼀⾃由度为N1,第⼆⾃由度为N2的F分布随机数gamrnd gamrnd(A, B,m,n)参数为A, B的分布随机数betarnd betarnd(A, B,m,n)参数为A, B的分布随机数lognrnd lognrnd(MU, SIGMA,m,n)参数为MU, SIGMA的对数正态分布随机数nbinrnd nbinrnd(R, P,m,n)参数为R,P的负⼆项式分布随机数ncfrnd ncfrnd(N1, N2, delta,m,n)参数为N1,N2,delta的⾮中⼼F分布随机数nctrnd nctrnd(N, delta,m,n)参数为N,delta的⾮中⼼t分布随机数ncx2rnd ncx2rnd(N, delta,m,n)参数为N,delta的⾮中⼼卡⽅分布随机数raylrnd raylrnd(B,m,n)参数为B的瑞利分布随机数weibrnd weibrnd(A, B,m,n)参数为A, B的韦伯分布随机数binornd binornd(N,P,m,n)参数为N, p的⼆项分布随机数geornd geornd(P,m,n)参数为 p的⼏何分布随机数hygernd hygernd(M,K,N,m,n)参数为 M,K,N的超⼏何分布随机数Poissrnd poissrnd(Lambda,m,n)参数为Lambda的泊松分布随机数4.1.4 通⽤函数求各分布的随机数据命令求指定分布的随机数函数 random格式 y = random('name',A1,A2,A3,m,n) %name的取值见表4-2;A1,A2,A3为分布的参数;m,n指定随机数的⾏和列例4-3 产⽣12(3⾏4列)个均值为2,标准差为0.3的正态分布随机数>> y=random('norm',2,0.3,3,4)y =2.3567 2.0524 1.8235 2.03421.9887 1.94402.6550 2.32002.0982 2.2177 1.9591 2.01784.2 随机变量的概率密度计算4.2.1 通⽤函数计算概率密度函数值命令通⽤函数计算概率密度函数值函数 pdf格式 Y=pdf(name,K,A)Y=pdf(name,K,A,B)Y=pdf(name,K,A,B,C)说明返回在X=K处、参数为A、B、C的概率密度值,对于不同的分布,参数个数是不同;name为分布函数名,其取值如表4-2。

几何分布的几个性质

几何分布的几个性质何朝兵;袁德强【摘要】证明了几何分布的顺序统计量的一些性质,有的性质与指数分布相对应的性质有区别但又相似。

%This paper obtains and proves some properties of order statistics of geometric distribution, certain properties are different from and also similar to corresponding properties of exponential distribution.【期刊名称】《海南师范大学学报(自然科学版)》【年(卷),期】2012(025)001【总页数】4页(P20-23)【关键词】几何分布;顺序统计量;性质;指数分布性【作者】何朝兵;袁德强【作者单位】安阳师范学院数学与统计学院,河南安阳455000;安阳师范学院数学与统计学院,河南安阳455000【正文语种】中文【中图分类】O211.3;O212.2几何分布已经应用到越来越多的领域中,特别是在信息工程,电子工程,控制论以及经济学等领域中都占有极其重要的地位.Ferguson[1]在1067年首次提出用顺序统计量来刻划几何分布的特征,文献[2-11]对此又作了进一步的分析研究.指数分布在可靠性统计推断中有着十分重要的地位,具有许多重要性质[12-15].虽然几何分布和指数分布都具有“无记忆性”,但由于它们的个性差异,导致两者差别很大.本文给出并证明了几何分布的顺序统计量的一些性质,有的性质与指数分布有区别但又相似.定义1 如果随机变量X的分布律为P(X =k)=pqk-1,k=1,2,3,…;0<p<1,q=1-p,则称X服从参数为p的几何分布,记为X~Geo(p).一般教材给出的顺序统计量的定义,对研究连续型分布很方便,但对研究离散型却很麻烦,所以下面针对离散型随机变量,给出其顺序统计量的定义.定义2 设X1,X2,…,Xn独立同分布于一离散型分布.把X1,X2,…,Xn的取值按从小到大排列,取值相同的归为一组,第i(1 ≤i≤n )组的取值记为X(i),称 X(i)为X1,X2,…,Xn的第i个顺序统计量.假设X1,X2,…,Xn独立同分布于几何分布Geo(p).X1,X2,…,Xn中取值 X(i)的个数记为Yi,令Di=X(i)-X(i -1),i=1,2,…,n,约定X(0)=0.在对产品进行寿命分析时,与指数分布相比,几何分布没有定数截尾寿命试验,相对应的应该是定组截尾寿命试验,即当观察到r组不同的失效数据时停止试验.为了准确起见,我们称之为定组截尾寿命试验.本文证明如下几个命题:命题1 在Y1=m1,…,Yr=mr的条件下,D1,D2,…,Dr相互独立,且命题2 X(1)与(Y 1,Y2,…,Yr)相互独立.命题3 设产品的寿命分布是几何分布Geo(p),设有n个产品投入定组截尾试验,截尾数为r,得定组截尾失效数据1≤k1<k2<…<kr,其中有mi个失效数据取ki,则p的极大似然估计(MLE)为 p=,其中命题4 设产品的寿命分布是几何分布Geo(p),设有n个产品投入定时截尾试验,截尾数为t0(t0为正整数),得定时截尾失效数据1≤k1<k2<…<kr≤t0,其中有mi个失效数据取ki,则p的极大似然估计(MLE)为,其中命题3和命题4所描述的几何分布的性质与指数分布是一样的.【相关文献】[1]曹晋华,程侃.可靠性数学引论[M].北京:高等教育出版社,2006:365-405.[2]Ferguson T S.On characterizing distributions by properties of orderstatistics[J].Sankhya,A,1967,29(2):265-278.[3]Ferguson T S.Acharacterization of the geometricdistribu⁃tion[J].Amer.Math.Mothly,1972,27(2):256-260.[4]Arnold B C.Two characterizations of geometric distribu⁃tion[J].ApplProb,1980,17(3):570-573.[5]Best D J,Rayner J C W.Test of fit for the geometric distri⁃bution[J].Communication in Statistics Theory and Meth⁃ods,2003,32(5):913-928.[6]Balakrislnan N,Balasubramanian K.Acharacterization of geometric distribution based on record walues[J].Journal of Applied Statistical Science,1995,(2):277-282.[7]Oncel Sevgi Yurt,Absanullah,Mohammad,et al.On char⁃acterization of geometric distribution through normal and weak record values[J].Stochastic Modeling andApplica⁃tion,2001,(1):53-58.[8]Dodunekova R.Characterization of Geometric and Expo⁃nential RandomVariables[J].Communications in Statis⁃tics Theory and Methods,2004,33(8):1755-1765.[9]徐晓岭,王蓉华,费鹤良.几何分布的统计特征[J].数学年刊A辑(中文版),1998,19(2):155-164.[10]毛用才.基于顺序统计量的几何分布特征的进一步结果[J].纯粹数学与应用数学,1995,11(2):115-119.[11]徐晓岭,费鹤良,王蓉华.几何分布的两个统计特征[J].应用概率统计,2006,22(1):10-20.[12]Lau K S,et al.Characterization of the exponential distri⁃bution by the relevation transform[J].Appl Prob,1990,27(3):726-729.[13]Lawrence M L.Probabilistic properties of exponentialdis⁃tribution[J].Microelectron.Reliab,1988,28(2):257-262.[14]Chen Z M,Mie J.Confidence Interval for the Mean of the Exponential Distribution Based on Grouped Data[J].IEEE Transactions on Reliability,1996,45(3):671-677.[15]Fei H,Kong F.Interval estimations for one-and two-pa⁃rameter exponential distributions under multiple type-II censoring[J].Comm Statist Theory andMethod,1994,23(9):1717-1733.。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

Random Geometric Problems on[0,1]2∗Josep D´ıaz Jordi Petit Mar´ıa SernaDepartament de Llenguatges i Sistemes Inform`a ticsUniversitat Polit`e cnica CatalunyaCampus Nord C6Jordi Girona Salgado1-308034Barcelona,Spain.{diaz,jpetit,mjserna}@lsi.upc.esAbstractIn this paper we survey the work done for graphs on random geometric models.We present some heuristics for the problem of the Minimal Linear Arrangement on[0,1]2and we conclude with a collection of open problems.1IntroductionThe probabilistic method has become a powerful tool in combinatorics.A particularfruitful application of the probabilistic method has been the study of graph invariants forrandom graphs(chromatic number,independence number,etc.).Thefield started in1959with a paper by Erd¨o s and R´e nyi[12].In the last two decades,the techniques developedin the probabilistic method have been used in the design and analysis of algorithms.Therehave been two models of random graphs:Given n∈N and0≤p≤1,define G n,p as theprobability space over the set of graphs on vertex set V=[n]={1,...,n},and such that any two vertices i,j∈V form an edge with probability p.For the second model,givenn,m∈N,let G n,m be the probability space of the graphs with vertex set V=[n]andedge set E m,a random subset of m edges from all possible edges in the complete graph onn vertices.In general G n,m will behave similarly to G n,p as p∼m/ n2 .Recall that f∼g denotes that f/g→1as the variables tend to infinity.Erd¨o s and R´e nyi[11]consideredthe G n,m model to study the threshold for several questions related to the connectivity ofgraphs.To study the evolution of graphs,they start with the empty graph on n verticesand add edges randomly one by one until having the m edges.Their main result is thatwith high probability a graph becomes connected when m≥n log n/2+O(n).Recallthat a sequence of events{E n}occurs with high probability(whp)if Pr[E n]→1as n→∞. Therefore,for a threshold of p=o(log n/n),whp the graphs G n,p will be connected.Good sources for random graphs are[7,14]and chapter10of[1].See[19]for the“adaptation”of the probabilistic method to the design of algorithms.In this paper we will consider geometric models of random graphs.Geometric ran-dom graphs are defined on the unit cube[0,1]d,d≥2by randomly choosing a sequenceX={X n}of independent and uniformly distributed points on[0,1]d.We can consider two main models:the Euclidian model,considering the weighted complete graph on X wherethe weight of an edge is its Euclidian distance(see section2),and the random geometricmodel G n(r),where the existence of edges depends on a parameter0<r<1that couldbe a function of n(see section3).There is another model of geometric graph,called theindependent model,where the distances are independent and identically distributed(i.i.d.)random variables from the uniform distribution on[0,1]and neither symmetry nor triangleinequality are assumed.This model,introduced in[16],is a difficult model to work with and we shall not enter into it(see for example[4]and[32,chapter2]for an interesting discussion on the independent model).Before going further,let us review some basic definitions from probability theory.Recall than given a sequence of random variables{X n}and a random variable X,we say that X n→X converges in probability if∀ǫ>0,Pr[|X n−X|>ǫ]→0as n→∞.We say that X n→X converges almost surely(a.s.)if Pr[lim sup X n=X=lim inf X n]→1as n→∞.This type of convergence is also called convergence with probability1. Convergence a.s.is quite a strong statement,but it is an asymptotic condition,it says nothing aboutfinite n.Convergence a.s.implies convergence in probability but not the converse.A sufficient condition for convergence a.s.is the Borel-Cantelli theorem.(For good treatments of stochastic convergence see,for example[32,chapter1]or[8,chapter4]).There are two different ways to get a set of uniform i.i.d.points on the unit square [0,1]d(they could be easily extended to the d-dimensional case):1.The vertices are random variables X i i.i.d.from the uniform distribution on[0,1]2.e a two-dimensional point Poisson process with intensity n on R2and keep thepoints that fall in the unit square.Recall that a two-dimensional point Poisson process with intensityλis a process of eventsin the plane such that(i)for any region of area A,the number of events in A is Pois-son distributed with meanµ=λA,and(ii)the events in nonoverlapping regions areindependent.2The BHH TheoremOne of the seminal papers in the area of probabilistic analysis of combinatorial optimiza-tion problems in the Euclidian d-dimensional unit cube[0,1]d,Beardwood,Halton andHammersley proved the following result[6],Theorem1.Let X={X i}be a sequence of independent and uniformly distributed points in[0,1]d.Let L n denote the length of the optimal solution of the traveling salesman tour (TSP)among X.Then there exists a constant0<β(d)<∞such thatL n→β(d)a.s.as n→∞.(1)dIt is still an open problem to obtain the exact value of the constants for specificdimensions.Beardwood,Halton and Hammersley gave upper and lower bounds for certain2√particular d,for instance for d=2they prove:0.44194≤β(2)/.k!From this formula it is possible to derive asymptotics for a k.Notice that the fact that all a k are bounded shows that Z is a continuous function of t.The key step in the proof,is a dissection technique of[0,1]2that will give a geometric subadditivity expression for L.Given any m∈N and t∈R,t≥0,let{Q i},1≤i≤m2,3be a partition of[0,t]2into squares of edge length t/m.We can select one point from each subsquare Q i,and compute a shortest TSP tour on this set of points.Once we have this tour we can complete the tour gluing at each point of the tour,the optimal subtour of the corresponding square.Therefore the additional cost of the gluing process can be bound with the bound on L m2times the scaling factor,so there is a constant C such that,L({x1,...,x n}∩[0,t]2)≤m2i=1L({x1,...,x n}∩Q i)+Ctm,(4)From equation(4)we get the recursion,E[Z(t)]≤m2E[Z(t/m)]+ing standard algebraic techniques,together with a change of variables it is shown that there is a constant γsuch that∞k=0a k e−t t k/k!∼γt1/2.(5)To de-Poissonize it is needed a relation between the a n values and the E[L n]for a Poisson random variable with mean n.The key fact is that the a k values do not change rapidly. Notice that it takes an additional cost of2√n). Putting all together and transferring the result to the discrete problem,5E[L n]/n1/2→γas n→∞.(6) But notice that equation(5)gives the existence ofβin the statement of the BHH-theorem, equation(3)gives the0<β(d)<∞condition and equation(3)gives the a.s.limit.3Other Work on the Euclidian ModelThe dissection technique of the unit cube into smaller disjoint subcubes,has been repeat-edly used.In particular Karp[16]used the dissection technique to give an algorithm to approximate the Euclidian TSP on[0,1]2.Given a uniform i.i.d.set X in[0,1]2,Karp’s algorithm consists in dissecting[0,1]2into n/m(n)squares{Q i},each of sizeproves that asymptotically,with probability1the algorithm tends to give near optimal solutions(it produces a tour of length within(1+ǫ)of the optimal),and with probabil-ity1the algorithm runs in O(n2log n)steps.The approximation heuristic of Karp was generalized to the d-dimensional cube in[15].Some work has also been done on the Eu-clidian directed TSP on[0,1]2,where the direction among any two random points in[0,1]2 is choosed independently with probability1/2.If D n denotes the length of the minimal√Euclidian length on such a graph,Steele[28]proves that asymptotically E[D n]∼γn d−12.The length N k,n of the k-th nearest graph,in which each point is connected to itsk-th nearest neighbor.3.The length V n of the Voronoi diagram of the points X.4.The length D n of the Delaunay triangulation of the points X.For problem1,Steele and Tierney[31]gave limiting distributions for Z n=Z(X1,...,X n). If the sample Z is drawn uniformly from a d-dimensional torus,for d≥3the limit distri-bution in this case differs from the case where the space X is drawn from[0,1]d,d≥3,due to the the boundary effects in the cube.This result should be taken into account by those who do simulation involving the computation of the nearest-neighbor procedure,for three or more dimensions they should work on the torus instead of the cube.The studyof asymptotic dominance of the boundary with respect to the limit distribution of Z n was continued in[9],where they reinforced the results obtained in[31].Avram and Bertsimas[5]studied problems2,3and4and use a Poisson process with intensity n to get the set X of points uniformly distributed in[0,1]2.It is known that ifL denotes the optimal length for each of the problems,E[L n]limn→∞=Φ(x),σ[L n]≤xwhereΦ(x)is the Normal distribution function.They also prove that the rate of conver-gence in each problem is O (log n)1+3/4Define the random variableκn(r)=|E r|then,κn(r)= n2 Pr[r].In fact,κn(r)log n→c(7) for a constant c∈(0,∞].Notice that equation(7)imposes a threshold condition r=Ω( n)on the evolu-tion of r as n evolves to∞.The reason for this threshold is that it keeps G n(r)connected. An important issue in the G n(r)graphs is the connectivity.Define the connectivity dis-tance c n of a random geometric graph byc n=inf{r|G n(r)is connected}.Apple and Russo prove that asymptoticallyc n=O n a.s.Penrose[23],generalized the connectivity result to any metric L p,2≤p≤∞, proving that asymptotically,with high probability,if one starts with single vertices and adds the corresponding edges as r increases,the resulting graph becomes(k+1)connected at the moment it achieves a minimum degree of k+1.Recall than in the Erd¨o s–R´e nyi model for random graphs G n,p the connectivity threshold is log n/n[7].Therefore,both models have similar behavior for connectivity,but while in the G n,p model,the edges are independent,the edges in the G n(r)can have non-zero correlations.Under the threshold condition of equation(7),Appel an Russo give almost sure asymptotic rates of convergence(divergence)for several graph parameters.For example, they prove that as n→∞,the rate at which the minimum vertex degree∆n(r n)of G n(r n) diverges,is that of any particular vertex in G n(r n).For a related parameter,letωn(r)denote the clique number of G n(x).To get a bound onωn(r)once more we use dissection.Let l∈N be such that l<1/r<l+1. Dissect[0,1]2in(l+1)2squares{Q i},each Q i of side at most r,therefore all the points inside of any Q i belong to a common clique in G n(x),which implies that n≤(l+1)2ωn(r) so we get the bound,nr2ωn(r)≥Other related parameter is the chromatic number χn (r )of G n (x ).¿From standard graph theory it is easy to see that ωn (r )≤χn (r )≤∆n (r )+1and ∆n (r )≤ωn (2r )−ing these inequalities,Apple and Russo gave theorems on the rate of convergence of ωn (r )and χn (r )when {r n }satisfies equation (7).They also give asymptotic rates of growth for the independence number βn (r )of G n (x ),under the assumption that {r n }satisfies equation (7).To prove this statement,they need an upper bound on βn (r ).To get it,they use dissection.Let {X i 1,···,X i m }be an independent set (in the graphtheoretical sense)of a random graph in G n (r ).Notice that the set of open squares {O i j }with side r and centered at X i j must be disjoint.Moreover the area of each O i is r ing a pigeon-hole argument we can conclude that m ≤(1+1/r )2.This must be true for the largest independent set,so for all n and r βn (r )≤(1+1/r )2.In a sequel paper,Appel and Russo [3]prove that under equation 7,the minimum degree δn (r n )of G n (r n )has an asymptotic convergence of Ω(log n ).5The MinLA Problem on Random Geometric GraphsGiven an undirected graph G =(V,E )with |V |=n ,a layout of G is a one-to-one function ϕ:V →[n ].The minimum linear arrangement problem,from now on denoted Minla ,is a combinatorial optimization problem formulated as follows:given a graph G =(V,E ),find a layout ϕof G that minimizes the costc ϕ=uv ∈E|ϕ(u )−ϕ(v )|.Minla is an interesting and appealing NP -hard problem with several different applica-tions in Computer Science and Biology [?].However,there exist exact polynomial time solutions for some particular kinds of graphs.The lack of efficient exact algorithms for general graphs has given rise to the possibility of finding approximation algorithms.An approximation scheme of Minla for dense graphs was presented in [13].Moreover,a O (log n )approximation for general graphs and a O (log log n )approximation for planar graphs is proposed in [13].An study on the G n,p model for sparse graphs is given in [10].An experimental analysis of several heuristics for this problem is given in [24],where it is observed that approximating geometric random graphs is harder than approximating standard random graphs.Let us consider geometric graphs G n (r )when r =In the G n,p model the average over all layouts is of the same magnitude as the minimum[10].However this does not hold anymore for random geometric graphs,as we will see that the minimum value is of smaller magnitude.Wefirst derive a lower bound for the minimum linear arrangement that holds for almost all random geometric graphs and then analyze two heuristics to obtain an upper bound.The lower bound.Consider[0,1]2and dissect it inαn/log n disjoint squares each of size log n× log n for somefixed(but arbitrary)constantα.A pigeon-hole type of argument will give us the following result,Lemma3.Every square contains at least one vertex and at mostαlog n vertices whp.Using thefirst part of this lemma we can obtain a lower bound:Theorem2.There exists a constant c1such that whp,for any layoutϕ,c1(n/log n)3/2≤cϕ.Proof.Conditioning on the event of lemma3,after dissecting the square[0,1]2,we have one node in each square.Takingα=r/2the only possible connections correspond to neighboring cells.Therefore whp our graph contains a squared mesh withαn/log n points. In[18]and[20]it is shown that the optimum linear arrangement for a mesh n×n has cost0.868n3+O(n2).We can apply the known optimal value for our mesh to obtain the claimed lower bound.To obtain upper bounds we consider two natural heuristics for the Minla problem on geometric graphs.These are the dissection and the projection heuristics.The dissection heuristic.Given a geometric graph in G n(r),1.Dissect[0,1]2intoα(n/log n)disjoint squares each of size log n× log n.2.Assign to all vertices in the same square consecutive numbers.By our selection ofα,all vertices in the same subsquare are connected.3.Sort the squares following the up to down and left to right fashion and follow thisorder to assign numbers to vertices.Let D Gn(r)denote the cost of the layout obtained using dissection.Figure1givesan example of application of the dissection heuristic.Theorem3.There exist a constant c2such that whp,D Gn(r)≤(c2n log n)3/2.Proof.To prove the upper bound,given G n(r)and a dissection as before we construct a new graph G u by adding extra vertices until all squares have log n vertices inside.The edges will be all possible connections between vertices in the same squares and all the connections of all the vertices in a square with the vertices in neighbor squares.Clearly, this construction is not always possible,it may be the case that a square has more than log n vertices,but by lemma3,we can assure that whp G u is a supergraph of G n(r).Applying the dissection heuristic to G u we get the upper bound.9Figure1:The dissection heuristic for the Minla problemFigure2:The projection heuristic for the Minla problemThe projection heuristic.The projection heuristic is also quite natural:the projection of each vertex into the x-axis induces a natural linear ordering of the vertices.Another way to see this heuristic is to slide a vertical line starting from position0to1,and number vertices in the order the line touches them.Figure2gives an example of the application of the dissection heuristic.denote the cost of the layout obtained using the projection heuristic.Let P Gn(r)Theorem4.There exist a constant c3such that whp,P Gn(r)≤(c3n log n)3/2.Proof.As the points are distributed uniformly,the expected length(on the projected layout)of any edge is n times the distance of the two end points projection.Furthermore, the real distance is close to the average whp.Therefore,as the distance between the projections is bounded by the value of r we have that whp P Gn(r)≤nmr.Substituting with the right parameters we get our bound.10Combining with the lower bound,both heuristics provide a O(log3n)approximation algorithm to Minla on almost all random geometric graphs.These algorithms have an approximation ratio worse than the error bound of O(log n)in[25]although the algorithm described by Rao and Richa is extremely ingenious,it has the drawback of using the ellipsoid method and,thus it is not feasible for large graphs.On the other hand,the algorithms described here are simple to apply.6Open ProblemsConcerning the Minla problem and analogously with other problems,there are several natural questions to ask:•What is the right order of magnitude of the mean value of the minimum linear arrangement cost over all graphs in G n(r)?•Is the minimum layout cost on G n(r)concentrated or not around this mean?•Finally,is there some BHH type result for this measure?In this case,one may ask which is the limiting constant.There are some subtle impediments when trying to answer these questions.Let us point out the main difficulties:•Although when we partition the graph into pieces we can compute a layout from optimal layouts on the disjoint pieces,the additional cost is not a linear function of the piece size.Furthermore,the piece size must be related under some conditions with the selected value of r.•The measure we are considering is discrete:Although the distance in the geometric graph has some good properties,we measure integer distances.Therefore,a scaling of the values will not scale the minimum cost.The only property that we can show is that if the transformation(scaling)creates a subgraph(supergraph)of our random graph then the cost in the new scaled graph is upper(lower)bounded by the cost in the original graph.•We loose monotonicity:notice that the sequence{r(n)}that we choose to get random sparse geometric graphs is decreasing.Therefore adding a point may change the graph dramatically,so that the new graph is neither a supergraph nor a subgraph of the previous one.On the other hand,random geometric graphs seems to be formed by small clusters, that form a clique expanded in the same fashion.Therefore,it seems that they could also be related to some cases of bounded tree-width graphs.It is an open problem to analyze the expected tree-with of such graphs for different sequences of radii.11References[1]N.Alon,J.H.Spencer,and P.Erd˝o s.The probabilistic method.Wiley,New York,1992.[2]M.J.B.Appel and R.P.Russo.The maximum vertex degree of a graph on uniformpoints in[0,1]d.Advances in Applied Probability,29(3):567–581,1997.[3]M.J.B.Appel and R.P.Russo.The minimum vertex degree of a graph on uniformpoints in[0,1]d.Advances in Applied Probability,29(3):582–594,1997.[4]F.Avram and D.Bertsimas.The minimum spanning tree constant in geometricprobability and under the independent model:A unified approach.The Annals of Applied Probability,2:113–130,1992.[5]F.Avram and D.Bertsimas.On the central limit theorems in geometrical probability.The Annals of Applied Probability,3:1033–1046,1993.[6]J.Beardwood,J.Halton,and J.M.Hammersley.The shortest path through manypoints.Mathematical Proceedings of the Cambridge Philosophy Society,55:299–327, 1959.[7]B.Bollob´a s.Random graphs.Academic Press,London,1985.[8]K.L.Chung.A course in probability theory.Academic Press,New York,secondedition,1974.[9]H.Dette and N.Henze.The limit distribution of the largest nearest-neighbour linkin the unit d-cube.Journal of Applied Probability,26:67–80,1989.[10]J.D´ıaz,J.Petit,M.Serna,and L.Trevisan.Approximating layout problems onrandom graphs.Discrete Mathematics,2001.To appear as number233.[11]P.Erd˝o s and A.Renyi.On the evolution of random graphs.Publ.Math.Inst.Hungarian Academy of Sciences,5:17–61,1960.[12]P.Erd˝o s and A.Rnyi.On random graphs—I.Publicationes Matematicae,6:290–297,1959.[13]A.Frieze and R.Kannan.The regularity lemma and approximation schemes for denseproblems.In37th Annual Symposium on Foundations of Computer Science,pages 12–20.IEEE Computer Society Press,1996.[14]A:Frieze and C.McDiarmid.Algorithmic theory of random graphs.Random Struc-tures&Algorithms,10(1-2):5–42,1997.[15]J.H.Halton and R.Terada.A fast algorithm for the Euclidian travelling-salesmanproblem,optimal with probability one.SIAM Journal on Computing,11:28–46,1982.[16]R.M.Karp.Probabilistic analysis of partitioning algorithms for the travelling-salesman problem in the plane.Mathematics of Operation Research,2:209–224,1977.12[17]es.On the homogeneous planar Poisson point process.Mathematical Bio-sciences,6:85–125,1970.[18]G.Mitchison and R.Durbin.Optimal numberings of an n×n array.SIAM Journalon Algebraic and Discrete Methods,7(4):571–582,1986.[19]R.Motwani and P.Raghavan.Randomized algorithms.Cambridge University Press,Cambridge,1995.[20]D.O.Muradyan and T.E.Piliposjan.Minimal numberings of vertices of a rectangularlattice.Akad.Nauk.Armjan.SRR,1(70):21–27,1980.In Russian.[21]C.H.Papadimitriou.The probabilistic analysis of matching heuristics.In15th AnnualConference on Communication Control Computing,pages368–378,1978.[22]M.Penrose.The longest edge of the random minimal spanning tree.The Annals ofApplied Probability,7:340–361,1997.[23]M.D.Penrose.On k-connectivity for a geometric random graph.Random Structures&Algorithms,15(2):145–164,1999.[24]J.Petit.Approximation heuristics and benchmarkings for the MinLA problem.InR.Battiti and A.Bertossi,editors,Alex’98—Building bridges between theory and applications,pages112–128.Universit di Trento,1998.[25]S.Rao and A.W.Richa.New approximation techniques for some ordering problems.In9th ACM-SIAM Symposium on Discrete Algorithms,pages211–218,1998. [26]M.I.Shamos and D.Hoey.Closest-point problems.In16th Annual Symposiumon Foundations of Computer Science,pages151–162.IEEE Computer Society Press, 1975.[27]J.M.Steele.Subadditive Euclidean functional and nonlinear growth in geometricprobability.Annals of Probability,9:365–376,1981.[28]J.M.Steele.Probabilistic algorithm for the directed traveling salesman problem.Mathematics of Operation Research,11:343–350,1986.[29]J.M.Steele.Growth rates of Euclidean minimal spanning trees with power weightededges.Annals of Probability,16:1767–1787,1988.[30]J.M.Steele.Probability theory and combinatorial optimization.Regional ConferenceSeries in Applied Mathematics.SIAM,1997.[31]J.M.Steele and L.Tierney.Boundary domination and the distribution of the largestnearest-neighbpr link in higher dimensions.Journal of Applied Probability,23:524–528,1986.[32]B.Weide.Statistical Methods in Algorithmic Design and Analysis.PhD thesis,De-partment of Computer Science,Carnegie–Mellon University,1978.13。

相关文档
最新文档