Data Structures and Algorithms (AT70. 02) Comp. Sc. and Inf. Mgmt

Slides:



Advertisements
Similar presentations
2 Discrete Random Variable. Independence (module 1) A and B are independent iff the knowledge that B has occurred does not change the probability that.
Advertisements

Data Structures and Algorithms (AT70.02) Comp. Sc. and Inf. Mgmt. Asian Institute of Technology Instructor: Dr. Sumanta Guha Slide Sources: CLRS “Intro.
Data Structures and Algorithms (AT70.02) Comp. Sc. and Inf. Mgmt. Asian Institute of Technology Instructor: Dr. Sumanta Guha Slide Sources: CLRS “Intro.
Data Structures and Algorithms (AT70.02) Comp. Sc. and Inf. Mgmt. Asian Institute of Technology Instructor: Dr. Sumanta Guha Slide Sources: CLRS “Intro.
Data Structures and Algorithms (AT70.02) Comp. Sc. and Inf. Mgmt. Asian Institute of Technology Instructor: Dr. Sumanta Guha Slide Sources: CLRS “Intro.
Chapter 5 Probability Distributions. E.g., X is the number of heads obtained in 3 tosses of a coin. [X=0] = {TTT} [X=1] = {HTT, THT, TTH} [X=2] = {HHT,
Probabilistic Analysis and Randomized Algorithm. Worst case analysis Probabilistic analysis  Need the knowledge of the distribution of the inputs Indicator.
Chapter 5. Probabilistic Analysis and Randomized Algorithms
UMass Lowell Computer Science Analysis of Algorithms Spring, 2002 Chapter 5 Lecture Randomized Algorithms Sections 5.1 – 5.3 source: textbook.
Probabilistic Analysis and Randomized Algorithms
1 Discrete Probability Hsin-Lung Wu Assistant Professor Advanced Algorithms 2008 Fall.
A multiple-choice test consists of 8 questions
1 9/23/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.
Simple Mathematical Facts for Lecture 1. Conditional Probabilities Given an event has occurred, the conditional probability that another event occurs.
BY Lecturer: Aisha Dawood. The hiring problem:  You are using an employment agency to hire a new office assistant.  The agency sends you one candidate.
CSCE 411 Design and Analysis of Algorithms Set 9: Randomized Algorithms Prof. Jennifer Welch Fall 2014 CSCE 411, Fall 2014: Set 9 1.
Data Structures and Algorithms (AT70.02) Comp. Sc. and Inf. Mgmt. Asian Institute of Technology Instructor: Prof. Sumanta Guha Slide Sources: CLRS “Intro.
Data Structures and Algorithms (AT70.02) Comp. Sc. and Inf. Mgmt. Asian Institute of Technology Instructor: Prof. Sumanta Guha Slide Sources: CLRS “Intro.
Data Structures and Algorithms (AT70. 02) Comp. Sc. and Inf. Mgmt
Copyright © 2005 Pearson Education, Inc. Slide 7-1.
Randomized Algorithms CSc 4520/6520 Design & Analysis of Algorithms Fall 2013 Slides adopted from Dmitri Kaznachey, George Mason University and Maciej.
Data Structures and Algorithms (AT70.02) Comp. Sc. and Inf. Mgmt. Asian Institute of Technology Instructor: Prof. Sumanta Guha Slide Sources: CLRS “Intro.
ICS 353: Design and Analysis of Algorithms
Data Structures and Algorithms (AT70.02) Comp. Sc. and Inf. Mgmt. Asian Institute of Technology Instructor: Prof. Sumanta Guha Slide Sources: CLRS “Intro.
CSC317 1 Randomized algorithms Hiring problem We always want the best hire for a job! Using employment agency to send one candidate at a time Each day,
Data Structures and Algorithms (AT70.02) Comp. Sc. and Inf. Mgmt. Asian Institute of Technology Instructor: Prof. Sumanta Guha Slide Sources: CLRS “Intro.
Data Structures and Algorithms (AT70.02) Comp. Sc. and Inf. Mgmt. Asian Institute of Technology Instructor: Prof. Sumanta Guha Slide Sources: CLRS “Intro.
1 Chapter 4 Mathematical Expectation  4.1 Mean of Random Variables  4.2 Variance and Covariance  4.3 Means and Variances of Linear Combinations of Random.
Data Structures and Algorithms (AT70.02) Comp. Sc. and Inf. Mgmt. Asian Institute of Technology Instructor: Prof. Sumanta Guha Slide Sources: CLRS “Intro.
Andrey Markov, public domain image
Data Structures and Algorithms (AT70. 02) Comp. Sc. and Inf. Mgmt
Probabilistic analysis
Data Structures and Algorithms (AT70. 02) Comp. Sc. and Inf. Mgmt
Chapter 6: Discrete Probability
Probability Axioms and Formulas
Introduction to Discrete Mathematics
Data Structures and Algorithms (AT70. 02) Comp. Sc. and Inf. Mgmt
Data Structures and Algorithms (AT70. 02) Comp. Sc. and Inf. Mgmt
Data Structures and Algorithms (AT70. 02) Comp. Sc. and Inf. Mgmt
Data Structures and Algorithms (AT70. 02) Comp. Sc. and Inf. Mgmt
CHAPTER 6 Random Variables
Data Structures and Algorithms (AT70. 02) Comp. Sc. and Inf. Mgmt
Now it’s time to look at…
Expected Value.
CS 583 Analysis of Algorithms
4 Probability Lesson 4.8 Combinations and Probability.
Data Structures and Algorithms (AT70. 02) Comp. Sc. and Inf. Mgmt
Chapter 16.
CSCE 411 Design and Analysis of Algorithms
Data Structures and Algorithms (AT70. 02) Comp. Sc. and Inf. Mgmt
Probabilities and Proportions
Data Structures and Algorithms (AT70. 02) Comp. Sc. and Inf. Mgmt
Great Theoretical Ideas In Computer Science
Data Structures and Algorithms (AT70. 02) Comp. Sc. and Inf. Mgmt
Data Structures and Algorithms (AT70. 02) Comp. Sc. and Inf. Mgmt
Chapter 5: Probabilistic Analysis and Randomized Algorithms
Data Structures and Algorithms (AT70. 02) Comp. Sc. and Inf. Mgmt
Data Structures and Algorithms (AT70. 02) Comp. Sc. and Inf. Mgmt
Data Structures and Algorithms (AT70. 02) Comp. Sc. and Inf. Mgmt
Discrete Distributions
6.2 Basics of Probability LEARNING GOAL
Discrete Distributions
Data Structures and Algorithms (AT70. 02) Comp. Sc. and Inf. Mgmt
Applied Discrete Mathematics Week 12: Discrete Probability
Discrete Distributions.
Randomized Algorithms CS648
Discrete Distributions
Chapter 5: Probabilistic Analysis and Randomized Algorithms
Randomized Algorithm & Public Key Cryptography
Sets, Combinatorics, Probability, and Number Theory
Presentation transcript:

Data Structures and Algorithms (AT70. 02) Comp. Sc. and Inf. Mgmt Data Structures and Algorithms (AT70.02) Comp. Sc. and Inf. Mgmt. Asian Institute of Technology Instructor: Prof. Sumanta Guha Slide Sources: CLRS “Intro. To Algorithms” book website (copyright McGraw Hill) adapted and supplemented

CLRS “Intro. To Algorithms” Ch CLRS “Intro. To Algorithms” Ch. 5: Probabilistic Analysis and Randomized Algorithms

Probability Practice Linearity of Expectation If the reward for rolling a dice is the number of dollars that the face up shows, what is the expected reward? What does this mean? E.g., if this were an actual game how much would you be willing to pay to play? If a coin is tossed 5 times, what is the probability of 0 heads, 1 head, 2 heads, …? If a coin is tossed 5 times what is expected number of heads? What does this mean? How do we calculate it? Two ways: (a) Let X be the random variable whose value is the number of heads E(X) = ∑x=0..5 x * Pr(X=x) (b) Let Xi = I{coin i is heads} Note: I(event) = 1, if event occurs; 0, if it doesn’t Then X = X1 + X2 + X3 + X4 + X5 Therefore, E(X) = E(X1) + E(X2) + E(X3) + E(X4) + E(X5) indicator variable Linearity of Expectation

How many times do we expect to hire a new assistant? Let X be the random variable whose value is the number of times. Let Xi = I{candidate i is hired} Then X = X1 + X2 + … + Xn Therefore, E(X) = E(X1) + E(X2) + … + E (Xn) What is E(Xi), the probability that the i th candidate is hired? In other words, what is the probability the i th candidate is the best of the first i candidates? Answer: 1/i Therefore, E(X) = 1 + 1/2 +1/3 + … + 1/n ≈ loge n

Guarantee randomness, no matter what the input!

Randomly Permuting the Input Array Assuming all priorities P[i ] are distinct, prove that the procedure produces a uniform random permutation. Prove that the procedure produces a uniform random permutation.

n balls are randomly tossed into b bins. 5.4.1 Birthday Paradox How many people must there be in a room before there is a 50% chance that two share a birthday? 5.4.2 Ball and bins n balls are randomly tossed into b bins. Expectedly, how many balls fall into a given bin? Expectedly, how many balls must one toss until a given bin is hit at least once? Expectedly, how many balls must one toss until every bin is hit at least once? 5.4.3 Streaks Suppose we toss a fair coin n times. What is the longest streak of heads one expects to see? First, try to estimate the probability that there will be a streak of length k.

Problems Ex. 5.1-2 Ex. 5.1-3 Ex. 5.2-1 Ex. 5.2-2 Ex. 5.2-4 Ex. 5.4-2 Suppose that balls are tossed into b bins. Each toss is independent, and each ball is equally likely to end up in any bin. What is the expected number of ball tosses before at least one of the bins contains two balls? Ex. 5.4-6 Prob. 5-2