Docsity

Understanding Probability Theory: Random Variables, Expectation, & Discrete Distributions, Slides of Java Programming

Partial preview of the text

Download Understanding Probability Theory: Random Variables, Expectation, & Discrete Distributions and more Slides Java Programming in PDF only on Docsity!

Today

  • Random variables
  • Expectation
  • Examples of discrete random variables
    • Bernoulli random variables
    • Binomial random variables
    • Geometric random variables
    • Poisson random variables
    • Power law distributions (didn’t get to this.. next time!)

Review of Probability Definitions

  • An experiment is an activity that results in exactly one of several possible outcomes.
  • The set of all possible outcomes of an experiment is called the sample space, typically denoted Ω.
  • An event is a collection of outcomes – that is, a subset of the sample space.
  • The atomic events are the basic, fundamental elements of the sample space. They are always mutually exclusive and exhaustive.

Random Variables

A random variable is a real-valued function of the outcome of an experiment…. though we won’t always write them as a function.

Random Variables

A random variable is a real-valued function of the outcome of an experiment…. though we won’t always write them as a function. Example: Suppose we roll two six-sided dice.

  • Sample space Ω ={11, 12, 13, ..., 66}
  • Random variables: the sum of the two rolls, the number of sixes rolled, the product of the two rolls, the value of the first roll, the number of even rolls, etc.

Random Variables

A random variable is called discrete if the set of values that it can take on is finite or countably infinite. For the next few lectures, we will only discuss random variables that are discrete.

Random Variables

A random variable is called discrete if the set of values that it can take on is finite or countably infinite. For the next few lectures, we will only discuss random variables that are discrete. In this class, we will use upper case letters for random variables and lower case letters for their values.

Probability Mass Functions

The probability mass function (PMF) of a random variable X is denoted p X

. For any value k that X can take on, p X ( k ) is the probability of the event {X= k }, so p X ( k ) = P(X= k ) = P({X= k }) Example: Suppose we flip a fair coin twice. Let X be the number of heads. What is p X (0)? What is p X

Probability Mass Function

  • Let P(X S) denote the probability that X takes on a value in the set S. How can we calculate this?

Probability Mass Function

  • Let P(X S) denote the probability that X takes on a value in the set S. How can we calculate this?
  • Example: Suppose we flip a fair coin twice. Let X be the number of heads. What is P(X≥1)?

P ( X ∈ S ) = p

X

( k )

values k ∈ S

Probability Mass Function

  • Let P(X S) denote the probability that X takes on a value in the set S. How can we calculate this?
  • Example: Suppose we flip a fair coin twice. Let X be the number of heads. What is P(X≥1)?
  • The same reasoning can be applied to show that

P ( X ∈ S ) = p

X

( k )

values k ∈ S

p

X

( k )

all values k

∑ =^1

Bernoulli Random Variables

  • Consider a biased coin that lands on heads with probability p. Let X be a random variable that takes on the value 1 if the coin is heads and 0 if the coin is tails. Such a variable is called a Bernoulli random variable.
  • Examples: A server can be online or not. A new email that you receive can be spam or not. A web user can click or not click on an ad that is displayed.

Bernoulli Random Variables

  • Consider a biased coin that lands on heads with probability p. Let X be a random variable that takes on the value 1 if the coin is heads and 0 if the coin is tails. Such a variable is called a Bernoulli random variable.
  • Examples: A server can be online or not. A new email that you receive can be spam or not. A web user can click or not click on an ad that is displayed.
  • The probability mass function is defined as follows: p X (1) = p p X (0) = 1- p

Binomial Random Variables

  • Suppose we flip the biased coin n times. Let X be the total number of heads that we see. Such a variable is called a binomial random variable.
  • Examples: Number of our n servers that are online, number of emails that are spam when we receive n emails, number of users who click on an ad when n users come to a site.

Binomial Random Variables

  • Suppose we flip the biased coin n times. Let X be the total number of heads that we see. Such a variable is called a binomial random variable.
  • Examples: Number of our n servers that are online, number of emails that are spam when we receive n emails, number of users who click on an ad when n users come to a site.
  • How can we calculate p X ( k ) for a particular value of k?