Statr sessions 7 to 8

Post on 29-Oct-2014

340 Views

Category:

Education

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

Praxis Weekend Analytics

Transcript

Probability and Inferential Statistics

• Probability – probability of occurrences areassigned in the inferential process underconditions of uncertainty

Methods of assigning

probability

• Classical method of assigning probability(rules and laws)

• Relative frequency of occurrence(cumulated historical data)

• Subjective Probability (personal intuitionor reasoning)

Classical probability: Assigning probability

• Each outcome is equally likely• Number of outcomes leading to the event

divided by the total number of outcomes possible which is denoted asP(E) = ne/N

where N = total number of outcomes, and ne = number of outcomes in event E

P(E) = probability of event E

Classical probability:

Assigning probability …. continued

Probability of event E can also be defined as

Number of outcomes favourable for E to occur divided by

Total number of outcomes in Sample space S

Measured on a scale between 0 and 1 inclusive. If E is impossible P(E) = 0, if E is certain then P(E) = 1.

Probability and related terms:

Experiment and Trial

• The process of observing a phenomenon that has variation in its outcomes.

• The term is used in a broad sense to include any operation of data collection or observation where the outcomes are subject to variation.

• Examples: rolling a die, drawing a card from a shuffled deck, sampling a number of customers for an opinion survey

• Trial is the occurrence and any repetition of an experiment.

Probability and related terms:

Sample space and Event

• Sample space: The collection of all possible distinct outcomes of an experiment. Denoted by S.

• Elementary outcome/ Simple event/ Element of the sample space: Each outcome of an experiment.

• Event: The collection of elementary outcomes possessing a designated feature. An event A occurs when any one of the elementary outcomes in A occurs.

Four Types of Probability

Marginal

The probability of an event X occurring

Union

The probability of X or Y or both occurring

Joint

The probability of both X and Y occurring

Conditional

The probability of X occurring given that Y has occurred

YX YX

Y

X

)(XP P X Y( ) P X Y( ) P X Y( | )

General Law of Addition

For any two events and , 𝐴 𝐵𝑃( or ) = ( ) = ( ) + ( ) − ( ∩ ) 𝐴 𝐵 𝑃 𝐴 ∪ 𝐵 𝑃 𝐴 𝑃 𝐵 𝑃 𝐴 𝐵+ - =

Note: “A or B” = includes the possibility that both A and B occur.

General Law of Addition … Example

)()()()( SNPSPNPSNP

SN

.56 .67.70

81.0

56.67.70.)(

56.)(

67.)(

70.)(

SNP

SNP

SP

NP

Complement rule

Denotes “all events that are not in A” as

Since either A or not A must happen, P(A) + P(Ac) = 1

𝐴 𝐴𝑐

Hence, P(Event happens) = 1 - P(Event doesn't happen)

e.g. when throwing a fair dice, P(not 6) = 1 – P(6) = 1 – 1/6 = 5/6.

Law of Multiplication

• As we know, the intersection of two events is called the joint probability

• General law of multiplication is used to find the joint probability

• General law of multiplication gives the probability that both events x and y will occur at the same time

• P(x|y) is a conditional probability that can be stated as the probability of x given y

Law of Conditional Probability

• If A and B are two events, the conditional probability of A occurring given that B is known or has occurred is expressed as P(A|B)

• The conditional probability of A given B is the joint probability of A and B divided by the marginal probability of B.

)(

)()|(

)(

)()|(

BP

APABP

BP

BAPBAP

Conditional Probability …….

In terms of P(B) and P(A and B) we have

gives the probability of an event in the B set. Given that the event is in B, is the probability of also being in A. It is the fraction of the outcomes that are also in .

Conditional Probability : Examples

• P(card is a heart | it is a red suit) = ½• P(Tomorrow is Tuesday | it is Monday) = 1• P(result of coin toss is heads | the coin is fair)

=1/2

Example:

A batch of 5 computers has 2 faulty computers. If the computers are chosen at random (without replacement), what is the probability that the first two inspected are both faulty? Answer:

P(first computer faulty AND second computer faulty)= P(first computer faulty) P(second computer faulty | first computer faulty)

=

25

14

¿2

20=

110

Use

1 2 3 4

46%

10%14%

31%

Drawing cards

Drawing two random cards from a pack without replacement, what is the probability of getting two hearts?[13 of the 52 cards in a pack are hearts]

1. 1/162. 3/513. 3/524. 1/4

Drawing cards

Drawing two random cards from a pack without replacement, what is the probability of getting two hearts?

To start with 13/52 of the cards are hearts. After one is drawn, only 12/51 of the remaining cards are hearts. So the probability of two hearts is

¿1352

×1251

¿14

×1251

=3

51

Throw of a die

Throwing a fair dice, let events be

A = get an odd number B = get a 5 or 6

What is P(A or B)?

This is consistent since

¿𝑃 (odd )+𝑃 (5∨6 )−𝑃 (5 )¿

36+

26

−16=

46=

23

“Probability of not getting either A or B = probability of not getting A and not getting B”

i.e. P(A or B) = 1 – P(“not A” and “not B”)

⇒𝑃 ( 𝐴∪𝐵 )=1 −𝑃 (𝐴𝑐∩ 𝐵𝑐)

Alternative

( 𝐴∪𝐵 )𝑐=Ac ∩𝐵𝑐

=

=

( 𝐴∪𝐵 )𝑐

Complements Rule

={2,4,6}, = {1,2,3,4} so {2,4}.

Throw of a dice

Throwing a fair dice, let events be

A = get an odd number B = get a 5 or 6

What is P(A or B)?Alternative answer

Hence

¿1 −𝑃 ( {2,4 } )¿1 −

13=

23

This alternative form has the advantage of generalizing easily to lots of possible events: 

Remember: for independent events,  

Lots of possibilities

Example: There are three alternative routes A, B, or C to work, each with some probability of being blocked. What is the probability I can get to work?

The probability of me not being able to get to work is the probability of all three being blocked. So the probability of me being able to get to work is

P(A clear or B clear or C clear) = 1 – P(A blocked and B blocked and C blocked).

e.g. if , ,

then P(can get to work) = P(A clear or B clear or C clear)

= = 1 – P(A blocked and B blocked and C blocked

¿1 −1

30=

2930

1 2 3 4 5

4%

24%

9%6%

57%

Problems with a device

There are three common ways for a system to experience problems, with independent probabilities over a year

A = overheats, P(A)=1/3 B = subcomponent malfunctions, P(B) = 1/3 C = damaged by operator, P(C) = 1/10

What is the probability that the system has one or more of these problems during the year?

1. 1/32. 2/53. 3/54. 3/45. 5/6

Problems with a device

There are three common ways for a system to experience problems, with independent probabilities over a year

A = overheats, P(A)=1/3 B = subcomponent malfunctions, P(B) = 1/3 C = damaged by operator, P(C) = 1/10

What is the probability that the system has one or more of these problems during the year?

¿1 −23

×23

×910

¿1 −4

10=

35

Special Addition Rule If , the events are mutually exclusive, so

A

BC

E.g. Throwing a fair dice,

P(getting 4,5 or 6)

In general if several events , are mutually exclusive (i.e. at most one of them can happen in a single experiment) then

= P(4)+P(5)+P(6) = 1/6+1/6+1/6=1/2

• Complements Rule:

Q. What is the probability that a random card is not the ace of spades?A. 1-P(ace of spades) = 1-1/52 = 51/52

• Multiplication Rule:

Q What is the probability that two cards taken (without replacement) are both Aces?A

• Addition Rule:

Q What is the probability of a random card being a diamond or an ace?A

Rules of probability recap

Independent Events :Special Multiplication Rule

If two events A and B are independent then P(A| B) = P(A) and P(B| A) = P(B): knowing that A has occurred does not affect the probability that B has occurred and vice versa.

P(A and B)

Probabilities for any number of independent events can be multiplied to get the joint probability.

Independent Events : Example

E.g. A fair coin is tossed twice, what is the chance of getting a head and then a tail?

P(H1 and T2) = P(H1)P(T2) = ½ x ½ = ¼.

E.g. Items on a production line have 1/6 probability of being faulty. If you select three items one after another, what is the probability you have to pick three items to find the first faulty one?

𝑃 (1 st OK ) 𝑃 (2 nd OK )𝑃 (3 rd faulty )¿56

×56

×16

¿25

216=0.116. .

top related