Probability Overview (1A)Mar 05, 2018  · Overview (1A) 5 Young Won Lim 3/5/18 Conditional...

32
Young Won Lim 3/5/18 Probability Overview (1A)

Transcript of Probability Overview (1A)Mar 05, 2018  · Overview (1A) 5 Young Won Lim 3/5/18 Conditional...

Page 1: Probability Overview (1A)Mar 05, 2018  · Overview (1A) 5 Young Won Lim 3/5/18 Conditional Probability Examples (2) 0, 0, 0, 0 0, 0, 0, 1 0, 0, 1, 0 0, 0, 1, 1 0, 1, 0, 0 0, 1, 0,

Young Won Lim3/5/18

Probability Overview (1A)

Page 2: Probability Overview (1A)Mar 05, 2018  · Overview (1A) 5 Young Won Lim 3/5/18 Conditional Probability Examples (2) 0, 0, 0, 0 0, 0, 0, 1 0, 0, 1, 0 0, 0, 1, 1 0, 1, 0, 0 0, 1, 0,

Young Won Lim3/5/18

Copyright (c) 2017 - 2018 Young W. Lim.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".

Please send corrections (or suggestions) to [email protected].

This document was produced by using LibreOffice and Octave.

Page 3: Probability Overview (1A)Mar 05, 2018  · Overview (1A) 5 Young Won Lim 3/5/18 Conditional Probability Examples (2) 0, 0, 0, 0 0, 0, 0, 1 0, 0, 1, 0 0, 0, 1, 1 0, 1, 0, 0 0, 1, 0,

Overview (1A) 3 Young Won Lim3/5/18

Conditional Probability

https://en.wikipedia.org/wiki/Conditional_probability

Given two events A and B with P(B) > 0, the conditional probability of A given B is defined as the quotient of the probability of the joint of events A and B, and the probability of B:

Page 4: Probability Overview (1A)Mar 05, 2018  · Overview (1A) 5 Young Won Lim 3/5/18 Conditional Probability Examples (2) 0, 0, 0, 0 0, 0, 0, 1 0, 0, 1, 0 0, 0, 1, 1 0, 1, 0, 0 0, 1, 0,

Overview (1A) 4 Young Won Lim3/5/18

Conditional Probability Examples (1)

https://en.wikipedia.org/wiki/Conditional_probability

The unconditional probability P(A) = 0.52. the conditional probability P(A|B1) = 1, P(A|B2) = 0.75, and P(A|B3) = 0.

P (A∩B1) = 0.1P (A∩B2) = 0.12P (A∩B3) = 0

P (B1) = 0.1P (B2) = 0.16P (B3) = 0.1

Page 5: Probability Overview (1A)Mar 05, 2018  · Overview (1A) 5 Young Won Lim 3/5/18 Conditional Probability Examples (2) 0, 0, 0, 0 0, 0, 0, 1 0, 0, 1, 0 0, 0, 1, 1 0, 1, 0, 0 0, 1, 0,

Overview (1A) 5 Young Won Lim3/5/18

Conditional Probability Examples (2)

0, 0, 0, 00, 0, 0, 10, 0, 1, 00, 0, 1, 10, 1, 0, 00, 1, 0, 10, 1, 1, 00, 1, 1, 11, 0, 0, 01, 0, 0, 11, 0, 1, 01, 0, 1, 11, 1, 0, 01, 1, 0, 11, 1, 1, 01, 1, 1, 1

0, 0, 0, 00, 0, 0, 10, 0, 1, 00, 0, 1, 10, 1, 0, 00, 1, 0, 10, 1, 1, 00, 1, 1, 1

0, 0, 0, 00, 0, 0, 10, 0, 1, 00, 0, 1, 10, 1, 0, 00, 1, 0, 10, 1, 1, 00, 1, 1, 11, 0, 0, 01, 0, 0, 11, 0, 1, 01, 0, 1, 11, 1, 0, 01, 1, 0, 11, 1, 1, 01, 1, 1, 1

P(E) =816

P(F ) =816

0, 0, 0, 00, 0, 0, 10, 0, 1, 00, 0, 1, 10, 1, 0, 00, 1, 0, 10, 1, 1, 00, 1, 1, 1

P(E∩F) =516

P(E∣F) =58

P(E∩F )

P (F)=

5 /168 /16

S E F E∩F

sample space E : at least two consecutive zero’s

F : starting with a zero

Page 6: Probability Overview (1A)Mar 05, 2018  · Overview (1A) 5 Young Won Lim 3/5/18 Conditional Probability Examples (2) 0, 0, 0, 0 0, 0, 0, 1 0, 0, 1, 0 0, 0, 1, 1 0, 1, 0, 0 0, 1, 0,

Overview (1A) 6 Young Won Lim3/5/18

Intersection Probability

https://en.wikipedia.org/wiki/Conditional_probability

Page 7: Probability Overview (1A)Mar 05, 2018  · Overview (1A) 5 Young Won Lim 3/5/18 Conditional Probability Examples (2) 0, 0, 0, 0 0, 0, 0, 1 0, 0, 1, 0 0, 0, 1, 1 0, 1, 0, 0 0, 1, 0,

Overview (1A) 7 Young Won Lim3/5/18

Independence

https://en.wikipedia.org/wiki/Independence_(probability_theory)

P (A∣B)= P(A)

P (B∣A)= P(B)

two events are (statistically) independent if the occurrence of one does not affect the probability of occurrence of the other.

Similarly, two random variables are independent if the realization of one does not affect the probability distribution of the other.

H

H

H H

1/2

1/2

1 /4 = (1 /2)(1/2)

Page 8: Probability Overview (1A)Mar 05, 2018  · Overview (1A) 5 Young Won Lim 3/5/18 Conditional Probability Examples (2) 0, 0, 0, 0 0, 0, 0, 1 0, 0, 1, 0 0, 0, 1, 1 0, 1, 0, 0 0, 1, 0,

Overview (1A) 8 Young Won Lim3/5/18

Independence

https://en.wikipedia.org/wiki/Independence_(probability_theory)

P (A∣B)= P(A)

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

Page 9: Probability Overview (1A)Mar 05, 2018  · Overview (1A) 5 Young Won Lim 3/5/18 Conditional Probability Examples (2) 0, 0, 0, 0 0, 0, 0, 1 0, 0, 1, 0 0, 0, 1, 1 0, 1, 0, 0 0, 1, 0,

Overview (1A) 9 Young Won Lim3/5/18

Coin Tossing Experiment (1)

H H H

H H T

H T H

H T T

T H H

T H T

T T H

T T T

3 H’s

2 H’s

2 H’s

1 H’s

2 H’s

1 H’s

1 H’s

0 H’s

0 T’s

1 T’s

1 T’s

2 T’s

1 T’s

2 T’s

2 T’s

3 T’s

H H H

H H T

H T H

H T T

T H H

T H T

T T H

T T T

H H H

H H T

H T H

H T T

T H H

T H T

T T H

T T T

Counting heads only Counting tails only

Page 10: Probability Overview (1A)Mar 05, 2018  · Overview (1A) 5 Young Won Lim 3/5/18 Conditional Probability Examples (2) 0, 0, 0, 0 0, 0, 0, 1 0, 0, 1, 0 0, 0, 1, 1 0, 1, 0, 0 0, 1, 0,

Overview (1A) 10 Young Won Lim3/5/18

Coin Tossing Experiment (2)

H H H

H H T

H T H

H T T

T H H

T H T

T T H

T T T

3 H’s

2 H’s

2 H’s

1 H’s

2 H’s

1 H’s

1 H’s

0 H’s

0 T’s

1 T’s

1 T’s

2 T’s

1 T’s

2 T’s

2 T’s

3 T’s

H H H

H H T

H H

H T T

H H

H T

TH

T T T

T

T

T

T

Counting heads only determines tails

Page 11: Probability Overview (1A)Mar 05, 2018  · Overview (1A) 5 Young Won Lim 3/5/18 Conditional Probability Examples (2) 0, 0, 0, 0 0, 0, 0, 1 0, 0, 1, 0 0, 0, 1, 1 0, 1, 0, 0 0, 1, 0,

Overview (1A) 11 Young Won Lim3/5/18

Coin Tossing Experiment (3)

H H H

H H T

H T H

H T T

T H H

T H T

T T H

T T T

3 H’s

2 H’s

1 H’s

0 H’s

0 T’s

1 T’s

2 T’s

3 T’s

H H H

H H T

H T T

T T T

× 3

× 3

× 1

× 1

Consider a combinationNot a permutation

C (3,3)

C (3,2)

C (3,1)

C (3,0)

Page 12: Probability Overview (1A)Mar 05, 2018  · Overview (1A) 5 Young Won Lim 3/5/18 Conditional Probability Examples (2) 0, 0, 0, 0 0, 0, 0, 1 0, 0, 1, 0 0, 0, 1, 1 0, 1, 0, 0 0, 1, 0,

Overview (1A) 12 Young Won Lim3/5/18

Coin Tossing Experiment (4)

H H H

H H T

H T H

H T T

T H H

T H T

T T H

T T T

3 H’s

2 H’s

1 H’s

0 H’s

0 T’s

1 T’s

2 T’s

3 T’s

H H H

H H T

H T T

T T T

× 3

× 3

p p p

p p q

p q q

q q q

p3⋅C (3,3)

p2q⋅C (3,2)

p q2⋅C (3,1)

q3⋅C (3,1)

× 1

× 1

p3

p2q

p2q

p2q

p q2

p q2

p q2

q3

Page 13: Probability Overview (1A)Mar 05, 2018  · Overview (1A) 5 Young Won Lim 3/5/18 Conditional Probability Examples (2) 0, 0, 0, 0 0, 0, 0, 1 0, 0, 1, 0 0, 0, 1, 1 0, 1, 0, 0 0, 1, 0,

Overview (1A) 13 Young Won Lim3/5/18

Random Variable is a function

● HHH● HHT● HTH● HTT● THH● THT● TTH● TTT

● 3

● 2

● 1

● 0

S: Sample Space R: Real Number

X(HHH) = 3

X(HHT) = 2

X(HTH) = 2

X(HTT) = 1

X(THH) = 2

X(THT) = 1

X(TTH) = 1

X(TTT) = 0

X(s)

Page 14: Probability Overview (1A)Mar 05, 2018  · Overview (1A) 5 Young Won Lim 3/5/18 Conditional Probability Examples (2) 0, 0, 0, 0 0, 0, 0, 1 0, 0, 1, 0 0, 0, 1, 1 0, 1, 0, 0 0, 1, 0,

Overview (1A) 14 Young Won Lim3/5/18

Random Variable is related to events

X(HHH) = 3

X(HHT) = 2

X(HTH) = 2

X(HTT) = 1

X(THH) = 2

X(THT) = 1

X(TTH) = 1

X(TTT) = 0

A random variable does not return a probability.

X = 3

X = 2

X = 1

X = 0

Event { HHH }

Event { HHT, HTH, THH }

Event { HTT, THT, TTH }

Event { TTT }

looks like variables

Page 15: Probability Overview (1A)Mar 05, 2018  · Overview (1A) 5 Young Won Lim 3/5/18 Conditional Probability Examples (2) 0, 0, 0, 0 0, 0, 0, 1 0, 0, 1, 0 0, 0, 1, 1 0, 1, 0, 0 0, 1, 0,

Overview (1A) 15 Young Won Lim3/5/18

Distribution

X(HHH) = 3

X(HHT) = 2

X(HTH) = 2

X(HTT) = 1

X(THH) = 2

X(THT) = 1

X(TTH) = 1

X(TTT) = 0

A random variable does not return a probability.

p(X = 3)

p(X = 2)

p(X = 1)

p(X = 0)

p(Event { HHH })

p(Event { HHT, HTH, THH })

p(Event { HTT, THT, TTH })

p(Event { TTT })

P3 = p3⋅C (3,3)

P2 = p2q⋅C (3,2)

P1 = pq2⋅C (3,1)

P0 = q3⋅C (3,1)

{ (0 , P0) , (1 ,P1) , (2 , P2) , (3 , P3) }Distribution

Page 16: Probability Overview (1A)Mar 05, 2018  · Overview (1A) 5 Young Won Lim 3/5/18 Conditional Probability Examples (2) 0, 0, 0, 0 0, 0, 0, 1 0, 0, 1, 0 0, 0, 1, 1 0, 1, 0, 0 0, 1, 0,

Overview (1A) 16 Young Won Lim3/5/18

A random variable and its distribution

● HHH● HHT● HTH● HTT● THH● THT● TTH● TTT

● 3

● 2

● 1

● 0

S: Sample Space R: Real Number

X(s)

● 1/8

● 3/8

R: Real Number

p(X)

Random variable Distribution

Page 17: Probability Overview (1A)Mar 05, 2018  · Overview (1A) 5 Young Won Lim 3/5/18 Conditional Probability Examples (2) 0, 0, 0, 0 0, 0, 0, 1 0, 0, 1, 0 0, 0, 1, 1 0, 1, 0, 0 0, 1, 0,

Overview (1A) 17 Young Won Lim3/5/18

Different Random Variable Assignments

0 1 2 3

18

38

38

18

38

38

18

18

1 2 3 4X

p (X)

X

p (X)

3 H’s

2 H’s

1 H’s

0 H’s

H H H

H H T

H T T

T T T

3 H’s

2 H’s

1 H’s

0 H’s

H H H

H H T

H T T

T T T

X = 3

X = 2

X = 1

X = 0

X = 4

X = 1

X = 2

X = 3

Page 18: Probability Overview (1A)Mar 05, 2018  · Overview (1A) 5 Young Won Lim 3/5/18 Conditional Probability Examples (2) 0, 0, 0, 0 0, 0, 0, 1 0, 0, 1, 0 0, 0, 1, 1 0, 1, 0, 0 0, 1, 0,

Overview (1A) 18 Young Won Lim3/5/18

Different Expectation Values

0 1 2 3

18

38

38

18

38

38

18

18

1 2 3 4X

p (X)

X

p (X)

E(X) = 0⋅18

+ 1⋅38

+ 2⋅38

+ 3⋅18

= 1.5

E(X) = 1⋅38

+ 2⋅38

+ 3⋅18

+ 4⋅18

= 2

Page 19: Probability Overview (1A)Mar 05, 2018  · Overview (1A) 5 Young Won Lim 3/5/18 Conditional Probability Examples (2) 0, 0, 0, 0 0, 0, 0, 1 0, 0, 1, 0 0, 0, 1, 1 0, 1, 0, 0 0, 1, 0,

Overview (1A) 19 Young Won Lim3/5/18

Normal Distribution

https://en.wikipedia.org/wiki/Normal_distribution

Probability mass function Cumulative distribution function

Page 20: Probability Overview (1A)Mar 05, 2018  · Overview (1A) 5 Young Won Lim 3/5/18 Conditional Probability Examples (2) 0, 0, 0, 0 0, 0, 0, 1 0, 0, 1, 0 0, 0, 1, 1 0, 1, 0, 0 0, 1, 0,

Overview (1A) 20 Young Won Lim3/5/18

Binomial Distribution

https://en.wikipedia.org/wiki/Binomial_distribution

Probability mass function Cumulative distribution function

Page 21: Probability Overview (1A)Mar 05, 2018  · Overview (1A) 5 Young Won Lim 3/5/18 Conditional Probability Examples (2) 0, 0, 0, 0 0, 0, 0, 1 0, 0, 1, 0 0, 0, 1, 1 0, 1, 0, 0 0, 1, 0,

Overview (1A) 21 Young Won Lim3/5/18

Binomial Distribution

https://en.wikipedia.org/wiki/Bernoulli_trial

the binomial distribution with parameters n and p

the discrete probability distribution of the number of successes in a sequence of n independent experiments, each asking a yes–no question, and each with its own boolean-valued outcome:

a random variable containing single bit of information: success / yes / true / one (with probability p) failure / no / false / zero (with probability q = 1 − p).

A single success / failure experimenta Bernoulli trial or Bernoulli experiment

a single trial, i.e., n = 1, the binomial distribution is a Bernoulli distribution.

a sequence of outcomesa Bernoulli process

Page 22: Probability Overview (1A)Mar 05, 2018  · Overview (1A) 5 Young Won Lim 3/5/18 Conditional Probability Examples (2) 0, 0, 0, 0 0, 0, 0, 1 0, 0, 1, 0 0, 0, 1, 1 0, 1, 0, 0 0, 1, 0,

Overview (1A) 22 Young Won Lim3/5/18

Binomial Distribution

https://en.wikipedia.org/wiki/Bernoulli_trial

The binomial distribution is

the basis for the popular binomial test of statistical significance.

frequently used to model the number of successesin a sample of size n drawn with replacement from a population of size N.

the sampling carried out without replacementthe draws are not independenta hypergeometric distributionnot a binomial distribution

for N much larger than n, the binomial distribution remains

a good approximationwidely used.

Page 23: Probability Overview (1A)Mar 05, 2018  · Overview (1A) 5 Young Won Lim 3/5/18 Conditional Probability Examples (2) 0, 0, 0, 0 0, 0, 0, 1 0, 0, 1, 0 0, 0, 1, 1 0, 1, 0, 0 0, 1, 0,

Overview (1A) 23 Young Won Lim3/5/18

Bernoulli Trial

https://en.wikipedia.org/wiki/Bernoulli_trial

a Bernoulli trial (or binomial trial) is a random experiment with exactly two possible outcomes, "success" and "failure", in which the probability of success is the same every time the experiment is conducted.

Page 24: Probability Overview (1A)Mar 05, 2018  · Overview (1A) 5 Young Won Lim 3/5/18 Conditional Probability Examples (2) 0, 0, 0, 0 0, 0, 0, 1 0, 0, 1, 0 0, 0, 1, 1 0, 1, 0, 0 0, 1, 0,

Overview (1A) 24 Young Won Lim3/5/18

Dependent Events

https://en.wikipedia.org/wiki/Bernoulli_trial

Graphs of probability P of not observing independent events each of probability p after n Bernoulli trials vs np for various p.

Blue arrow: Throwing a 6-sided dice 6 times gives 33.5% chance that 6 (or any other given number) never turns up; it can be observed that as n increases, the probability of a 1/n-chance event never appearing after n tries rapidly converges to 0.

Grey arrow: To get 50-50 chance of throwing a Yahtzee (5 cubic dice all showing the same number) requires 0.69 × 1296 ~ 898 throws.

Green arrow: Drawing a card from a deck of playing cards without jokers 100 (1.92 × 52) times with replacement gives 85.7% chance of drawing the ace of spades at least once.

Page 25: Probability Overview (1A)Mar 05, 2018  · Overview (1A) 5 Young Won Lim 3/5/18 Conditional Probability Examples (2) 0, 0, 0, 0 0, 0, 0, 1 0, 0, 1, 0 0, 0, 1, 1 0, 1, 0, 0 0, 1, 0,

Overview (1A) 25 Young Won Lim3/5/18

Tossing Coins Probability

https://en.wikipedia.org/wiki/Bernoulli_trial

Page 26: Probability Overview (1A)Mar 05, 2018  · Overview (1A) 5 Young Won Lim 3/5/18 Conditional Probability Examples (2) 0, 0, 0, 0 0, 0, 0, 1 0, 0, 1, 0 0, 0, 1, 1 0, 1, 0, 0 0, 1, 0,

Overview (1A) 26 Young Won Lim3/5/18

Binomial Distribution Examples

Binomial distribution for p = 0.5 with n and k as in Pascal's triangle

The probability that a ball in a Galton box with 8 layers (n = 8) ends up in the central bin (k = 4) is 70 / 256

https://en.wikipedia.org/wiki/Binomial_distribution

Page 27: Probability Overview (1A)Mar 05, 2018  · Overview (1A) 5 Young Won Lim 3/5/18 Conditional Probability Examples (2) 0, 0, 0, 0 0, 0, 0, 1 0, 0, 1, 0 0, 0, 1, 1 0, 1, 0, 0 0, 1, 0,

Overview (1A) 27 Young Won Lim3/5/18

Bean Machine

https://en.wikipedia.org/wiki/Bean_machine

Page 28: Probability Overview (1A)Mar 05, 2018  · Overview (1A) 5 Young Won Lim 3/5/18 Conditional Probability Examples (2) 0, 0, 0, 0 0, 0, 0, 1 0, 0, 1, 0 0, 0, 1, 1 0, 1, 0, 0 0, 1, 0,

Overview (1A) 28 Young Won Lim3/5/18

Binomial Distribution – Mean

https://en.wikipedia.org/wiki/Binomial_distribution

Page 29: Probability Overview (1A)Mar 05, 2018  · Overview (1A) 5 Young Won Lim 3/5/18 Conditional Probability Examples (2) 0, 0, 0, 0 0, 0, 0, 1 0, 0, 1, 0 0, 0, 1, 1 0, 1, 0, 0 0, 1, 0,

Overview (1A) 29 Young Won Lim3/5/18

Binomial Distribution – Variance

https://en.wikipedia.https://en.wikipedia.org/wiki/Binomial_distribution/wiki/Algorithm

Page 30: Probability Overview (1A)Mar 05, 2018  · Overview (1A) 5 Young Won Lim 3/5/18 Conditional Probability Examples (2) 0, 0, 0, 0 0, 0, 0, 1 0, 0, 1, 0 0, 0, 1, 1 0, 1, 0, 0 0, 1, 0,

Overview (1A) 30 Young Won Lim3/5/18

Central Limit Theorem

https://en.wikipedia.org/wiki/Central_limit_theorem#/media/File:Central_limit_thm.png

A distribution being "smoothed out" by summation, showing original density of distribution and three subsequent summations;

Page 31: Probability Overview (1A)Mar 05, 2018  · Overview (1A) 5 Young Won Lim 3/5/18 Conditional Probability Examples (2) 0, 0, 0, 0 0, 0, 0, 1 0, 0, 1, 0 0, 0, 1, 1 0, 1, 0, 0 0, 1, 0,

Overview (1A) 31 Young Won Lim3/5/18

Central Limit Theorem

https://en.wikipedia.org/wiki/Central_limit_theorem

Page 32: Probability Overview (1A)Mar 05, 2018  · Overview (1A) 5 Young Won Lim 3/5/18 Conditional Probability Examples (2) 0, 0, 0, 0 0, 0, 0, 1 0, 0, 1, 0 0, 0, 1, 1 0, 1, 0, 0 0, 1, 0,

Young Won Lim3/5/18

References

[1] http://en.wikipedia.org/[2] https://en.wikiversity.org/wiki/Discrete_Mathematics_in_plain_view