Basic probability Events An event is something that can happen. An - - PowerPoint PPT Presentation

basic probability events
SMART_READER_LITE
LIVE PREVIEW

Basic probability Events An event is something that can happen. An - - PowerPoint PPT Presentation

Basic probability Events An event is something that can happen. An atomic event is not composed of others. Each atomic event x has an associated probability P[x] [0,1]. The sum of the probabilities of all atomic events is 1. X


slide-1
SLIDE 1

Basic probability

slide-2
SLIDE 2
  • An event is something that can happen.
  • An atomic event is not composed of others.
  • Each atomic event x has an associated probability P[x] ∈ [0,1].
  • The sum of the probabilities of all atomic events is 1.
  • We consider only finite or countably infinite sets of atomic events.
  • Example: throwing a dice:
  • atomic events = {1, 2, 3, 4, 5, 6}
  • If it is a fair dice then: P[1] = P[2] = P[3] = P[4] = P[5] = P[6] =1/6.
  • If it is an unfair dice then we can have different probabilities for the

different events. Fx:

  • P[1] = P[2] = 1/3, P[3] = P[4] = P[5] = 1/18, P[6] =1/6

Events

X

x is atomic event

P[x] = 1

11

slide-3
SLIDE 3
  • A random variable is an entity that can assume different values.
  • The values are selected “randomly”; i.e., the process is governed by a

probability distribution.

  • Examples: Let X be the random variable “number shown by dice”.
  • X can take the values 1, 2, 3, 4, 5, 6.
  • If it is a fair dice then the probability that X = 1 is 1/6:
  • P[X=1] =1/6.
  • P[X=2] =1/6.

Random variables

12

slide-4
SLIDE 4
  • A random variable is an entity that can assume different values.
  • The values are selected “randomly”; i.e., the process is governed by a

probability distribution.

  • Examples:
  • The number shown by a dice:
  • X random variable “number shown by dice”.
  • X can take the values 1, 2, 3, 4, 5, 6.
  • If it is a fair dice then the probability that X = 1 is 1/6:
  • P[X=1] = P[X=2] = P[X=3] = P[X=4] = P[X=5] = P[X=6] =1/6.
  • The distance of two coins dropped on the floor.
  • The running time of a randomized algorithm. 


Random variables

X

slide-5
SLIDE 5
  • Let X be a random variable with values in {x1,…xn}, where xi are

numbers.

  • Let pi = P[X = xi] be the probability that X assumes value xi.
  • The expected value (expectation) of X is defined as
  • The expectation is the theoretical average.

Expected values

E[X] =

n

X

i=1

xi · pi

13

slide-6
SLIDE 6
  • Let X be the random variable “number shown by the dice”.
  • Atomic events: {1, 2, 3, 4, 5, 6}
  • Probabilities: P[1] = ··· = P[6] = 1/6
  • Composed event: Even = {2, 4, 6}
  • Composed event: ge4 = {4, 5, 6}
  • Expectation:

Example: a fair dice

14

E[X] =

n

X

i=1

xi · pi

E[X] = 1 ⋅ P[X = 1] + 2 ⋅ P[X = 2] + 3 ⋅ P[X = 3] + 4 ⋅ P[X = 4] + 5 ⋅ P[X = 5] + 6 ⋅ P[X = 6] = 1 ⋅ 1 6 + 2 ⋅ 1 6 + 3 ⋅ 1 6 + 4 ⋅ 1 6 + 5 ⋅ 1 6 + 6 ⋅ 1 6 = (1 + 2 + 3 + 4 + 5 + 6) ⋅ 1 6 = 3.5

slide-7
SLIDE 7
  • Let X be the random variable “number shown by the dice”.
  • Atomic events: 1, 2, 3, 4, 5, 6
  • Probabilities: 0.1, 0.1, 0.1, 0.3, 0.2, 0.2
  • Expectation

E[X] = 1 · 0.1 + 2 · 0.1 + 3 · 0.1 + 4 · 0.3 + 5 · 0.2 + 6 · 0.2 = 4.0 


Example: a loaded dice

15

E[X] =

n

X

i=1

xi · pi

slide-8
SLIDE 8
  • If we repeatedly perform independent trials of an experiment, each of

which succeeds with probability p > 0, then the expected number of trials we need to perform until the first succes is 1/p.

  • Linearity of expectation: For two random variables X and Y we have

E[X+Y] = E[X] + E[Y].

Expectation

16

slide-9
SLIDE 9
  • We have a fair dice that we toss 6 times.
  • Let X be random variabel “the number of times we get a 1”.
  • Let X1 be a random variable that is 1 if we get 1 in the first throw and 0 otherwise.
  • Let X2 be a random variable that is 1 if we get 1 in the second throw and 0
  • therwise.
  • ….
  • That is
  • Xi is called an indicator variable.
  • We have
  • X = X1 + X2 + X3 + X4 + X5 + X6
  • E[X] = E[X1] + E[X2] + E[X3] + E[X4] + E[X5] + E[X6]
  • E[Xi] = 1 · Pr[Xi = 1] + 0 · Pr[Xi = 0] = Pr[Xi = 1] = 1/6
  • E[X] = 1/6 + 1/6 + 1/6 + 1/6 + 1/6 +1/6 = 6/6 = 1.

Example: Using random variables for counting

Xi = { 1 we get a 1 in the ith throw

  • therwise
slide-10
SLIDE 10
  • Let A and B be events.
  • If A and B are independent then
  • P[A∧B] = P[A] · P[B]
  • If A and B are disjoint then
  • P[A∨B] = P[A] + P[B]

Rules for Probabilities

18

slide-11
SLIDE 11
  • A dice is tossed twice.
  • Let the random variable X1 be the result of first throw.
  • Let the random variable X2 be the result of second throw.
  • Events: A = (X1 = 2) and B = (X2 = 5)
  • P[A] = 1/6 and P[B] = 1/6
  • P[A∧B] = 1/36 = 1/6·1/6 = P[A] · P[B]

Independence example

19

slide-12
SLIDE 12
  • A dice is tossed once.
  • Event A = Even = {2, 4, 6}: P[A] = 1/2
  • Event B = ge4 = {4, 5, 6}: P[B] = 1/2
  • A ∧ B = {4, 6}
  • P[A∧B] = 1/3 ≠ 1/4 = P[A] · P[B]

Non-independent example

20

slide-13
SLIDE 13
  • A dice is tossed once.
  • Event A = Div3 = {3, 6}: P[A] = 1/3
  • Event B = le2 = {1, 2}: P[B] = 1/3
  • A ∨ B = {1, 2, 3, 6}
  • P[A∨B] = 2/3 = 1/3 + 1/3 = P[A] + P[B]

Disjoint example

21