59
Probability and Counting Basic Counting Principles Permutations and Combinations Sample Spaces, Events, Probability Union, Intersection, Complements; Odds Conditional Probability, Independence Bayes’ Formula Random Variable, Distribution, Expectation Basic Counting Principles Sets, Operations on Sets Addition Principle Venn Diagrams Multiplication Principle

Probability and Counting - Louisville

  • Upload
    others

  • View
    19

  • Download
    0

Embed Size (px)

Citation preview

Probability and Counting

■ Basic Counting Principles■ Permutations and Combinations■ Sample Spaces, Events, Probability■ Union, Intersection, Complements; Odds■ Conditional Probability, Independence■ Bayes’ Formula■ Random Variable, Distribution, Expectation

Basic Counting Principles

■ Sets, Operations on Sets

■ Addition Principle

■ Venn Diagrams

■ Multiplication Principle

Some TerminologyA SET is a COLLECTION of objects calledELEMENTS

A={a,b,m,n,1,2,3} 1∈∈∈∈ A “1 is an element of A”B={*,&,#,@,!,-,P}C={1,2,3} “C is a subset of A”

D={ { },{1},{2},{3},{1,2},{1,3},{2,3},{1,2,3} }E={ }

EMPTY SETPOWER SET

C A⊆

UNION: all elements which arein A or B (or both) but no repeats!

BA ∩ all elements that are in both, A and B

INTERSECTION:

{2}=a,4}{2, {1,2,3} ∩

BA ∪

{ } { } { }a1,2,3,4,a,42,1,2,3 =∪

Complements:

Universal Set = Set of all things to be considered for this case

U = all students in classU = all students in classU = all students in classU = all students in classA = students getting an AA = students getting an AA = students getting an AA = students getting an AB = students getting a BB = students getting a BB = students getting a BB = students getting a BA’= complement of A, all students not A’= complement of A, all students not A’= complement of A, all students not A’= complement of A, all students not

getting an A getting an A getting an A getting an A A’= U A’= U A’= U A’= U \\\\ A “ UA “ UA “ UA “ U minus A ”minus A ”minus A ”minus A ”

Addition Principle

Counting elements in a set:

n(A)= number of elements in A (distinct)

n({1,z,2,3})= 4F = set of female students in this roomM= set of male students in this room

set of students in this roomF M ∪

n(F)n(M)F) n(M +=∪

A = set of business majors registered for class

B = set of students present today

= set of business majors or students present today

A B = set of business majors present today�

B)n(A -n(B)n(A)B) n(A ∩+=∪

B A ∪

Addition Principle for Counting

For any two sets A and B

If A and B are disjoint, i.e. { }or =BA ∅∩

B)n(A -n(B)n(A)B) n(A ∩+=∪

n(B)n(A)B)n(A +=∪

Practical Problem

UUUU students in this class 40students in this class 40students in this class 40students in this class 40A students owning carA students owning carA students owning carA students owning carB students owning computerB students owning computerB students owning computerB students owning computer

30 students own a car30 students own a car30 students own a car30 students own a car20 students own a computer20 students own a computer20 students own a computer20 students own a computer15 own both15 own both15 own both15 own both

How many have neither?How many have neither?How many have neither?How many have neither?

U

A B

Venn Diagram

Assigning Students Numbers

Suppose each student is assigned a 5 digit number. How many different numbers can be created?

Each digit is 0,1,2,3,4,5,6,7,8,9

Ten possibilities for each

10*10*10*10*10=105=100,000

More interestingly

A) Suppose not digit is repeatedFirst slot: 10 PossibilitiesSecond 9 PossibilitiesThird 8 PossibilitiesFourth 7 PossibilitiesFifth 6 Possibilities

TOTAL = 10*9*8*7*6 = 30240B) No two adjacent digits are equal

First slot: 10 Possibilities2,3,4,5: 9 Possibilities

TOTAL = 10*9*9*9*9 = 65610

Multiplication Rule1. If two operations O1 and O2 are performed in order, with N1 and N2 possible outcomes, respectively, then there are

N1*N2possible combined outcomes.

2. For O1,O2,…,Ok operations with N1,N2,…,Nkpossible outcomes, then there are

N1*N2*…*Nkpossible combined outcomes

Permutations and Combinations

■ FACTORIAL

■ PERMUTATIONS

■ COMBINATIONS

■ APPLICATIONS

Factorial

Counting without replacement involved

25*24*23*…*2*1

and similar products, multiplying several numbers, each one less than the previous.

Beginning Lotto:

Pick 6 numbered balls out of 49 (numbered consecutively 1,2,3,…,49) without replacing them. How many ways can this be done (the order is important here)First ball: 49 choicesSecond : 48Third: 47Fourth: 46Fifth: 45Sixth: 44Total: 49*48*47*46*45*44 = 10,068,347,520

So there are over 10 billion ways to pick the six balls. But the order is not importantwhen playing Lotto.

1 2 3 4 5 66 5 4 3 2 11 3 2 4 5 6 etc. are the same

and should not be counted separate.

We will get back to that soon.

Factorial

For a natural number n,

n!=n*(n-1)*(n-2)*…*2*1

0!=1

n!=n*(n-1)!

Read “n factorial”.

Examples:

6! = 6 5 4 3 2 1= 7207! = 7 (7 - 1)! = 7 (6!) = 7 720 = 504049!43! =

49 48 47 46 45 44 43 42 ... 2 143 42 ... 2 1

=49 48 47 46 45 44 (43!)

43! = 49 48 47 46 45 44

49!43!6! =

49 48 47 46 45 446! =

10068347520720 = 13,983,816

• • • • •• • •

• • • • • • • • • •• • • •

• • • • • •• • • • •

• • • • •

Permutations

Recall the lotto example:Order was not important!

Question: How many was can we rearrange or permute the numbers

1 2 3 4 5 6

We can choose any one of the 6 forthe first slot, any of the remaining 5 for the second etc.1st 62nd 53rd 44th 35th 26th 1

Total 6!=720.

There is nothing particular about the numbers 1 2 3 4 5 6, any six distinct objects can be arranged in 6! differentways.

A Permutation of a Set of Objects

A permutation of a set of distinct objects is an arrangement of the objects in a specific order without repetition.

Number of Permutations of n Objects

The number of permutations of n distinctobjects without repetition, denoted Pn,n,is given by

Pn,n = n*(n-1)*(n-2)*…*2*1=n!

A permutation of n Objects r at a Time

In our Lotto example we have 49 numbers available but pick only 6 at a time:

49 choices for the first

48 for the second

44 for the sixth

49,6P6)!-(49

49!43!49!44454647 48 49 ===•••••

A Permutation of n Objects, r at a time

A permutation of a set of n distinct objects taken r at a time without repetition is an arrangement of the r objects in a specific order

The number of Permutations of n Objectstaken r at a timeThe number of permutations of n distinct objects taken r at a time without repetition is given by

n!P nr0 r)!-(n

n!P

factors 1)r(n1)-(nnP

nn,rn,

rn,

=≤≤=

+−•••= r�

Combinations

In our Lotto example the order of the six numbers did not matter. So we can NOT use the permutation formula.

Combination of n Objects taken r at a time

A combination of a set of n distinct objects taken r at a time without repetition is an relement subset of a set of n objects. The arrangement of the elements does NOT matter.

Simple Example:

How many ways can 2 out of 3 paintings of an artist be selected for shipment to an exhibition? Let the paintings correspond to {A,B,C}

First choice: A B C

Second: B or C A or C A or B

Ordered: (A,B) ; (A,C) (B,A) ; (B,C) (C,A) ; (C,B)

There are 6 permutations, but only 3 combinations: {A,B};{A,C};{B,C}

Number of Combinations of n objects taken r at a time

The number of combinations of n distinct objects taken r at a time without repetition is given by

nr0 r)!-(nr!

n!r!

Prn

C rn,rn, ≤≤==��

����

�=

How many 5 card hands can be drawn from a 52 card deck?

2,598,960120

48 49 50 51 52)(47!120

52!5)!-(525!

52!552

C52,5

=••••

=•

==���

����

�=

Permutation: ORDER MATTERS

Combination: ORDER DOES NOT MATTER

Sample Spaces, Events and Probability

■ EXPERIMENTS

■ SAMPLE SPACES AND EVENTS

■ PROBABILITY OF AN EVENT

■ EQUALLY LIKELY ASSUMPTION

Experiments

We need: Mathematical Model for Probability

Random Experiments:

Do not yield same result if repeated

Result of Experiment = Outcome

Sample Spaces and Events

Experiment = rolling a six sided die

Outcomes: one dot uptwo dots up

etc. Possible outcomes of oneexperiment:

Simple OutcomesSimple Events

S = , , , , ,•�

���

���

���

���

••

���

���

• •

• •

���

���

• ••

• •

���

���

• • •

• • •

���

���

Sample Spaces and Events

S is a sample space for an experiment ifin each trial one and only one of the elements of S can occur as outcome.The elements of S are called simple eventsor simple outcomes.

An event E is any subset of S, including the empty set and S itself. E is a simple event if it contains exactly one element ofS, it is a compound event if it contains more than one element. We say the event Eoccurs if any of the simple events in E occur.

For dice we could think of the die havingthe numbers {1,2,3,4,5,6} written on each side (instead of dots), then S= {1,2,3,4,5,6}.

A simple event would be E={3} (rolling a 3)or E={6} (rolling a 6)

A compound event E={1,3,5} (rolling and odd number)this happens if we roll a 1 or a 3 or a 5

Coin Tossing:Tossing one coin: Once: Head or Tail S={H,T}Twice: S={HH,HT,TH,TT}

Tossing two coins(nickel and dime):Once:

Start

Nickel Dime Combined

H

T

HTHT

HHHTTHTT

The sample space also depends on what question in which we are interested:

Number of heads when tossing two coins:

S={0,1,2}

Do both coins show the same side:

S={yes,no}

Choosing the Sample Space:

There is NO ONE correct sample space for a given experiment. We need to include enough detail to answer all questions of interest regarding the outcomes of the experiment. When in doubt choosea sample space with more rather than less elements.

Rolling a die and tossing a coin:

1 2 3 4 5 6

H (H,1) (H,2) (H,3) (H,4) (H,5) (H,6)

T (T,1) (T,2) (T,3) (T,4) (T,5) (T,6)

S={ (H,1),(H,2),(H,3),(H,4),(H,5),(H,6),(T,1),(T,2), (T,3),(T,4),(T,5), (T,6) }

Probability of an Event

We need a way to compare different experiments such as two lotteries, say Lotto Kentucky and Power Ball. Which one

(A) gives us a better chance of winning

(B) is more likely to produce more money

To answer (A), we need a NUMBER that is independent on the exact nature of the experiment and measures the likelihood ofwinning.

Number of “good” outcomes versus

Number of all possible outcomes

Probability of rolling a 3 with one fair six sideddie is 1 in 6 or 1/6.

Probabilities for Simple Events

Given a sample space S={e1,e2,…,en} with nsimple events ei we assign a real number, denoted P(ei), called the probability of ei to each simple event. These numbers have to meet only the following conditions:

1) 0 < P(ei) < 1 for i=1,2,…,n

2) P(e1)+P(e2)+…+P(en)=1

Equally Likely Assumption

If the experiment is such that each simple event is equally likely (fair coin, fair die,fair poker dealer, but not horse racing), then

Probability of a simple event with equallylikely assumption:Sample space S={e1,e2,…,en}, with n elements, then under equally likely assumption we have

P(e ) =1ni for i=1,2,…,n

Rolling a die: is it fair or not?

Experiment: Roll it 600 times

If fair:About 100 times each of 1,2,3,4,5,6

Empirical Probability Approximation

P(e )Frequency of occurrence of e

Total number of trials=

f(e )n

(The larger n is the better the approximation)

ii i≈

Probability of an arbitrary event E

Given probabilities for simple events, wedefine the probability of an event E as

(A) E is empty set, then P(E)=0(B) E is simple, then P(E) is known(C) E is compound, then P(E) is the sum

of all P(ei) for ei in E (over all simpleevents in E)

(D) E=S (the sample space) then P(E)=1(Note: this is a consequence of C)

theorem 1

Probability of E under equally likely

If we assume each simple event in the sample space S to be equally likely, then

P(E) =Number of elements in ENumber of elements in S

=n(E)n(S)

Page 403 #20

Suppose 6 people check their coats in a checkroom. If all claim checks are lost and the 6 coats are randomly returned, what is the probability that all people will get their own coats back?

SolutionThe experiment is drawing 6 coats without replacement from 6 available coats. Person A gets the first coat, Person B the second etc. So order does matter and we need permutations of 6 coats 6 at a time, P6,6

For the probability we need to know how many correct assignments there are. Only one!

0.001389 720

16!1

P1P(E)6,6

≈===

Union, Intersection, Complementof Events

Odds

■ UNION and INTERSECTION■ COMPLEMENT of an EVENT■ ODDS■ APPLICATIONS to EMPIRICAL

PROBABILITY

Union and IntersectionA, B events in (i.e. subsets of) sample spaceS, then A B (“A union B”) and A B (“A inter-sect B”) are

∪ ∩

A B = {e S|e A or e B} ∪ ∈ ∈ ∈

A B= {e S|e A and e B}∩ ∈ ∈ ∈

A BS

S

The event A or B is A B

The event A and B is A B

Example: Rolling a die, S={1,2,3,4,5,6}a) E=Rolling an odd number or a number

greater than 3.A={1,3,5} B={4,5,6} E=A B={1,3,4,5,6}P(E)=n(E)/n(S)=5/6

b) F=Rolling an odd number and a numbergreater than 3.

A={1,3,5} B={4,5,6} F=A B={5}P(F)=n(F)/n(S)=1/6

Recall:

And since

Probability of a Union of two Events:

P(A B)=P(A)+P(B)-P(A B)

If A and B are mutually exclusive (A B)= )

P(A B)=P(A)+P(B)

∪ ∩

n(S)B)n(A-n(B)n(A)

n(S)B)n(AB)P(A ∩+=∪=∪

B)n(A-n(B)n(A)B)n(A ∩+=∪

Complement of an Event

S={e1,e2,…,en}

E and E’ subsets of S such that

E E’=S

E E’= then E’ is the complement of E in S

E’= set of all elements of S NOT in E.

∩ ∅

S

E

E’

Complements

P(E)=1-P(E’) P(E’)=1-P(E)

Recall thatP(S)=1 and P(E E’)=P(E)+P(E’)∪

Birthday ProblemSuppose everyone has one of 365 birthdays(no leap years). We have 39 students registeredwhat is the probability that at least two have the same birthday (only day not year)?

S=possible birthdays for 39 people:

n(S)=365*365*…*365 = 36539

E=at least two people have same birthdayE’=everyone has a different birthday

To determine n(E’), we note that the first personcan have any of 365 birthdays, but the secondonly 364 (not the same as the previous person)and the third only 363 (not same as all previouspersons) etc.

n(E’)=365*364*363*…(365-38) (39 terms) =365!/(365-39)!

with the equally likely assumption

P(E’)=n(E’)/n(S)= =0.122

P(E)=1-P(E’)=0.87839)!-(365365

365!39

From Probability to OddsOdds for E and odds against E

If P(E) is the probability of event E, then

Odd for E=

Odds against E=

P(E)1-P(E)

= P(E)P(E')

P(E) 1≠

P(E')P(E)

P(E) 0≠

Probability measures: • good events divided by all possible events

Odds measure:• good events divided by bad events

or Probability of winning divided byProbability of loosing

From Odds to Probability

If the odds for the event E are a/b, thenthe probability of E is

P(E)= aa+b

Fair Game

If the odds for the event E are a/b, then we say the game is fair if your bet of $a is lost if E does not happen, but you win $b if E does happen.

Single Roll of Two Fair DiceWhat is the probability (what are the odds)of rolling a sum of 8?

1111 2222 3333 4444 5555 66661111 2 3 4 5 6 72222 3 4 5 6 7 83333 4 5 6 7 8 94444 5 6 7 8 9 1 05555 6 7 8 9 1 0 1 16666 7 8 9 1 0 1 1 1 2

1st

di

e

roll

roll of the second die

There are 5 ways of getting an 8, butthere are 36 total possibilities, thus

P(E)= 536

=0.1389

The odds for E are

P(E)1-P(E)=

536

1-=

5363136

= 5315

36

If you bet $5 that a sum of 8 turns up,how much should the house pay to makethis a fair game?

Since the odds are 5:31 the house shouldpay $31 if a sum of 8 comes up.

Applications to empirical probabilityOdds for E is number of elements in Edivided by number of elements in S but NOT in E

1000 people are surveyed, 500 tried brand A600 tried brand B and 200 tried both. What are the empirical odds for the event E that one person has tried at least one of the brands?

901000900 .==∪

=

=

=

=+=∩+=∪

n(S)B)n(A isy probabilit empirical

one" to nine" 1:9 100900

neither tried whopeople of numbereither tried whopeople of Number

are E forodds the Therefore100900-1000

either tried thaven’ whopeople of number900200-600500B)n(A-n(B)n(A)B)n(A

Conditional Probability,Intersection, Independence

■ CONDITIONAL PROBABILITY■ INTERSECTION OF EVENTS

(PRODUCT RULE)■ PROBABILITY TREES■ INDEPENDENT EVENTS■ SUMMARY

Probability of someone carrying a bomb on an airplane = p1

Probability of two people carryinga bomb on an airplane = p2

p2 << p1

Should you always carry a bomb?

NO!NO!NO!NO!

Conditional Probability

The probability of a second person carryinga bomb, given that you already brought one,is the same as the probability any one personcarrying on a bomb.

P(second bomb| first bomb)=P(one bomb)

“probability of a second bomb, given thatwe know there is already one”

Probability that you roll a 6 with a singleroll of a fair die, given that the person before you rolled a 6

If the die is fair, this knowledge does not help. P(6|6 previously)=P(6)=1/6

Probability that you rolled a prime number{2,3,5} given that you rolled an odd numberThere are 3 odd numbers, {1,3,5}, but only {3,5} are prime

P(prime|odd)=2/3

Rules for Conditional Probabilities

P(A|B)=n(A B)n(B)

=n(A B)

n(S)n(B)

n(S)=P(A B)

P(B)∩

∩∩

Conditional ProbabilityFor events A and B in a sample space S, the conditional probability of A given B is

P(B) ≠ 0

Intersection of EventsProduct Rule

P(A|B)=P(A B)P(B)

and P(B|A)=P(A B)P(A)

soP(A B)=P(A|B)P(B)=P(B|A)P(A)

∩ ∩

Last time we discussed the probability ofa union of two events, what about intersection?

If 60% of the customers of a departmentstore are female and 80% of the male customers have charge accounts, what isthe probability that a customer selectedat random is male and has a charge account?

P(male)=1-P(female)=1-0.6=0.4

P(charge|male)=0.8

P(male and charge)=P(charge|male)P(male)

= 0.8 * 0.4 =0.32

Probability Trees

A box has two green (striped)and three blue (dotted) balls.We draw two balls withoutreplacement.

Sstart

g1

b1

g2

b2g2

b2

Sstart

g1

b1

g2

b2

g2

b2

25

35

14

34

24

24

P(g2|g1)=

P(b2|b1)=

101=

41

52=)1g|2)P(g1=P(g)2g1P(g •∩

103=

43

52=)1g|2)P(b1=P(g)2b1P(g •∩

103=

42

53=)1|b2)P(g1=P(b)2g1P(b •∩

103=

42

53=)1b|2)P(b1P(b=)2b1P(b •∩

Total =1

Constructing Probability Trees

Step 1. Draw tree diagram, all combined outcomes of sequences of experiments

Step 2. Assign probabilities to each branch; probability of combined outcome is product of all probabilities leading to that end

Step 3. Use the results of the above to answer all questions

More Draws, Bigger Tree

Draw three times withoutreplacement, what is the probability to draw a) striped, striped, dotted

(g,g,b)=g1g2b3b) dotted, dotted, dotted

(b,b,b)=b1b2b3c) striped, striped, striped

(g,g,g)=g1g2g3

S

g1

b1

b2

g2

b2

g2

g3

g3

g3

b3

b3

b3

b3

IndependenceSuppose instead of keeping the balls out afterthey were drawn, we put them back in, thenit looks as follows:After 1 draw After 3 drawsAfter 2 draws

Independence

If A and B are any events then we saythat A and B are independent if and onlyif

P(A B) = P(A)P(B)∩

Otherwise, And B are dependent

Theorem 1: On Independence

If A and B are independent events withnonzero probability, then

P(A|B)=P(A) and P(B|A)=P(B)

If either of the above equations holds,then A and B are independent.

Testing for Independence

We need to check whether the probabilitythat events A and B occur together is thesame as the product of the probability ofA and the probability of B

Toss a coin twice:S={HH,HT,TH,TT} A={HH,HT} B={HH,TH}

P(A and B)=P(HH)=1/4P(A)=1/2; P(B)=1/2; P(A)P(B)=1/2*1/2=1/4

Independent of Set of Events

A set of events is said to be independent if for any finite subset {E1,E2,…,Ek} we have

)kP(E)2P(E)1P(E=)kE2E1P(E �� ∩∩∩

Problem 50 page 434

Quality control: A car manufacturer produces37% of its cars at plant A. If 5% of the cars made at plant A have a defective part, what is the probability that car of this manufacturer was made at plant A and has a defective part?

A=made at plant A; D=defective part

P(A)=0.37, P(D|A)=0.05P(A and D)=0.37*0.05= 0.0185

Summary

)k P(E) ) P(E)=P(EkE EP(Ek ,E, ,EE

P(B)P(A))P(B|A)=P(B)P(A|B)=P(A)B)=P(A)P(BP(A

P(A)(B)=P(B|A)B)=P(A|B)PP(A

P(A)B)P(AP(B|A)=

P(B)B)P(AP(A|B)=

��

212121

00

∩∩∩

≠≠∩

∩∩

then tindependen are If and if and

Events tIndependen

Rule Product

and yProbabilit lConditiona

Bayes’ Formula

Probability of an earlier event

Sstart

g1

b1

g2

b2

g2

b2

Sstart

g1

b1

g2

b2

g2

b2

Given the probabilities at the end P(b2), P(g2) can we determine P(g1), P(b1)?

A more useful setting

Given are two urns U1, containing 3 blue and two white balls, and U2, containing one blue and 3 white balls.

We first pick an urn, then pick a ball at random from the chosen urn.

P(U1)=1/3 P(B|U1)=3/5 P(W|U1)=2/5 P(U2)=2/3 P(B|U2)=1/4 P(W|U2)=3/4

The probability tree

Sstart

U1

U2

B

WB

W

31

32

53

52

43

41

Now we would like to know:If we got a blue ball what was

the probability that it came from urn 1?

P(B)B)P(UB)|P(U 1

1∩=

B)P(UB)P(UP(B) 21 ∩+∩=

Since there are only two ways to get B

Combining these two

B)P(UB)P(UB)P(UB)|P(U

21

11 ∩+∩

∩=

)U|)P(BP(U)U|)P(BP(U)U|)P(BP(UB)|P(U

2211

111 +

=

))P(UU|P(B))P(UU|P(B))P(UU|P(BB)|P(U

2211

111 +

=

Recall from last time

P(B|U1)P(U1)=Product of branch probabilities leading to B through U1: (3/5)*(1/3)=1/5

P(B|U2)P(U2)= Product of branch probabilities leading to B through U2: (1/4)*(2/3)=1/6

0.55116

32

41

31

53

31

53

B to products branch all of SumU throughBtoiesprobabilitbranch of ProductB)|P(U 1

1

≈=��

���

���

���

�+��

���

���

���

��

���

���

���

=

=

More Urns, a Picture

S

U1 U2 U3

EU1 ∩ EU2 ∩ EU3 ∩

E

Associated Formulae

E)P(UE)P(UE)P(UE)P(UE)|P(U

321

11 ∩+∩+∩

∩=

))P(UU|P(E))P(UU|P(E))P(UU|P(E))P(UU|P(EE)|P(U

332211

111 ++

=

Bayes’ Formula

Theorem 1Theorem 1Theorem 1Theorem 1Let ULet ULet ULet U1111,U,U,U,U2222,…, U,…, U,…, U,…, Un n n n be n mutually exclusive eventsbe n mutually exclusive eventsbe n mutually exclusive eventsbe n mutually exclusive eventswhose union is S. Let E be an event in S suchwhose union is S. Let E be an event in S suchwhose union is S. Let E be an event in S suchwhose union is S. Let E be an event in S suchthat P(E) is not zero. Then that P(E) is not zero. Then that P(E) is not zero. Then that P(E) is not zero. Then

P(E)E)P(UE)|P(U k

k∩=

))P(UU|P(E...))P(UU|P(E))P(UU|P(EE)|P(U

nn11

kkk ++

=

Sstart

U1

U2

B

WB

W

31

32

53

52

43

41

Sstart

B

W

U1

U2U1

U2

Page 442, number 42: A company rated 75% of employees satisfactory,25%unsatisfactory. Of the satisfactory ones 80%had experience, of the unsatisfactory only 40%.If a person with experience is hired, what is the probability that (s)he will be satisfactory?

E=experience, N=no experience, S=satisfactoryU=unsatisfactory

P(E|S)=0. 8, P(E|U)=0.2, P(N|S)=0.4, P(N|U)=0.6P(S)=0.75, P(U)=0.25

Question, what is P(S|E)?

S

U

E

NE

N

0.75

0.25

0.8

0.20.4

0.6

0.857 0.25 0.40.75 0.8

0.75 0.8U)P(U)|P(ES)P(S)|P(E

S)P(S)|P(EE)|P(S

≈+

=+

=

Random VariableProbability Distribution

Expectation

■ RANDOM VARIABLE, PROBABILITY DISTRIBUTION

■ EXPECTED VALUE OF A RANDOM VARIABLE

■ DECISION-MAKING AND EXPECTED VALUE

Random Variable

A random variable is a function that assigns a numerical value to each simple event in asample space S.

Example: Tossing a coin.

S1={H,T} for a single tossS2={HH,HT,TH,TT} two tosses

The random variable will depend on the question that we want to answer:

Number of heads:f(H)=1, f(T)=0g(HH)=2, g(HT)= g(TH)=1, g(TT)=0

Simpler notation:

Tossing a coin three times, let x be therandom variable of the number of tails.

{ }0,1,2,3x ∈

The corresponding events are

{HHH} is event the if 3xHTH}THH,{HHT, is event the if 2x

TTH}THT,{HTT, is event the if 1x{HHH}isevent the if 0x

====

What about probabilities?

Probability of getting two tails when tossinga coin three times:

x= number of tails

p(0)=P(x=0)=P({ei in S| x(ei)=0})=P({HHH})=1/8p(1)=P(x=1)=P({ei in S| x(ei)=1})

=P({THH,HTH,HHT})=3/8p(2)= … =3/8p(3)= … =P({TTT})=1/8

Probability distribution of a random variable X

A probability function P(X=x)=p(x) is a probability distribution of the random variable Xif

1. 0<p(x)<1, x in {x1,x2, … ,xn}2. P(x1)+p(x2)+ … +p(xn)=1

where {x1,x2, … ,xn} are the range (possible values) of X.

Random variable Probability distribution

Sample space Numerical values of X

Probability ofX=x

e1, e2 e3 e4e5 e6 e7 e8

x1, x2 x3x4 x5 x6

p1 p2 p3

X p

Expected Values of a Random Variable

IDEA: What happens in the “long run”?

What is the “average” number of tails in the experiment of tossing the coin three times?

1) toss three times2) record number of tails {0,1,2,3}3) repeat n timesWe expect to get 0 tails 1/8 of the time, 1 tail 3/8 of the time, 2 tails 3/8 of the time and 3 heads 1/8 of the time

Expected value of a random variable X

Given the probability distribution of a random variable X,

xi x1 x2 … xn

pi p1 p2 … pn

Where pi = p(xi), we define the expected valueof X, denoted E(X), by the formula

E(X)=x1p1+x2p2+ … +xnpn

Steps for Computing Expected Values

Step 1: Form the probability distributionof the random variable X.

Step 2: Multiply each image value of Xby its corresponding probabilityof occurrence; add the results.

Expected Winnings for Lottery

Suppose we pay $ D (that is buy D tickets with the same six numbers) and win onemillion dollars if our six numbers come up,otherwise loose our $ D. What are our ex-pected winnings? This is a 6 out of 49 lotto.

Correct combinations: 1

Possible combinations: 13,983,816 43! 6!

49!649

==���

����

Probability of winning: 0.000000007151123842= 0.7151123842 10-7

Probability of loosing: 1- 0.7151123842 10-7

=0.9999999285

Expected winnings =

(1,000,000-D)*0.7151123842 10-7+(-D)*(1- 0.7151123842 10-7)

= 0.0 7151123842 - D

Fair would be if expected value = 0

This would correspond to a ticket price of D= 0.0 7151123842 or about 7 cents

If you bet $1 you can expect towin -0.92848876158 or loose about 93 cents

Decision making

Outdoor concert, weather forecast predicts 0.24 chance of rain. If no rain $100000 net, if rain only $ 10000 net. Insurance for the $ 100000 costs $ 20000. Should you insure?

pi

Insuredxi

Not insuredxi

0.24rain

$ 90,000 $ 10,000

0.76no rain

$ 80,000 $100,000

Ins. E(X)=(90000)(0.24)+(80000)(0.76)=82400

Not E(X)=(10000)(0.24)+(100000)(0.76)=78400

The other side of the story:

For the insurance company:

E(X)=(-80000)(0.24)+(20000)(0.76)=-4000

They are either soon going out of businessor have “inside”information.