Lec 18 Nov 12 Probability – definitions and simulation.

Slides:



Advertisements
Similar presentations
Lecture Discrete Probability. 5.3 Bayes’ Theorem We have seen that the following holds: We can write one conditional probability in terms of the.
Advertisements

Random Variables ECE460 Spring, 2012.
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.
Probability Fall 2011, CISC1400 Dr. Zhang.
Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 5-1 Chapter 5 Some Important Discrete Probability Distributions Statistics.
March 31, 2015Applied Discrete Mathematics Week 8: Advanced Counting 1 Discrete Probability Example I: A die is biased so that the number 3 appears twice.
Binomial Distribution & Bayes’ Theorem. Questions What is a probability? What is the probability of obtaining 2 heads in 4 coin tosses? What is the probability.
Lecture 10 – Introduction to Probability Topics Events, sample space, random variables Examples Probability distribution function Conditional probabilities.
22C:19 Discrete Structures Discrete Probability Fall 2014 Sukumar Ghosh.
Introduction to Probability
Section 16.1: Basic Principles of Probability
1 Discrete Structures & Algorithms Discrete Probability.
Review of Basic Probability and Statistics
Chapter 1 Probability Theory (i) : One Random Variable
1 Discrete Math CS 280 Prof. Bart Selman Module Probability --- Part a) Introduction.
Probability Distributions
1 Review of Probability Theory [Source: Stanford University]
Probability and Statistics Review
A random variable that has the following pmf is said to be a binomial random variable with parameters n, p The Binomial random variable.
C4: DISCRETE RANDOM VARIABLES CIS 2033 based on Dekking et al. A Modern Introduction to Probability and Statistics Longin Jan Latecki.
Great Theoretical Ideas in Computer Science.
Probability Review Thursday Sep 13.
Probability and Statistics Review Thursday Sep 11.
Chapter 21 Random Variables Discrete: Bernoulli, Binomial, Geometric, Poisson Continuous: Uniform, Exponential, Gamma, Normal Expectation & Variance, Joint.
Joint Distribution of two or More Random Variables
Review of Probability Theory. © Tallal Elshabrawy 2 Review of Probability Theory Experiments, Sample Spaces and Events Axioms of Probability Conditional.
Lecture 10 – Introduction to Probability Topics Events, sample space, random variables Examples Probability distribution function Conditional probabilities.
Prof. SankarReview of Random Process1 Probability Sample Space (S) –Collection of all possible outcomes of a random experiment Sample Point –Each outcome.
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.
Chapter 1 Probability and Distributions Math 6203 Fall 2009 Instructor: Ayona Chatterjee.
Winter 2006EE384x1 Review of Probability Theory Review Session 1 EE384X.
Binomial Distributions Calculating the Probability of Success.
Lecture Discrete Probability. 5.3 Bayes’ Theorem We have seen that the following holds: We can write one conditional probability in terms of the.
1 Lecture 7: Discrete Random Variables and their Distributions Devore, Ch
5.3 Random Variables  Random Variable  Discrete Random Variables  Continuous Random Variables  Normal Distributions as Probability Distributions 1.
Random Variables. A random variable X is a real valued function defined on the sample space, X : S  R. The set { s  S : X ( s )  [ a, b ] is an event}.
BINOMIALDISTRIBUTION AND ITS APPLICATION. Binomial Distribution  The binomial probability density function –f(x) = n C x p x q n-x for x=0,1,2,3…,n for.
Binomial Experiment A binomial experiment (also known as a Bernoulli trial) is a statistical experiment that has the following properties:
Week 21 Conditional Probability Idea – have performed a chance experiment but don’t know the outcome (ω), but have some partial information (event A) about.
Probability Theory for Networking Application Rudra Dutta ECE/CSC Fall 2010, Section 001, 601.
STA347 - week 31 Random Variables Example: We roll a fair die 6 times. Suppose we are interested in the number of 5’s in the 6 rolls. Let X = number of.
22C:19 Discrete Structures Discrete Probability Spring 2014 Sukumar Ghosh.
Natural Language Processing Giuseppe Attardi Introduction to Probability IP notice: some slides from: Dan Jurafsky, Jim Martin, Sandiway Fong, Dan Klein.
Probability (outcome k) = Relative Frequency of k
Basics on Probability Jingrui He 09/11/2007. Coin Flips  You flip a coin Head with probability 0.5  You flip 100 coins How many heads would you expect.
Copyright © 2006 The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin Review of Statistics I: Probability and Probability Distributions.
Random Variables Example:
Chapter 16 Week 6, Monday. Random Variables “A numeric value that is based on the outcome of a random event” Example 1: Let the random variable X be defined.
Chapter 2: Probability. Section 2.1: Basic Ideas Definition: An experiment is a process that results in an outcome that cannot be predicted in advance.
© by Yu Hen Hu 1 ECE533 Digital Image Processing Review of Probability, Random Process, Random Field for Image Processing.
3/7/20161 Now it’s time to look at… Discrete Probability.
Probability Distribution. Probability Distributions: Overview To understand probability distributions, it is important to understand variables and random.
Random Variables Lecture Lecturer : FATEN AL-HUSSAIN.
Random Variables By: 1.
Ch 11.7 Probability. Definitions Experiment – any happening for which the result is uncertain Experiment – any happening for which the result is uncertain.
Conditional Probability 423/what-is-your-favorite-data-analysis-cartoon 1.
ONE DIMENSIONAL RANDOM VARIABLES
Random variables (r.v.) Random variable
Introduction to Discrete Mathematics
Appendix A: Probability Theory
Natural Language Processing
Introduction to Probability
Probability Trees By Anthony Stones.
The Binomial and Geometric Distributions
M248: Analyzing data Block A UNIT A3 Modeling Variation.
Discrete Random Variables: Basics
Discrete Random Variables: Basics
Discrete Random Variables: Basics
Chapter 11 Probability.
Presentation transcript:

Lec 18 Nov 12 Probability – definitions and simulation

(Discrete) Sample space Experiment: a physical act such as tossing a coin or rolling a die. Sample space – set of outcomes. Coin toss Sample Space S = { head, tail} Rolling a die Sample space S = {1, 2, 3, 4, 5, 6} Tossing a coin twice. Sample space S = {(h,h), (h,t), (t,h), (t,t)}

Events and probability Event E is any subset of sample space S. You flip 2 coins Sample space S = {(h,h), (h,t), (t,h), (t,t)} Event: both tosses produce same result E = {(h,h), (t,t)} Prob(E) = |E|/ |S| In the above example, p(E) = 2/4 = 0.5 Question: what is the probability of getting at least one six in three roles of a die?

Bernoulli trial Bernoulli trials are experiments with two outcomes. (success with prob = p and failure with prob = 1 – p.) Example: rolling an unloaded die. Success is defined as getting a role of 1. p(success) = 1/6

Random Variable Random variable (RV) is a function that maps the sample space to a number. E.g. the total number of heads X you get if you flip 100 coins Another example: Keep tossing a coin until you get a head. The RV n is the number of tosses. Event = { H, TH, TTH, TTTH, … } RV n(H) = 1, n(TH) = 2, n(TTH) = 3, … etc.

Common Distributions Uniform X: U[1, N] Binomial distribution X takes values 1, 2, …, N E.g. picking balls of different colors from a box Binomial distribution X takes values 0, 1, …, n N coin tosses. What is the prob. That there are exactly k tails?

Conditional Probability P(A|B) is the probability of event A given that B has occurred. Suppose 6 coins are tossed. Given that there is at least one head, what is the probability that the number of heads is 3? Definition: p(A|B) =

Baye’s Rule If X and Y are events, then p(X|Y) = p(Y|X) p(X)/p(Y) Useful in situation where p(X), p(Y) and p(Y|X) are easier to compute than p(X|Y).

Independent events Definition: X and Y are independent if

Monty Hall Problem You're given the choice of three doors: Behind one door is a car; behind the others, goats. You want to pick the car. You pick a door, say No. 1 The host, who knows what's behind the doors, opens another door, say No. 3, which has a goat. Do you want to pick door No. 2 instead?

Host reveals Goat A or Host reveals Goat B                          Host must reveal Goat B                          Host must reveal Goat A                                                       Host reveals Goat A or Host reveals Goat B                          

Monty Hall Problem: Bayes Rule : the car is behind door i, i = 1, 2, 3 : the host opens door j after you pick door i

Monty Hall Problem: Bayes Rule continued WLOG, i=1, j=3

Monty Hall Problem: Bayes Rule continued

Monty Hall Problem: Bayes Rule continued You should switch!

Continuous Random Variables What if X is continuous? Probability density function (pdf) instead of probability mass function (pmf) A pdf is any function that describes the probability density in terms of the input variable x.

Probability Density Function Properties of pdf Actual probability can be obtained by taking the integral of pdf E.g. the probability of X being between 0 and 1 is

Cumulative Distribution Function Discrete RVs Continuous RVs

Common Distributions Normal E.g. the height of the entire population

Moments Mean (Expectation): Discrete RVs: Continuous RVs: Variance:

Properties of Moments Mean If X and Y are independent, Variance

Moments of Common Distributions Uniform Mean ; variance Binomial Mean ; variance Normal Mean ; variance

Simulating events by Matlab programs Write a program in Matlab to distribute the 52 cards of a deck to 4 people, each getting 13 cards. All the choices must be equally likely. One way to do this is as follows: map each card to a number 1, 2, …, 52. Generate a random permutation of the array a[1 2 … 52], then give the cards a[1:13] to first player, a[14:26] to second player etc.

Random permutation generation We can use ceil(rand()*n) to generate a random number from the set {1, 2, …, n}. Algorithm generate a random permutation: 1. Start with array a = [ 1 2 … n] 2. For j = n: -1: 1 randomly pick a number r in [1..j]. Switch a[r] and a[j] 3. Output a.