1 outline – part 2 random processes probability and chance discovering a regular pattern in random...

27
1 Outline – Part 2 Outline – Part 2 Random processes Probability and chance Discovering a regular pattern in random processes:

Upload: coleen-lane

Post on 31-Dec-2015

222 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1 Outline – Part 2 Random processes Probability and chance Discovering a regular pattern in random processes:

1

Outline – Part 2Outline – Part 2

• Random processes

• Probability and chance

• Discovering a regular pattern in random processes:

Page 2: 1 Outline – Part 2 Random processes Probability and chance Discovering a regular pattern in random processes:

2

Random PhenomenonRandom Phenomenon

1. Toss a fair coin, sometimes you get heads sometimes you get tails.2. Roll a die: the die can land on any of the 6 faces.3. Waiting time at the dentist: sometimes you wait less than 10 minutes

& sometimes you wait longer.

In a random phenomenon individual outcomes are uncertain, but there is nonetheless a regular distribution of outcomes after a large number of repetitions.

Think about another example of a random phenomenon.

Page 3: 1 Outline – Part 2 Random processes Probability and chance Discovering a regular pattern in random processes:

3

Tossing a coinsTossing a coins

The proportion of heads in “n” tosses of a coin changes as we make more tosses. Eventually it approaches 0.5

There is still a regular pattern in the phenomenon, that is discovered only after many repetitions.

Page 4: 1 Outline – Part 2 Random processes Probability and chance Discovering a regular pattern in random processes:

4

Probability or chanceProbability or chance

Tossing a coin: what is the chance of getting a head?

Rolling a die: what is the chance of getting a 3?

It is 1 in 2 that is 50%

It is 1 in 6, that is 16.7%

The chance or probability of a certain outcome is the percentage of times the outcome is expected to happen, when the process is repeated over and over again, independently and under the same conditions.

Page 5: 1 Outline – Part 2 Random processes Probability and chance Discovering a regular pattern in random processes:

5

An event is the outcome of a random process.

The set of all the possible outcomes is called sample space.

Probabilities are values between 0 and 1.

The impossible event occurs 0% of the time, hence has probability 0 to happen.

The certain event happens every time, hence has probability 1 to happen.

Examples?

Page 6: 1 Outline – Part 2 Random processes Probability and chance Discovering a regular pattern in random processes:

6

Computing probabilitiesComputing probabilities

To calculate the probability of an event, if every outcome is equally likely. 1. Count all the possible outcomes of the random process. 2. Count the outcomes that are favorable to that event

The probability is calculated as the ratio

# favorable outcomesprobability=

# all possible outcomes

One deck of cards is shuffled and the top card is placed face down on the table.What is the chance that the card is a king of hearts?

1. How many cards are in a deck?2. How many king of hearts? Chance=1/52

Page 7: 1 Outline – Part 2 Random processes Probability and chance Discovering a regular pattern in random processes:

7

Computing chancesComputing chances

1. What’s the probability of selecting a female student in this class?

# of students = 30probability = 7/30

# female students = 7

2. What’s the probability of choosing a red M&M from a bag containing 10 red, 5 blue and 3 yellow candies?

Probability= 10/18

Page 8: 1 Outline – Part 2 Random processes Probability and chance Discovering a regular pattern in random processes:

8

Throwing a pair of diceThrowing a pair of dice

There are 36 ways of throwing two dice.What is the probability of getting a 7?Count the favorable outcomes and divide by 36

P(getting a 7)=6/36=1/6

Page 9: 1 Outline – Part 2 Random processes Probability and chance Discovering a regular pattern in random processes:

9

Probability rulesProbability rules

1. Complementation rule: The probability that an event does not occur is 1 minus the probability that the event occurs. This is useful if the chance of the “opposite” event is easier to compute.

2. Mutually exclusive events: If two events cannot occur together, the probability that one or the other occurs is the sum of their individual probabilities.

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

Page 10: 1 Outline – Part 2 Random processes Probability and chance Discovering a regular pattern in random processes:

10

What is the chance that the first card is not a king of hearts?

1. How many cards are in a deck?2. How many cards are not king of hearts?

The answer is 51/52 This equal to 1-1/52, that is 1 minus the chance that the first card is a king of hearts.

This is an example of the complementation rule

The chance of something happening is equal to 100% minus the chance of the opposite event.

Page 11: 1 Outline – Part 2 Random processes Probability and chance Discovering a regular pattern in random processes:

11

Mutually exclusive events

What’s the probability of getting 2 or 3 in a roll of a die?

P(2 spot face or 3 spot face) = P(2 spot face)+P( 3 spot face) =1/6+1/6= 2/6 = 1/3

Page 12: 1 Outline – Part 2 Random processes Probability and chance Discovering a regular pattern in random processes:

12

Known probabilitiesKnown probabilitiesAll human blood can be typed as one of O, A, B, AB. The distribution of the types varies a bit with the race. The table displays the probabilities of a randomly chosen white American. The probabilities are calculated as the proportion of individuals with a given blood type in a very large sample of white Americans.

Blood Type O A B AB

Probability 0.45 0.40 0.11 ?

1. What’s the probability that a white American has type AB blood?

2. Judy has type B blood. She can safely receive transfusions from people with type O and type B blood. What is the probability that a randomly chosen white American can donate her blood?

Pr(O or B)=Pr(O)+Pr(B)=0.45+0.11=0.56

Page 13: 1 Outline – Part 2 Random processes Probability and chance Discovering a regular pattern in random processes:

13

Intranet designIntranet design

The Intranet is a private Internet operating on a company's internal network. It is a convenient vehicle within the company for sharing information, documents and databases. In U.S. companies, Intranet is designed either by IT personnel, graphic artists, consultant IT personnel or consultant graphic artists. The probabilities of selecting a company that has Intranet developed by a given professional is displayed below.

Intranet developers

Internal IT personnel

Internal graphic artists

Consultant IT personnel

Consultant graphic artists

Probability 0.40 0.20 0.25 0.15

What is the probability that a company’s Intranet wasn’t designed by a graphic artist? Pr(No artist)=Pr(Internal IT or Cons. IT)=

Pr(Int. IT) + Pr(Cons. IT)=0.40+0.25=0.65

Page 14: 1 Outline – Part 2 Random processes Probability and chance Discovering a regular pattern in random processes:

14

Independent eventsIndependent events

Two events are independent if the probability for the second given the first are the same, no matter how the first turns out.

For instance, roll a die 3 times. Each time you roll a die, this is independent of the other times.

Coin tosses are independent of each other, the probability of getting a head won’t change.

Lottery drawings are independent!!! The probability of winning does not change from drawing to drawing!! It is always very very small

In the Illinois lotto, what’s the “luckiest” combination between these two?

1 2 3 4 5 6 or 3 43 23 15 32 1.

Page 15: 1 Outline – Part 2 Random processes Probability and chance Discovering a regular pattern in random processes:

15

If two events A and B are independent, the probability of them happening together is equal to the product of their probabilities.

P(A & B)=P(a)P(B)

The chance of getting two aces in two rolls of a die is

P(1st roll =ace & 2nd roll=ace) = P(1st roll =ace)P(2nd roll=ace) = 1/6 1/6 = 1/36

Suppose a computer company produces poor quality chips, each shipment contains 5% defective chips. A car manufacturer buys a shipment of such chips. Each car uses 4 of these chips selected independently, what is the probability that all 4 are faulty (F)? P(4 chips are faulty)=P(1st =F & 2nd =F & 3rd =F & 4th =F)=

=P(1st =F) P(2nd =F) P(3rd =F) P(4th =F)= 0.05 0.05 0.05 0.05=0.0000062

Page 16: 1 Outline – Part 2 Random processes Probability and chance Discovering a regular pattern in random processes:

16

What is the probability that all 4 chips are not defective?

P(not defective chips)=1 – P(defective chip)=1– 0.05=0.95P(all 4 chips are not defective)= 0.81How did I calculate this number?

P(All 4 chips are not defective)==P(1st chip= ND)P(2nd chip=ND) P(3rd chip= ND)P(4th chip= ND)== 0.95*0.95*0.95*0.95=0.954=0.814

Page 17: 1 Outline – Part 2 Random processes Probability and chance Discovering a regular pattern in random processes:

17

Telephone cableTelephone cableA transatlantic telephone company contains repeaters at at regular intervals to amplify the signal. If a repeater fails it must be replaced by fishing the cable to the surface at great expense. Each repeater has 0.999 probability of functioning without failure for 10 years. Repeaters fail independently from each other.

What is the probability that two receivers both last for 10 years?

Pr(No failure for receiver 1 and 2)= Pr(1st =No Failure)*Pr(2nd =No Failure)=0.999*0.999=0.998

A company has 10 receivers, what is the probability that only one receiver will fail in 10 years?

Pr(only one receiver will fail)=Pr(No failure for 9 receiver & one receiver will fail). The events are all independent, so the probability Pr(No failure for 9 receiver & one receiver will fail) is the product of individual probabilities. Pr(No failure for 9 receiver & one receiver will fail)=Pr(1 rec. = No failure)Pr(2 rec. = No failure) …Pr(9 rec. = No failure)P(receiver=fail)=

=0.9999 (1-0.999)=0.892

Page 18: 1 Outline – Part 2 Random processes Probability and chance Discovering a regular pattern in random processes:

18

Cryptography and CryptanalysisCryptography and Cryptanalysis

The shift cipher was invented in the 16th century. One famous cipher was invented by Vigenere and thought to be secure until the 20th century.

In 1920’s Friedman found a method for breaking it. Methods for breaking secret codes use cryptanalysis and probability models for the frequency of letters. For instance in English language:

A

0.082

B

0.015

C

0.028

D

0.043

E

0.107

F

0.022

G

0.020

H

0.061

I

0.070

J

0.002

K

0.08

L

0.040

M

0.024

N

0.067

O

0.075

P

0.019

Q

0.001

R

0.060

S

0.063

T

0.091

U

0.028

V

0.010

W

0.023

X

0.001

Y

0.020

Z

0.001

Page 19: 1 Outline – Part 2 Random processes Probability and chance Discovering a regular pattern in random processes:

19

Compare the two encryptions for English language.Consider three letters appearing in a cipher-text: the table below

shows the frequencies of these letters in the encoded text. A B C7 3 3

We have two possible encryptions:1) Ae Bf Cd Small letters indicate text - 2) Ac Bg Cl Capital letters indicate cipher-text.

What’s the most likely encryption?1) P(e,e,e,e,e,e,e,f,f,f,d,d,d)= (0.107)7 (0.022)3 (0.043)3 2) P(c,c,c,c,c,c,c,g,g,g,l,l,l)= (0.028)7 (0.020)3 (0.040)3

The probability in 1 is larger, method 1 is more likely!

Page 20: 1 Outline – Part 2 Random processes Probability and chance Discovering a regular pattern in random processes:

20

You win one dollar if the second card is a queen of spades? I) What is the chance of winning one dollar?

Probability of second card being a queen of spades: 1/52=0.0192

II) You know that the first card is an ace, what is the chance of winning one dollar?

There are 51 cards left in the deck of cards, and there is just one chance out of 51 to get the queen of spades. So the chance is 1/51=0.0196

A conditional probability is the probability of an event, knowing that another event has occurred.

Conditional ProbabilitiesConditional Probabilities

Page 21: 1 Outline – Part 2 Random processes Probability and chance Discovering a regular pattern in random processes:

21

Examples of conditional probabilityExamples of conditional probability

The lab has 30 pc’s, SAS is installed on 20 pc’s.

A student wants to use SAS and chooses a pc at random. What is the probability of choosing a pc that runs SAS?

The probability is ? Pr(SAS)=20/30=2/3

Two students are already using two pc’s and working with SAS. What is the probability of choosing a pc that runs SAS?

Pr(SAS| two students use SAS)=18/28=0.642

Page 22: 1 Outline – Part 2 Random processes Probability and chance Discovering a regular pattern in random processes:

22

Multiplication RuleMultiplication RuleWhat is the probability that two students choose two computers that have

SAS?

Two events need to happen together: I) the first student selects a pc that has SAS II) the second student selects another pc that has SAS (given that the

first student is using a pc with SAS).

The first chance is calculated above = 20/30The chance of the second event is conditional and is 19/29

The probability of the two students choosing two computers with SAS is the product of I and II.

The answer is chance = 20/30*19/29=43.67%

Page 23: 1 Outline – Part 2 Random processes Probability and chance Discovering a regular pattern in random processes:

23

Multiplication RuleThe chance of two events happening together is equal to the chance that the first will happen multiplied by the chance that the second will happen given that the first has happened.

P(A occurs & B occurs)=P(A occurs) × P(B occurs | A has occurred)

given

Or more in general

P(A & B & C occur)==P(A occurs)P(B occurs|A occurs)P(C occurs|A & B occur)

Page 24: 1 Outline – Part 2 Random processes Probability and chance Discovering a regular pattern in random processes:

24

Example: A manufacturer of scientific workstations produces its new model at sites A, B, and C; 20% at A, 35% at B, and the remaining 45% at C. The probability of shipping a defective model is 0.01 if shipped from site A, 0.06 if from site B, and 0.03 if from site C.

1. What is the probability that a randomly selected workstation was faulty and produced at site A?

2. What is the probability that a randomly selected workstation was faulty and produced at site B?

Write down the probabilitiesPr(prod at A)=0.20 Pr(prod at B)=0.35 Pr(prod at C)=0.45Pr(Faulty|prod at A)=0.01 Pr(Faulty|prod at B)=0.06 Pr(Faulty|prod at C)=0.03

1. P(Faulty & prod at A)=P(prod at A)P(Faulty| prod at A)==

0.20*0.01=0.002

2. P(Faulty & prod at B)=P(prod at B)P(Faulty| prod at B)==

0.35*0.06=0.021

Page 25: 1 Outline – Part 2 Random processes Probability and chance Discovering a regular pattern in random processes:

25

ExampleExample

Only 5% of male high school basketball, baseball and football players go on to play at the college level. Of these, 1.7% enter major league professional sports. About 40% of the athletes who compete in college and then reach the pros have a career of more than 3 years.

What is the probability that a high school athlete competes in college and then goes on to have a pro career of more than 3 years?

Events A={playing at college level}, B={college professional sports}

C={career longer than 3 years}

Probabilities: P(A)=0.05, P(B|A)=0.017, P(C|A,B)=0.40

Result: P(A,B,C)=P(A)P(B|A)P(C|A,B)=0.05x0.017 x0.40=0.00034

Page 26: 1 Outline – Part 2 Random processes Probability and chance Discovering a regular pattern in random processes:

26

Addition rule for unions of two eventsAddition rule for unions of two events

If two events A and B can occur simultaneously, the probability of either one occurring is defined as

P(A or B)=P(A) + P(B) - p(A & B)

The sum of the probability of A + the probability of B, minus the probability that both occur.

A

B

A & B

Page 27: 1 Outline – Part 2 Random processes Probability and chance Discovering a regular pattern in random processes:

27

ExampleExample

When a computer goes down, there is a probability 0.75 that it is due to an overload and probability 0.15 that it is due to a software problem. There is probability 0.05 that is due to an overload and a software problem. What is the probability that the computer goes down for an overload or a software problem?

Events: A={down for overload} B={down for software problem}

P(A)=0.75 P(B)=0.15 P(A & B)=0.05

Result:

P(A or B)=P(A)+P(B)-P(A&B)= 0.75+0.15-0.05=0.85.