Download Review of counting.

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Statistics wikipedia , lookup

History of statistics wikipedia , lookup

Birthday problem wikipedia , lookup

Ars Conjectandi wikipedia , lookup

Probability interpretations wikipedia , lookup

Probability wikipedia , lookup

Transcript
MAT 470, REVIEW OF “PREREQUISITES”
SETS
Given sets A and B, that are subsets of some overall set S:
The intersection A  B consists of the elements that are in both A and B.
The union A  B consists of the elements that are in A or B (or both).
The complement A (also denoted ~ A or A ) consists of all elements that are not in A.
The number of elements in set A is denoted by n(A) or |A|.
B
S
A
Thus, A  B consists of those elements in A that are not in B.
A  B A  B A  B
Also, A   A  B   A  B  .
DeMorgan’s Laws:
 A  B   A  B and similarly,  A  B   A  B .
A  B
COUNTING
Addition Rule:
In general, given sets E and F,
n( E  F )  n( E )  n( F )  n( E  F ),
but note n( E  F )  n( E )  n( F ), if E and F don’t overlap (i.e., E  F   ).
For example, n( A)  n  A  B  n  A  B  .
This rule may be extended to a larger number of sets. For example,
n(E  F  G )  n( E )  n( F )  n(G )  n( E  F )  n( E  G )  n( F  G )+n( E  F  G ) .
Permutations:
n!
distinct ways.
(n  r )!
Given the 26 letters of the alphabet, there are 26P4 = 358800 ways to select and arrange a
sequence of 4 of these letters.
Given n items, we can select and arrange r of these items in n P r 
Combinations:
n!
distinct ways.
r !(n  r )!
Here we’ve only counted the different possible groups without regard to how the items are
arranged. Given the 26 letters of the alphabet, there are 26C4 = 14950 ways to choose a group of
4 of these letters.
Given n items, we can choose a group of r of these items in nCr 
Multiplication Rule:
If a series of m decisions/selections are made to determine a set or outcome, and there are nk
choices for the kth decision, then the total number of possible outcomes which may result is given
by the product n1 n2 n3 … nm. How many ways can we form a sequence of 4 distinct letters?
There are (26)(25)(24)(23) = 358800 such sequences (compare with permutations above). But if
the same letter may be repeated, then there are (26)(26)(26)(26) = 456976 sequences of letters.
PROBABILITY
For an element randomly selected (with each element equally likely to be selected) from S,
the probability the element is from A is given by
n( A)
(i.e., the percentage of elements that lie in A).
P( A) 
n( S )
It follows, P( A)  P( A)  1 . That is, all 100% of the elements are either in A or not in A.
Equivalently, P( A)  1  P( A) .
The set of possible outcomes resulting from an experiment is called the sample space, S. The
individual elements or outcomes are the samples points. A subset of the sample space (i.e., a
collection of outcomes) is called an event. For example, when a coin is tossed 3 times, consider
the event that heads occurs exactly 2 times. Here, E = { {H, H, T}, {H, T, H}, {T, H, H} } and
so P( E )  3/ 8 and so P( E)  5 / 8 .
Addition Rule: P( E  F )  P( E )  P( F )  P( E  F ),
or simply P( E  F )  P( E )  P( F ), if E  F   .
Conditional Probability:
The probability that E occurs, given that event F does occur is denoted P( E | F ) and read as
“the probability of E, given F”:
n( E  F ) P ( E  F )
,
P( E | F ) 

n( F )
P( F )
and so,
P( E  F )  P( E | F ) P( F ) .
E|F
EF
The event E  F may be illustrated using a tree diagram:
F
E | F
F
Note P( E | F )  1  P( E | F ) . Also, note this rule may be extended as
P( E  F  G )  P(G | E  F ) P( F | E ) P( E ) .
Independent Events:
If the occurrence of event F has no effect on the likelihood of event E
(i.e., the events are independent), then
P( E | F )  P( E ) (likewise, P( F | E )  P( F ) ) and
P( E  F )  P( E ) P( F ) when E and F are independent.
Law of Total Probability:
If the sample space may be written as the union of non-overlapping sets B1 , B2 , …, Bn (i.e., a
partition of S), then for an event A, the Law of Total Probability states
P( A)  P  A  B1   P  A  B2   P( A  Bn )
 P( A | B1 ) P( B1 )  P( A | B2 ) P( B2 ) 
P( A | Bn ) P( Bn )
That is, we simply consider all of the ways A may occur.
B1
B2
Bn
A | B2
B1
A  B1
A  B2
A  B1
A | B1
S
A  B2
B2
A  Bn
A
A | Bn
Bn
A  Bn
Bayes’ Rule:
For a partition of S given by B1 , B2 , …, Bn , we may use the probability P ( A | B j ) to compute
the probability P ( B j | A) , as follows.
P( B j | A) 
P  A  Bj 
P( A)

P  A | B j  P( B j )
P( A)
Combining this result with the Law of Total Probability, we may write
P  A | B j  P( B j )
P( B j | A) 
P( A | B1 ) P( B1 )  P( A | B2 ) P( B2 )  P( A | Bn ) P( Bn )