您的位置:首页 > 移动开发

排队论与随机服务问题的建模分析及应用

2006-10-31 15:11 309 查看
4000 关键字:数学模型,概率论与数理统计,运筹学,排队论和随机服务问题摘 要:本文介绍了概率论中的排队论与随机服务问题的基本知识。以饭店在单位时间内到达的顾客和设置的位席做分析目标,采用数学建模的方法介绍排队论和随机服务问题的解题过程。通过此案例阐述排队论在生产生活中的应用。1        相关学科简介1.1    运筹学的起源现代运筹学的起源可以追溯到几十年前,在某些组织的管理中最先试用科学手段的时候。可是,现在普遍认为,运筹学的活动是从二次世界大战初期的军事任务开始的。当时迫切需要把各项稀少的资源以有效的方式分配给各种不同的军事经营及在每一经营内的各项活动,所以美国及随后美国的军事管理当局都号召大批科学家运用科学手段来处理战略与战术问题,实际上这便是要求他们对种种(军事)经营进行研究,这些科学家小组正是最早的运筹小组。[1]运筹学的主要分支有:数学规划、决策分析、排队论、库存论、对策论、搜索论、计算机模拟等。60年代以来,运筹学主要用於处理大型的复杂的问题,诸如军事问题,教育问题、污染问题、交通运输问题、人力资源管理问题等;还广泛应用於这样一些部门:能源、预测、会计金融、销售、存储、计算机与信息系统、设计、城市服务系统、保健与医疗、电气、加工工业、第 三产业等。数学规划的研究对象是计划管理工作中有关安排和估值的问题,解决的主要问题是在给定条件下,按某一衡量指标来寻找安排的最优方案。它可以表示成求函数在满足约束条件下的极大极小值问题。[2]1.2    概率论的诞生作为数学统计基础的概率论的创始人分别是法国数学家帕斯卡 ( Blaise Pascal 1628 - 1662 ) 和费马 ( Pierre de Fermat 1601 - 1665 ) ,其可追溯到公元 17 世纪。当时的法国宫廷贵族里盛行着掷色子游戏,游戏规则是玩家连续掷 4 次色子,如果其中没有 6 点出现,玩家赢,如果出现一次 6 点,则庄家 ( 相当于现在的赌场 ) 赢。按照这一游戏规则庄家长期扮演赢家的角色,而玩家大部分时间是输家,因为庄家总是要靠此为生的,因此当时人们也就接受了这种现象。[3]后来为了使游戏更刺激,游戏规则发生了些许变化,玩家这回用 2 个色子连续掷 24 次,不同时出现 2 个 6 点,玩家赢,否则庄家赢。当时人们普遍认为,2 次出现 6 点的概率是一次出现 6 点的概率的 1 / 6 ,因此 6 倍于前一种规则的次数,也既是 24 次赢或输的概率与以前是相等的。然而事实却刚好相反,这回庄家长期处于输家的状态,于是他们去请教当时的数学家帕斯卡,求助其对这种现象做出解释。[3]这个游戏就是概率论发展史上颇有名气的“德·梅尔问题”,正是这些问题导致了帕斯卡(Pascal)的研究和他与费马(Fermat)的著名通信。他们的研究标志着概率论的诞生。[4]1.3    排队论的出现排队是在日常生活中经常遇到的现象,如顾客到商店购买物品、病人到医院看病常常要排队。此时要求服务的数量超过服务机构(服务台、服务员等)的容量,也就是说,到达的顾客不能够立即得到服务,因而出现排队现象。除此之外,电话局占线问题、车站码头等交通枢纽的车船堵塞和疏导、故障机器的停机待修、水库贮存调节等都是有形无形的排队现象。可以说,排队现象几乎是不可避免的,并且,顾客到达和服务时间常常具有随机性。如果增加服务设备,就产生增加投资或者发生空闲浪费;如果服务设备太少,排队现象就会严重从而产生不利影响。因此,管理员必须考虑如何在这两者之间取得平衡,经常检查目前的处理是否得当,研究改进对策以期提高服务质量,降低成本。排队论(Queueing Theory)也称随机服务系统理论,就是为解决上述问题而发展的一门学科。[5]2        排队论基础知识的引入2.1    排队论基本概念2.1.1      排队过程的一般表示
服务规则
[align=center]顾客源[/align]
[align=center]排队结构[/align]
[align=center]服务机构[/align]
顾客到来
离去
排队规则
排队系统
[align=center]图表 1排队过程的一般模型[/align]图表1就是排队过程的一般模型。各个顾客由顾客源(总体)出发,到达服务机构(服务台、服务员)前排队等候接受服务,服务完毕即离开。排队结构之对了的数目和排列方式,排队规则和服务规则是说明顾客在排队系统中按怎样的规则、次序接受服务的。我们所说的排队系统就是指图中虚线所包括的部分。2.1.2      排队系统的组合和特征一般的排队系统都有三个基本的组成部分:1、输入过程;2、排队规则;3、服务机构。2.1.2.1                   输入过程输入即指顾客到达排队系统,可能有几种不同的情况:1)        顾客总体(称为顾客源)的组成,可能是有限的,如工厂内停机待修的设备;可能是无限的,如上流河水流入水库;2)        顾客到来的方式,可能是一个一个的,也可能是成批的。如到餐厅就餐的顾客。3)        顾客相继到达的间隔时间,可能是随机的,如商店购物的顾客;也可能是确定型的,如生产流水线上的工件,定期运行的班车、班机等等;4)        顾客的到达,可以是相互独立的,就是说,以前的到达情况对以后顾客的到来没有影响;否则就是有关联的,如工厂内的机器在短时间区间内出现停机(顾客到达)的概率受已经待修或者被修理的机器数目的影响;5)        输入的过程,可以是平稳的或称为对时间是齐次的,是指描述相继到达的间隔时间分布和所含参数(如期望值、方差等)都是与时间无关的;否则成为非平稳的。2.1.2.2                   排队规则1)        顾客达到时,如果所有的服务台都正被占用,这种情况下顾客可以随即离去(称为即时制,或者损失制);可以排队等候(称为等待制)。对于等待的情形,为顾客进行服务的次序可以采用下列各种规则:先到先服务,后到先服务,随机服务,有优先权的服务等。2)        从占有的空间,由于空间的限制或者其他原因,有的系统要规定容量(及允许进入排队系统的顾客数)的最大限;3)        从队列的数目,可分为单列或者多列。2.1.2.3                   服务机构从机构形式和工作情况来看有几种情况:1)        服务机构可以没有服务员,也可以有一个或多个服务员;2)        在有多个服务台的情形中,他们可以是平行排列(并列)的,也可以是前后排列(串行)的,或者混合的;3)        服务方式可以是对单个顾客进行,或者对成批顾客进行;4)        和输入过程一样,服务时间可以是确定型的和随机型的,以及平稳的和非平稳的。2.1.3      排队模型的分类按照上述各部分的特征中最主要的、影响最大的三个即:1)        相继顾客到达间隔时间的分布;2)        服务时间的分布;3)        服务台个数。按照这三个特征分类,用符号[align=center]X/Y/Z[/align]表示服务台的情形。其中的X、Y、Z依次表示上述三个影响的因素。其中相继到达间隔时间和服务时间的各种分布的符号M 表示“负指数分布”(其他不在此阐述),在实际的处理过程中,为了目标问题的分析和解决,采用的算法有所变化。2.1.4      排队问题的求解在一个实际的排队问题求解时,首先要研究它属于哪个类型,其中的“顾客到达的间隔时间分布”和“服务时间的分布”需要实测的数据来确定,其他因素都是在问题提出时给定的。解排队问题的目的,是研究排队系统运行的效率,评估服务的质量,确定系统参数的最优值,以决定系统结构是否合理、研究设计改进的措施等。所以必须确定用以判断系统运行优劣的基本数量指标,解排队问题就是首先求出这些数量指标的概率分布或特征数。这些指标通常是:1)        队长,指在系统中的顾客数。它的期望值记作Ls;排队长(队列长),是在系统中排队等待服务的顾客数,它的期望值记作Lq。有如下关系:[队长] = [排队长] + [正在被服务的顾客数]2)        逗留时间,指一个顾客在系统中停留的时间,它的期望值记作Ws;等待时间,只一个顾客在系统中排队等待的时间,它的期望值记作Wq,有如下关系:[逗留时间] = [等待时间] + [服务时间]2.1.4.1                   M/M/1模型M/M/1 模型即指顾客到达服从泊松分布,服务时间服从负指数分布,单服务台的情形。它又分为标准型、顾客源有限型和服务系统容量有限型三种。M/M/1 模型要求到达规律服从参数为λ的泊松过程,服务时间服从参数为μ的负指数分布,所以先介绍这两个概念:λ——平均到达率,表示单位时间平均到达的顾客数。μ——平均服务率,表示单位时间能被服务完的顾客数(期望值),而1/μ就表示一个顾客的平均服务时间。在排队论中“平均”就指概率论中的数学期望,这是一种习惯用法。这两个参数都需要实测的数据经过统计学检验来确定。λ/μ有着重要意义,它是相同时间区间内顾客到达的期望值与能被服务的期望值之比,这个比是评估服务效率和服务机构利用程度的重要标志。令ρ=λ/μ我们称ρ为服务强度。在解排队论问题时,要求求出系统在任意时间的状态为n(系统中有n个顾客)的概率Pn,它决定了系统运行的特征。M/M/1 表示相继到达间隔时间为负指数分布、服务时间为负指数分布、单服务台模型。在标准的M/M/1模型中,Pn=(1-ρ)ρn(推导从略)。当n=0时,P0=1-ρ=1-λ/μ,这是系统中顾客为零时的14b7c概率。如果λ/μ>1,则P0将是负值,这违背了概率论的法则(概率论要求一个时间的概率在0~1之间,不可能事件的概率为0,必然事件的概率为1)。这种情况说明排队在无止境的增长,系统处于非稳定的状态。因此要求ρ=λ/μ<1。≥Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".
<!-- Web.Config Configuration File --><configuration><system.web><customErrors mode="Off"/></system.web></configuration>
Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.
<!-- Web.Config Configuration File --><configuration><system.web><customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/></system.web></configuration>
'>1 Runtime Error  以此为基础,可以算出系统运行指标:①Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".
<!-- Web.Config Configuration File --><configuration><system.web><customErrors mode="Off"/></system.web></configuration>
Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.
<!-- Web.Config Configuration File --><configuration><system.web><customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/></system.web></configuration>
'>1   ②Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".
<!-- Web.Config Configuration File --><configuration><system.web><customErrors mode="Off"/></system.web></configuration>
Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.
<!-- Web.Config Configuration File --><configuration><system.web><customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/></system.web></configuration>
'>1   ③Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".
<!-- Web.Config Configuration File --><configuration><system.web><customErrors mode="Off"/></system.web></configuration>
Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.
<!-- Web.Config Configuration File --><configuration><system.web><customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/></system.web></configuration>
'>1   ④Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".
<!-- Web.Config Configuration File --><configuration><system.web><customErrors mode="Off"/></system.web></configuration>
Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.
<!-- Web.Config Configuration File --><configuration><system.web><customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/></system.web></configuration>
'>1Runtime Error Runtime Error Runtime Error  Runtime Error  在服务系统容量有限型的M/M/1模型中,假设系统容量为N,系统状态为n的概率公式为:Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".
<!-- Web.Config Configuration File --><configuration><system.web><customErrors mode="Off"/></system.web></configuration>
Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.
<!-- Web.Config Configuration File --><configuration><system.web><customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/></system.web></configuration>
'>1 Runtime Error  指标归纳如下:Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".
<!-- Web.Config Configuration File --><configuration><system.web><customErrors mode="Off"/></system.web></configuration>
Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.
<!-- Web.Config Configuration File --><configuration><system.web><customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/></system.web></configuration>
'>1 Runtime Error   2.1.4.2                   M/M/C模型M/M/C 与 M/M/1 的区别在于前者有C个并列的服务台。它与后者一样,分为标准型、顾客源有限型和服务系统容量有限型三种。M/M/C 模型稍微复杂,需要限定一些约束条件进行分析。在此不作赘述。3        案例及分析3.1    命题的提出假设你要开一个饭店,预计每天平均有100批客人,每批客人平均吃饭用2小时。你若准备了40个桌子,请问满席的概率?最佳的桌子数?(M/M/1 模型,如果考虑流量的非平均分布,请用 M/M/S 模型)(公司员工考核题目)3.2    数学建模3.2.1      模型分析在实际生活中的情况可能会比较复杂,为了方便对问题的分析,常常对现实的问题进行数学建模,标准化问题的约束条件。比如,在本案例中每批客人的数量是不一样的,有的是一个人,有的可能两三人,也有可能会是十几人甚至几十人。在这种情况下,我们建立模型的时候,将问题简单化,每批客人占用一个桌子的位席。至于实际情况每批客人的多少,以及其他的问题,可作为另外一个命题进行分析。根据前面的基本知识,对该命题进行分析得出:3.2.1.1                   输入过程由于顾客来源没有限定,顾客总体的组成,是无限的;为了简化分析,顾客到来方式,每批作为一个独立的顾客实体,占用一个服务台;顾客相继到达间隔时间,是随机的,满足泊松分布;顾客的到达时相互独立的;输入的过程式平稳的。3.2.1.2                   排队规则顾客到达时,如果所有服务台被占用,则顾客随即离去(即时制);从占有的空间,系统容量是有限的(提供的桌子的数量有限);队列的数目,为单列。3.2.1.3                   服务机构饭店的工作情况约定为,单服务台,对多个顾客进行,服务时间随机型,输入过程为平稳性。3.2.2      模型建立根据上面的分析,建立数学模型,排队模型采用 M/M/1 模型,以天为单位时间。每天的平均到达率=100(批/天);每次服务平均时间为=2(小时),40个桌子每天完成的服务数量=40*24/2=480(批/天)由于饭店的桌子数量是有限的,因此,该模型属于服务系统容量有限型的M/M/1 模型。3.2.3      解题取λ=100,μ=480,得ρ=λ/μ=100/480≈0.2083=20.83%它说明,饭店有 20.83% 的时间是繁忙的,79.17% 的时间是空闲的。系统无等待,N=40是系统最大容量。Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".
<!-- Web.Config Configuration File --><configuration><system.web><customErrors mode="Off"/></system.web></configuration>
Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.
<!-- Web.Config Configuration File --><configuration><system.web><customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/></system.web></configuration>
'>1 Runtime Error  3.2.3.1                   求解:满席的概率40个座位满席的概率,即系统状态为40的概率Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".
<!-- Web.Config Configuration File --><configuration><system.web><customErrors mode="Off"/></system.web></configuration>
Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.
<!-- Web.Config Configuration File --><configuration><system.web><customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/></system.web></configuration>
'>1 Runtime Error  这个概率是相当小的,可以忽略不计(这个数字是个什么概念?他告诉我们,这基本上是不可能事件)。也就是,基本上不大可能出现满座的情况。3.2.3.2                   求解:最佳的桌子数有关最佳的桌子数的问题,需要考虑的因素有许多,主要的两个因素是:增加一个桌子的成本,和失去一个顾客造成的经济损失。要权衡着两个主要的经济指标来确定最佳的桌子数,是解这个问题的最终答案。命题中没有给出失去顾客时候的损失,在解答这个问题的时候,这个指标因素可以省略,而将问题更改为:求解顾客损失率不超过p的桌子数。因此,这个问题解的不等式应该为,求N,使得Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".
<!-- Web.Config Configuration File --><configuration><system.web><customErrors mode="Off"/></system.web></configuration>
Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.
<!-- Web.Config Configuration File --><configuration><system.web><customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/></system.web></configuration>
'>1   Runtime Error  下面给出n及Pn的部分数据的对照表供参考:
[align=center]n[/align][align=center]1[/align][align=center]2[/align][align=center]3[/align][align=center]4[/align][align=center]5[/align][align=center]6[/align][align=center]10[/align]
[align=center]Pn[/align]17.2%3.47%0.72%0.15%0.03%0.006%12.1/亿
 附录1是该计算的C#程序源代码。3.3    模型改进根据上表的数据我们可以查得:如果要保证每天的顾客流失率不超过1%的话,这个饭店只需准备3张桌子就够了!3.3.1      题目的分析是的,这样的结果与实际差别实在是太大了。如果是这样的情况,那概率论与运筹学简直就是形而上学的东西,对实际的生产生活根本没有任何的帮助,反而会有误导作用。之所以会出现这样结果,是因为这个命题只是一个题目而已,实际情况中,吃饭的相对集中在一天当中的几个小时内,题目中没有给出这几个小时的数据分布(也就是说题目为了简化问题的复杂程度,没有要求考虑该条件)。3.3.2      模型的改进假如每天顾客吃饭的时间绝大部分集中在5个小时内的时间中,则模型中的数据指标平均服务率应该为:u=40*5/2=100。由此得出:[align=center]ρ=λ/μ=100%[/align]这样的话,饭店的服务系统是100%的繁忙,没有任何的空闲时间。这样的系统,处于不稳定的边缘,接近于崩溃状态。我们可以根据经验中的数据,实际情况中,饭店午餐基本集中在11:00~14:00之间,晚餐基本集中在17:00~21:00之间,每天的7个小时当中。修正平均服务率及服务系统服务强度指标数据为:[align=center]u=40*5/2=140[/align][align=center]ρ=λ/μ=71.43%[/align]据此指标数据,我们计算得:满席概率P40≈4.08-5%,相当于千万分之四。对于最佳桌子数的 n及Pn的部分数据的对照表参数如下:
[align=center]n[/align][align=center]1[/align][align=center]4[/align][align=center]5[/align][align=center]10[/align][align=center]11[/align][align=center]19[/align][align=center]20[/align]
[align=center]Pn[/align]41.67%9.14%6.13%1.01%0.72%4.79/万3.42/万
如果要想每天的顾客损失率不超过1%,需要至少准备11张桌子。这就是流量的非平稳分布(也称为非平均分布)的特殊化情况。由此我们可以看出,如果给出的样本数据不充分或者误差较大,或者选择错了模型,会对计算的结果产生较大的负面的影响。3.4    对现实生活问题的深入分析对该现实生活中的概问题的进一步分析,可以找出更多的关键因素进行建模求解,这样使得问题的模型化更加精确,问题解决更加准确。除了上面对流量分布的进一步分析外,还可以在模型中加入失去顾客产生的经济损失作为考虑参数的一部分。4        结束语通过这个范例,我们了解了概率论与数理统计及运筹学中排队论的起源,以及排队论的基本知识。认识了建立数学模型解决现实生活中的问题。我们如果对饭店问题的深入探讨,我们可以针对更多的命题建立数学模型,比如:每批顾客的人数分析、每批顾客的消费水平分析、季节性及特殊时期的消费分析等等。建立越多的数学模型对饭店更多方面问题进行正确的分析和解决,将会使得饭店的经营状况把握的更加准确。依靠科学的手段,一切尽在掌握中!5        参考文献[align=left][1] 卢湾科普,http://www.kp365.com/index/text/73004.htm[/align][align=left][2] 博士家园,http://www.bossh.net/article.php/41[/align][align=left][3] 维基百科,http://zh.wikipedia.org/wiki/%E6%A6%82%E7%8E%87%E8%AE%BA[/align][align=left][4] 《概率论基础》,复旦大学李贤平著,高等教育出版社 1997年4月第2版 P31[/align][align=left][5] 《运筹学》(修订版),高等学校试用教材,《运筹学》教材编写组编,清华大学出版社 1990年1月第2版 P310[/align]6        附录6.1    附录1using System; public class Math{    public static void Main(string[] args){           double p = 0.0, rp = 0.2083;           int N = 0;           for (int i=1; i<21;i++)                  Console.WriteLine("{0} => {1}", i, Compute(i));    }       private static double Compute(int N){           double rtn = 0.0, rp = 0.7143;           double rpn = 1.0;           for (int i=0; i<N; i++)                  rpn *= rp;                     rtn = (1.0-rp)*rpn/(1.0-rpn*rp);           return rtn;    }}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息