CSCE 2100: Computing Foundations 1 Probability Theory Tamara Schneider Summer 2013.

Slides:



Advertisements
Similar presentations
Beginning Probability
Advertisements

Mathematics in Today's World
Modeling and Simulation Monte carlo simulation 1 Arwa Ibrahim Ahmed Princess Nora University.
Independence and the Multiplication Rule
Games of probability What are my chances?. Roll a single die (6 faces). –What is the probability of each number showing on top? Activity 1: Simple probability:
CSC-2259 Discrete Structures
Probability theory and average-case complexity. Review of probability theory.
Section 4.2 Probability Rules HAWKES LEARNING SYSTEMS math courseware specialists Copyright © 2008 by Hawkes Learning Systems/Quant Systems, Inc. All rights.
22C:19 Discrete Structures Discrete Probability Fall 2014 Sukumar Ghosh.
CSCE 2100: Computing Foundations 1 Combinatorics Tamara Schneider Summer 2013.
Lec 18 Nov 12 Probability – definitions and simulation.
1 Hiring Problem and Generating Random Permutations Andreas Klappenecker Partially based on slides by Prof. Welch.
PROBABILITY Uses of Probability Reasoning about Probability Three Probability Rules The Binomial Distribution.
1 Discrete Math CS 280 Prof. Bart Selman Module Probability --- Part a) Introduction.
1 Copyright M.R.K. Krishna Rao 2003 Chapter 5. Discrete Probability Everything you have learned about counting constitutes the basis for computing the.
1 Section 5.1 Discrete Probability. 2 LaPlace’s definition of probability Number of successful outcomes divided by the number of possible outcomes This.
Finite probability space set  (sample space) function P:  R + (probability distribution)  P(x) = 1 x 
Copyright © 2010, 2007, 2004 Pearson Education, Inc. Chapter 14 From Randomness to Probability.
Sets, Combinatorics, Probability, and Number Theory Mathematical Structures for Computer Science Chapter 3 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesProbability.
Sets, Combinatorics, Probability, and Number Theory Mathematical Structures for Computer Science Chapter 3 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesProbability.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Combinatorics.
Chapter 1 Basics of Probability.
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.
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.
Lecture Discrete Probability. 5.1 Probabilities Important in study of complexity of algorithms. Modeling the uncertain world: information, data.
1-1 Copyright © 2015, 2010, 2007 Pearson Education, Inc. Chapter 13, Slide 1 Chapter 13 From Randomness to Probability.
Discrete Mathematical Structures (Counting Principles)
Counting and Probability. Counting Elements of Sets Theorem. The Inclusion/Exclusion Rule for Two or Three Sets If A, B, and C are finite sets, then N(A.
Chapter 8: Probability: The Mathematics of Chance Lesson Plan Probability Models and Rules Discrete Probability Models Equally Likely Outcomes Continuous.
Chapter 7 With Question/Answer Animations. Section 7.1.
What Do You Expect D. Brooke Hill & Rose Sinicrope East Carolina University , Thursday, 31 October 2013 NCCTM 43 rd Annual Conference Auditorium.
Discrete Probability CSC-2259 Discrete Structures Konstantin Busch - LSU1.
March 10,  Counting  Fundamental Counting principle  Factorials  Permutations and combinations  Probability  Complementary events  Compound.
1 Discrete Structures – CNS2300 Text Discrete Mathematics and Its Applications (5 th Edition) Kenneth H. Rosen Chapter 5 Counting.
Homework Homework due now. Reading: relations
Basic Concepts of Probability Coach Bridges NOTES.
Copyright © 2010 Pearson Education, Inc. Chapter 14 From Randomness to Probability.
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.
M ONTE C ARLO SIMULATION Modeling and Simulation CS
Probabilistic Analysis and Randomized Algorithm. Average-Case Analysis  In practice, many algorithms perform better than their worse case  The average.
PROBABILITY, PROBABILITY RULES, AND CONDITIONAL PROBABILITY
From Randomness to Probability Chapter 14. Dealing with Random Phenomena A random phenomenon is a situation in which we know what outcomes could happen,
13.3 Conditional Probability and Intersections of Events Understand how to compute conditional probability. Calculate the probability of the intersection.
ICS 253: Discrete Structures I Discrete Probability King Fahd University of Petroleum & Minerals Information & Computer Science Department.
Probability Theory Modelling random phenomena. Permutations the number of ways that you can order n objects is: n! = n(n-1)(n-2)(n-3)…(3)(2)(1) Definition:
+ Chapter 5 Overview 5.1 Introducing Probability 5.2 Combining Events 5.3 Conditional Probability 5.4 Counting Methods 1.
Stat 13, Thu 4/19/ Hand in HW2! 1. Resistance. 2. n-1 in sample sd formula, and parameters and statistics. 3. Probability basic terminology. 4. Probability.
 Counting  Fundamental Counting principle  Factorials  Permutations and combinations  Probability  Complementary events  Compound events  Independent.
Section 5.3 Independence and the Multiplication Rule.
Chapter 8: Probability: The Mathematics of Chance Lesson Plan Probability Models and Rules Discrete Probability Models Equally Likely Outcomes Continuous.
Section 6.2: Definition of Probability. Probability of an event E denoted P(E) is the ratio of the number of outcomes favorable to E to the total number.
3/7/20161 Now it’s time to look at… Discrete Probability.
Probability theory and average-case complexity. Review of probability theory.
Copyright © 2010 Pearson Education, Inc. Chapter 14 From Randomness to Probability.
Probability Distributions. Constructing a Probability Distribution Definition: Consists of the values a random variable can assume and the corresponding.
Lecture PowerPoint Slides Basic Practice of Statistics 7 th Edition.
Counting and Probability. Imagine tossing two coins and observing whether 0, 1, or 2 heads are obtained. Below are the results after 50 tosses Tossing.
Probability What is the probability of rolling “snake eyes” in one roll? What is the probability of rolling “yahtzee” in one roll?
AP Statistics From Randomness to Probability Chapter 14.
1 What Is Probability?. 2 To discuss probability, let’s begin by defining some terms. An experiment is a process, such as tossing a coin, that gives definite.
13 Lesson 1 Let Me Count the Ways Fundamental Counting Principle, Permutations & Combinations CP Probability and Statistics FA 2014 S-ID.1S-CP.3S-CP.5.
PROBABILITY AND COMPUTING RANDOMIZED ALGORITHMS AND PROBABILISTIC ANALYSIS CHAPTER 1 IWAMA and ITO Lab. M1 Sakaidani Hikaru 1.
11-2 Basic Probability.
Chapter 6: Discrete Probability
Monte Carlo simulation
Conditional Probability
11-2 Basic Probability.
Conditional Probability and the Multiplication Rule
Sets, Combinatorics, Probability, and Number Theory
Presentation transcript:

CSCE 2100: Computing Foundations 1 Probability Theory Tamara Schneider Summer 2013

Why Probability Theory in CS? Estimation of Running Time – Very large worst-case running time – Better average-case running time Decisions in algorithms in presence of uncertainty – Medical diagnosis – Allocation of resource based on future needs 2

Probability Space Finite set of points, whereby each of them represents a possible outcome of a specific experiment Each point (outcome) has a probability associated with it – Probabilities are always positive!!! – The sum of all probabilities is always 1 – Assume an equal probability distribution if not otherwise stated e.g. 1/6 for a specific number of a die throw (unless die is not fair) 3

Example: Probability Space · Event E · Probability space Event E that you roll a 2, 4, or 5 Imagine you throw a dart randomly at the box. You will hit the area of E 50% of the time. P(E) = 0.5 4

Probability and Combinatorics We need to count the number of possible outcomes (probability space) We need to count the number of points in the probability space for a specific event 5

Example: Craps Throw 2 dice and calculate the probability of obtaining a total of 7 or possible outcomes The event contains 8 points. p = 8/36 ≈ 22% 6

Example: Keno Randomly select 20 numbers in the range of 1 and 80 (not repeated) Players guess 5 numbers and are rewarded if they have guessed 3, 4, or 5 correct numbers Probability space: Number of selections of twenty numbers out of eighty. 7

Example: Keno p ≈ = 8.4% 8 Ways of choosing 20 of 80: Ways of picking 3 winners out of 5 and 17 losers out of 75:

Conditional Probability Definition: If E and F are two events in a probability space, the conditional probability of F given E is the sum of the probabilities of the points that are both in E and F (region A) divided by the sum of the probabilities of the points in E. Notation: P(F/E) “ the probability of F given E E F A B A: in E and F B: in E but not in F P(F/E) = A/E 9

Example 1: Conditional Probability Toss of 2 dice Probability space has 36 elements with equal probability 1/36 E: First comes out 1 (E 1 ) F: Second comes out 1 (E 2 ) P(E) = 6/36 = 1/6 P(F) = 6/36 = 1/6 P(F/E) = 1/6 The experiments are independent, since P(F) = P(F/E). It does not matter if E occurred or not; the probability of F stays the same. 10

Deal of 2 cards from a 52 card deck Number of points in experiment (probability space): Π(52,2) = 52 × 51 = 2,652 E: First card is an ace: 4 × 51 = 204 (4 choices for ace, 51 choices for second card) P(E) = 204/2,652 = 1/13 F: Second card is an ace: 4 × 51 = 204 (4 choices for ace, 51 choices for first card) P(F) = 204/2,652 = 1/13 P(F/E) = 12/204 = 1/17 (= 3/51) since there are 4×3 = 12 combinations for aces. Example 2: Conditional Probability [1] 11

Example 2: Conditional Probability [1] Probability Space: 52 × 51 = 2,652 E: first card is an ace F: second card is an ace 2 aces none of the cards is an ace 4 × 51 = 204 4×3=12 P(E) = 204/2,652 P(F) = 204/2,652 P(F/E) = 12/204 The experiments are not independent, since P(F) ≠ P(F/E). It does matter if E occurred or not; the probability of F changes. 12

Product Rule for Independent Experiments For a sequence of outcomes of k independent experiments, we can multiply the probabilities Example E: The last 4 digits of a phone# are 1234 – E 1 = E 2 = E 3 = E 4 = 0.1 – P(E) = (0.1) 4 = = 0.01% 13

Programming Applications - Example [1] Find out if x is in array A If x is not found, running time: O(n) If x is found, running time: O(n) Is the average case running time better? Assume that all points are equally likely 14 bool find(int x, int A[], int n){ for(int i=0; i<n; i++) if(A[i] == x) return true; return false } //find

Programming Applications - Example [2] Probability space has n points: from 0 to n-1 If x is in A[k], then the loop iterates k times Assume we find it in the i-th iteration with cost c per iteration – cost d needed for initialization and return statement – running time: ci + d O(n) 15 bool find(int x, int A[], int n){ for(int i=0; i<n; i++) if(A[i] == x) return true; return false } //find

Monte Carlo Algorithms Deterministic algorithm: For the same data and same input we will always receive the same output. Monte-Carlo algorithm: Makes a random selection at each iteration. 16

Monte Carlo Example Computer chip factory Probability of a bad chip in untested box is 0.1 Testing a box of n chips takes O(n) time Monte Carlo: Select k chips from each box – If all k tested chips are OK, declare box OK – 1/10 of the chips are bad if box is untested – Probability of saying OK after testing 1 chip : 0.9 – Probability of error: (0.9) k For k=131 tests (0.9) k ≈ (if the box is good, we should find a bad chip with a probability ≈ none) ⇒ So we find a bad chip with a probability = % 17

Summary Probability Space Conditional Probabilities Independent Experiments Monte Carlo Algorithms 18