Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS433: Modeling and Simulation Dr. Anis Koubâa Al-Imam Mohammad bin Saud University 09 October 2010 Lecture 03: Probability Review.

Similar presentations


Presentation on theme: "CS433: Modeling and Simulation Dr. Anis Koubâa Al-Imam Mohammad bin Saud University 09 October 2010 Lecture 03: Probability Review."— Presentation transcript:

1 CS433: Modeling and Simulation Dr. Anis Koubâa Al-Imam Mohammad bin Saud University 09 October 2010 Lecture 03: Probability Review

2 2 Goals of today  Review the fundamental concepts of probability  Understand the difference between discrete and continuous random variable

3 3 Topics  Fundamental Laws of Probability  Discrete Random Variable  Probability Mass Function (PMF)  Continuous Random Variable  Probability Density Function (PDF)  Cumulative Distribution Function (CDF)  Mean and Variance

4 Probability Review

5 5 Fundamentals  We measure the probability for Random Events  How likely an event would occur  The set of all possible events is called Sample Space  In each experiment, an event may occur with a certain probability (Probability Measure)  Example:  Tossing a dice with 6 faces  The sample space is {1, 2, 3, 4, 5, 6}  Getting the Event « 2 » in on experiment has a probability 1/6

6 6  The probability of every set of possible events is between 0 and 1, inclusive.  The probability of the whole set of outcomes is 1.  Sum of all probability is equal to one  Example for a dice: P(1)+P(2)+P(3)+ P(4)+P(5)+P(6)=1  If A and B are two events with no common outcomes, then the probability of their union is the sum of their probabilities.  Event E1={1},  Event E2 ={6}  P(E1 U E2)=P(E1)+P(E2) Probability

7 7  Complementary Event of A is not(A)  P(A)=1-P(not A)  The probability that event A will not happen is 1-P(A).  Example  Event E1={1}  Probability to get a value different from {1} is 1-P(E1). Complementary Event

8 8  Event Union ( U = OR ) Event Intersection ( ∩= AND )  Joint Probability (A ∩ B)  The probability of two events in conjunction. It is the probability of both events together.  Independent Events  Two events A and B are independent if Joint Probability

9 9 Example on Independence 3 21 Case 1: Drawing with replacement of the ball The second draw is independent of the first draw E1: Drawing Ball 1 E2: Drawing Ball 2 E3: Drawing Ball 3 Case 2: Drawing without replacement of the ball The second draw is dependent on the first draw P(E1): 1/3 P(E2):1/3 P(E3): 1/3 Quiz: Show that in Case 2, we have

10 10 Conditional Probability  Conditional Probability p(A|B) is the probability of some event A, given the occurrence of some other event B.  If A and B are independent, then and  If A and B are independent, the conditional probability of A, given B is simply the individual probability of A alone; same for B given A.  p(A) is the prior probability;  p(A|B) is called a posterior probability.  Once you know B is true, the universe you care about shrinks to B.

11 11 Example on Independence 3 21 Case 1: Drawing with replacement of the ball The second draw is independent of the first draw E1: Drawing Ball 1 E2: Drawing Ball 2 E3: Drawing Ball 3 Case 2: Drawing without replacement of the ball The second draw is dependent on the first draw P(E1): 1/3 P(E2):1/3 P(E3): 1/3

12 12 Baye’s Rule  We know that  Using Conditional Probability definition, we have  The Bayes rule is:

13 13 Law of Total Probability  In probability theory, the law of total probability means the prior probability of A, P(A), is equal to the expected value of the posterior probability of A.  That is, for any random variable N,  where p(A|N) is the conditional probability of A given N.

14 14 Law of Total Probability  Law of alternatives: The term law of total probability is sometimes taken to mean the law of alternatives, which is a special case of the law of total probability applying to discrete random variables.  if { B n : n = 1, 2, 3,... } is a finite partition of a probability space and each set B n is measurable, then for any event A we have or, alternatively, (using Rule of Conditional Probability)

15 15 Example: Law of Total Probability Sample Space Partitions Event Law of Total Probability

16 Five Minutes Break You are free to discuss with your classmates about the previous slides, or to refresh a bit, or to ask questions. Administrative issues  Groups Formation (mandatory to do it this week)

17 17 A random variable ► Random variable is a measurable function from a sample space of events  to the measurable space S of values of possible values of the variable EventValue Each value/event has a probability of occurrence

18 18 A random variable ► Random Variable is also know as stochastic variable. ► A random variable is not a variable. It is a function. It maps from the sample space to the real numbers. ► random variable is defined as a quantity whose values are random and to which a probability distribution is assigned.

19 19 A random variable: Examples. ► The number of packets that arrives to the destination ► The waiting time of a customer in a queue ► The number of cars that enters the parking each hour ► The number of students that succeed in the exam

20 20 Random Variable Types ► Discrete Random Variable: ► possible values are discrete (countable sample space, Integer values) ► Continuous Random Variable: ► possible values are continuous (uncountable space, Real values)

21 21 Discrete Random Variable  The probability distribution for discrete random variable is called Probability Mass Function (PMF).  Properties of PMF  Cumulative Distribution Function (CDF)  Mean value and

22 22 Discrete Random Variable  Mean (Expected) value  Variance General Equation For Discrete RV

23 23 Discrete Random Variable: Example  Random Variable: Grades of the students Student ID12345678910 Grade3231231322 Probability Mass Function PDF Grade

24 24 Discrete Random Variable: Example  Random Variable: Grades of the students Student ID12345678910 Grade3231231322 Probability Mass Function Property Cumulative Distribution Function CDF Grade

25 25 Discrete Random Variable: Example  Random Variable: Grades of the students Student ID12345678910 Grade3231231322 The Mean Value

26 26 Continuous Random Variable  The probability distribution for continuous random variable is called Probability Density Function (PDF).  The probability of a given value is always 0  The sample space is infinite  For continuous random variable, we compute  Properties of PDF

27 27 Continuous Random Variable  Cumulative Distribution Function (CDF)  Mean/Expected value  Variance and

28 28 Discrete versus Continuous Random Variables Discrete Random VariableContinuous Random Variable Finite Sample Space e.g. {0, 1, 2, 3} Infinite Sample Space e.g. [0,1], [2.1, 5.3] Cumulative Distribution Function (CDF) Probability Density Function (PDF) Probability Mass Function (PMF)

29 29 Continuous Random Variables: Example Example: modeling the waiting time in a queue  People waiting for service in bank queue  Time is a continuous random variable  Random Time is typically modeled as exponential distribution   is the mean value Exponential Distribution Exp (µ)

30 30 Continuous Random Variables: Example  We assume that with average waiting time of one customer is 2 minutes PDF: f (time) time

31 31 Continuous Random Variables: Example  Probability that the customer waits exactly 3 minutes is:  Probability that the customer waits between 2 and 3 minutes is:  The Probability that the customer waits less than 2 minutes CDF

32 32 Continuous Random Variables: Example  The mean of life of the previous device is:  To compute variance of X, we first compute E(X 2 ):  Hence, the variance and standard deviation of the device’s life are: Expected Value and Variance

33 Two Minutes Break You are free to discuss with your classmates about the previous slides, or to refresh a bit, or to ask questions. Administrative issues  Groups Formation (mandatory to do it this week)

34 34 Variance  The standard deviation is defined as the square root of the variance, i.e.:

35 35 Coefficient of Variation  The Coefficient of Variance of the random variable X is defined as:

36 End of lecture There are some additional slides afterwards that may help to explain some concepts

37 37 Discrete Probability Distribution  The probability distribution of a discrete random variable is a list of probabilities associated with each of its possible values.  It is also sometimes called the probability function or the probability mass function (PMF) for discrete random variable.

38 38 Probability Mass Function (PMF)  Formally  the probability distribution or probability mass function (PMF) of a discrete random variable X is a function that gives the probability p(xi) that the random variable equals xi, for each value xi:  It satisfies the following conditions:

39 39 Continuous Random Variable  A continuous random variable is one which takes an infinite number of possible values.  Continuous random variables are usually measurements.  Examples include height, weight, the amount of sugar in an orange, the time required to run a mile.

40 40 Probability Density Function (PDF)  For the case of continuous variables, we do not want to ask what the probability of "1/6" is, because the answer is always 0...  Rather, we ask what is the probability that the value is in the interval (a,b).  So for continuous variables, we care about the derivative of the distribution function at a point (that's the derivative of an integral). This is called a probability density function (PDF).  The probability that a random variable has a value in a set A is the integral of the p.d.f. over that set A.

41 41 Probability Density Function (PDF)  The Probability Density Function (PDF) of a continuous random variable is a function that can be integrated to obtain the probability that the random variable takes a value in a given interval.  More formally, the probability density function, f(x), of a continuous random variable X is the derivative of the cumulative distribution function F(x) :  Since F(x)=P(X≤x), it follows that:

42 42 Cumulative Distribution Function (CDF)  The Cumulative Distribution Function (CDF) is a function giving the probability that the random variable X is less than or equal to x, for every value x.  Formally  the cumulative distribution function F(x) is defined to be:

43 43 Cumulative Distribution Function (CDF)  For a discrete random variable, the cumulative distribution function is found by summing up the probabilities as in the example below.  For a continuous random variable, the cumulative distribution function is the integral of its probability density function f(x).

44 44 Cumulative Distribution Function (CDF) ► Example ► Discrete case: Suppose a random variable X has the following probability mass function p(xi): ► The cumulative distribution function F(x) is then:

45 45 Mean or Expected Value Expectation of discrete random variable X Expectation of continuous random variable X

46 46 Example: Mean and variance  When a die is thrown, each of the possible faces 1, 2, 3, 4, 5, 6 (the xi's) has a probability of 1/6 (the p(xi)'s) of showing. The expected value of the face showing is therefore: µ = E(X) = (1 x 1/6) + (2 x 1/6) + (3 x 1/6) + (4 x 1/6) + (5 x 1/6) + (6 x 1/6) = 3.5  Notice that, in this case, E(X) is 3.5, which is not a possible value of X.

47 47 Variance  The variance is a measure of the 'spread' of a distribution about its average value.  Variance is symbolized by V(X) or Var(X) or σ 2.  The mean is a way to describe the location of a distribution,  the variance is a way to capture its scale or degree of being spread out. The unit of variance is the square of the unit of the original variable.

48 48 Variance  The Variance of the random variable X is defined as:  where E(X) is the expected value of the random variable X.  The standard deviation is defined as the square root of the variance, i.e.:


Download ppt "CS433: Modeling and Simulation Dr. Anis Koubâa Al-Imam Mohammad bin Saud University 09 October 2010 Lecture 03: Probability Review."

Similar presentations


Ads by Google