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

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

.30 25 Histogram for 10 .20- flips of a coin 1 10 .05 0 0 1 23456789 10 Number of Heads 问题: 你能否结合这个图解释与随机变量相关的以 下的标念:期望值、分布以及它们之间的关系?
Histogram for 10 flips of a coin

Histogram for answers for a 10-problem test 35 .30 .25 问题2 .20 .15 .10 图中纵坐标值是 .05 0 012345678910 怎台得出来的? Number of Right Answers 贝努利试验过程: P(exactly k successes)= (p1-p- 当k=8, 0.88.0.22≈0.302
Histogram for answers for a 10-problem test 贝努利试验过程: 当k=8, 0.8 0.2 0.302 8 10 8 2

HIRE-ASSISTANT (n) best 0 /candidate 0 is a least-qualified dummy candidate 2 for i 1 to n 3 interview candidate i 4 if candidate i is better than candidate best 5 best i 6 hire candidate i 那么,有没有问: 般情况下,代价 问题3: 会如何? 这个算法是“确定”的吗? 什么是“随机”的呢? 它的best和worst case是什么?
那么,有没有问: 一般情况下,代价 会如何?

Average-Case Analysis of Algorithms We focus on computing the runing 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 runing time for an input of a given size
Average-Case Analysis of Algorithms

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
Average case Analysis of an Algorithm

HIRE-ASSISTANT (n) 1 best =0 /candidate 0 is a least-qualified dummy candidate 2 for i 1 to n 3 interview candidate i 4 if candidate i is better than candidate best 5 best i 6 hire candidate i 问题4: 在hiring problem.算法中假设 应聘者随机到达”意味着什么?

HIRE-ASSISTANT (n) 1 best =0 /candidate 0 is a least-qualified dummy candidate 2 for i 1 to n 3 interview candidate i 4 if candidate i is better than candidate best 5 best i 6 hire candidate i 问题5: 在hiring problem算法中分析算 法所需要的随机变量是什么?

Hiring-Assistant算法的平均情况分析 涉及的随机变量: ·Hiring?操作执行次数:X; E[X]=∑xPr{X=x x=1 ·事件“第个候选人被雇用”的indicator::X; X=X1+X2+…+Xn
Hiring-Assistant算法的平均情况分析 涉及的随机变量: • Hiring操作执行次数:X ; • 事件“第i个候选人被雇用”的indicator:Xi ;

Indicator Random variable if A occurs, if A does not occur Indicator random variables provide a convenient method for onverting between probabilities and expectations. 问题6: 这句话是什么意思?
Indicator Random Variable
按次数下载不扣除下载券;
注册用户24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
- 南京大学:《计算机问题求解》课程教学资源(课件讲稿)树及搜索树.pdf
- 南京大学:《计算机问题求解》课程教学资源(课件讲稿)有限与无限.pdf
- 南京大学:《计算机问题求解》课程教学资源(课件讲稿)数据与数据结构.pdf
- 南京大学:《计算机问题求解》课程教学资源(课件讲稿)排序与选择.pdf
- 南京大学:《计算机问题求解》课程教学资源(课件讲稿)常用的证明方法及其逻辑正确性.pdf
- 南京大学:《计算机问题求解》课程教学资源(课件讲稿)布尔代数.pdf
- 南京大学:《计算机问题求解》课程教学资源(课件讲稿)如何将算法告诉计算机.pdf
- 南京大学:《计算机问题求解》课程教学资源(课件讲稿)堆与堆排序.pdf
- 南京大学:《计算机问题求解》课程教学资源(课件讲稿)基本数据结构.pdf
- 南京大学:《计算机问题求解》课程教学资源(课件讲稿)分治法与递归.pdf
- 南京大学:《计算机问题求解》课程教学资源(课件讲稿)函数.pdf
- 南京大学:《计算机问题求解》课程教学资源(课件讲稿)关系及其基本性质.pdf
- 南京大学:《计算机问题求解》课程教学资源(课件讲稿)什么样的推理是正确的.pdf
- 南京大学:《计算机问题求解》课程教学资源(课件讲稿)为什么计算机能解题.pdf
- 南京大学:《计算机问题求解》课程教学资源(课件讲稿)不同的程序设计方法.pdf
- 南京大学:《计算机问题求解》课程教学资源(课件讲稿)Hashing方法.pdf
- Go To Statement Considered Harmful.pdf
- What is System Hang and How to Handle it?.pdf
- How Far We Have Progressed in the Journey? An Examination of Cross-Project Defect Prediction.pdf
- 南京大学:《计算机问题求解》课程教学资源(课件讲稿)关于问题求解的几个思考.pdf
- 南京大学:《计算机问题求解》课程教学资源(课件讲稿)离散概率基础.pdf
- 南京大学:《计算机问题求解》课程教学资源(课件讲稿)算法方法.pdf
- 南京大学:《计算机问题求解》课程教学资源(课件讲稿)算法正确性.pdf
- 南京大学:《计算机问题求解》课程教学资源(课件讲稿)算法的基本结构.pdf
- 南京大学:《计算机问题求解》课程教学资源(课件讲稿)算法的效率.pdf
- 南京大学:《计算机问题求解》课程教学资源(课件讲稿)组合与计数.pdf
- 南京大学:《计算机问题求解》课程教学资源(课件讲稿)计算思维引导.pdf
- 南京大学:《计算机问题求解》课程教学资源(课件讲稿)递归及其数学基础.pdf
- 南京大学:《计算机问题求解》课程教学资源(课件讲稿)集合及其运算.pdf
- 南京大学:《计算机问题求解》课程教学资源(课件讲稿)动态规划.pdf
- 南京大学:《计算机问题求解》课程教学资源(课件讲稿)贪心算法.pdf
- 南京大学:《计算机问题求解》课程教学资源(课件讲稿)用于动态等价关系的数据结构.pdf
- 南京大学:《计算机问题求解》课程教学资源(课件讲稿)B树.pdf
- 南京大学:《计算机问题求解》课程教学资源(课件讲稿)图的基本概念.pdf
- 南京大学:《计算机问题求解》课程教学资源(课件讲稿)图的计算机表示以及遍历.pdf
- 南京大学:《计算机问题求解》课程教学资源(课件讲稿)树.pdf
- 南京大学:《计算机问题求解》课程教学资源(课件讲稿)单源最短通路算法.pdf
- 南京大学:《计算机问题求解》课程教学资源(课件讲稿)多源最短通路算法 All-Pair Shortest Paths.pdf
- 南京大学:《计算机问题求解》课程教学资源(课件讲稿)图中的连通度和距离.pdf
- 南京大学:《计算机问题求解》课程教学资源(课件讲稿)旅行问题(图旅行).pdf