Randomized Algorithms Randomized Algorithms CS648 Lecture 2 Randomized Algorithm for Approximate Median Elementary Probability theory Lecture 2 Randomized.

Slides:



Advertisements
Similar presentations
Copyright © 2006 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide
Advertisements

Chapter 4 Probability and Probability Distributions
Instructor: Dr. Ayona Chatterjee Spring  If there are N equally likely possibilities of which one must occur and n are regarded as favorable, or.
Randomized Algorithms Randomized Algorithms CS648 Lecture 3 Two fundamental problems Balls into bins Randomized Quick Sort Random Variable and Expected.
CSC-2259 Discrete Structures
Probability theory and average-case complexity. Review of probability theory.
1 Introduction to Stochastic Models GSLM Outline  course outline course outline  Chapter 1 of the textbook.
Randomized Algorithms Randomized Algorithms CS648 Lecture 6 Reviewing the last 3 lectures Application of Fingerprinting Techniques 1-dimensional Pattern.
Randomized Algorithms Randomized Algorithms CS648 Lecture 8 Tools for bounding deviation of a random variable Markov’s Inequality Chernoff Bound Lecture.
Chapter 8: Probability: The Mathematics of Chance Lesson Plan
1 CSC401 – Analysis of Algorithms Lecture Notes 9 Radix Sort and Selection Objectives  Introduce no-comparison-based sorting algorithms: Bucket-sort and.
Selection1. 2 The Selection Problem Given an integer k and n elements x 1, x 2, …, x n, taken from a total order, find the k-th smallest element in this.
Finite probability space set  (sample space) function P:  R + (probability distribution)  P(x) = 1 x 
Chapter 9 Introducing Probability - A bridge from Descriptive Statistics to Inferential Statistics.
Sets, Combinatorics, Probability, and Number Theory Mathematical Structures for Computer Science Chapter 3 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesProbability.
1 9/8/2015 MATH 224 – Discrete Mathematics Basic finite probability is given by the formula, where |E| is the number of events and |S| is the total number.
CSCE 2100: Computing Foundations 1 Probability Theory Tamara Schneider Summer 2013.
PROBABILITY AND STATISTICS FOR ENGINEERING Hossein Sameti Department of Computer Engineering Sharif University of Technology Independence and Bernoulli.
Random Sampling, Point Estimation and Maximum Likelihood.
Simple Mathematical Facts for Lecture 1. Conditional Probabilities Given an event has occurred, the conditional probability that another event occurs.
Theory of Probability Statistics for Business and Economics.
Discrete Mathematical Structures (Counting Principles)
L Berkley Davis Copyright 2009 MER301: Engineering Reliability1 LECTURE 1: Basic Probability Theory.
Probability Theory 1.Basic concepts 2.Probability 3.Permutations 4.Combinations.
OPIM 5103-Lecture #3 Jose M. Cruz Assistant Professor.
Discrete Probability CSC-2259 Discrete Structures Konstantin Busch - LSU1.
Lecture PowerPoint Slides Basic Practice of Statistics 7 th Edition.
Independence and Bernoulli Trials. Sharif University of Technology 2 Independence  A, B independent implies: are also independent. Proof for independence.
Order Statistics David Kauchak cs302 Spring 2012.
Topics What is Probability? Probability — A Theoretical Approach Example 1 Remarks Example 2 Example 3 Assessments Example 4 Probability — A Experimental.
1.4 Equally Likely Outcomes. The outcomes of a sample space are called equally likely if all of them have the same chance of occurrence. It is very difficult.
EXAMPLE 1 Independent and Dependent Events Tell whether the events are independent or dependent. SOLUTION You randomly draw a number from a bag. Then you.
M ONTE C ARLO SIMULATION Modeling and Simulation CS
Copyright © Cengage Learning. All rights reserved. Elementary Probability Theory 5.
PROBABILITY, PROBABILITY RULES, AND CONDITIONAL PROBABILITY
Probability Definition : The probability of a given event is an expression of likelihood of occurrence of an event.A probability isa number which ranges.
Analysis of Algorithms CS 477/677 Instructor: Monica Nicolescu Lecture 7.
Sixth lecture Concepts of Probabilities. Random Experiment Can be repeated (theoretically) an infinite number of times Has a well-defined set of possible.
Conditional Probability Mass Function. Introduction P[A|B] is the probability of an event A, giving that we know that some other event B has occurred.
Probability. What is probability? Probability discusses the likelihood or chance of something happening. For instance, -- the probability of it raining.
ICS 353: Design and Analysis of Algorithms
Probability Experiments Problem Solving Sample Spaces Theoretical vs Experimental Compound Events Independent and Dependent Events.
Probability theory is the branch of mathematics concerned with analysis of random phenomena. (Encyclopedia Britannica) An experiment: is any action, process.
UNIT 3. OUTLINE: Sets and Subsets Set Operations the Laws of Set Theory Counting and Venn Diagrams. A First Word on Probability. The Axioms of Probability.
CS2420: Lecture 12 Vladimir Kulyukin Computer Science Department Utah State University.
Chapter 8: Probability: The Mathematics of Chance Probability Models and Rules 1 Probability Theory  The mathematical description of randomness.  Companies.
Chapter 4: Probability. Probability of an Event Definitions An experiment is the process of observing a phenomenon that has variation in its outcomes.
Chapter 6 Large Random Samples Weiqi Luo ( 骆伟祺 ) School of Data & Computer Science Sun Yat-Sen University :
Probability What is the probability that Christ will come again to judge all mankind?
Computing Fundamentals 2 Lecture 7 Statistics, Random Variables, Expected Value. Lecturer: Patrick Browne
Aim: What is the importance of probability?. What is the language of Probability? “Random” is a description of a kind of order that emerges in the long.
Probability theory and average-case complexity. Review of probability theory.
Random Variables Lecture Lecturer : FATEN AL-HUSSAIN.
AP STATISTICS LESSON AP STATISTICS LESSON PROBABILITY MODELS.
2-6 Probability Theoretical & Experimental. Probability – how likely it is that something will happen – Has a range from 0 – 1 – 0 means it definitely.
Probability What is the probability of rolling “snake eyes” in one roll? What is the probability of rolling “yahtzee” in one roll?
Quick-Sort 2/18/2018 3:56 AM Selection Selection.
Probability Theory Basic concepts Probability Permutations
Chapter 7: Counting Principles
Selection Selection 1 Quick-Sort Quick-Sort 10/30/16 13:52
Randomized Algorithms CS648
Advanced Artificial Intelligence
CS3332(01) Course Description
Randomized Algorithms CS648
Quick-Sort 5/7/2019 6:43 PM Selection Selection.
Quick-Sort 5/25/2019 6:16 PM Selection Selection.
Lecture 9 Randomized Algorithms
Sets and Probabilistic Models
A random experiment gives rise to possible outcomes, but any particular outcome is uncertain – “random”. For example, tossing a coin… we know H or T will.
Chapter 11 Sets, and Selection
Presentation transcript:

Randomized Algorithms Randomized Algorithms CS648 Lecture 2 Randomized Algorithm for Approximate Median Elementary Probability theory Lecture 2 Randomized Algorithm for Approximate Median Elementary Probability theory 1

RANDOMIZED MONTE CARLO ALGORITHM FOR APPROXIMATE MEDIAN 2 This lecture was delivered at slow pace and its flavor was that of a tutorial. Reason: To show that designing and analyzing a randomized algorithm demands right insight and just elementary probability.

A simple probability exercise 3

4

Approximate median Definition: Given an array A[] storing n numbers and ϵ > 0, compute an element whose rank is in the range [(1- ϵ)n/2, (1+ ϵ)n/2]. Best Deterministic Algorithm: “Median of Medians” algorithm for finding exact median Running time: O(n) No faster algorithm possible for approximate median 5 Can you give a short proof ?

½ - Approximate median A Randomized Algorithm Rand-Approx-Median(A) 1.Let k  c log n; 2.S  ∅; 3.For i=1 to k 4. x  an element selected randomly uniformly from A; 5. S  S U {x}; 6.Sort S. 7.Report the median of S. Running time: O(log n loglog n) 6

Analyzing the error probability of Rand-approx-median 7 Elements of A arranged in Increasing order of values n/4n/4 3n/4 Right QuarterLeft Quarter When does the algorithm err ? To answer this question, try to characterize what will be a bad sample S ?

Analyzing the error probability of Rand-approx-median Observation: Algorithm makes an error only if k/2 or more elements sampled from the Right Quarter (or Left Quarter). 8 n/4n/4 Left QuarterRight Quarter Elements of A arranged in Increasing order of values 3n/4 Median of S

Analyzing the error probability of Rand-approx-median 9 Elements of A arranged in Increasing order of values n/4n/4 3n/4 Right QuarterLeft Quarter Exactly the same as the coin tossing exercise we did ! ¼

Main result we discussed 10

ELEMENTARY PROBABILITY THEORY (IT IS SO SIMPLE THAT YOU UNDERESTIMATE ITS ELEGANCE AND POWER) 11

Elementary probability theory (Relevant for CS648) We shall mainly deal with discrete probability theory in this course. We shall take the set theoretic approach to explain probability theory. Consider any random experiment : o Tossing a coin 5 times. o Throwing a dice 2 times. o Selecting a number randomly uniformly from [1..n]. How to capture the following facts in the theory of probability ? 1.Outcome will always be from a specified set. 2.Likelihood of each possible outcome is non-negative. 3.We may be interested in a collection of outcomes. 12

Probability Space 13 Ω

Event in a Probability Space 14 A Ω

Exercises A randomized algorithm can also be viewed as a random experiment. 1.What is the sample space associated with Randomized Quick sort ? 2.What is the sample space associated with Rand-approx-median algorithm ? 15

An Important Advice In the following slides, we shall state well known equations (highlighted in yellow boxes) from probability theory. You should internalize them fully. We shall use them crucially in this course. Make sincere attempts to solve exercises that follow. 16

Union of two Events 17 A B Ω

Union of three Events 18 A BC Ω

Exercises 19

Conditional Probability 20

Exercises A man possesses five coins, two of which are double-headed, one is double-tailed, and two are normal. He shuts his eyes, picks a coin at random, and tosses it. What is the probability that the lower face of the coin is a head ? He opens his eyes and sees that the coin is showing heads; what it the probability that the lower face is a head ? He shuts his eyes again, and tosses the coin again. What is the probability that the lower face is a head ? He opens his eyes and sees that the coin is showing heads; what is the probability that the lower face is a head ? He discards this coin, picks another at random, and tosses it. What is the probability that it shows heads ? 21

Partition of sample space and an “important Equation” 22 Ω B

Exercises 23

Independent Events 24 P(A ∩ B) = P(A) · P(B)

Exercises 25