南京大学:《计算机问题求解》课程教学资源(PPT课件讲稿)概率分析与随机算法

计算机问题求解一论题2-8 。概率分析与随机算法 2020年04月16日
计算机问题求解 – 论题2-8 - 概率分析与随机算法 2020年04月16日

问题0: 说明什么是随机变量?解释 为什么它本质上是函数? A random variable for an experiment with a sample space S is a function that assigns a number to each element of S
A random variable for an experiment with a sample space S is a function that assigns a number to each element of S

掷两颗骰子 ■其样本空间S:36,,,., ■定义函数f:S->{2,3,..,12} 口该函数又称:掷两颗骰子的和的随机变量 口骰子:此时该函数的值是7,我们可以认为“随机变量=7” 口骰子:此时该函数的值是12,我们可以认为“随机变量f仁12” ▣随机变量仁7的概率是多少?等价于两个骰子掷出7点的概率 还可以: 口定义随机变量X:掷出豹子点
掷两颗骰子 ◼ 其样本空间S:36,,,…, ◼ 定义函数f:S->{2,3,…,12} ❑ 该函数又称:掷两颗骰子的和的随机变量 ❑ 骰子: 此时该函数的值是7,我们可以认为“随机变量f=7” ❑ 骰子: 此时该函数的值是12,我们可以认为“随机变量f=12” ❑ 随机变量f=7的概率是多少?等价于两个骰子掷出7点的概率 ◼ 还可以: ❑ 定义随机变量X:掷出豹子点

问题00: 什么是随机变量的期望值? 如何理解期望反映了随机变量的均值” 它与平均值有什么不同? We define the expected value,or expectation,of a random variable X whose values are the set {x1,x2,...,xk}to be E(X)=xi P(X=xi). i=1

HIRE-ASSISTANT(n) 1 best =0 /candidate 0 is a least-qualified dummy candidate 2 fori =1ton 3 interview candidate i 4 if candidate i is better than candidate best 5 best i 6 hire candidate i

HIRE-ASSISTANT (n) 1 best =0 /candidate 0 is a least-qualified dummy candidate 2 for i 1to n 3 interview candidate i 4 if candidate i is better than candidate best 5 best i 6 hire candidate i 问题1: 什么是”确定性”算法? 这个算法是“确定”的吗?

RANDOMIZED-HIRE-ASSISTANT(n) randomly permute the list of candidates 2 best =0 /candidate 0 is a least-qualified dummy candidate 3 for i 1ton 4 interview candidate i 5 if candidate i is better than candidate best 6 best i 7 hire candidate i 问题2: 什么是随机算法? 这个算法是“随机”的吗?

HIRE-ASSISTANT(n) 1 best =0 /candidate 0 is a least-qualified dummy candidate 2 for i 1ton 3 interview candidate i 4 if candidate i is better than candidate best 5 best i 6 hire candidate i 那么,有没有问: 般情况下,代价 会如何? 问题3: 这个确定算法有“随机”性吗? 如果我们分析第六条语句的执行条数, 你能给出这个“随机”的概率模型吗?
那么,有没有问: 一般情况下,代价 会如何?

什么是算法的Average--Case Analysis? ·算法的性能依赖于输入数据的随机性 口“好”数据、“差”数据、“不好不差”数据 ·完全可以围绕“算法的性能”定义输入数据集(样本空间)上的随机变量 ■算法的平均开销就是这个随机变量的“平均” 口这个随机变量的“期望” We focus on computing the running time of various algorithms. When the running time of an algorithm is different for different inputs of the same size,we can think of the running time of the algorithm as a random variable on the sample space of inputs,and thus,we can analyze the expected running time of the algorithm.This gives us an understanding different from studying just the worst-case running time for an input of a given size
什么是算法的Average-Case Analysis? ◼ 算法的性能依赖于输入数据的随机性 ❑ “好”数据、“差”数据、“不好不差”数据 ◼ 完全可以围绕“算法的性能”定义输入数据集(样本空间)上的随机变量 ◼ 算法的平均开销就是这个随机变量的“平均” ❑ 这个随机变量的“期望

The difficult of Average case Analysis of an Algorithm In order to perform a probabilistic analysis,we must use knowledge of,or make assumptions about,the distribution of the inputs. Then we analyze our algorithm,computing an average-case running time,where we take the average over the distribution of the possible inputs.Thus we are,in effect,averaging the running time over all possible inputs.When reporting such a running time,we will refer to it as the average-case running time. 输入数据的分布特性假设失败,必定导致平均运行时间分析的失败
The difficult of Average case Analysis of an Algorithm 输入数据的分布特性假设失败,必定导致平均运行时间分析的失败
按次数下载不扣除下载券;
注册用户24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
- 南京大学:《计算机问题求解》课程教学资源(PPT课件讲稿)算法方法.pptx
- 南京大学:《计算机问题求解》课程教学资源(课件讲稿)递归及其数学基础 linear-recurrences(简版).pdf
- 南京大学:《计算机问题求解》课程教学资源(课件讲稿)递归及其数学基础 linear-recurrences.pdf
- 南京大学:《计算机问题求解》课程教学资源(PPT课件讲稿)递归及其数学基础(part-1).pptx
- 南京大学:《计算机问题求解》课程教学资源(课件讲稿)组合与计数 Counting(简版).pdf
- 南京大学:《计算机问题求解》课程教学资源(课件讲稿)组合与计数 Counting.pdf
- 南京大学:《计算机问题求解》课程教学资源(PPT课件讲稿)算法的正确性.pptx
- 南京大学:《计算机问题求解》课程教学资源(课件讲稿)算法的效率 Efficiency(简版).pdf
- 南京大学:《计算机问题求解》课程教学资源(课件讲稿)算法的效率 Efficiency.pdf
- 南京大学:《计算机问题求解》课程教学资源(PPT课件讲稿)分治法与递归.pptx
- 《计算机问题求解》课程教学资源(参考书籍)Proofs from THE BOOK(Fifth Edition,Martin Aigner · Günter M. Ziegler).pdf
- 《计算机问题求解》课程参考书籍资料:《Mathematics for Computer Science》PDF电子书(revised Wednesday 6th June, 2018,Eric Lehman、F Thomson Leighton、Albert R Meyer).pdf
- 《计算机问题求解》课程教学资源:《An Introduction to the Analysis of Algorithms》参考书籍教材(Second Edition,Robert Sedgewick、Philippe Flajolet).pdf
- 南京大学:《计算机问题求解》课程教学资源(PPT课件讲稿)布尔代数.pptx
- 《计算机问题求解》课程教学资源(阅读材料)THE CLASSIC WORK EXTENDED AND REFINED《The Art of Computer Programming》Vol4A Combinatorial Algorithms Part 1(DONALD E.KNUTH).pdf
- 《计算机问题求解》课程教学资源(阅读材料)Programming Pearls, Second Edition by Jon Bentley. Addison-Wesley, Inc., 2000.pdf
- 《计算机问题求解》课程教学资源:《Concrete Mathematics:A Foundation for Computer Science》参考书籍教材(Ronald L. Graham、Donald E. Knuth、Oren Patashnik).pdf
- 《计算机问题求解》课程参考书籍教材:Abstract Data Types and Algorithms(Second Edition,Manoochehr Azmoodeh).pdf
- 《计算机问题求解》课程教学资源:《Discrete Mathematics for Computer Scientists》参考书籍教材(Stein、DrysdaleBogart).pdf
- 南京大学:《计算机问题求解》课程教学资源(课件讲稿)集合论(IV)无穷 Infinity(简版).pdf
- 南京大学:《计算机问题求解》课程教学资源(PPT课件讲稿)离散概率基础.pptx
- 南京大学:《计算机问题求解》课程教学资源(课件讲稿)排序与选择算法 sorting and selection.pdf
- 南京大学:《计算机问题求解》课程教学资源(课件讲稿)排序与选择算法 sorting and selection(简版).pdf
- 南京大学:《计算机问题求解》课程教学资源(PPT课件讲稿)基本数据结构.pptx
- 南京大学:《计算机问题求解》课程教学资源(课件讲稿)堆的结构、实现以及算法应用 Heap & HeapSort.pdf
- 南京大学:《计算机问题求解》课程教学资源(PPT课件讲稿)B树.pptx
- 南京大学:《计算机问题求解》课程教学资源(课件讲稿)Hashing方法.pdf
- 南京大学:《计算机问题求解》课程教学资源(PPT课件讲稿)搜索树.pptx
- 南京大学:《计算机问题求解》课程教学资源(PPT课件讲稿)红黑树.pptx
- 《计算机问题求解》课程参考书籍教材:《Introduction to Algorithms》PDF电子版(Third Edition,Thomas H. Cormen、Charles E. Leiserson、Ronald L. Rivest、Clifford Stein).pdf
- 南京大学:《计算机问题求解》课程教学资源(PPT课件讲稿)动态规划.pptx
- 南京大学:《计算机问题求解》课程教学资源(PPT课件讲稿)红黑树.pptx
- 南京大学:《计算机问题求解》课程教学资源(PPT课件讲稿)图的基本概念.pptx
- 南京大学:《计算机问题求解》课程教学资源(PPT课件讲稿)摊还分析.pptx
- 南京大学:《计算机问题求解》课程教学资源(PPT课件讲稿)贪心算法.pptx
- 南京大学:《计算机问题求解》课程教学资源(PPT课件讲稿)树.pptx
- 南京大学:《计算机问题求解》课程教学资源(PPT课件讲稿)用于动态等价关系的数据结构.pptx
- 南京大学:《计算机问题求解》课程教学资源(PPT课件讲稿)单源最短路径算法.pptx
- 南京大学:《计算机问题求解》课程教学资源(PPT课件讲稿)图的计算机表示以及遍历.pptx
- 南京大学:《计算机问题求解》课程教学资源(PPT课件讲稿)多源最短路径算法.pptx