Sample Space and Sample Points

Sample Space

The set of all possible outcomes of a statistical experiment is call a sample sspace and it is repreented by the symol s.

Observation: An recording of information Numerical or categorical
e.g Weight (Numerical), gender (categorical)

However, if we divide the weight into categories such that there are 2, bigger than 65 cat and smaller than 65 . In this case, its categorical. We need to look at what information is rpesented to us about a specific variable

Statiscal Experiment: Generates a set of data


e.g
1. Consider an experiemnent of tossing a die, the sample space would be s = {1,2,3,4,5,6}
However, it all depends on our interest

If we are interestede in only whether the number is even or odd then the sample space is simply s= {even, odd}

In conclusion, the sample space is defined by what we are trying to look (what we are interested in)

2. See slide 8 for tossing of 2 dice
We need to work on equally likely outcomes, thats why we represet (2,1) and (1,2)
It is equally likely to get the first dice to be 2 and second dice 1 as well as first dice be 1 and second dice be 2.

Imagine if we playing a lottery ticket with 6 number digit. There are 10 single digit number for each slot but for us we have 2 ways to win. win or lose which is half half. But this is false because the probability is not equally likely.

Sample pon

Every outcome in a sample space is called an element of the sample space

e.g 
1. S = {even, odd}
Sample pon: odd or even

Events

An events is a subset of a sample space

e.g
S = {1,2,3,4,5}
An event that an odd number occurs = {1,3,5}

Simple and Compound Events

Simple events

An Event if it have one outcomes (e.g one sample pon)

Compound events

More than one outcomes (or sample pon)

e.g 
S= {1,2,3,4,5,6}
Compound:
A odd number occurs = {1,3,5}
Simple:
A number > 5 = {6}

Check what you are interested in, if the event only have one pon means that it is a simple event

Operation of events

Union and intersection Events

Insert 24

Union: The union of two events A and B denoted by AUB
is the event containing alll the elements that belong to A, B or both
 Independent events cannot be represented by venn diagram

Intersection
The intersection of two events A and B is denoted by AnB or AB
is the event that contain all elements that are common to A and B


Insert 25
If all variable is intersecting each other, it doesnt matter which direction we do the order of opperation. It only matters if we have a mix of intersection and unions

Complement
The complement of Event A with respect to S denoted by A' or A^c
is the set of all elements of S that is not in A

Mutually exclusive events
AnB = 0
A and B have no elements in Common
Insert 30

e.g A and A' is always mutually exclusive


Union of N events

e.g AUBUCUD
This means that there is a set of sample pons that either belong to A,B,C or D
Insert Giant U slide 32


Intersection
e.g AnBnCnD
This means that every pon must belong to A, B, C and D


Insert Giant N slide 33


Some basic properties of Operation of Events

1. AnA' = 0
2. An0 =0
3. AUA' = S
4. (A')' = A
5. (An B)' = A' U B' [Demorg]
6. (AUB)' = A'n B' [Demorg]
7. AU(BnC) = (AUB)n(AUC) [Distribution]
8. An(BUC) = (AnB)U(AnC) [Distribution]
9. AUB = AU(BnA') [Expanding]
10. A = (AnB)u(AnB')

Contained (⊂)
If all the elements in the event of A are in B then A is contain in event B
A⊂B

If A⊂B and B⊂A then A = B

Counting methods

Multiplication Principle

If an operation can be perform in n ways, and each of these ways the second operation can be perform in n2 ways then two operation can be performed together in nn2

We have to do addition if they are not the same, make sure each of the operation have the same number of operation in the second operation (n2)

If each outcome experiment 1 there are n2 possible outcomes of ex 2 then together there are n1n2 possible outcome of the experiment

e.g
How many sample points when a die and coin thrown together?
Die = 6
Coin = 2
6*2 possible outcomes

If the second experiment depends on the outcome of the first
e.g If its odd, toss the coin, if its even, toss the die.
Multiplication does not work here

e.g There is a community of 10 men, each men got 3 son, choose one man and one son, how many choices

1. There are 10 possible men
2. Each men, 3 choosen
=> 10*3

What if we pick the son first?
3 son each so there are 30 sons
For each son, there are 1 father each
=> 30*1

What if one father have one son less
Multiplication rule fail because one father have one less.
Use addition rule

For 10*3, does the 3 refer to the same son? No
They are not the same set of sons.

Generalised multiplication rule

The sequence of k operation can be perform in n1n2n3...nk ways
For each of the first two ways, the 3rd operation can be performed in n3 ways and so forth.

e.g How many even 3 digit numbers can be formed from digits 1,2,5,9,6 if each digits can only be use once?

______        ______        ______

100th               10th            ones

 (3)                  (4)                (2)

1. Fulfill important criterias first (restriction)
In this case, it has to be even number, so fill up the ones place first.
Even numbers must have the ones slot filled by an even number
2. Filled up the next slots
In this case, we only can use each number once, so the number of numbers in the pool decreases for each slot used.

e.g A test consist of 10 multiple choice question with 4 possible answers each.
What is the possible way are there in which a student can choose one answer to each question

1. For each question, there are 4 answer
(4)(4)(4)(4)....(4) -> 10 times ,
4^10

Among these cases, how many are such that all answers are wrong.
1. For each question, 3 answer is wrong
(3)(3)(3)..(3) -> 10 times
3^10 

e.g How many ways can 4 boys and 5 gitls sit in a row if the boys and girls must alternate
1. Starting from the left, we have 5 girls, so we have 5 choices
2. for each girl, i have 4 choices for boys

GBGBGBGBG
5 4 4 3 3 2 2 1 1
= 5!4! = 2880

IF there are 5 boys and 5 girls?
GBGBGBGBGB

BGBGBGBGBG

There are 2 possible scenarios,  both is 5!5!
so its 2*5!5!

What about 5 girls but 3 boys?
0, there is no way

Addition principle

Suppose that in a procedure can be perform in n1 ways
Assume that procedure 2 can be perform in n2 ways
Suppose furthermore that is not possible that both procedure to 1 and 2 are performed together.
Then the number of ways to perform 1 and 2 is n1+n2

e.g How many even three digit number can be formed from digits 0,1,2,5,6,9 if each digit can be use only once?

Consider 2 cases

A:
0 is use for the ones


_____    ______    ______
   (4)           (5)            0
There are 5*4 ways to arrange the hundreds and tens place

B:
0 is not use for the ones

_____    ______    ______
   (4)           (4)            (2)

0 cannot be use in the hundred place.

Add both Cases together to get the answer. We cannot have a 3 digit number with both 0 in the one place and not in the ones places


e.g Digits 0,1,2,3,4,5,6
How many 3 digits are even.
How many of these digits are greater than 420

Case1: the ones is 0
6(5)(1) = 30

Case2: the ones is not 0
5(5)(3) =75

There are 75+30 choices for even

Case 1: Hundred is 4, tens is 2

1(1)(4) =4
The ones place can only be 1,3,5,6

Case 2: Hundred is 4, Tens is 3,5,6
(1)(3)(5)
The ones place can be anything except 4 and one of the (3)

Case 3: Hundred is 5 or 6
(2)(6)(5)

Add everything together.



Permutation

Permutation is an arrangement of r object from a set of n objects.
This is the number of ways to arrange n objects

Lets say we want to arrange 2 objects out of 3, {a,b,c}
we can have (a,b), (b,a), (b,c), (c,b),(c,a),(a,c) <- Ordered tuples

___      ___
(3)        (2)

The number of permutation of n distinct objects taken r at a time is 
nPr = n!/(n-r)! = n(n-1)(n-2)....(n-(r-1))
nPn = n!

Using r is to pick a subset of n

Permutation of n distinct object
nPn = n! = n!/0!

E.g Find the number of all possible four letter code words in which all letters are different

26 distinct letters n=26
4 letter code word r = 4
Possible: 26P4 = 26!/(26-4)! = 26!/22!

E.g There are 20 horses, how many possible ways to arrange the top 3
n =20
r = 3
20P3 = 20!/(20-3)! = 6840

e.g How many ways can 6 ppl line up to get a bus
6P6  = 6!
If 3 people insist to follow each other, how many ways can 6 person line up?

1. Group the 3 ppl as one, permute the 4 objects
4P4 = 4!
2. Permute within the 3 of them
3P3 = 3!

Because we need to look at each scenarios, we have to arrange within 

3!*4!

If 2 people refuse to follow each other, how many ways of line up are possible

1. Find how many ways the two can be together
2P2 * 5P5
2. Subtract from the total 
6P6 - (2P2 * 5P5)

Arrange permutation of n distinct objects arrange in a circle

The number of permutation of n distinct objects arrange in a circle is (n-1)!
If the next neighbour is the same, is like the same permutation.

By considering one person in fixed position and arranging the other n-1 persons, therefore there are (n-1)! ways.

e.g 
abcd    bcda    cdab    dabc 
Are the same in a circle

Permutation where not all n objects are distinct

Some of them are the same, suppose i have n objects where there are n1 of one kind and n2 of second kind and ... nk of k kind. Where
n1+n2+n3+...nk = n

Then the number of distinct permutation of these n objects taken together is
n!/ (n1!n2!n3!..nk!)

We have to get rid of the permutation that are the same by dividing it away.
Imagine if we have 5 object, 3 are white and 2 are black.
To permute it, we have 5!
but because 3 is white and 2 are black, there are no different in between the white, so we need to divide away 3! and 2! to rid permutation of the same kind of white and black together.

e.g How many ways can 3 red, 4 yellow and 2 blue bulbls be arrange in 9 sockets

n=9
n1 = 3 , n2 = 4, n3 = 2
9!/(3!4!2!) = 1260
There are no difference amongst the red bulbs/yellow/blue groups, so we must remove the extra permutation

e.g How many ways can 7 people be assigned to 1 triple and 2 double rooms?

The are 7 ppl, n =7
There are 1 group of 3 ppl, 2 group of 2 ppl
n1 = 3, n2 = 2, n3 =2
We do not differentiate the permutation of the same group of people

Combinations

We do not care about the order in the number of ways of selecting r objects.
The number of ways to arrange r objects of n objects without caring about the order.
Selection of r objects in n objects regardless of order

n!/(n-r)!r!

The combination creates a partition with 2 groups, one containing r objects and the other containing the n-r objects that are left.
We do not care about the order, so we get rid of it. (r!)
What ever i selected there are r! ways of arranging them.

Only applies to distinct objects



Binomial Coefficient

(n r) is called a binomial coefficient because it is the coefficient of the term a^rb^(n-r)

Insert 107


We are considering the expansion of a + b to the power of n, the idea is like combination where we look at n factors, each factor we take an a, we choose r factors and the rest we choose a b.
(a+b)(a+b)(a+b)
by Expansion, we choose a multiply by a multiply by b as one of the terms. We are choosing one factors out of each (a+b) term

It cannot be any r, r must be an integer between 0 and n
Each time we choose r out of n objects and then r - 1  out of n-1 objects and so on so forth

E.g
A box have 25 good and 5 bad apples. Select 5 without replacement
1) How many samples?
There are 30 apples,
30C5


2) How many samples in ) have exactly one bad

One bad apple select = 5C1 = 5
4 Good apples selected = 25C4

Exactly one bad samples = 25C4 * 5C1

There are 2 groups in the sample, one group of bad apple and another group of good apples


3) How many in 1) have at least 2 bad

Consider all cases, 
Number of samples with exactly two bad apples is
Number of samples with exactly 3 bad apples is
Number of samples with exactly 4 bad apples is
Number of samples with exactly five bad apples is

Add all of the cases together.

Or we can do the complement methodEverything - at most one bad apple
which is part 2 and the case of 0 bad apple

E.g
Group of 4 men and 5 women, how many commitees of size 3 are possible
1) No restriction

9C3

2)2 men and one women if one particular men must be on it

Instead of dividing the 0 ppl into 4 men and 5 women, we split the 4 men into 1 men and 3 men.
from this,
1c1 (this particular men) * 3C1 (the another men) * 5C1 (choose the women)


3) 2 men and 1 women if 2 of men refuse to serve together
We split the men into 2 groups, 2men who cant work and the remaining 2. 
We are trying to do complement, so we will find the number of ways the 2 men can work together

2C2 (the 2 men that cant work together) * 5 C1 (the women) = 5

We take 9C3 - 5 = 25, this is to get the answer of having 2 men not wanting to work together.

e.g Bridge hands are possible containing 4 spades, 6 diamonds, 1 club and 2 hearts
How many possible hands?
13C4 * 13C6 * 13C1 * 13C2

Relative Frequency and Definition of Probability

If A is an event associated with the experiment, then we cannot state with certainty that A will or will not occur.
It is important to try to associate a number with the event A which will measure how likely the event A occurs.

Relative Frequency

By conducting frequency to check probability. The more times conducted, the more accurate it will be. 
e.g To check for probability of dice throwing, we will toss the dice more often.

Repeat the experiment E for n times and let A be an event associated with E

Properties
1. Between 0 and 1
2. F = 1 if A occurs every time among the n repetition
3. F = 0 if A never occurs among the n repetition

4. If A and B are mutually exclusive events, then probability is summed
ie fA + fB
Mutually exclusive = They can't happen at the same time

5. fA "stailizes" near some definite numerical value as the experiment is repeated more and more times

Axioms of probability

Axioms is something that we consider true and cannot be challenged. Axioms and definition are like the foundation and other things are based on these two things.

Consider a sample space S (not the population), the objective of probability assigned to each event A is the number that is label as PR(A). PR(A) gives a precise measure of the chance that A will occur.
It satisfied these axioms

1. PR(A) is between 0 and 1

2. PR(S) = 1
We are considering the entire sample, so its 1

3. If A1 and A2 are mutually exclusive (disjoint) events then 
PR(UnionSum Ai) = Sum Pr(Ai)
The union of all the Ai is the same as the sum of probability of all the Ai

Even if the sets may not be the same, it is possible for the possibility to be the same. 
If we have two mutually exclusive events then pr(AUB) = PR(A) + Pr(B)
only if they are non overlapping

Axiom 3 can expand to infinite number of events and they are mutually exclusive.
They must have no common outcome.

E.G
Consider tossing a coin, let H denote the event of having a head
1) find PR(H)
getting H or T is mutually exclusive.
It is 1/2 to get either.

Since P(S) = 1 where S is H and T
thus the coin is fair therefor Pr(h) = pr(T)

2) If the coin is biased and head appears twice as much as a tail
PR(H) + PR(H) + PR(T)   = PR(S)
It is still mutually exclusive.
But Head is more likely to appear (2 times more)

PR(H)  = 2/3


E.G
The fair dice is tossed. Let A be event that an even number turn up and let B be the event that either a 1 or 3 occurs

1) PR(A) = 3/6 = 1/2
{2,4,6}
2)PR(B) = 2/6 = 1/3
{1, 3}
3) PR(AUB) = 1/3 + 1/2
They are mutually exclusive, they have no intersection.

Let C be the event that a number is dividable by 3 occurs
{3,6}

PR(C) = 2/6
Since they are not mutually exclusive, we cannot add them together
PR(CUA) = {2,3,4,6} = 2/3

Basic Properties of probability

1. PR(O) = 0
2. If A1 .. An is mutually exclusive events, we can add the probability together
3. For any event A, PR(A') = 1 - PR(A)
Derived from Axiom 2, the union is mutually exclusive.
4. For any two events A and B, 
P(A) = P(A∩B) + P(A∩B')

since 
A = (A∩B) U (A∩B') and
(A∩B)∩(A∩B') = null set

5. For any two events A and B,
P(AUB) = P(A) + P(B) - P(A∩B)
we are removing the double of the intersection of A and B

Therefore P(AUB) = P(B) + P(A∩B')
from property 4...

6. For any 3 events,
P(AUBUC) = P(A) + P(B) + P(C) - P(A∩B) - P(A∩C) - P(B∩C) + P(A∩B∩C)
We subtract too much, so we need add back


Inclusion and exclusion principle

The above property can be extended to n events,
For each sum of the probability of Ai sum of events, we subtract the sum of P(Ai∩Aj) where
j = i +1
we must then add back the union of P(Ai∩AjAk)where j = i +1 and k = j +1


7. If A is a subset of B, then P(A) is less then or greater then P(B)
note: the subset is inclusive

Since B = (B∩A)U(B∩A') and B∩A = A
so B = AU (B∩A') and A∩(B∩A') are nullset
therefore 
P(B) = P(A) + P(B∩A') and is greater than/ equal to P(A)

This also show that P(B∩A') is greater or equal to 0

E.G
A retail accepts A credit card and B credit card
24 percent of customers carry A card and 61 percent carry a VISA card. 11 percent carry both
What percentage of customers carries a credit card that the establishment will accept?
P(AUV) = P(A) + P(V) - P(A∩V)


E.g
The prob that gas station pumps gas into 0,1,2,3,4,5 or more cars during 30 mins period are 
0.03, 0.18, 0.24, 0.28, 0.10 and 0.17 respectively.  

1) More than 2 cars recieve gas

Look at 0 and 1 cars and take 1 - P(0) - P(1) - P(2)
or just sum P(3) ..P (5 or more)

2) At most 4 cars recieve gas
1 - P(5 or more cars)
= 1 - 0.17

Or we can add everything till p(4)

e.g Hall Paegent,
Win the crown is 0.14
Miss photogenic is 0.3
Win both is 0.11

1) What is the probability she will win at least one of the two?
 P(at least one) = 0.14 + 0.3 - 0.11

2) Only one
P(Only one) = P(at least one) - P(both)

There is only 3 operation for sets, union, complement and intersects

e.g Birthday Problem
In a room full of 50 people, there is a very high chance to have 2 ppl having the same birthday.
For n people, what is the probability that there are at least 2 people with the same birthday?

Assume that each day is equally likely to be a birthday of everyone and there is no leap year.
A person can have his birthday on any of 365 days so there are a (365)^n outcomes.

Let A be at least 2 people share the same birthday,
the complement is A' where noone share the same birthday

p(A') = [365(364)...(365 - (n-1)) ] /365^n
because each time, the days available is decreased by 1

E.G Inverse birthday problem
What is the chance that someone sharing his or her birthday with you is larger than 0.5?

We are restricting the first birthday now. (We specify)

p(n ppl have different birthday from you) = (364/365)^n
P(same birthday) = 1 - (364/365)^n >= 0.5

Solving this equation using log
Note: We need to reverse the inequality sign if we multiple/divide by negative number
we need at least 253 people excluding me.

Sample spaces having finite outcomes

Consider a sample space S which contain finite number of k outcomes.
e.g tossing a die with sample space of 6 outcomes

1)The probability is between 0 and 1
2) The sum of all the probability of all 6 outcomes  = 1

This is because outcomes in a set is mutually exclusive

E.g Let S be sample space of the sum of numbers when a pair of dice is tossed.

The outcomes : (1,1) .... (6,6)
S = {2,.....12}
The sum of the two dice cannot go beyond 12
But in this set, the probability of getting the outcomes are all different
ie, getting a sum of 2 is different from trying to get a sum of 7
=> There are more combinations for getting a sum of 7

Similiar to toto, there are two cases to win or lose. But they are both not equally likely.

E.G A die is loaded such a way that an even number is twice likely to occur as an odd number
1) If E is the event that a number is less than 4 on a single toss, find P(E)

2) Let A is even number and B is num divisible by 3
What is AUB and A∩B


Sample spaces having equally likely outcomes

Consider an experiments with sample s where the numbers are equally likely to occur.
e.g Looking at two dice with different colours. This is when we care about order.
(1,2) is not (2,1) //order matter
{1,2} = {2,1} //order does not matter

P(A) = Number of sample pon in A / Number of sample pon in S

E.g
For outcomes which are equally likely them
1) Tossing a fair coins 
P(Head) = 0.5 = P(Tail)

2) Tossing a fair die
P(Number greater than 4) = {5,6}= 2/6
where 6 is the number of outcomes in the sample space

For outcomes that are not equally likely,
Tossing a bias coin such that head is twice as likely as a tail to occur then
P(H) = 2P(T)

E.G 
A box contains 50 bolts and 150 nuts
Half of bolts and half of nuts are rusted
IF one item is chosen at random, what is the prob that it is rusted or is a bolt

P(Rusted or bolt) = P(rusted) + p(bolt) - p(rusted and bolt)
= 100/200 + 50/200 - 25/200
This is because they are not mutually exclusive

E.G
If 2 balls are randomly drawn from an urn containing 6 white and 5 black balls
What is the prob that one is white and other is black

If we take it one by one, order matters
If we grab together, order does not matter.

Number of possible outcomes  = 11C2 = 55
Number of outcomes that is one white and one black= 6C1 * 5C1 = 30
The probability of it being white and black is 30/55

IF we consider one ball at a time,
Number of possible outcomes = 11P2 = 110
Number of possible outcomes that one is white and one is black = (5)(6) + (6)(5) = 60
Probability = 60/110

E.G Poker hand consisting of 5 cards, find prob of getting 2 ace and 3 jacks
Num of possible outcomes for picking 5 cards = 32C5
Number of possible outcomes for picking 2 ace and 3 jacks
= 4C2 * 4C3 * 4C0 (Choose nothing for others)
= 24

Prob = 24 / 32C5
This is very small chance.

E.G Professor hands out 10 topics, 5 will appear in test
One student have enough time to prepare only 7
If the proff choose 5 topic at random, what is the prob that the student will be prepared for

1) All five topics

Number of elements in S = 10C5 
Number of prepared for all five = 7C5 * 3C0 (The remaining 3 not studied did not come out)

2) Less than 3 topics
Number of prepared for less than 3 = 7C2 * 3C3 (Remaining 3 topics that appear and he didnt study)

3) Exactly 4 topics
7C4 (Out of the 7 topic study, 4 came out) * 3C1 (Out of 3 never study, one came out)

Sometimes drawing venn diagram is useful

Conditional probability

Sometimes we have more knowledge that certain event has occur.
e.g We toss a die, we do not know the outcome but we know the value is greater than 3.
Then we ask what is the value that its an odd number?

P(A|B) , what is the probability of getting A given B
The conditional probability of event B given that A has occur.

The sample space is smaller, restrain to the sample size of B
This is
P(A|B) = P(A∩B)/ P(B)
where P(B) is not 0

1. P(A|B) is between 1 and 0
2. P(S|A) = 1 
//A is subset of S 
Think of it as getting the probability of A in A
3. Can add if mutually exclusive.
P(B1U B2 | A ) = P(B1|A) + P(B2|A) 
where B1 and B2 is mutually exclusive

E.g Roll 2 balance dice
Suppose first die is a 3, what is the prob that sum of 2 dice is 8
P(A) = first die is 3
P(B) = sum of both dice is 8

P(B|A) = P(A∩B) / P(A) = 1/6
A∩B = {(3,5)}

E.g Roll Unbalance die
S = {1,2,3,4,5,6}
Suppose the respective prob is 1/12,1/12,1/6,1/6,1/6,1/3
a) if num is even, what is the prob its a 6
P(A) = {2,4,6} = 7/12
P(B) = {6} = 1/3 = P(A∩B)
P(B|A) = 4/7

// can just sum the probabilities together

e.g A couple 2 children
Prob that both are boys if they have at least one son

IT is an order pair because boy can be born first then girl or girl being born first
P(boy) = 1/2 = P(girl)
P(at least one) = {(bb), (bg), (gb)}
P(boy | at least one son} = 1/3

e.g A married couple living in certain district, the prob that husband vote is 0.21
P(wife) = 0.28
P(both vote) = 0.15
a) At least one member vote
P(HUW) = P(W) + P(H) - P(W∩H)

b) wife vote given husband vote
P(W|H) = P(W∩H) / P(H)

c) hasband vote given wife does not vote
P(W') = 1 - P(W)
P(H∩W') = P(H) - P(H∩W) //given formula
P(H|W') = P(H∩ W') / P(W)

e.g 7 (Not completed)
A = poff bad morning lec
B = Proff bad aft lec
//note
P(B|A) + P(B'|A) = 1


Multiplicative rule of probability

P(A∩B) = P(A|B) * P(B)
P(A∩B∩C) = P(A)*P(B|A)*P(C|A∩B)
The intersection probability must be greater than 0

e.g1 Suppose that among 12 shirts, 3 are white
two shirts random choose one by one with no replacement
a) prob both shirts are white
P(first is white) = 3/12
P(secondwhite|firstwhite) = 2/11
P(first and white) = 3/12 * 2/11


b) only one white
Find first shirt not white, second is white
and
first shirt white, second is not white

Use the same method in a)

OR

1- none - a)

c)3 shirts random, all white

P(A∩B∩C) = P(A)*P(B|A)*P(C|A∩B)

e.g 4
Prob a doctor correct diag is 0.7
Prob patient go lawsuit given wrong diag is 0.9

What is the prob that doc makes incorrect and patient sues
P(A∩B) = P(A|B) * P(B)

e.g 5
Four ppl go blood bank
All forget blood type
Only A+ want and only one of 4 have it
Ppl selected at random for typing

a)at least 3 must be typed
Means that the first 2 is not A+
P(first is not a+ and second is not A+) = P(A) * P(B|A)

b) The third donor is A+
First donor is not * second donor is not | first is not * third is | first 2 is not

The Law of Total Probability

Divide the sample space to mutually exclusive events. (No intersection) and union of all event is sample space. (exhausitive)

Any event B is equal to
the sum of all B∩A 
which is the sum of  all P(A)*p(B|A)
where A is the partition of the sample space

e.g1 Factory have machine A,B,C with produce 2, 1 and 3 percent defective screws.
Of total production, A,B and C produce 35,25,40 percent

Screw select randomly
a) prob of it being defective
sum of P(A/B/C |) * P(D|A/B/B)

b) Produce by C given defective
P(C|D) = P(C∩D) / P(D)
P(C) * P(D|C) = P(C∩D)

e.g bag have 4 white 3 black balls
second bag 3 white and 5 black

one ball take from first and place in 2nd
what prob that a ball drawn from second bag is black

P(first is white) = 4/7
P(frst is black) = 3/7

P(drawn black given first is white) = P(B|A) = 5/9
P(drawn black given first is black) = 6/9

P(black drawn second) = P(furst white) * P(blackdrawn given white) + p(first black) * P(black drawn given first is black)

//we can draw tree diagram to visualise

e.g 4
Event A = 10 cent is chosen
B = 20 cent
C = 50 cent
4H = 4 head in 4 toses

The 10 cent is fake, both side is head
What is the prob that fake coin is used
P(A) = P(B) = P(C) = 1/3


2 operation : tossing coin 4 times and  choosing the coin

P(4 Head) = P( 4 Head | B) + P(4Head|C) + P(4 Head | A)
                  = (1/3) ([1/2 to the power of 4 ]*2 + 1)

We have to times it all with 1/3 because it is 1/3 prob to get each of the coin
To get 4H for event B and C, it is 1/2 to the power of 4
To get 4H for event A is 1

P(A∩4H) = 1/3 * 1
P(A|4H) = P(A∩4H) / P(4H) [ANS]

Bayes Theorem

Assume there is a partition of the sample space to A1, A2.... An

P(Ak | B ) = P(Ak) P(B|Ak) / sum of P(Ai) P(B|Ai)
                 = P(Ak) P(B|Ak) / p(B)
where k can be 1 to n

This follow the def of conditonal probability

E.g 1
There is a collapse
the chance the design is faulty is 0.01
The chance that house collapse if the design is faulty is 75 percent
Otherwise (design is not faulty) = 0.01%
Whats the prob that the collapse is due to faulty design

P(D) = 0.01
P(C|D) = 0.75
P(C | D' ) = 0.00001

Applying total prob,
A is house collapse
B is faulty design
P(A) = P(A|B) P(B) + P(A|B') P(B)
P(B|A) = P(A∩B) / P(A)
            = P(A|B)P(B) / P(A)

E.g 4
Only 1 in 1000 adult has rare disease for which there is a diagnostic test being developed
The test is positive but does not imply that you are 100 percent with the disease.

P(have) = 1/1000
P(have ∩ Pos) = 0.99
p(have' ∩ Pos ) = 0.02

If the random select has positive result, whats the prob that they have the disease
P(have|Pos) = P(Have ∩ Pos) / P(Pos)

P(Pos) = P(have)P(pos|have) + p(have')P(pos|have')

We can use the tree diagram to represent this better, 
when constructing, make sure that each node has branches that add up to 1

Insert slide 120


E.g 5

Student answer multiple choice question with 4 possible answer
P(knows) = 0.8
P(know') = 0.2
P(correct| guess) = 0.25

What is the prob that student really knew the correct answer?
P(know | correct) = P(correct ∩ know) / P(correct)

2 Operation: Knows the answer, answer the correct


E.g 6
The components of a certain type are shipped in batches of then
Suppose 50 percent of batches contains no defective, P(none) = 0.5

30 percent contain one def , P(one def) = 0.3
20 percent have 2 def, P(2 def) = 0.2

2 component from a batch are randomly selected and tested
What are the prob associated with 0,1,2 defective components being in the batch if neither tested component is defective

We need to select two items out of batches of 10, 10C2
P(0 def | 0 def in 2) = P( 0 def ∩ 0 def in 2) / P(0def)


Independent Events

Introduction

Suppose a fair dice is tossed twice
Given that
A is that the first toss is an even
B is that the second toss is 5 or 6

The number of outcomes in tossing the dice twice is
6C1 * 6C1

A outcomes is
3C1 * 6C1

B Outcomes is 6C1 * 2C1

For A and B outcomes is 3C1 * 2C1

Because we know that they are independent, we can multiply them together.
If we want to show that it is independent, we show that P(A∩B) = P(A)P(B)
It also mean that P(A|B) = P(A) & P(B|A) = P(B)

We do not know if B has occur or not because they are not dependent on each other.

- In general, P(B|A) is not equal to P(B)
- Knowing that event A has occured generally gives a different view on the chance of B happening
- Only when it is independent does P(B|A) = P(B)

Definition:
Two event A and B are independent if and only if

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

Properties

Suppose P(A) > 0 and P(B) > 0
1.  If A and B are independent, then
P(B|A) = P(B) and P(A|B) = P(A)

2.  Independent events means that A and B cannot be mutually exclusive
Mutually exclusive means that A∩B = null

If we know that A has occur, B cannot occur => Mutually exclusive
A happens does not affect B => Independent

Probability of a given 0 does not mean that the set is empty.
If the probability of a given is not 0, it means the set is definitely not empty

3. If A and B are mutually exclusive, they are not independent

Imagine A' and A, they are mutually exclusive.
If we consider independency,
it breaks the law of the earth as how can something that is not suppose to happen together happen one after another.
Independent: A does not affect A' , but the fact is that A and A' cannot happen tgt

4. The sample space S as well as empty set are independent of any event

S does not give you specific information on what is the outcome (dependency)

5. If A is a subset of B, the A and B are dependent UNLESS B = S

A being a subset of B implies that A∩B = A


NOTE: Venn Diagram cannot show the independence unlike mutually exclusive

Remarks

- Mutually exclusive can be dependent events
- Not mutually exclusive can be dependent
- Not mutually exclusive can be independent
- The negation of independent event have no relations to mutually exclusive (vice versa)
One does not imply the other


E.g 1 The prob that a person will make mistake on income tax return is 10 percent
Find prob that two unrelated person each make a mistake

They are not related, means they are independent
Mi = Person i makes mistake for i = 1,2

P(M1∩M2) = P(m1)P(m2) = 0.1 * 0.1 = 0.01

Theorem

If A and B are independent,
then so are
-A and B' ,
- A' and B ,
-A' and B'

If somehow i can prove any of these are true, then A and B are independent.

A = (A∩B) U (A∩B')
P(A∩B') = P(A) - P(A∩B)
= P(A) - P(A)P(B)
= P(A) (1-P(B))

e.g 2
Tom will be alive in 20 years is 0.7 prob
Jack alive in 20 years is 0.9
Whats the prob that both not alive in 20 eyears

P(A) = .7
P(B) = .9
P(A') = .3
P(B') = .1
P(A' ∩B') = .3 *.1

Since both of them are independent, we can just multiply their complement following the theorem

N independent events

Pairwise independent events

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

with this we cannot conclude if A,B,C are independent.
If we can take any pair from a set, they are pairwise independent


Mutually Independent
The event A1.. An are mutually independent
if and only if for any subset {Ai1...Aik} of A1 , A2,.. An

Every element or subset of the set must satisfy this equation:
P(Ai1∩Ai2 ... Aik) = P(Ai1)P(Ai2)....P(Aik)
to be mutually independent

Ie all elements in the set is independent to each other no matter which pairs of element we take out.

However, it is very hard to check if its mutually independent unless it is defined to us in the questions

Remark:
- For any pair of events or any number of events, they are all independent to each other
- Mutually independent must have pairwise independence and any pairs/threes/...
- Pairwise does not mean mutually independent

Suppose A1.. A2 .. An are mutually independent events
B 1 = Ai or Ai'
Then B1, B2 .. Bn are Independent

Eg 1
Fair dice is toss 3 times
What is prob that first toss give odd number, second give even, and third is >4
P(odd) = 3C1 * 6C1*6C1/ (6C1 ^3)
P(even) = 6C1 * 3C1 * 6C1/ (6C1 ^3) => for 2nd toss
P(>4) = 6C1 * 6C1 * 2C1 / (6C1^3) => for 3rd toss

P(odd ∩ even) = P(odd) * P(Even) = 3C1 * 3C1 * 6C1 / (6C1 ^3) [Proves pairwise]
P(even ∩ >4) = P(even) P(>4)
P(odd ∩ >4) = p(odd) P(>4)

However, this does not prove A B and C are mutually independent

P(even∩odd∩>4) = P(odd) *P(even) * P(>4) 
=> This proves A and B and C are mutually independent

e.g 2
toss 2 dice
A = 1st is event
B = 2nd is odd
C = 2 dice show both odd and both even

P(A) = 3C1 * 6C1 / (6C1 * 6C1)
P(B) = 6C1 * 3C1 / (6C1 ^2)
P(C) = P(Both even) + P(both odd)

A, B, C are pairwise independent
A is independent of C
B is independent of C
A is independent of B

But A, B and C are not independent together (mutually independent)
since P(A∩B∩C) = P(A)P(B)P(C) = 0

e.g 3
3 fire engine operate independently
Prob of specific engine is available is 0.9
what is the prob that no engine is available when needed?
Consider 3 fire engine, E1 E2 and E3 to represent the availability of the engines.
P(E1) = P(E2) = P(E3) = 0.9
We want P(E1'∩E2'∩E3')
Since E1 and E 2 and E3 and independent, implies that their complement are independent as well.
P(E1'∩E2'∩E3') = P(E1') P(E2') P(E3')

The answer we attain is the same as [P(E1UE2UE3)]' -> Any of the engines available

e.g 4
Prob that a grader make marking err on a question is 0.05
There are 10 questions that are marked independently

a) What is prob that no error are made
P(E) = 0.05
P(Ei')  = 1-.05
P(E1'.....E10') = .95 ^10

This is because all of the questions are independent of each other


b) At least one error is made
P(At least one)  = 1 - a)

c) For p replacing 0.05 and n replace 10, the two prob are
(1 - p) ^n
and
1 - (1-p)^n