Download Probability and Graph Theory

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

Ethnomathematics wikipedia , lookup

Mathematics of radio engineering wikipedia , lookup

Location arithmetic wikipedia , lookup

Foundations of mathematics wikipedia , lookup

History of statistics wikipedia , lookup

Elementary mathematics wikipedia , lookup

Foundations of statistics wikipedia , lookup

Infinite monkey theorem wikipedia , lookup

Law of large numbers wikipedia , lookup

Birthday problem wikipedia , lookup

Transcript
Advanced Mathematics Training Class Notes
Chapter 12: Probability and Graph Theory
Addition property (加
加法原理)
法原理
Chapter 12
Probability and
Graph Theory
For any two events E1 and E2, if they can never occur in the same time, i.e., P(E1 and E2) = 0,
we say that E1 and E2 are mutually exclusive events (互斥事件).
If there are k mutually exclusive events E1, E2, … Ek, then:
P ( E1 or E2 or … or Ek ) = P ( E1 ) + P ( E2 ) + … + P ( Ek )
For example, the probability of having an odd number when throwing a fair die
= P(1 or 3 or 5)
= P(1) + P(3) + P(5)
= 1/6 + 1/6 + 1/6
= 1/2.
What is Probability? (概率
概率)
概率
Probability is the measure of the chance of the occurrence (發生機會) of an event (事件).
An example is tossing (擲) a coin. The outcome can either be a “head” (公) or a “tail” (字).
We don’t know if the result of each tossing, but we know that it has half of the chance of
getting a “head”, another half for getting a “tail”. The statement “A head comes up when
tossing a coin” describes an event. The probability of this event is 50% (half), or 0.5.
Number of Favourable Outcomes
Probability =
Number of Possible Outcomes
We often denote the probability of the event E as P(E). For example, P(head) = 0.5 in our
example.
In this text, the word “or” will be expressed as addition of events, and the word “and” will be
viewed as multiplication of events. So the above equation can be simplified as:
 k
 k
P ∑ E j  = ∑ P E j
 j =1  j =1


This is the addition property of probability.
( )
Multiplication property (乘法原理
乘法原理)
乘法原理
If two events E1 and E2 do not affect each other, they are called independent events (獨立事
件). If not, they are called dependent events (非獨立事件). Example of independent events
is “Today is Sunday” and “Tomorrow will rain”. Example of dependant events is “This
month is February” and “Today is the 29th”.
When an event is certain to happen, its probability is 1.
When an event is impossible to happen, its probability is 0. Thus,
0 < P(E) < 1
When throwing a fair die (骰子), P(getting 1) = 1/6. But how about not getting 1? We found
that P(not getting 1) = 5/6 = 1 – 1/6. Actually,
P(E ) = 1− P( E)
If there are k independent events E1, E2, … Ek, then:
 k
 k
P∏ E j  = ∏ P E j
 j =1  j =1


This is the multiplication property of probability.
( )
E means not having the event E.
For example, P(tossing two heads in a row)
= P(head × head)
= P(head) × P(head)
= 1/2 × 1/2
= 1/4.
90
Advanced Mathematics Training Class Notes
Chapter 12: Probability and Graph Theory
Conditioned Probability (條件機率
條件機率)
條件機率
Example: In a bag there are four fair coins, five unfair coins that its P(head) = 1/3, and six
unfair coins that P(head) = 3/5. If we randomly pick a coin in the bag, what is the probability
that we can toss a head?
P ( head ) = 4+ 45+ 6 × 12 + 4 +55+ 6 × 13 + 4 +56+ 6 × 53 = 109
225
Conditioned Probability, denoted as P(A|B) means the probability of A when B is happened.
For k events (not necessary independent or dependent) E1, E2, … Ek:
j −1
k
 k



P  ∏ E j  = P ( E1 ) ⋅ ∏ P  E j ∏ Ei 


 j =1 
j=2 
i =1



= P ( E1 ) ⋅ P ( E2 | E1 ) ⋅ P ( E3 | E2 E1 ) ⋅ P ( E4 | E3 E2 E1 )⋯
Inclusive and Exclusive Property (容斥原理
容斥原理)
容斥原理
For some events E1, … Ek, we have
j1
k
k
 k

 k

k +1
P  ∑ E j  = ∑ P E j0 − ∑ ∑ P E j0 E j1 + … + ( −1) P  ∏ E j 
 j =1  j =1


j1 = 2 j0 =1

 0
 j =1 
In case k = 2,
P ( E1 + E2 ) = P ( E1 ) + P ( E2 ) − P ( E1E2 )
( )
Particularly, when there are two events A and B,
P ( AB ) = P ( B ) ⋅ P ( A | B )
That is,
P ( A | B) =
P ( AB )
P( B)
(
=
(
P tail2 × head 2
(
1 − P head
)
Example: What is the probability of an integer that is less than 100 is divisible by 3 or 5?
P(divisible by 3 or 5)
= P(divisible by 3) + P(divisible by 5) – P(divisible by 3 and 5)
 99   99   99 
=  3  +  5  −  3×5 
99
99
99
33 19 6
=
+
−
99 99 99
46
=
99
Which also indicates that there are 46 of such a numbers.
)
)
( 12 ) ( 12 )
2
1 − ( 12 )
2
=
2
2
1
3
(Note: having at least a “tail” means there is no chance in getting two “heads” in a row.)
=
Assume k mutually exclusive events E1, … Ek such that
k
( ) (
∑ j =1 E j = 1 , then for any event A,
P( B) = ∑ P E j P B E j
j =1
For k = 2, if A and B are two events, then
)
If E1 and E2 are mutually exclusive, we get the addition property.
For example, the probability of tossing a coin two times and result in two “tails” when it is
known that there is at least a “tail”.
= P tail × tail | head × head
(
k
)
( ) (
P ( B ) = P ( A) P ( B A) + P A P B A
)
91
Advanced Mathematics Training Class Notes
Chapter 12: Probability and Graph Theory
Permutations and Combinations
Pigeonhole Principle (抽屜定理
抽屜定理/鴿籠定理
抽屜定理 鴿籠定理)
鴿籠定理
n
In Chapter 10, we learnt the notation of Prn and   . Recall that Prn is the number of
r
n
n!
, and   is the number of
choices to arrange r objects out of n objects =
( n − r )!
r
Pigeonhole principle is an easy yet powerful tool in combinatorics. It states that:
When n pigeons are put into k pigeonholes,
There exists at least one pigeonhole that has ≥  nk  pigeons
And more than one pigeonhole that have ≤  nk  pigeons
n!
combinations of selecting r objects out of n =
. In this case, we assumed that there
r !( n − r )!
Here  x  is the ceiling function that means the smallest integer that is greater than or
is only one supply for each of the objects. But if there are infinite supplies, we will get the
 n + r − 1
duplicable combination (可重組合) H rn = 
.
 r

equals to x. For example,  2.1 = 3, 7.1 = 8, π  = 4,  −1.2  = 1, 6  = 6.
For example, when 7 objects (pigeons) are put into 5 boxes (pigeonholes), there must be at
least one box having more than 2 objects, and more than one box having at most 1 object.
Example: How many ways that one can make a six-letter combination by letters from “A” to
“G”?
Assume “A” to “G” are 7 different objects and the combination be a collection of 6 boxes.
 7 + 6 − 1 12 
Since there are infinite supplies of objects, there are H 67 = 
 =   = 924 ways.
 6  6
Example: There are 9 bees in a cubic cage that its side length is 1. Neglecting the size of the
3
bees, prove there must be at least a pair of bees that their distance is ≤
.
2
We divide the cage into 8 little cages that their side lengths are 1/2. Now assume the little
cages are the pigeonholes, and the bees are the pigeons. By the pigeonhole principle, there
must be at least a pigeonhole (cage) that contains at least 2 pigeons (bees). In a little cage, the
3
. The result follows.
farthest distance of any two bees is the diagonal, which the length is
2
Application of permutations and combinations
The application of permutations and combinations are usually for counting numbers.
10
Example: How many non-negative solutions to the diophantine equation
∑ xk = 90 ?
k =1
Assume “1” is an object, so if xk = n, it is the collection of n “1”’s. In a series of 99 boxes,
there are various “1” and “+”. The “1”’s are grouped together to form an “xn”. The “+” means,
of course, addition. It can be seen that there must be exactly 9 “+”’s. Thus, there are exactly
 99 
12
  ≈ 1.73 × 10 solutions.
9
1/2
1
1/2
1/2
92
1/2
Advanced Mathematics Training Class Notes
Chapter 12: Probability and Graph Theory
Rectangle and Square Counting
Path Problems
Graph (圖) in combinatorics is an object that is composed of several vertices and edges.
Examples of graphs are:
Now consider the following graph:
B
Rectangular graph is a special kind of graph that its form is rectangular.
A
How many ways could one move from point A to B? We can add up all possibilities that one
can make up a way from A to B.
We say that this graph is composed of a 5×3 grid or 4×2 unit squares.
To do so, we employ the paths counting algorithm:
For a rectangular graph that is composed of m×n unit squares:
There are 16 n ( n + 1)( 3m − n + 1) distinct squares, if n < m.
There are
1 mn
4
( m + 1)( n + 1)
First of all, put a “1” on the starting point. (For reading convenient, the arrows are omitted)
distinct rectangles, including squares.
In particular, if m = n (The rectangular graph is actually a square):
n
The number of squares = 16 n ( n + 1)( 2n + 1) = ∑ k 2
1
k =1
“Spread” this “1” to the corresponding vertices that is connected from it.
n
The number of rectangles = 14 n 2 ( n + 1) = ∑ k 3
2
k =1
For example, a table with 11 rows and columns has exactly
1
4
(11)2 (11 + 1)2
1
= 4356
rectangles.
1
93
1
Advanced Mathematics Training Class Notes
Chapter 12: Probability and Graph Theory
Now spread the new “1”’s. First spread the red node (節點)…
Revision
1
1
In this chapter, we’ve learnt:
1. Probability
2. Applications of permutations and combinations
3. Pigeonhole principle
4. Rectangle and square counting
5. Path problems
1
1
1
And then the blue. Note that the vertex above the blue node is already occupied by a “1”. You
should add the “1” spread to that node. That is, that node should now read as “2”.
1
Continue spreading…
1
2
Exercise
1
1 1
In the followings, if not specified, x is the variable.
1. Refer to the following situation.
1
6
10
A
3
I
2 3
3
Q
9
Y
3
3
o
2
5
D
94
7
h
p
x
8
ζ
3
S
a
7
i
2
q
5
y
η
T
b
j
6
r
8
z
1
θ
4
U
c
1
k
8
s
5
α
5
ι
V
d
l
8
t
4
β
8
κ
2
W
e
8
m
1
u
2
γ
2
λ
n
6
9
v
2
7
4
2
f
9
8
1
X
9
4
9
P
7
5
1
3
O
H
9
9
4
1
2
2
6
2
1
6
4
3
2
N
G
7
3
1
2
9
3
4
8
5
M
F
9
9
8
4
5
8
8
9
6
8
9
5
2
3
L
E
8
6
7
8
1
3
4
7
6
ε
Z
K
D
5
1
6
8
w
5
3
2
 ( 5 − 1) + ( 3 − 1)   6 
For example, there are 
 =   = 15 ways to travel from C to D if the
3 −1

  2
distance is shortest.
C
R
4
3
7
9
g
2
7
9
If the graph is a rectangular graph composed of an m×n grid, the number of shortest ways to
travel from one corner to another corner opposite to it is simply
 ( m − 1) + ( n − 1)   ( m − 1) + ( n − 1) 
( m + n − 2 )! .

=
=
m
m
n
−
1
−
1

 
 ( − 1)!( n − 1)!
J
C
3
4
6
1
1 1
Until the goal has been reached. Here, the number on point B read as “10”. This means there
are totally 10 ways to travel from A to B.
1
5
6
1
B
δ
8
8
µ
N
Advanced Mathematics Training Class Notes
Chapter 12: Probability and Graph Theory
8. Assume there are n letters and n envelopes. We number them as “1” to “n”. We say that
putting a letter numbered “j” into the envelope, which also numbered “j”, is good. If we
randomly put the letters into the envelopes, what is the probability that no goods have
happened?
9. (PCMSIMC 2003) A mat of size 10×10 is divided into 100 squares of size 1×1. The
squares at the top left and bottom right corners are then removed. How many rectangles
(including squares) can be found on the mat?
10. (PCMSIMC 2003) Given a 7×7 grid, we remove the 5×5 grid at the upper right hand
corner to obtain an L-shaped grid as shown. We want to travel from the upper left hand
corner to the lower right hand corner of this L-shaped grid, but in each step we can only
move rightward or downward along the gridlines. How many different paths are there?
The graph on the previous page shows the structure of the “Square City”. It is composed
of a 8×8 grid. The citizens in Square City can only travel along the streets, denoted by the
black lines. The numbers on the line indicates how much time, measured in minutes, is
needed to walk through that street. The intersection points of the streets are evenly
distributed, with each corresponding points have a distance of 1 km. John lived in the
corner of this city at ε, and Jennifer lived at H. One day, John is needed to go to Jennifer’s
home.
a)
Find the shortest distance John must travel.
b)
How many ways can John travel in shortest distance?
c)
Find the path that both shortest distance and time is achieved for John. What is
the time needed?
d)
It is later known that Jennifer is not at home. On the way John is walking, he did
not see Jennifer. What is the probability of her being on b, c, j or k?
e)
How many rectangles can be formed by the streets, excluding the square bckj?
2. (ISMC 2000 Final) Each of two boxes contains both black and white marbles, and the
total number of marbles in the two boxes is 25. One marble is taken out of each box
randomly. The probability that both marbles are black is 27/50, and the probability that
both marbles are white is m/n, where (m, n) = 1. Find m + n.
[Hint: Factorize 50.]
3. How many numbers between 1 and 1000 such that they are divisible by 3, 5, 7 or 11?
4. (PCMSIMC 2004) A game is played as follows: On the blackboard the number “0” is
written. There is a box in which nine balls numbered “1” to “9” are placed. One then
randomly takes a ball from the box and adds the number on the ball to the number on the
blackboard. The number on the blackboard is then replaced by the sum obtained. This is
repeated, with the ball drawn put back into the box each time, until the number on the
blackboard exceeds 10. If the probability that the number “9” ever appears on the
blackboard during the game is k9 , find k.
Start
End
9
5. (HKMO 2002 Heat) There are 9 cards, numbered from 1 to 9, in a bag. If 3 cards are
drawn together at random, find the probability that all cards are odd.
6. In a unit square (square with side length 1), there is a point. Show that:
a)
There is a vertex that the distance to the point is at most
b)
There is a side that the distance to the point is at least 1/2.
2
2
.
7. Prove that, if a number n can be factorized into p1a1 p2a2 … pk ak , then the number of
k
positive factors must be
∏1 + a j .
j =1
95
Advanced Mathematics Training Class Notes
Chapter 12: Probability and Graph Theory
Suggested Solutions for the Exercise
1a) 14 km
b) 924
c) εwxyqiaSKCDEFGH or εwxyqiaSTLDEFGH. 55 minutes.
d) 4/49
e) 528
2) 26
3) 585
4) 100,000,000
5) 20/243
8) 1/n!
9) 720
10) 491
96