29
7. Probability Revision on set: A set is a collection of elements has the same properties. For examples: A = {1, 3, 5, 7, 9} B = {m, a, g, h, r, b, y} C = {Aly, Ayman, Ahmed} Elements and subsets If A = {1, 2, 3, 4, 5, 6, 7} B = {2, 4, 6} Then we can say that: 3 ∈ A and 3 ∉ B Also B ⊂ A Empty set Ф: Ф = { } has no elements. Sets & Relations: Page 1

07_Probability.docx

Embed Size (px)

Citation preview

Page 1: 07_Probability.docx

7. Probability

Revision on set:

A set is a collection of elements has the same properties.

For examples:

A = {1, 3, 5, 7, 9} B = {m, a, g, h, r, b, y}

C = {Aly, Ayman, Ahmed}

Elements and subsets

If A = {1, 2, 3, 4, 5, 6, 7} B = {2, 4, 6}

Then we can say that:

3 ∈ A and 3 ∉ BAlso B ⊂ AEmpty set :Ф = { } has no elements.Ф

Sets & Relations:

Symbol Representation

SS

Page 1

Page 2: 07_Probability.docx

A ⊂ S

A ∩ B “and”

A ∪ B “or”

A ∩ B = ФAc

A ~ B

S = {1, 2, 3… 10} S

Page 2

S A

SA

A

A B

B

B

A B

S A

SA B

Page 3: 07_Probability.docx

A = {1, 2, 3, 5}

B = {2, 3, 4, 6, 7}

C = {8, 9}

a) Intersection “ ∩ ”: “and”A ∩ B = {2, 3}A ∩ C = { } ФA ∩ S = A {1, 2, 3, 5}

b) Intersection “ ∪ ”: “or”A ∪ B = {1, 2, 3, 4, 5, 6, 7} A or B or both.A ∪ C = {1, 2, 3, 5, 8, 9}A ∪ S = S {1, 2, 3, 5, 10}

c) Subtraction “ ~” : A ~ B = {1, 5} A but not BB ~ A = {4, 6, 7} B but not AS ~ A = {4, 6, 7, 8, 9, 10}A ~ S = Ф

Ac = not A S ~ A = {4, 6, 7, 8, 9, 10}Bc = not B S ~ B = {1, 5, 8, 9, 10}

Note:5 ∈ A & 5 ∉ BA ⊂ S & A ⊄ B

Probability

Basic Definitions:

Page 3

A B

1 2

5 3

4

6 7C

8 9

Page 4: 07_Probability.docx

1) Experiment: It refers to the process of obtaining an observed result of some phenomenon.

2) Trail: The performance of an experiment is called a trial.

3) Outcome:The observed result on a trial of the experiment.

4) Random Experiment: It’s an experiment buti. All possible outcomes can be completely defined in

advance.ii. Can be repeated, theoretically, any number of times under

identical conditions but we can’t predict which of these outcomes will exactly occur when the experiment is carried out.For example, if a coin is tossed, there’re two possible outcomes of the experiment:Heads (denoted by H) &Tails (denoted by T).On any performance of this experiment one does not know what the outcome will be. The coin can be tossed as many times as desired.

5) Sample space (S):It’s the set of all possible outcomes of the experiment. Example:An experiment of tossing two coins, and observed the face of each coin. The sample space is S = [HH, HT, TH, TT]

6) Event:An event A is a collection of some of the possible outcomes of the random experiment.I.E

Page 4

Page 5: 07_Probability.docx

A ⊂ S7) Mutually Exclusive Events:

Two events A and B are called mutually exclusive if both A and B cannot occur in the same time (A ∩ B = )Ф . “like A and C in the previous example”.

Classical probability

The probability that the event A will occur, denoted by P(A) will defined as:

P(A) = Number of outcomes belongs ¿A ¿Number of outcomes belongs ¿

S¿ = n(A)n (S)

Where 0 ≤ P (A) ≤ 1Ex-1:In an experiment of tossing a single fair dice, find the probability of:a) The appearance of the number 6.b) The appearance of an even number.c) The appearance of a prime number.

Solution:S = {1, 2, 3, 4, 5, 6} n(S) = 6Page 5

Page 6: 07_Probability.docx

a) A = {6} n(A) = 1P(A) = 16

b) B = {2, 4, 6} n(B) = 3 P(B) = 36c) C = {2, 3, 5} n(C) = 3 P(C) = 36

Ex-2:A coin is tossed twice, find the probability of:a) The appearance of one head.b) The appearance of one head at least.c) The appearance of one head at most.Solution:

Note:

At least: The thing and over or more.

At most: The thing and less.

n(S) = (All possible outcomes)n

Where n is number of trials.

HPage 6

Page 7: 07_Probability.docx

HTH

TT

S = [HH, HT, TH, TT] n(S) = 4

a) A = [HT, TH] n(A) = 2 P(A) = 24 = 12

b) B = [HH, TH, HT] n(B) = 3 P(B) = 34

c) C = [HT, TH, TT] n(C) = 3 P(C) = 34

Ex-3:A dice is tossed two times, find the probability of:a) The appearance of the number 2 in the first toss.b) The appearance of the number 3 in the first toss and 5 in the second.c) The appearance of the number 4 in any toss.d) The appearance of the two numbers whose sum is 6.e) The appearance of the two numbers whose difference is 4 at least.Solution: 2nd

6

Page 7

Page 8: 07_Probability.docx

5

4

3

2

1

1 2 3 4 5 6 1st

n(S) = (6)2 = 36

a) A = [(2, 1), (2, 2), (2, 3), (2, 4), (2, 5), (2, 6)]

n(A) = 6 P(A) = 636 = 16

b) B = [(3, 5)] n(B) = 1 P(B) = 136

c) C = [(1, 4), (2, 4), (3, 4), (4, 4), (5, 4), (6, 4), (4, 1), (4, 2), (4, 3), (4, 5), (4, 6)]

n(C) = 11 P(B) = 1136

d) D = [(1, 5), (5, 1), (2, 4), (4, 2), (3, 3)]

n(D) = 5 P(D) = 536

e) E = [(1, 5), (5, 1), (1, 6), (6, 1), (2, 6), (6, 2)]

n(E) = 6 P(E) = 636 = 16

Page 8

∑ P = 1

Page 9: 07_Probability.docx

Ex-4:Three students are in a swimming race. If the first and the second have the same probability of winning and each is twice as likely to win as the third. What’s the probability that the second wins?Solution:Let, P(3rd) = x so, P(2nd) = 2x & P(1st) = 2x∑ P = 1 x + 2x + 2x = 1 5x = 1 x = 15

P(1st) = 25 P(2nd) = 25 P(3rd) = 15Ex-5:An integers from 1 to 100 is selected randomly, Find the probability of getting a perfect square if all integers from 10 to 80 are twice likely to occur as the rest.Solution:

S = [1, 2, 3……., 9, 10, 11, 12……., 80, 81, 82………, 100]

A = [1, 4, 9, 16, 25, 36, 49, 64, 81, 100]

n(A) = 15 P(A) = 15171

General Rule of Probability

Page 9

2

2222 2

Note: n(S) = 100 + (80 – 10 + 1) = 171

Page 10: 07_Probability.docx

P(A ∪ B) = P(A) + P(B) – P(A ∩ B)Where:P(A ∩ B) = 0 “if A & B are mutually exclusive”P(A ∩ B) = P(A) × P(B) “if A & B are independent”Ex-6:The probability that Mohamed Nasser passes Mathmatics examination is 0.85 and the probability that he passes English examination is 0.75. Find the probability that Mohamed passes at least one course.Solution:P(A) = 0.85 P(B) = 0.75 “coz the 2 events are independent”P(A ∪ B) = P(A) + P(B) – [P(A) × P(B)]P(A ∪ B) = 0.85 + 0.75 − [0.85 × 0.75] = 0.9625

Ex-7:If A & B are two events with P(A) = 1/4, P(A ∪ B) = 1/3, and P(B) = k ; where k is unknown. Find k in each of the following:i. A and B are mutually exclusive.ii. A and B are independent.iii. A is subset of B “A ⊂ B”.Page 10

Page 11: 07_Probability.docx

Solution:P(A) = 1/4, P(A ∪ B) = 1/3, and P(B) = ki. P(A ∪ B) = P(A) + P(B) – P(A ∩ B)1/3 = 1/4 + k − 0 k = 1/3 – 1/4 = 4 – 312 = 112 ii. P(A ∪ B) = P(A) + P(B) – [P(A) × P(B)]1/3 = 1/4 + k – [k × 1/4]112 = 3k4 k = 436 = 19

iii. P(A ∪ B) = P(A) + P(B) – P(A)1/3 = 1/4 + k – 1/4 k = 1/3

Complementary of the second

Ex-8:Three students are in a swimming race. If the first and the second have the same probability of winning and each is twice as likely to win as the third.a. What’s the probability that the first or the second wins?b. What’s the probability that the second doesn’t win?Solution:From ex.-4:

P(1st) = 25 P(2nd) = 25 P(3rd) = 15a. P(1st ∪ 3rd) = P(1st) + P(2nd) – [P(1st) ∩ P(2nd)]Page 11

P(A) = 1 – P(A)

Page 12: 07_Probability.docx

P(1st ∪ 3rd) = 25 + 15 – 0 = 35b. P(not 2nd) = 1 – P(2nd) = 1 – 25 = 35

Note:All the outcomes of any random experiment are mutually exclusive with each other.

Ex-9:A box contains 9 balls where 4 balls are white and 5 balls are black. If 2 balls are drowning randomly from the box “with replacement”, calculate the probability of each of the following:a. Both balls are black.b. Both balls are of the same color.c. Both balls are of different color.Solution: “Independent / Separate” P(W 2) = 4

9

P(W 1) = 49

P(B2) = 59

P(W 2) = 49 P(B1) = 5

9 P(B2) = 49

Page 12

4 5

W B

Page 13: 07_Probability.docx

1681 2081 2081 2581 S = [W 1W 2 ,W 1B2 ,B1W 2 ,B1B2¿

a. P(B1∩B2) = P(B1) × P(B2) = 59 × 59 = 2581b. P(both are of the same color) = P(both white ∪ both black) = P(both white) + P(both black) − [P(both white) ∩ P(both black)]= 1681 + 2581 − 0 = 4181c. P(both are of different color) = 1 − P(both are of the same color)= 1 − 4181 = 4081Note:

Independency : means two events or more in a separate sample spaces. Mutually exclusive : means the outcomes of an event in the same sample space. Also in the same sample space the events may be intersected.

Ex-10:A box contains 20 balls numbered from 1 to 20. Two balls are chosen at random “with replacement” from the box, calculate the probability of each of the following:a. Both balls carrying an even number.Page 13

Page 14: 07_Probability.docx

b. Both balls carrying a prime number.Solution:S = [1, 2, 3…, 20] n(S) = 20Even numbers = [2, 4, 6……, 20] n(E) = 10 Prime numbers = [2, 3, 5, 7, 11, 13, 17, 19] n(P) = 8

a)P(E1∩E2) = 1020 × 1020 = 100400 = 14b)P(P1∩P2) = 820 × 820 = 64400

Ex-11:In the experiment of tossing a dice twice, if A is the event of getting the number 4 in any toss and B is the event of getting two numbers whose sum is 6.Find:a)P(A), P(B), P(A ∩ B), P(A ∪ B).b)P(A~B) and P(B~A).Solution:n(S) = 36A = [(1, 4), (2, 4), (3, 4), (4, 4), (5, 4), (6, 4), (4, 1), (4, 2), (4, 3), (4, 5), (4, 6)]

n(A) = 11 B = [(1, 5), (5, 1), (2, 4), (4, 2), (3, 3)] n(B) = 5a)Page 14

Page 15: 07_Probability.docx

P(A) = 1136 P(B) = 536 P(A ∩ B) = [(2, 4), (4, 2)] n(A ∩ B) = 2

P(A ∩ B) = 236 P(A ∪ B) = 1136 + 536 − 236 = 1436b) P(A~B) = P(A) − P(A ∩ B)= 1136 − 236 = 936 P(B~A) = P(B) − P(A ∩ B)= 536 − 236 = 336

Ex-12:A dice is designed such that, when it tossed the probability of appearance of the numbers 1, 2, 3, 4, 5 are equal, and the probability of appearance of number 6 equal three times the probability of appearance of one. Calculate the probability of:a. The appearance of an odd number.b. The appearance of a prime number.c. The appearance of an even number.

Solution:S = [1, 2, 3, 4, 5, 6] n(S) = 8

Page 15

3

Page 16: 07_Probability.docx

a. A = [1, 3, 5] n(A) = 3 P(A) = 38b. B = [2, 3, 5] n(B) = 3 P(B) = 38c. C = [2, 4, 6] n© = 5 P(C) = 58 Ex-12˴:Two dice are tossed, if the first is fair and the second is designed such ex-12 find the probability of:a. The appearance of the number 2 in the first toss.b. The appearance of the number 3 in the first toss and 5 in the second.c. The appearance of the number 4 in any toss.d. The appearance of the two numbers whose sum is 6.e. The appearance of the two numbers whose difference is 4 at least.Solution:

2nd

6

5

4

3

2

1

1 2 3 4 5 6 1st

Page 16

Page 17: 07_Probability.docx

n(S) = 48a. A = [(2, 1), (2, 2), (2, 3), (2, 4), (2, 5), (2, 6)]

n(A) = 8 P(A) = 848 = 16

b. B = [(3, 5)] n(B) = 1 P(B) = 148

c. C = [(1, 4), (2, 4), (3, 4), (4, 4), (5, 4), (6, 4), (4, 1), (4, 2), (4, 3), (4, 5), (4, 6)]

n(C) = 13 P(B) = 1348

d. D = [(1, 5), (5, 1), (2, 4), (4, 2), (3, 3)]

n(D) = 5 P(D) = 548

e. E = [(1, 5), (5, 1), (1, 6), (6, 1), (2, 6), (6, 2)]

n(E) = 10 P(E) = 1048

Ex-12 ˵:Two dice are tossed, if the first is fair and the second is designed such that when it tossed the probability of the appearance of an even number is double the probability of the appearance of an odd number, find the probability of:a. The appearance of the number 2 in the first toss.b. The appearance of the number 3 in the first toss and 5 in the second.c. The appearance of the number 4 in any toss.d. The appearance of the two numbers whose sum is 6.Page 17

3

3

3 3

Page 18: 07_Probability.docx

e. The appearance of the two numbers whose difference is 4 at least. 2nd

6

5

4

3

2

1

1 2 3 4 5 6 1st Solution:n(S) = 54

a. A = [(2, 1), (2, 2), (2, 3), (2, 4), (2, 5), (2, 6)]

n(A) = 9 P(A) = 954 = 16

b. B = [(3, 5)] n(B) = 1 P(B) = 154

c. C = [(1, 4), (2, 4), (3, 4), (4, 4), (5, 4), (6, 4), (4, 1), (4, 2), (4, 3), (4, 5), (4, 6)]

n(C) = 19 P(B) = 1954

d. D = [(1, 5), (5, 1), (2, 4), (4, 2), (3, 3)]

n(D) = 7 P(D) = 754

Page 18

2

2 2

22

2 2 222 2 2 2

2 2

2

Page 19: 07_Probability.docx

e. E = [(1, 5), (5, 1), (1, 6), (6, 1), (2, 6), (6, 2)]

n(E) = 9 P(E) = 954

Conditional Probability

The events are independent but the sample space will change.(A2/A1) = (A2∩ A1)(A1)ThenP(A2∩ A1) = P(A1) × P(A2/A1)

P(1st ∩ 2nd)= P(1st) × P(2nd/1st)Ex-13:A box contains 9 balls where 5 balls are black and 4 balls are white. Two balls are drawn randomly from the box “without replacement”. Calculate the probability that:a. The first is black and the second is white.b. Both balls are black.c. Both balls are of the same colors.d. Both balls are of different colors.Solution: P(W 2/W 1) = 3

8

Page 19

Page 20: 07_Probability.docx

P(W 1) = 49

P(B2/W 1) = 58

P(W 2/B1) = 48 P(B1) = 5

9 P(B2/B1) = 48

a. P(B1∩W 2/B1) = P(B1) × P(W 2/B1)= 59 × 48 = 2072b. P(B1∩B2/B1) = 59 × 48 = 2072c. P(Both are of the same colors) = P(both white ∪ both black)= (49 × 38) + (59 × 48) = 3272d. P(Both are of different colors) = 1 − P(Both are of the same colors)= 1 − 3272 = 4072Ex-14:A box contains 12 balls where 3 balls are white, 4 balls are red and 5 balls are black. Two balls are drawn randomly from the box “without replacement”. Calculate the probability that:a. The first is red and the second is white.b. The first is black and the second is red.c. Both balls are of different colors.Solution:

Page 20

4 5

W B5 3

B W

4 4

B W

Page 21: 07_Probability.docx

P(W 2/W 1) = 211P(W 1) = 312 P(R2/W 1) = 411 P(B2/W 1) = 511 P(W 2/R1) = 311 P(R1) = 412 P(R2/R1) = 311

P(B2/R1) = 511 P(W 2/B1) = 311 P(B1) = 5

12 P(R2/B1) = 4

11

P(B2/B1) = 411

a. P(R1∩W 2/R1) = P(R1) × P(W 2/R1) = 412 × 311 = 12132b. P(B1∩R2/B1) = P(B1) × P(R2/B1) = 512 × 411 = 20132c. P(both are of different colors) = 1 − P(both are of the same colors)= 1 – P(both W ∪ both R ∪ both B) = 1 – [P(W 1∩W 2/W 1) + P(R1∩R2/R1) + P(B1∩B2/B1)]= 1 – [( 312 × 211) + [( 412 × 311) + [( 512 × 411)] =1 – 38132 = 47132Ex-14:

Page 21

4 5

W B

3

R

2 5

W B

4

R

3 5

W B

3

R

3 4

W B

4

R

Page 22: 07_Probability.docx

Two cards are selected from 20 cards numbered from 1 to 20 “without replacement”. Find the probability that:a. Both cards carrying an even number.b. Both cards carrying a prime number.Solution:S = [1, 2, 3……, 20] n(S) = 20S(E) = [2, 4, 6……, 20] n(E) = 10S(P) = [2, 3, 5, 7, 11, 13, 17, 19] n(P) = 8

a. P(E1∩E2/E1) = P(E1) × P(E2/E1)= 1020 × 919 = 190380b. P(P1∩P2/P1) = P(P1) × P(P2/P1)= 820 × 719 = 56380

P(A/B) = 1 − P(A/B)

Ex-14:If P(A) = 0.6, P(B) = 0.8 and P(A∪B) = 0.9. Find P(A/B)Solution:Page 22

Page 23: 07_Probability.docx

P(A∪B) = P(A) + P(B) − P(A∩B)0.9 = 0.6 + 0.8 − P(A∩B)P(A∩B) = 0.5 P(A∩B) = P(B∩A) = P(B) × P(A/B)0.5 = 0.8 × P(A/B) P(A/B) = 58 P(A/B) = 1 − 58 = 38

Page 23