* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download Working with Probability ~ 2
Survey
Document related concepts
Transcript
Working with Probability ~ 2 Joseph Spring School of Computer Science Measures and Models of Software Engineering Areas for Discussion • Random Variables • Probability Distributions • Probability Density Function • E(X) and Var(X) Random Variables There are two types of random variable: – Discrete – Continuous A random variable (also referred to as variate) is a function associating events/outcomes from a sample space to numeric values, subject to chance (i.e. probability) Random Variables For Example • The number of threes resulting when 2 dice are thrown • Amount of pocket money received given that it is a multiple of the value obtained when a die is thrown • Winnings from the throw of a die / turn of a roulette wheel / turn of a card / … Random Variables • Random Variables (r.v.) are represented by capital letters (X, Y, Z, T, etc; …) • Particular values that a r.v. can take are represented by lower case letters (x1, x2, .... ) • the function P that allocates probabilities is referred to as the pdf - ( the probability density function ) Properties of a Random Variable • Discrete r.v. – variable takes only discrete values (no continuous values) – variable takes a finite number of possible values x1, x2, .... , xn – Σpi = 1 where pi is P( X = xi ) (P is the pdf) So if you add the associated probabilities you get 1 Examples of Discrete Random Variables • Uniform Distribution • Binomial Distribution • Poisson Distribution • …. Properties of a Random Variable • Continuous r.v. (height, mass, time, …) – variable takes only continuous values – variable defined over a range of values a ! x ! b so an infinite number of possible values for a ≠ b – the pdf is now represented by a function f(x) and probabilities are determined by the area under the curve given by f(x), (as with Normal Distribution) Examples of Continuous Random Variables • Uniform Distribution • Exponential Distribution • …. • Normal Distribution Properties of a Random Variable • Drawing from lecture Examples - Discrete 1 Trivial case For a die we could take: X = { 1, 2, 3, 4, 5, 6 } the number of dots on each face The associated pdf would be: P( X = xi ) = 1/6 which holds for all values of x Examples - Discrete This gives the following probability distribution: X = x P ( X i = x i ) 1 2 3 4 5 6 1 /6 1 /6 1 /6 1 /6 1 /6 1 /6 Examples - Discrete 2 A tetrahedral die has numbers 1, 2, 3, 4 on its faces. The die is biased so that the probability of the die landing on the number n is inversely proportional to n So for example P( X = 3 ) = k/3 where k is a constant. Given that X is a r.v. representing the number that the die lands upon after one throw of the die find the probability distribution for X and solve for k. Examples - Discrete Solution: X = x i P ( X = x i) 1 2 3 4 k /1 k /2 k /3 k /4 X is a r.v. So k/1 + k/2 + k/3 + k/4 = 1 Hence (25/12)k = 1 and therefore k = 12/25 Examples - Discrete The resulting probability distribution is: X = x P (X i = x i) 1 1 2 /2 5 2 6 /2 5 3 4 /2 5 4 3 /2 5 E(X) and Var(X) E(X) and Var(X) are now the symbols we use to denote – the expectation/expected value of the r.v. X – and variance (respectively) of the r.v. X Areas for Discussion • Random Variables • Probability Distributions • Probability Density Function • E(X) and Var(X)