Santos - Elementary Discrete Probability
Santos - Elementary Discrete Probability
Santos - Elementary Discrete Probability
David A. SANTOS
[email protected]
ii
Contents
Preface
iii
To the Student
1 Preliminaries
1.1 Sets . . . . . . . . . . . .
Homework . . . . . . . . . . .
1.2 Sample Spaces and Events
Homework . . . . . . . . . . .
1.3 Combining Events . . . . .
Homework . . . . . . . . . . .
1.4 Functions . . . . . . . . .
Homework . . . . . . . . . . .
Answers . . . . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
1
1
2
3
4
4
5
6
8
8
2 Counting
2.1 Inclusion-Exclusion . . . . . . . .
Homework . . . . . . . . . . . . . . .
2.2 The Product Rule . . . . . . . . .
Homework . . . . . . . . . . . . . . .
2.3 The Sum Rule . . . . . . . . . . .
Homework . . . . . . . . . . . . . . .
2.4 Permutations without Repetitions .
Homework . . . . . . . . . . . . . . .
2.5 Permutations with Repetitions . .
Homework . . . . . . . . . . . . . . .
2.6 Combinations without Repetitions
Homework . . . . . . . . . . . . . . .
2.7 Combinations with Repetitions . .
Homework . . . . . . . . . . . . . . .
2.8 Binomial Theorem . . . . . . . .
Homework . . . . . . . . . . . . . . .
2.9 Miscellaneous Counting Problems .
Homework . . . . . . . . . . . . . . .
Answers . . . . . . . . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
10
10
13
14
18
19
21
22
23
24
26
27
30
33
35
35
38
38
40
41
.
.
.
.
.
.
.
47
47
49
50
55
58
60
61
3 Discrete Probability
3.1 Probability Spaces . . . .
Homework . . . . . . . . . . .
3.2 Uniform Random Variables
Homework . . . . . . . . . . .
3.3 Independence . . . . . . .
Homework . . . . . . . . . . .
3.4 Binomial Random Variables
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Homework . . . . . . . . . . . .
3.5 Geometric Random Variables
Homework . . . . . . . . . . . .
3.6 Poisson Random Variables .
Answers . . . . . . . . . . . . .
4 Conditional Probability
4.1 Conditional Probability
Homework . . . . . . . . .
4.2 Conditioning . . . . .
Homework . . . . . . . . .
4.3 Bayes Rule . . . . . .
Homework . . . . . . . . .
Answers . . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
63
63
65
65
66
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
70
70
71
71
75
76
78
79
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
81
81
84
85
86
86
87
87
6 Markov Chains
6.1 Discrete Time Stochastic Processes
Homework . . . . . . . . . . . . . . .
6.2 Long Run Probabilities . . . . . .
Answers . . . . . . . . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
88
88
89
89
90
.
.
.
.
.
.
.
91
A The Integers
Homework . . . . . . . . . . . . . . . . . . . . .
96
99
B Divisibility Tests
100
Homework . . . . . . . . . . . . . . . . . . . . . 103
C Arithmetic Sums
104
Homework . . . . . . . . . . . . . . . . . . . . . 108
D Geometric Sums
109
Homework . . . . . . . . . . . . . . . . . . . . . 112
Answers . . . . . . . . . . . . . . . . . . . . . . 112
Preface
These notes started during the Spring of 2002. The contents are mostly discrete probability, suitable for students
who have mastered only elementary algebra. No calculus is needed, except perhaps in a very few optional exercises.
Since a great number of the audience of this course comprises future elementary school teachers, I have included a
great deal of preliminary ancillary material, especially in the areas of arithmetic and geometric sums and divisibility
criteria. It has been my experience that many of these future teachers do actually enjoy learning the fundamentals
of number theory and divisibility through probability problems. The response overall, has been positive.
I would appreciate any comments, suggestions, corrections, etc., which can be addressed at the email below.
David A. Santos
[email protected]
Things to do:
iii
Legal Notice
This material may be distributed only subject to the terms and conditions set forth in the Open Publication License,
version 1.0 or later (the latest version is presently available at http://www.opencontent.org/openpub/
THIS WORK IS LICENSED AND PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE OR A WARRANTY OF NON-INFRINGEMENT.
THIS DOCUMENT MAY NOT BE SOLD FOR PROFIT OR INCORPORATED INTO COMMERCIAL DOCUMENTS WITHOUT EXPRESS PERMISSION FROM THE AUTHOR(S). THIS DOCUMENT MAY BE FREELY
DISTRIBUTED PROVIDED THE NAME OF THE ORIGINAL AUTHOR(S) IS(ARE) KEPT AND ANY CHANGES
TO IT NOTED.
iv
To the Student
These notes are provided for your benefit as an attempt to organise the salient points of the course. They are a
very terse account of the main ideas of the course, and are to be used mostly to refer to central definitions and
theorems. The number of examples is minimal, and here you will find few exercises. The motivation or informal
ideas of looking at a certain topic, the ideas linking a topic with another, the worked-out examples, etc., are given
in class. Hence these notes are not a substitute to lectures: you must always attend to lectures. The order of
the notes may not necessarily be the order followed in the class.
There is a certain algebraic fluency that is necessary for a course at this level. These algebraic prerequisites
would be difficult to codify here, as they vary depending on class response and the topic lectured. If at any stage
you stumble in Algebra, seek help! I am here to help you!
Tutoring can sometimes help, but bear in mind that whoever tutors you may not be familiar with my conventions.
Again, I am here to help! On the same vein, other books may help, but the approach presented here is at times
unorthodox and finding alternative sources might be difficult.
Here are more recommendations:
Dont fall behind! The sequence of topics is closely interrelated, with one topic leading to another.
The use of calculators is allowed, especially in the occasional lengthy calculations. However, when graphing, you
will need to provide algebraic/analytic/geometric support of your arguments. The questions on assignments
and exams will be posed in such a way that it will be of no advantage to have a graphing calculator.
Presentation is critical. Clearly outline your ideas. When writing solutions, outline major steps and write in
complete sentences. As a guide, you may try to emulate the style presented in the scant examples furnished
in these notes.
1 My
doctoral adviser used to say I said A, I wrote B, I meant C and it should have been D!
Chapter
Preliminaries
1.1
Sets
1 Definition By a set we will understand any well-defined collection of objects. These objects are called the elements
of the set. A subset is a sub-collection of a set. We denote that the set B is a subset of A by the notation B A.
If a belongs to the set A, then we write a A, read a is an element of A. If a does not belong to the set A, we
write a A, read a is not an element of A.
Notation: We will normally denote sets by capital letters, say A, B, , R, etc. Elements will be
denoted by lowercase letters, say a, b, , r, etc. The following sets will have the special symbols
below.
N = {0, 1, 2, 3, . . .}
Z = {. . . , 3, 2, 1, 0, 1, 2, 3, . . .}
Observe that N Z R,and that the empty set is always a subset of any set.
2 Example There are various ways to allude to a set:
by a verbal description, as in the set A of all integers whose absolute value is strictly less than 2.
by a mathematical description, as in A = {x Z : |x| < 2}. This is read the set of x in Z such that |x| is
strictly less than 2.
by listing the elements of the set, as in A = {1, 0, 1}.
Notice that the set A is the same in all three instances above.
3 Definition Given a particular situation, the universe or universal set is the set containing all the points under
consideration. For any particular situation, its universe will be denoted by unless otherwise noted.1
4 Example Let = {1, 2, . . . , 20}, that is, the set of integers between 1 and 20 inclusive. A subset of is
E = {2, 4, 6, . . . , 20}, the set of all even integers in . Another subset of is P = {2, 3, 5, 7, 11, 13, 17, 19}, the set
of primes in . Observe that, for example, 4 E but 4 P.
1 The
Chapter 1
5 Definition The cardinality of a set A, denoted by card (A) is the number of elements that it has. If the set X
has infinitely many elements, we write card (X) = .
6 Example If A = {1, 1} then card (A) = 2. Also, card (N) = .
7 Definition The set of all subsets of a set A is the power set of A, denoted by 2A . In symbols
2A = {X : X A}.2
S4 = {c}
S5 = {a, b}
S6 = {b, c}
S7 = {c, a}
S8 = {a, b, c}
S6 = {b, c}
S7 = {c, a}
S8 = {a, b, c}
S9 = {d}
S10 = {a, d}
S11 = {b, d}
S2 = {a}
S3 = {b}
S4 = {c}
S5 = {a, b}
S12 = {c, d}
S13 = {a, b, d}
S14 = {b, c, d}
S15 = {c, a, d}
S16 = {a, b, c, d}
Reasoning inductively, as in the last two examples, we obtain the following theorem.
Homework
11 Problem Given the set A = {a, b}, find 2A and card 2A .
12 Problem Let A be the set of all 3-element subsets of
{1, 2, 3, 4}. List all the elements of A and find card (A).
13 Problem List all the elements of the set
A = {x Z : x2 < 6},
2 This
that is, the set of all integers whose squares are strictly less
than 6. Is the set A the same as the set
B = {t Z : t2 < 9}?
14 Problem How many subsets does the set have? How
many subsets does a set with 10 elements have?
15 Problem Is there a difference between the sets and {}?
1.2
flipping a coin,
spinning a roulette.
18 Definition A set = is called a sample space or outcome space. The elements of the sample space are called
outcomes. A subset A is called an event. In particular, is called the null or impossible event.
19 Example If the experiment is flipping a fair coin and recording whether heads H or tails T is obtained, then the
sample space is = {H, T }.
20 Example If the experiment is rolling a fair die once and observing how many dots are displayed, then the sample
space is = {1, 2, 3, 4, 5, 6} The event of observing an even number of dots is E = {2, 4, 6} and the event of observing
an odd number of dots is O = {1, 3, 5}. The event of observing a prime number score is P = {2, 3, 5}.
21 Example If the experiment consists of tossing two (distinguishable) dice (say one red, one blue), then the sample
space consists of the 36 ordered pairs
(1, 1) (1, 2) (1, 3) (1, 4) (1, 5) (1, 6),
(2, 1) (2, 2) (2, 3) (2, 4) (2, 5) (2, 6),
(3, 1) (3, 2) (3, 3) (3, 4) (3, 5) (3, 6),
(4, 1) (4, 2) (4, 3) (4, 4) (4, 5) (4, 6),
(5, 1) (5, 2) (5, 3) (5, 4) (5, 5) (5, 6),
(6, 1) (6, 2) (6, 3) (6, 4) (6, 5) (6, 6).
Here we record first the number on the red die and then the number on the blue die in the ordered pair (R, B). The
event S of obtaining a sum of 7 is the set of ordered pairs
S = {(1, 6), (2, 5), (3, 4), (4, 3), (5, 2), (6, 1)}.
22 Example An experiment consists of the following two stages: (1) first a fair die is rolled and the number of dots
recorded, (2) if the number of dots appearing is even, then a fair coin is tossed and its face recorded, and if the
number of dots appearing is odd, then the die is tossed again, and the number of dots recorded. The sample space
for this experiment is the set of 24 points
{ (1, 1), (1, 2), (1, 3), (1, 4), (1, 5), (1, 6), (2, H), (2, T ),
(3, 1), (3, 2), (3, 3), (3, 4), (3, 5), (3, 6), (4, H), (4, T ),
(5, 1), (5, 2), (5, 3), (5, 4), (5, 5), (5, 6), (6, H), (6, T )
}.
Chapter 1
23 Example An experiment consists of drawing one card from a standard (52-card) deck and recording the card.
The sample space is the set of 52 cards
{ A, 2, 3, 4, 5, 6, 7, 8, 9, 10, J, Q, K,
A, 2, 3, 4, 5, 6, 7, 8, 9, 10, J, Q, K,
A, 2, 3, 4, 5, 6, 7, 8, 9, 10, J, Q, K,
A, 2, 3, 4, 5, 6, 7, 8, 9, 10, J, Q, K
}.
Homework
24 Problem An experiment consists of flipping a fair coin
twice and recording each flip. Determine its sample space.
1.3
Combining Events
Figure 1.1: A B
Figure 1.2: A B
Ac
Figure 1.3: A \ B
Figure 1.4: Ac
A B = {1, 3, 5},
A \ B = {2, 4, 6},
B \ A = {7, 9}.
Homework
Observe that Ac is all that which is outside A. The complement Ac represents the event that A does not occur.
We represent Ac pictorially as in figure 1.4.
A Bc Cc
(A B)c
A Bc C
(A B C)c
Ac B C
ABC
AB
A Bc Cc
A Bc
Ac B Cc
Ac B
A B Cc
The various intersecting regions for two and three sets can be seen in figures 1.5 and 1.6.
30 Example Let = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9} be the universal set of the decimal digits and let A = {0, 2, 4, 6, 8}
be the set of even digits. Then Ac = {1, 3, 5, 7, 9} is the set of odd digits.
Observe that
(Ac ) A = .
(1.1)
The following equalities are known as the De Morgan Laws, and their truth can easily be illustrated via Venn
Diagrams.
(A B)c = Ac Bc ,
(1.2)
(A B)c = Ac Bc .
(1.3)
Homework
Chapter 1
Determine X \ Z.
Determine Y \ Z.
1.4
Determine (X \ Z) (Y \ Z).
Functions
41 Definition By a function f : Dom (f) Target (f) we mean the collection of the following ingredients:
a name for the function. Usually we use the letter f.
a set of inputs called the domain of the function. The domain of f is denoted by Dom (f).
an input parameter , also called independent variable or dummy variable. We usually denote a typical input
by the letter x.
a set of possible outputs of the function, called the target set of the function. The target set of f is denoted
by Target (f).
an assignment rule or formula, assigning to every input a unique output. This assignment rule for f is
usually denoted by x f(x). The output of x under f is also referred to as the image of x under f, and is
denoted by f(x).
image
rule
target set
domain
The notation3
f:
f(x)
read the function f, with domain Dom (f), target set Target (f), and assignment rule f mapping x to f(x) conveys
all the above ingredients. See figure 1.7.
3 Notice the difference in the arrows. The straight arrow is used to mean that a certain set is associated with another set, whereas
the arrow (read maps to) is used to denote that an input becomes a certain output.
Functions
42 Definition The image Im (f) of a function f is its set of actual outputs. In other words,
Im (f) = {f(a) : a Dom (f)}.
Observe that we always have Im (f) Target (f).
It must be emphasised that the uniqueness of the image of an element of the domain is crucial. For example, the
diagram in figure 1.8 does not represent a function. The element 1 in the domain is assigned to more than one
element of the target set. Also important in the definition of a function is the fact that all the elements of the
domain must be operated on. For example, the diagram in 1.9 does not represent a function. The element 3 in the
domain is not assigned to any element of the target set.
2
1
3
4
2
8
16
0
1
3
4
8
43 Example Consider the sets A = {1, 2, 3}, B = {1, 4, 9}, and the rule f given by f(x) = x2 , which means that f
takes an input and squares it. Figures 1.10 through 1.11 give three ways of representing the function f : A B.
f:
{1, 2, 3} {1, 4, 9}
x
x2
f:
1
1
2
3
1
4
9
44 Example Find all functions with domain {a, b} and target set {c, d}.
Solution: There are 22 = 4 such functions, namely:
f1 given by f1 (a) = f1 (b) = c. Observe that Im (f1 ) = {c}.
f2 given by f2 (a) = f2 (b) = d. Observe that Im (f2 ) = {d}.
f3 given by f3 (a) = c, f3 (b) = d. Observe that Im (f3 ) = {c, d}.
f4 given by f4 (a) = d, f4 (b) = c. Observe that Im (f4 ) = {c, d}.
45 Definition A function is injective or one-to-one whenever two different values of its domain generate two different
values in its image. A function is surjective or onto if every element of its target set is hit, that is, the target set is
the same as the image of the function. A function is bijective if it is both injective and surjective.
Chapter 1
1
2
3
2
8
4
1
2
3
4
2
1
2
3
4
2
1
2
4
2
8
46 Example The function in the diagram 1.13 is an injective function. The function represented by the diagram
1.14, however is not injective, since (3) = (1) = 4, but 3 = 1. The function represented by diagram 1.15 is
surjective. The function represented by diagram 1.16 is not surjective since 8 is part of the target set but not of
the image of the function.
47 Theorem Let f : A B be a function, and let A and B be finite. If f is injective, then card (A) card (B).
If f is surjective then card (B) card (A). If f is bijective, then card (A) = card (B).
Proof:
If f were injective then f(x1 ), f(x2 ), . . . , f(xn ) are all distinct, and among the yk . Hence n m.
If f were surjective then each yk is hit, and for each, there is an xi with f(xi ) = yk . Thus there
are at least m different images, and so n m.
48 Definition A permutation is a function from a finite set to itself which reorders the elements of the set.
a b
f1 :
f2 :
a b
.
b
a b
f3 :
f4 :
a a
.
b
Homework
50 Problem Find all functions from {0, 1, 2} to {1, 1}. How
many are injective? How many are surjective?
Answers
Answers
2A
11
12
{1, 2, 3}, {1, 2, 4}, {1, 3, 4}, and {2, 3, 4}, whence card (A) = 4.
13
14
= 4.
15 Yes. The first is the empty set, and has 0 elements. The second is a set containing the empty set, and hence it has 1 element.
24
25
We have
32
{(1, 1), (1, 2), (1, 3), (2, 1), (2, 2), (3, 1)}
51
{1} {2, 3}
{2} {1, 3}
{3} {1, 2}
33
34
35
AB
36
37
(A \ B) (B \ A) (A B)
38
(A Bc ) (Ac B) = (A B) \ (A B).
39
We have
40
(A B Cc ) (A Bc C) (Ac B C) (A B C).
53
f1 :
50
f2 :
f2 :
f4 :
There are 23 = 8 such functions:
We have
1
f1 :
f3 :
f5 :
f6 :
Chapter
Counting
2.1
Inclusion-Exclusion
In this section we investigate a tool for counting unions of events. It is known as The Principle of InclusionExclusion or Sylvester-Poincar Principle.
54 Theorem (Two set Inclusion-Exclusion)
card (A B) = card (A) + card (B) card (A B)
Proof:
We have
A B = (A \ B) (B \ A) (A B),
In the Venn diagram 2.1, we mark by R1 the number of elements which are simultaneously in both sets (i.e., in
A B), by R2 the number of elements which are in A but not in B (i.e., in A \ B), and by R3 the number of
elements which are B but not in A (i.e., in B \ A). We have R1 + R2 + R3 = card (A B), which illustrates the
theorem.
6
A
B
R2
R1
R3
B
18
10
10
11
Inclusion-Exclusion
55 Example Of 40 people, 28 smoke and 16 chew tobacco. It is also known that 10 both smoke and chew. How
many among the 40 neither smoke nor chew?
Solution: Let A denote the set of smokers and B the set of chewers. Then
card (A B) = card (A) + card (B) card (A B) = 28 + 16 10 = 34,
meaning that there are 34 people that either smoke or chew (or possibly both). Therefore the number of people that
neither smoke nor chew is 40 34 = 6.
Aliter: We fill up the Venn diagram in figure 2.2 as follows. Since card (A B) = 10, we put a 10 in the intersection.
Then we put a 28 10 = 18 in the part that A does not overlap B and a 16 10 = 6 in the part of B that does
not overlap A. We have accounted for 10 + 18 + 6 = 34 people that are in at least one of the set. The remaining
40 34 = 6 are outside these sets.
56 Example How many integers between 1 and 1000 inclusive, do not share a common factor with 1000, that is,
are relatively prime to 1000?
Solution: Observe that 1000 = 23 53 , and thus from the 1000 integers we must weed out those that have a factor of
2 or of 5 in their prime factorisation. If A2 denotes the set of those integers divisible by 2 in the interval [1; 1000]
1000
then clearly card (A2 ) =
= 500. Similarly, if A5 denotes the set of those integers divisible by 5 then
2
1000
1000
= 200. Also card (A2 A5 ) =
= 100. This means that there are card (A2 A5 ) =
card (A5 ) =
5
10
500 + 200 100 = 600 integers in the interval [1; 1000] sharing at least a factor with 1000, thus there are
1000 600 = 400 integers in [1; 1000] that do not share a factor prime factor with 1000.
We now deduce a formula for counting the number of elements of a union of three events.
C
R4
R6
R7
R3
R2
R1
R5
57 Theorem (Three set Inclusion-Exclusion) Let A, B, C be events of the same sample space . Then
card (A B C) = card (A) + card (B) + card (C)
card (A B) card (B C) card (C A)
+card (A B C)
12
Chapter 2
Proof:
This gives the Inclusion-Exclusion Formula for three sets. See also figure 2.3.
In the Venn diagram in figure 2.3 there are 8 disjoint regions: the 7 that form A B C and
the outside region, devoid of any element belonging to A B C.
58 Example How many integers between 1 and 600 inclusive are not divisible by neither 3, nor 5, nor 7?
Solution: Let Ak denote the numbers in [1; 600] which are divisible by k. Then
card (A3 )
600
3
= 200,
card (A5 )
600
5
= 120,
card (A7 )
600
7
= 85,
card (A15 )
600
15
= 40
card (A21 )
600
21
= 28
card (A35 )
600
35
= 17
card (A105 )
600
105
= 5
By Inclusion-Exclusion there are 200 + 120 + 85 40 28 17 + 5 = 325 integers in [1; 600] divisible by at least
one of 3, 5, or 7. Those not divisible by these numbers are a total of 600 325 = 275.
59 Example In a group of 30 people, 8 speak English, 12 speak Spanish and 10 speak French. It is known that 5
speak English and Spanish, 5 Spanish and French, and 7 English and French. The number of people speaking all
three languages is 3. How many do not speak any of these languages?
13
Homework
Solution: Let A be the set of all English speakers, B the set of Spanish speakers and C the set of French speakers
in our group. We fill-up the Venn diagram in figure 2.4 successively. In the intersection of all three we put 8. In
the region common to A and B which is not filled up we put 5 2 = 3. In the region common to A and C which
is not already filled up we put 5 3 = 2. In the region common to B and C which is not already filled up, we put
7 3 = 4. In the remaining part of A we put 8 2 3 2 = 1, in the remaining part of B we put 12 4 3 2 = 3,
and in the remaining part of C we put 10 2 3 4 = 1. Each of the mutually disjoint regions comprise a total
of 1 + 2 + 3 + 4 + 1 + 2 + 3 = 16 persons. Those outside these three sets are then 30 16 = 14.
Sports
C
u
1
2
t
x
3
1
Movies
20
15
Reading
60 Example A survey shews that 90% of high-schoolers in Philadelphia like at least one of the following activities:
going to the movies, playing sports, or reading. It is known that 45% like the movies, 48% like sports, and 35%
like reading. Also, it is known that 12% like both the movies and reading, 20% like only the movies, and 15% only
reading. What percent of high-schoolers like all three activities?
Solution: We make the Venn diagram in as in figure 2.5. From it we gather the following system of equations
x
+ y +
+ y
+ y
+ y +
z
z + t +
+ t
z + t +
u
+ 15
u + 15
+ 20 =
45
48
35
12
+ 20 =
90
The solution of this system is seen to be x = 5, y = 7, z = 13, t = 8, u = 22. Thus the percent wanted is 5%.
Homework
61 Problem Consider the set
A = {2, 4, 6, . . . , 114}.
14
Chapter 2
How many are relatively prime to 42?
How many are divisible by 2 and 3 but not by 7?
How many are divisible by exactly one of 2, 3 and 7?
XY
XZ
Y Z
Average Age
37
23
41
29
39.5
33
69 Problem Each of the students in the maths class twice attended a concert. It is known that 25, 12, and 23 students
attended concerts A, B, and C respectively. How many students are there in the maths class? How many of them went
to concerts A and B, B and C, or B and C?
young or old,
male or female, and
married or single.
2.2
71 Problem Would you believe a market investigator that reports that of 1000 people, 816 like candy, 723 like ice cream,
645 cake, while 562 like both candy and ice cream, 463 like
both candy and cake, 470 both ice cream and cake, while 310
like all three? State your reasons!
72 Problem (AHSME 1991) For a set S, let card 2S denote
the number of subsets of S. If A, B, C, are sets for which
minimum
possible
value
of
74 Rule (Product Rule) Suppose that an experiment E can be performed in k stages: E1 first, E2 second, . . . , Ek
last. Suppose moreover that Ei can be done in ni different ways, and that the number of ways of performing Ei is
not influenced by any predecessors E1 , E2 , . . . , Ei1 . Then E1 and E2 and . . . and Ek can occur simultaneously in
15
75 Example In a group of 8 men and 9 women we can pick one man and one woman in 8 9 = 72 ways. Notice
that we are choosing two persons.
76 Example A red die and a blue die are tossed. In how many ways can they land?
Solution: If we view the outcomes as an ordered pair (r, b) then by the multiplication principle we have the 66 = 36
possible outcomes
(1, 1) (1, 2) (1, 3) (1, 4) (1, 5) (1, 6)
(2, 1) (2, 2) (2, 3) (2, 4) (2, 5) (2, 6)
(3, 1) (3, 2) (3, 3) (3, 4) (3, 5) (3, 6)
(4, 1) (4, 2) (4, 3) (4, 4) (4, 5) (4, 6)
(5, 1) (5, 2) (5, 3) (5, 4) (5, 5) (5, 6)
(6, 1) (6, 2) (6, 3) (6, 4) (6, 5) (6, 6)
The red die can land in any of 6 ways,
6
and also, the blue die may land in any of 6 ways
6
6 .
77 Example A multiple-choice test consists of 20 questions, each one with 4 choices. There are 4 ways of answering
the first question, 4 ways of answering the second question, etc., hence there are 420 = 1099511627776 ways of
answering the exam.
78 Example There are 9 10 10 = 900 positive 3-digit integers:
100, 101, 102, . . . , 998, 999.
For, the leftmost integer cannot be 0 and so there are only 9 choices {1, 2, 3, 4, 5, 6, 7, 8, 9} for it,
9
9 10
10 10 .
16
Chapter 2
For, the leftmost integer cannot be 0 and so there are only 9 choices {1, 2, 3, 4, 5, 6, 7, 8, 9} for it,
9
9 10
Since the integer must be even, the last digit must be one of the 5 choices {0, 2, 4, 6, 8}
9
10 5 .
80 Definition A palindromic integer or palindrome is a positive integer whose decimal expansion is symmetric and
that is not divisible by 10. In other words, one reads the same integer backwards or forwards.1
81 Example The following integers are all palindromes:
1, 8, 11, 99, 101, 131, 999, 1234321, 9987899.
82 Example How many palindromes are there of 5 digits?
Solution: There are 9 ways of choosing the leftmost digit.
.
Once the leftmost digit is chosen, the last digit must be identical to it, so we have
1 .
9
There are 10 choices for the second digit from the left
1 .
9 10
Once this digit is chosen, the second digit from the right must be identical to it, so we have only 1 choice for it,
9
10
1 .
Finally, there are 10 choices for the third digit from the right,
9
10 10
1 ,
17
Solution: We have 300 = 3 22 52 . Thus every factor of 300 is of the form 3a 2b 5c , where 0 a 1, 0 b 2,
and 0 c 2. Thus there are 2 choices for a, 3 for b and 3 for c. This gives 2 3 3 = 18 positive divisors.
85 Example How many paths consisting of a sequence of horizontal and/or vertical line segments, each segment
connecting a pair of adjacent letters in figure 2.6 spell BIPOLAR?
Solution: Split the diagram, as in figure 2.7. Since every required path must use the R, we count paths starting from
R and reaching up to a B. Since there are six more rows that we can travel to, and since at each stage we can go
either up or left, we have 26 = 64 paths. The other half of the figure will provide 64 more paths. Since the middle
column is shared by both halves, we have a total of 64 + 64 1 = 127 paths.
We now prove that if a set A has n elements, then it has 2n subsets. To motivate the proof, consider the set
{a, b, c}. To each element we attach a binary code of length 3. We write 0 if a particular element is not in the set
and 1 if it is. We then have the following associations:
000,
{a, b} 110,
{b} 010,
{b, c} 011,
{a} 100,
{c} 001,
{a, c} 101,
{a, b, c} 111.
Thus there is a one-to-one correspondence between the subsets of a finite set of 3 elements and binary sequences
of length 3.
86 Theorem (Cardinality of the Power Set) Let A be a finite set with card (A) = n. Then A has 2n subsets.
Proof: We attach a binary code to each element of the subset, 1 if the element is in the subset
and 0 if the element is not in the subset. The total number of subsets is the total number of such
binary codes, and there are 2n in number.
87 Theorem Let A, B be finite sets with card (A) = n and card (B) = m. Then
18
Chapter 2
we must have n m in view of Theorem 47. If to different inputs we must assign different outputs
then to the first element of A we may assign any of the m elements of B, to the second any of
the m 1 remaining ones, to the third any of the m 2 remaining ones, etc., and so we have
m(m 1) (m n + 1) injective functions.
88 Example Let A = {a, b, c} and B = {1, 2, 3, 4}. Then according to Theorem 87, there are 43 = 64 functions from
A to B and of these, 4 3 2 = 24 are injective. Similarly, there are 34 = 81 functions from B to A, and none are
injective.
Homework
89 Problem A true or false exam has ten questions.
many possible answer keys are there?
How
l {a, b, c, d, u, v, w, x, y, z}.
The hardware was changed and now the software accepts passwords of the form
eeelll.
How many more passwords of the latter kind are there than
of the former kind?
93 Problem A license plate is to be made according to the
following provision: it has four characters, the first two characters can be any letter of the English alphabet and the last
two characters can be any digit. One is allowed to repeat
letters and digits. How many different license plates can be
made?
94 Problem In problem 93, how many different license plates
can you make if (i) you may repeat letters but not digits?, (ii)
you may repeat digits but not letters?, (iii) you may repeat
neither letters nor digits?
19
108 Problem How many positive divisors does 360 have? How
many are even? How many are odd? How many are perfect
squares?
109 Problem (AHSME 1988) At the end of a professional
bowling tournament, the top 5 bowlers have a play-off. First
# 5 bowls #4. The loser receives the 5th prize and the winner
bowls # 3 in another game. The loser of this game receives
the 4th prize and the winner bowls # 2. The loser of this
game receives the 3rd prize and the winner bowls # 1. The
loser of this game receives the 2nd prize and the winner the
1st prize. In how many orders can bowlers #1 through #5
receive the prizes?
111 Problem Let n = 231 319 . How many positive integer divisors of n2 are less than n but do not divide n?
104 Problem How many n-digit numbers do not have the digit
0?
113 Problem In how many ways can one decompose the set
{1, 2, 3, . . . , 100}
into subsets A, B, C satisfying
2.3
A B C = {1, 2, 3, . . . , 100}
and
ABC=
114 Rule (Sum Rule: Disjunctive Form) Let E1 , E2 , . . . , Ek , be pairwise mutually exclusive events. If Ei can occur
in ni ways, then either E1 or E2 or, . . . , or Ek can occur in
n1 + n2 + nk
ways.
20
Chapter 2
One Golden retriever and one Irish setter can be chosen in 5 6 = 30 ways; one Golden retriever and one Poodle
can be chosen in 5 8 = 40 ways; one Irish setter and one Poodle can be chosen in 6 8 = 48 ways. By the sum rule,
there are 30 + 40 + 48 = 118 combinations.
117 Example To write a book 1890 digits were utilised. How many pages does the book have?
Solution: A total of
1 9 + 2 90 = 189
digits are used to write pages 1 to 99, inclusive. We have of 1890 189 = 1701 digits at our disposition which is
enough for 1701/3 = 567 extra pages (starting from page 100). The book has 99 + 567 = 666 pages.
118 Example The sequence of palindromes, starting with 1 is written in ascending order
1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 22, 33, . . .
Find the 1984-th positive palindrome.
Solution: It is easy to see that there are 9 palindromes of 1-digit, 9 palindromes with 2-digits, 90 with 3-digits, 90
with 4-digits, 900 with 5-digits and 900 with 6-digits. The last palindrome with 6 digits, 999999, constitutes the
9 +9 +90 +90 +900 +900 = 1998th palindrome. Hence, the 1997th palindrome is 998899, the 1996th palindrome
is 997799, the 1995th palindrome is 996699, the 1994th is 995599, etc., until we find the 1984th palindrome to
be 985589.
119 Example The integers from 1 to 1000 are written in succession. Find the sum of all the digits.
Solution: When writing the integers from 000 to 999 (with three digits), 3 1000 = 3000 digits are used. Each
of the 10 digits is used an equal number of times, so each digit is used 300 times. The the sum of the digits in the
interval 000 to 999 is thus
(0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9)(300) = 13500.
Therefore, the sum of the digits when writing the integers from 000 to 1000 is 13500 + 1 = 13501.
Aliter: Pair up the integers from 0 to 999 as
(0, 999), (1, 998), (2, 997), (3, 996), . . . , (499, 500).
Each pair has sum of digits 27 and there are 500 such pairs. Adding 1 for the sum of digits of 1000, the required
total is
27 500 + 1 = 13501.
120 Example How many 4-digit integers can be formed with the set of digits {0, 1, 2, 3, 4, 5} such that no digit is
repeated and the resulting integer is a multiple of 3?
Solution: The integers desired have the form D1 D2 D3 D4 with D1 = 0. Under the stipulated constraints, we must
have
D1 + D2 + D3 + D4 {6, 9, 12}.
We thus consider three cases.
Case I: D1 + D2 + D3 + D4 = 6. Here we have {D1 , D2 , D3 , D4 } = {0, 1, 2, 3, 4}, D1 = 0. There are then 3
choices for D1 . After D1 is chosen, D2 can be chosen in 3 ways, D3 in 2 ways, and D1 in 1 way. There are thus
3 3 2 1 = 3 3! = 18 integers satisfying case I.
21
Homework
Homework
121 Problem How many different sums can be thrown with
two dice, the faces of each die being numbered
0, 1, 3, 7, 15, 31?
122 Problem How many different sums can be thrown with
three dice, the faces of each die being numbered
1, 4, 13, 40, 121, 364?
123 Problem How many two or three letter initials for
people are available if at least one of the letters must be a D
and one allows repetitions?
2, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 200, 201, . . . ,
Find the 1978-th digit written.
22
Chapter 2
2.4
139 Definition We define the symbol ! (factorial), as follows: 0! = 1, and for integer n 1,
n! = 1 2 3 n.
n! is read n factorial.
140 Example We have
1! = 1,
2! = 1 2 = 2,
3! = 1 2 3 = 6,
4! = 1 2 3 4 = 24,
5! = 1 2 3 4 5 = 120.
141 Example We have
7!
4!
(n + 2)!
n!
(n 2)!
(n + 1)!
7 6 5 4!
4!
= 210,
(n + 2)(n + 1)n!
n!
= (n + 2)(n + 1),
(n 2)!
(n + 1)(n)(n 1)(n 2)!
1
(n + 1)(n)(n 1)
142 Definition Let x1 , x2 , . . . , xn be n distinct objects. A permutation of these objects is simply a rearrangement
of them.
143 Example There are 24 permutations of the letters in MATH, namely
MATH
MAHT
MTAH
MTHA
MHTA
MHAT
AMTH
AMHT
ATMH
TAMH
TAHM
TMAH
TMHA
THMA
THAM
HATM
HAMT
HTAM
HTMA
HMTA
HMAT
144 Theorem Let x1 , x2 , . . . , xn be n distinct objects. Then there are n! permutations of them.
Proof: The first position can be chosen in n ways, the second object in n 1 ways, the third in
n 2, etc. This gives
n(n 1)(n 2) 2 1 = n!.
145 Example The number of permutations of the letters of the word RETICULA is 8! = 40320.
23
Homework
146 Example A bookshelf contains 5 German books, 7 Spanish books and 8 French books. Each book is different
from one another.
How many different arrangements can be done of these
books?
How many different arrangements can be done of these
books if books of each language must be next to each
other?
How many different arrangements can be done of these
Solution:
We are permuting 5 + 7 + 8 = 20 objects. Thus the
number of arrangements sought is
20! = 2432902008176640000.
Glue the books by language, this will assure that
books of the same language are together. We permute
the 3 languages in 3! ways. We permute the German
books in 5! ways, the Spanish books in 7! ways and
the French books in 8! ways. Hence the total number
of ways is 3!5!7!8! = 146313216000.
Align the German books and the Spanish books first.
Putting these 5 + 7 = 12 books creates 12 + 1 = 13
spaces (we count the space before the first book, the
spaces between books and the space after the last
book). To assure that all the French books are next
each other, we glue them together and put them in
one of these spaces. Now, the French books can be
permuted in 8! ways and the non-French books can be
permuted in 12! ways. Thus the total number of
permutations is
(13)8!12! = 251073478656000.
Align the German books and the Spanish books first.
Putting these 5 + 7 = 12 books creates 12 + 1 = 13
spaces (we count the space before the first book, the
spaces between books and the space after the last
book). To assure that no two French books are next to
each other, we put them into these spaces. The first
French book can be put into any of 13 spaces, the
second into any of 12, etc., the eighth French book can
be put into any 6 spaces. Now, the non-French books
can be permuted in 12! ways. Thus the total number
of permutations is
(13)(12)(11)(10)(9)(8)(7)(6)12!,
which is 24856274386944000.
Homework
147 Problem How many changes can be rung with a peal of
five bells?
148 Problem A bookshelf contains 3 Russian novels, 4
German novels, and 5 Spanish novels. In how many ways
may we align them if
there are no constraints as to grouping?
all the Spanish novels must be together?
no two Spanish novels are next to one another?
149 Problem How many permutations of the word
IMPURE are there? How many permutations start with P
and end in U? How many permutations are there if the P
and the U must always be together in the order PU? How
many permutations are there in which no two vowels (I, U,
E) are adjacent?
24
2.5
Chapter 2
= 64864800.
157 Example In how many ways may we permute the letters of the word MASSACHUSETTS in such a way that
MASS is always together, in this order?
Solution: The particle MASS can be considered as one block and the 9 letters A, C, H, U, S, E, T, T, S. In A, C,
H, U, S, E, T, T, S there are four Ss and two T s and so the total number of permutations sought is
10!
= 907200.
2!2!
158 Example In how many ways may we write the number 9 as the sum of three positive integer summands? Here
order counts, so, for example, 1 + 7 + 1 is to be regarded different from 7 + 1 + 1.
25
3!
2!
=3
(1, 2, 6)
3! = 6
(1, 3, 5)
3! = 6
(1, 4, 4)
(2, 2, 5)
3!
2!
3!
2!
=3
=3
(2, 3, 4)
3! = 6
(3, 3, 3)
3!
=1
3!
U R
U R
R ,
R
R .
In the first case there are 2! = 2 of putting the remaining M and U, in the second there are 2! = 2 and in the third
there is only 1!. Thus starting the word with MU gives 2 + 2 + 1 = 5 possible arrangements. In the general case,
we can choose the first letter of the word in 3 ways, and the second in 2 ways. Thus the number of ways sought is
3 2 5 = 30.
160 Example In how many ways can the letters of the word AFFECTION be arranged, keeping the vowels in
their natural order and not letting the two Fs come together?
9!
ways of permuting the letters of AFFECTION. The 4 vowels can be permuted in 4! ways,
2!
9!
and in only one of these will they be in their natural order. Thus there are
ways of permuting the letters of
2!4!
AFFECTION in which their vowels keep their natural order.
Now, put the 7 letters of AFFECTION which are not the two Fs. This creates 8 spaces in between them where
we put the two Fs. This means that there are 8 7! permutations of AFFECTION that keep the two Fs
8 7!
together. Hence there are
permutations of AFFECTION where the vowels occur in their natural order.
4!
In conclusion, the number of permutations sought is
9!
2!4!
8 7!
4!
8!
4!
8 7 6 5 4!
4!
7
2
= 5880
26
Chapter 2
161 Example How many arrangements of five letters can be made of the letters of the word PALLMALL?
Solution: We consider the following cases:
there are four Ls and a different letter. The different letter can be chosen in 3 ways, so there are
3 5!
5!
3!2!
4!
= 15
there are three Ls and two different letters. The different letters can be chosen in 3 ways ( either P and A;
3 5!
or P and M; or A and M), so there are
= 60 permutations in this case.
3!
there are two Ls, two As and a different letter from these two. The different letter can be chosen in 2 ways.
2 5!
There are
= 60 permutations in this case.
2!2!
there are two Ls and three different letters. The different letters can be chosen in 1 way. There are
1 5!
= 60 permutations in this case.
2!
there is one L. This forces having two As and two other different letters. The different letters can be chosen
1 5!
= 60 permutations in this case.
in 1 way. There are
2!
The total number of permutations is thus seen to be
15 + 10 + 60 + 60 + 60 + 60 = 265.
Homework
162 Problem In how many ways may one permute the letters
of the word MEPHISTOPHELES?
163 Problem How many arrangements of four letters can be
made out of the letters of KAFFEEKANNE without
letting the three Es come together?
164 Problem How many numbers can be formed with the
digits
1, 2, 3, 4, 3, 2, 1
so that the odd digits occupy the odd places?
165 Problem The password of the anti-theft device of a car
is a four digit number, where one can use any digit in the set
{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}.
A.
27
2.6
n
k
(read n choose k) is
n!
n (n 1) (n 2) (n k + 1)
=
.
k!(n k)!
1 2 3k
Observe that in the last fraction, there are k factors in both the numerator and
denominator. Also, observe the boundary conditions
n
0
n
n
n
1
= 1,
n
n1
= n.
11
2
12
7
110
109
110
0
654
123
= 20,
1110
12
= 55,
1211109876
1234567
= 792,
= 110,
= 1.
n!
k!(n k)!
n!
(n k)!(n (n k))!
n
nk
This can be interpreted as follows: if there are n different tickets in a hat, choosing k of them out
of the hat is the same as choosing n k of them to remain in the hat.
172 Example
11
9
12
5
=
=
11
2
12
7
= 55,
= 792.
28
Chapter 2
176 Theorem Let there be n distinguishable objects, and let k, 0 k n. Then the numbers of k-combinations
n
of these n objects is
.
k
Proof: Pick any of the k objects. They can be ordered in n(n 1)(n 2) (n k + 1), since
there are n ways of choosing the first, n 1 ways of choosing the second, etc. This particular
choice of k objects can be permuted in k! ways. Hence the total number of k-combinations is
n(n 1)(n 2) (n k + 1)
=
k!
n
.
k
10
4
= 210 ways.
178 Example In a group of 2 camels, 3 goats, and 10 sheep in how many ways may one choose 6 animals if
there are no constraints in species?
Solution:
There are 2 + 3 + 10 = 15 animals and we must
choose 6, whence 15
= 5005
6
Since the 2 camels are included, we must choose
6 2 = 4 more
animals from a list of 15 2 = 13
animals, so 13
= 715
4
Since the 2 camels must be excluded, wemust
choose
6 animals from a list of 15 2 = 13, so 13
= 1716
6
If k sheep are chosen from the 10 sheep, 6 k animals
5
3
10
4
5
2
10
5
5
1
10
6
5
,
0
B
O
9550
14266
14266
14406
9550
9550
14266
without a 7
without an 8
179 Example To count the number of shortest routes from A to B in figure 2.8 observe that any shortest path
must consist of 6 horizontal moves and 3 vertical ones for a total of 6 + 3 = 9 moves.
Of these 9 moves once we
choose the 6 horizontal ones the 3 vertical ones are determined. Thus there are 96 = 84 paths.
29
Solution:
1. There are 9 possible choices for the first digit and 10
possible choices for the remaining digits. The number
of choices is thus 9 104 = 90000.
2. There are 8 possible choices for the first digit and 9
possible choices for the remaining digits. The number
of choices is thus 8 94 = 52488.
3. The difference 90000 52488 = 37512.
Observe that
37512 = 29889 + 6804 + 774 + 44 + 1.
9. We have 7 choices for the first digit and 8 choices for
the remaining 4 digits, giving 7 84 = 28672 such
integers.
10. We have 6 choices for the first digit and 7 choices for
the remaining 4 digits, giving 6 74 = 14406 such
integers.
11. We use inclusion-exclusion. From figure 2.10, the
numbers inside the circles add up to 85854. Thus the
desired number is 90000 85854 = 4146.
182 Example Find the number of surjections from A = {a, b, c, d} to B = {1, 2, 3}.
Solution: The trick here is that we know how to count the number of functions from one finite set to the other
(Theorem 87). What we do is over count the number of functions, and then sieve out those which are not
surjective by means of Inclusion-Exclusion. By Theorem 87, there are 34 = 81 functions from A to B. There are
30
Chapter 2
24 = 48 functions from A to B that miss one element from B. There are 32 14 = 3 functions from A to B that
miss two elements from B. There are 30 04 = 4 functions from A to B that miss three elements from B. By
Inclusion-Exclusion there are
81 48 + 3 = 36
1
m
1
(m 1)n +
m
2
(m 2)n
m
3
(m 3)n + + (1)m1
m
m1
(1)n .
Homework
184 Problem Verify the following.
20
= 1140
3
1212
4
= 457380
6
n
n1
n1
=1
n(n 1)
2
61 + 63 + 65 = 25
70 + 72 + 74 = 26 76
31
Homework
199 Problem (AHSME 1990) How many of the numbers
100, 101, . . . , 999,
have three different digits in increasing order or in
decreasing order?
200 Problem There are twenty students in a class. In how
many ways can the twenty students take five different tests if
four of the students are to take each test?
201 Problem In how many ways can a deck of playing cards
be arranged if no two hearts are adjacent?
202 Problem Given a positive integer n, find the number of
quadruples (a, b, c, d, ) such that
0 a b c d n.
203 Problem There are T books on Theology, L books on
Law and W books on Witchcraft on Dr. Faustus shelf. In
how many ways may one order the books
there are no constraints in their order?
all books of a subject must be together?
no two books on Witchcraft are juxtaposed?
all the books on Witchcraft must be together?
204 Problem From a group of 20 students, in how many
ways may a professor choose at least one in order to work on
a project?
205 Problem From a group of 20 students, in how many
ways may a professor choose an even number number of
them, but at least four in order to work on a project?
206 Problem How many permutations of the word
CHICHICUILOTE
are there
215 Problem How many ways can three boys share fifteen
different sized pears if the youngest gets seven pears and the
other two boys get four each?those in which the digit 1
occurs or those in which it does not occur?
32
Chapter 2
11
11 .
r
r
k
n
k
nk
rk
(2.1)
for 0 k r n.
230 Problem Give a combinatorial proof that for integer
n 1,
2
n
2n
n
.
=
n
k
k=0
Find r.
226 Problem If 11
28
2r
= 225
24
2r4
, find r.
for integers 1 k n.
n1
k1
n1
,
k
33
2.7
241 Theorem (De Moivre) Let n be a positive integer. The number of positive integer solutions to
x1 + x2 + + xr = n
is
n1
r1
Proof:
Write n as
n = 1 + 1 + + 1 + 1,
where there are n 1s and n 1 +s. To decompose n in r summands we only need to choose r 1
pluses from the n 1, which proves the theorem.
242 Example In how many ways may we write the number 9 as the sum of three positive integer summands? Here
order counts, so, for example, 1 + 7 + 1 is to be regarded different from 7 + 1 + 1.
Solution: Notice that this is example 158. We are seeking integral solutions to
a + b + c = 9,
8
2
= 28.
243 Example In how many ways can 100 be written as the sum of four positive integer summands?
Solution: We want the number of positive integer solutions to
a + b + c + d = 100,
which by Theorem 241 is
99
3
= 156849.
244 Corollary Let n be a positive integer. The number of non-negative integer solutions to
y1 + y2 + + yr = n
is
n+r1
.
r1
Proof:
is equivalent to
which from Theorem 241, has
x1 + x2 + + xr = n + r,
n+r1
r1
solutions.
34
Chapter 2
= 18424.
246 Example There are five people in a lift of a building having eight floors. In how many ways can they choose
their floor for exiting the lift?
Solution: Let xi be the number of people that floor i receives. We are looking for non-negative solutions of the
equation
x1 + x2 + + x8 = 5.
Putting yi = xi + 1, then
x1 + x2 + + x8 = 5
which is
12
7
y1 + y2 + + y8 = 13
= 792.
247 Example Find the number of quadruples (a, b, c, d) of non-negative integers which satisfy the inequality
a + b + c + d 2001.
Solution: The number of non-negative solutions to
a + b + c + d 2001
equals the number of solutions to
a + b + c + d + f = 2001
where f is a non-negative integer. This number is the same as the number of positive integer solutions to
a1 1 + b1 1 + c1 1 + d1 1 + f1 1 = 2001,
which is easily seen to be
2005
4
248 Example
How many integral solutions to the equation
a + b + c + d = 100,
are there given the following constraints:
1 a 10, b 0, c 2, 20 d 30?
35
Homework
Solution: We use Inclusion-Exclusion. There are
80
3
a + b + c + d = 100, a 1, b 0, c 2, d 20.
Let A be the set of solutions with
a 11, b 0, c 2, d 20
70
69
, card (B) =
a 1, b 0, c 2, d 31.
, card (A B) =
70
card (A B) =
59
69
3
and so
59
3
= 74625.
is thus
80
70
69
59
+
3
3
3
3
= 7535.
Homework
249 Problem How many positive integral solutions are there
to
a + b + c = 10?
sweet-meats?
252 Problem How many integral solutions are there to the
equation
x1 + x2 + + x100 = n
250 Problem Three fair dice, one red, one white, and one
blue are thrown. In how many ways can they land so that
their sum be 10 ?
2.8
Binomial Theorem
(x + y)n =
k=0
n
k
xk ynk .
consists of adding up all the terms obtained from multiplying either an x or a y from the first set
of parentheses times either an x or a y from the second set of parentheses etc. To get xk , x must
be chosen from exactly k of the sets of parentheses. Thus the number of xk terms is n
. It
k
follows that
(x + y)n
=
=
n
0
x0 yn +
n
k=0
n
k
x y
xyn1 +
nk
x2 yn2 + +
xn y0
(2.2)
36
Chapter 2
2n =
n
1
+ +
n1
n
n
(2 x)5 =
25k (x)k
k=0
5
k
n
1
+ +
= (1 + 1)n = 2n .
257 Example (AIME 1989) Ten points are marked on a circle. How many distinct convex polygons of three or
more sides can be drawn using some (or all) of the ten points as vertices? (Polygons are distinct unless they have
exactly the same vertices.)
Solution: Choosing k points 3 k 10 points will determine a k-sided polygon, since the polygons are convex
and thus have no folds. The answer is thus
10
k=3
10
k
= 210
10
0
10
1
10
= 1024 1 10 45 = 968.
2k
k=1
11
k
11
10
(x2 + 2x)10 =
k=0
To obtain x
12
10
(x2 )k (2x)10k =
k
10
2
10
k=0
10 10k k+10
2
x
.
k
2 = 11520
37
Binomial Theorem
260 Lemma
n
k
n n1
.
k k1
Proof:
n
n!
k!(n k)!
(n 1)!
(k 1)!(n k)!
n n1
k k1
261 Lemma
n
n1
k1
n2
k2
Proof:
n
k
n!
k!(n k)!
n(n 1)
(n 2)!
k(k 1)
(k 2)!(n k)!
n
k
n1
k1
n2
k2
262 Theorem
n
k
k=1
Proof:
n
k=1
n
k
n
k
=n
pk (1 p)nk = np.
n1
k1
pk (1 p)nk
. Then
n
k=1
n1
k=0
n1
k1
pk (1 p)nk
n1
n1
k=0
pk+1 (1 p)n1k
n1
pk (1 p)n1k
np
np(p + 1 p)n1
np.
263 Lemma
n
k(k 1)
k=2
Proof:
n
k
n
k
= n(n 1)
n2
k2
38
Chapter 2
Then
n
k=2
k(k 1)
pk (1 p)nk
n
k=2
n2
k=0
n2
n(n 1)
pk (1 p)nk
k2
n2
n(n 1)
n2
k=0
= n(n 1)p2
pk+2 (1 p)n1k
n1
pk (1 p)n2k
264 Theorem
(k np)2
k=0
Proof:
n
k
Then
n
k=0 (k
np)2
n
k
pk (1 p)nk
n
k=0 (k(k
1) + k(1 2np)
n
+n2 p2 )
=
n
k=0
pk (1 p)nk
k(k 1)
n
k=0
pk (1 p)nk
n
k=0
+(1 2np)
+n2 p2
n
k
pk (1 p)nk
n
k
pk (1 p)nk
Homework
265 Problem Expand (a 2b)5 .
266 Problem Expand (2a + 3b)4 .
267 Problem By alternately putting x = 1 and x = 1 in 2.2
and adding and subtracting the corresponding quantities,
2.9
n
0
n
2
n
4
+ ,
2n1 =
n
1
n
3
n
5
+ ,
268 Example n equally spaced points 1, 2, . . . , n are marked on a circumference. If 15 directly opposite to 49,
how many points are there total?
39
Solution: Points 16, 17, . . . , 48 are 33 in total and are on the same side of the diameter joining 15 to 49. For each
of these points there is a corresponding diametrically opposite point. There are thus a total of 2 33 + 2 = 68
points.
269 Example An urn has 900 chips, numbered 100 through 999. Chips are drawn at random and without
replacement from the urn, and the sum of their digits is noted. What is the smallest number of chips that must be
drawn in order to guarantee that at least three of these digital sums be equal?
Solution: There are 27 different sums. The sums 1 and 27 only appear once (in 100 and 999), each of the other 25
sums appears thrice. Thus if 27 + 25 + 1 = 53 are drawn, at least 3 chips will have the same sum.
270 Example Little Dwayne has 100 cards where the integers from 1 through 100 are written. He also has an
unlimited supply of cards with the signs + and =. How many true equalities can he make, if he uses each card no
more than once?
Solution: The shortest equality under the stated conditions must involve 3 numbers, and hence a maximum of 33
equalities can be achieved. The 33 equalities below shew that this maximum can be achieved.
1 + 75 = 76
23 + 64 = 87
45 + 53 = 98
3 + 74 = 77
25 + 63 = 88
47 + 52 = 99
5 + 73 = 78
27 + 62 = 89 49 + 51 = 100
7 + 72 = 79
29 + 61 = 90
24 + 26 = 50
9 + 71 = 80
31 + 60 = 91
20 + 28 = 48
11 + 70 = 81 33 + 59 = 92
16 + 30 = 46
13 + 69 = 82 35 + 58 = 93
12 + 32 = 44
15 + 68 = 83 37 + 57 = 94
8 + 34 = 42
17 + 67 = 84 39 + 56 = 95
2 + 38 = 40
19 + 66 = 85 41 + 55 = 96
4 + 6 = 10
21 + 65 = 86 43 + 54 = 97
14 + 22 = 36
271 Example (Derangements) Ten different letters are taken from their envelopes, read, and then randomly
replaced in the envelopes. In how many ways can this replacing be done so that none of the letters will be in the
correct envelope?
Solution: Let Ai be the property that the i-th letter is put back into the i-th envelope. We want
40
Chapter 2
10
10
10
10
10
9! +
8!
7! +
1! +
0! .
1
2
3
9
10
272 Example (AIME 1993) How many ordered four-tuples of integers (a, b, c, d) with 0 < a < b < c < d < 500
satisfy satisfy a + d = b + c and bc ad = 93?
Solution: Since a + d = b + c, we can write the four-tuple (a, b, c, d) as
(a, b, c, d) = (a, a + x, a + y, a + x + y), with integers x, y, 0 < x < y. Now,
93 = bc ad = (a + x)(a + y) a(a + x + y) = xy. Thus either (x, y) = (1, 93) or (x, y) = (3, 31). In the
first case
(a, b, c, d) = (a, a + 1, a + 93, a + 94)
is in the desired range for 1 a 405. In the second case,
(a, b, c, d) = (a, a + 3, a + 31, a + 34)
is in the desired range for 1 a 465. These two sets of four-tuples are disjoint, and so the sought number of
four-tuples is 870.
273 Example A is a set of one hundred distinct natural numbers such that any triplet a, b, c of A (repetitions
are allowed in a triplet) gives a non-obtuse triangle whose sides measure a, b, and c. Let S(A ) be the sum of the
perimeters obtained by adding all the triplets in A . Find the smallest value of S(A ). Note: we count repetitions
in the sum S(A ), thus all permutations of a triplet (a, b, c) appear in S(A ).
Solution: Let m be the largest member of the set and let n be its smallest member. Then m n + 99 since there
are 100 members in the set. If the triangle with sides n, n, m is non-obtuse then m2 2n2 from where
If n < 240 the stated condition is not met since m2 (n + 99)2 2n2 and the triangle with sides of length
n, n, m is not obtuse. Thus the set
A = {240, 241, 242, . . . , 339}
achieves the required minimum. There are 1003 = 1000000 triangles that can be formed with length in A and so
3000000 sides to be added. Of these 3000000/100 = 30000 are 240, 30000 are 241, etc. Thus the value required
is
100(240 + 339)
30000(240 + 241 + + 339) = (30000)
= 868500000.
2
Homework
274 Problem Prove that the sum of the digits appearing in
the integers
1, 2, 3, . . . , 99 . . . 9
n 9 s
9n10n
is
.
2
275 Problem Give a combinatorial proof of Vandermondes
Convolution Identity:
n
k=0
r
k
s
nk
r+s
n
41
Answers
staircase. Oli goes down two steps at a time, Gooh three,
Phree four, and Nyck five. If the only steps with all fours
footprints are at the top and at the bottom, how many steps
have just one footprint?
a < c?
280 Problem (Putnam 1987) The sequence of digits
12345678910111213141516171819202122 . . .
x2 + x n
factor into the product of two linear factors with integer
coefficients?
Answers
61
100
= 7
14
100
= 4
21
57
3
There are
= 2
42
100 50 33 14 + 16 + 7 + 4 2 = 28
= 19.
A3
16 2 = 14
57
5
There are
52
57
15
There are
A5
= 11
We want card
A3 A5
A15
A15
63
52%
64
22
65 Let A be the set of students liking Mathematics, B the set of students liking
theology, and C be the set of students liking alchemy. We are given that
= 3, and
A3 A5 .
= card
= 19 + 11 3 = 27.
and
card (A B C) = 4.
We want
card
A \ (A3 A5 )
57 27
30.
A3 A5
card
Ac Bc Cc
We want
card
(A3 A5 ) \ (A3 A5 )
card
(A3 A5 )
card
=
27 3
24.
A3 A5
40 14 16 11 + 7 + 5 + 8 4 = 15.
66
We have
31
10
62
We have
3
100
= 50
100
3
= 33
100
1
= 14
100
6
1
= 16
960
42
Chapter 2
67 Let Y, F, S, M stand for young, female, single, male, respectively, and let H
stand for married.2 We have
This gives
card (A B) .45n,
card (C D) .65n.
card (Y F S)
card (Y F) card (Y F H)
card (Y ) card (Y M)
68
34
69
30; 7; 5; 18
70
This means that at least 10% of the combatants lost all four members.
89
71 Let C denote the set of people who like candy, I the set of people who like ice
cream, and K denote the set of people who like cake. We are given that
card (C) = 816, card (I) = 723, card (K) = 645, card (C I) = 562,
card (C K) = 463, card (I K) = 470, and card (C I K) = 310. By
Inclusion-Exclusion we have
card (C I K)
210 = 1024
90 I can choose a right shoe in any of nine ways, once this has been done, I can
choose a non-matching left shoe in eight ways, and thus I have 72 choices.
Aliter: I can choose any pair in 9 9 = 81 ways. Of these, 9 are matching pairs,
so the number of non-matching pairs is 81 9 = 72.
91
= (20)(19)(20)(19)(20)(20) = 57760000
92
+card (C I K)
=
999.
The investigator miscounted, or probably did not report one person who may not
have liked any of the three things.
A set with k elements has 2k different subsets. We are given
72
26
26
26
100
100
card(C)
card(ABC)
2
+2
+2
= 2
.
This forces card (C) = 101, as 1 + 2card(C)101 is larger than 1 and a power
of 2. Hence card (A B C) = 102. Using the Principle Inclusion-Exclusion,
since card (A) + card (B) + card (C) card (A B C) = 199,
26
10
26
card (A B C)
26
26
10
10 .
card (A B) + card (A C) + card (B C) 199 By the multiplication principle, the number of different four-tuples is
26 26 10 10 = 67600.
94
26
10
card (B C) 199
403 card (A B) card (A C) card (B C) .since after a digit has been used for the third position, it cannot be used again.
Thus this can be done in 26 26 10 9 = 60840 ways.
(ii) In this case we have a grid like
25
10
10 ,
since after a letter has been used for the first position, it cannot be used again.
Thus this can be done in 26 25 10 10 = 65000 ways.
(iii) After a similar reasoning, we obtain a grid like
97.
26
25
10
By letting
A = {1, 2, . . . , 100}, B = {3, 4, . . . , 102},
and
C = {1, 2, 3, 4, 5, 6, . . . , 101, 102}
we see that the bound card (A B C) = card ({4, 5, 6, . . . , 100}) = 97 is
achievable.
73 Let A denote the set of those who lost an eye, B denote those who lost an
ear, C denote those who lost an arm and D denote those losing a leg. Suppose
there are n combatants. Then
2 Or
card (A B)
card (C D)
432
97
Solution:
The first letter can be one of any 4. After choosing the first letter, we
have 3 choices for the second letter, etc.. The total number of words is
thus 4 3 2 1 = 24.
The first letter can be one of any 4. Since we are allowed repetitions, the
second letter can also be one of any 4, etc.. The total number of words so
formed is thus 44 = 256.
98 The last digit must perforce be 5. The other five digits can be filled with any
of the six digits on the list: the total number is thus 65 .
99
We have
This is 5 86 = 1310720.
43
Answers
This is 5 7 6 5 4 3 2 = 25200.
109
16
This is 5 85 4 = 655360.
110
This is 5 85 4 = 655360.
n1 + s
5 6 5 4 3 2 2 = 7200
111
There are 589 such values. The easiest way to see this is to observe that
there is a bijection between the divisors of n2 which are > n and those < n. For
if n2 = ab, with a > n, then b < n, because otherwise n2 = ab > n n = n2 , a
contradiction. Also, there is exactly one decomposition n2 = n n. Thus the
desired number is
phone numbers. If the last digit were either 3 or 7, then we would have 4
choices for the last digit and so we would have
d(n2 )
4 6 5 4 3 2 2 = 5760
phone numbers. Thus the total number of phone numbers is
7200 + 5760 = 12960.
26 254 = 10156250
101
For the leftmost digit cannot be 0 and so we have only the nine choices
{1, 2, 3, 4, 5, 6, 7, 8, 9}
for this digit. The other n 1 digits can be filled out in 10 ways, and so there
are
n1
.
9 10 10 = 9 10
n1 10 s
The leftmost digit cannot be 0 and so we have only the nine choices
{1, 2, 3, 4, 5, 6, 7, 8, 9}
+ 1 (32)(20) = 589.
112 The total number of sequences is 3n . There are 2n sequences that contain
no 0, 1 or 2. There is only one sequence that contains only 1s, one that contains
only 2s, and one that contains only 0s. Obviously, there is no ternary sequence
that contains no 0s or 1s or 2s. By the Principle of Inclusion-Exclusion, the
number required is
113 The conditions of the problem stipulate that both the region outside the
circles in diagram 2.3 and R3 will be empty. We are thus left with 6 regions to
distribute 100 numbers. To each of the 100 numbers we may thus assign one of
6 labels. The number of sets thus required is 6100 .
121
21
122
56
123 There are 262 252 = 51 using two letters with at least one of the letters
a D, and 263 253 with three letters, with at least one of the letters a D. Thus
there is a total of (262 252 ) + (263 253 ) = 2002.
124
9+99
for this digit. If the integer is going to be even, the last digit can be only one of
the five {0, 2, 4, 6, 8}. The other n 2 digits can be filled out in 10 ways, and
so there are
n2
9 10 10 5 = 45 10
.
+9 9 8 + 9 9 8 7
+9 9 8 7 6 + 9 9 8 7 6 5
n2 10 s
103
(63)(39)
3n (2n + 2n + 2n ) + (1 + 1 + 1) = 3n 3 2n + 3.
100
102
+ 1 d(n) =
+9 9 8 7 6 5 4 + 9 9 8 7 6 5 4 3
+9 9 8 7 6 5 4 3 2
+9 9 8 7 6 5 4 3 2 1
104 One can choose the last digit in 9 ways, one can choose the penultimate
digit in 9 ways, etc. and one can choose the second digit in 9 ways, and finally
one can choose the first digit in 9 ways. The total number of ways is thus 9n .
105
= 8877690
125
m2 , m(m 1)
2 + 4 + 8 + 16 = 30.
126
106 We will assume that the positive integers may be factorised in a unique
manner as the product of primes. Expanding the product
2
8
2
9
2
(1 + 2 + 2 + + 2 )(1 + 3 + 3 + + 3 )(1 + 5 + 5 )
each factor of 28 39 52 appears and only the factors of this number appear.
There are then, as many factors as terms in this product. This means that there
are (1 + 8)(1 + 9)(1 + 3) = 320 factors.
The sum of the divisors of this number may be obtained by adding up each
geometric series in parentheses. The desired sum is then
127 We condition on the first digit, which can be 4, 5, or 6. If the number starts
with 4, in order to satisfy the conditions of the problem, we must choose the last
digit from the set {0, 2, 6, 8}. Thus we have four choices for the last digit. Once
this last digit is chosen, we have 8 choices for the penultimate digit and 7 choices
for the antepenultimate digit. There are thus 4 8 7 = 224 even numbers
which have their digits distinct and start with a 4. Similarly, there are 224 even
numbers will all digits distinct and starting with a 6. When they start with a 5,
we have 5 choices for the last digit, 8 for the penultimate and 7 for the
antepenultimate. This gives 5 8 7 = 280 ways. The total number is thus
224 + 224 + 280 = 728.
128
29 1
21
310 1
31
53 1
= 467689684.
1 9 + 2 90 = 189
51
digits, which is more than 1002 digits. The 1002nd digit must be among the
three-digit positive integers. We have 1002 189 = 813 digits at our disposal,
from which we can make 813 = 271 three-digit integers, from 100 to 370.
3
When the 0 in 370 is written, we have used 189 + 3 271 = 1002 digits. The
1002nd digit is the 0 in 370.
a
a
a
n = p 1p 2 p k
1
2
k
has
d(n) = (a1 + 1)(a2 + 1) (ak + 1)
positive divisors. Also, if (n) denotes the sum of all positive divisors of n, then
(n) =
a +1
p 1
1
1
p1 1
a +1
p 2
1
2
p2 1
a +1
p k
1
k
1 9 + 2 90 + 3 900 = 2889
pk 1
107 The 96 factors of 295 are 1, 2, 22 , . . . , 295 . Observe that 210 = 1024
and so 220 = 1048576. Hence
19
20
2
= 524288 < 1000000 < 1048576 = 2
.
129
130 There is 1 such number with 1 digit, 10 such numbers with 2 digits, 100
with three digits, 1000 with four digits, etc. Starting with 2 and finishing with
299 we have used 1 1 + 2 10 + 3 100 = 321 digits. We need
1978 321 = 1657 more digits from among the 4-digit integers starting with
2. Now 1657 = 414, so we look at the 414th 4-digit integer starting with 2,
4
namely, at 2413. Since the 3 in 2413 constitutes the 321 + 4 414 = 1977-th
digit used, the 1978-th digit must be the 2 starting 2414.
131
19990
132
The factors greater than 1, 000, 000 are thus 220 , 221 , . . . 295 . This makes
for 96 20 = 76 factors.
133
108
134
4095
44
135
Chapter 2
144
136 First observe that 1 + 7 = 3 + 5 = 8. The numbers formed have either one,
two, three or four digits. The sum of the numbers of 1 digit is clearly
1 + 7 + 3 + 5 = 16.
153
249
154
We have
This is 8!.
Permute XY in 2! and put them in any of the 7 spaces created by the
remaining 6 people. Permute the remaining 6 people. This is 2! 7 6!.
There are 4 3 = 12 numbers formed using 2 digits, and hence 6 pairs adding
to 8 in the units and the tens. The sum of the 2 digits formed is
6((8)(10) + 8) = 6 88 = 528.
Glue the couples into 4 separate blocks. Permute the blocks in 4! ways.
Then permute each of the 4 blocks in 2!. This is 4!(2!)4 .
Observe that
Sit the women first, creating 5 spaces in between. Glue the men together
and put them in any of the 5 spaces. Permute the men in 4! ways and
the women in 4!. This is 5 4!4!.
162
1816214400
163
548
164
18
165
166
We have
This is
10!
4!3!2!
If |a b| = 1, then we have
This is
9!
4!3!2!
or 49 pairs. If |a b| = 2, then we have
This is
8!
2!3!2!
167
36
168
25
169
126126; 756756
185
186
75
187
188
189
25
190
p(000) + + p(999) = m(0)m(0)m(0) + + m(9)m(9)m(9),
which in turn
=
(1 + 1 + 2 + + 9)3
463
97336.
Hence
S
= 21
= (7)(10) = 70
4! = 1680
= 300
Let the subsets be A and B. We have either card (A) = 1 or card (A) = 2.
4
= 4 ways of choosing its elements and
1
3
= 1 ways of choosing the elements of B. If card (A) = 2 then there are
34
2
= 6 ways of choosing its elements and
= 1 ways of choosing the
2
2
elements of B. Altogether there are 4 + 6 = 10 ways.
191
= 20
3
192 We count those numbers that have exactly once, twice and three times.
There is only one number that has it thrice (namely 333). Suppose the number
xyz is to have the digit 3 exactly twice. We can choose these two positions in
3
ways. The third position can be filled with any of the remaining nine digits
2
97336 p(000)
97336 m(0)m(0)m(0)
97335.
147
120
148
193
= 10
194
128
195
10 3! = 60
81729648000
196
We have
149
150
1440
151
152
5
3
5
5
2
3
numbers that have 3 exactly once.
2
3
3
= 5 + 10 + 1 = 16.
+ 92
= 300.
45
Answers
13!
(E + F + S + I)!
= 86486400
2!3!3!
197
4! E!F!S!I!
E+F+I+1
E+F+I+1
2!
F+I+1
2
11!
11!
12
20
7
can be chosen in seven ways. The answer is thus
207
19
11!
3!3!
We have
M + W
We can choose the four students who are going to take the first test in
12
4
16
4
20
4
M+W2
C2
208
M + W
8
4
ways
M + W 2
= 2
C2
209
2030
210
211
n+k1
202 The equality signs cause us trouble, since allowing them would entail
allowing repetitions in our choices. To overcome that we establish a one-to-one
correspondence between the vectors (a, b, c, d), 0 a b c d n and
the vectors (a , b , c , d ), 0 a < b < c < d n + 3. Let
(a , b , c , d ) = (a, b + 1, c + 2, d + 3). Now we just have to pick four
different numbers from the set {0, 1, 2, 3, . . . , n, n + 1, n + 2, n + 3}. This
n+4
can be done in
ways.
4
212 [1] For the first column one can put any of 4 checkers, for the second one,
any of 3, etc. hence there are 4 3 2 1 = 24. [2] If there is a column without a
checker then there must be a column with 2 checkers. There are 3 choices for this
4
column. In this column we can put the two checkers in
= 6 ways. Thus there
2
16
213
7560.
214
1
4!
215
864
2
158
7
215
216
171273 1714
5
217
210 .
= 99
k
k=3
T + L + 1
T + L + 1
204
20
206
220
121164
221
620
+ +
20
20
20
= 2
20
222
95
223
bg
224
= 1048576 1 = 1048575.
20 20
4
219
20
205
210 1 1
(T + L)!W!
6
We have
+ +
20
20
20
20
19
= 2
0
2
= 5242881190 = 524097.
10
218
(T + L)!W!
7
We have
(T + L + W)!
M + W 2
C1
50
are 4 3
.
203
M + W 2
201 We align the thirty-nine cards which are not hearts first. There are
thirty-eight spaces between them and one at the beginning and one at the end
40
making a total of forty spaces where the hearts can go. Thus there are
13
ways of choosing the places where the hearts can go. Now, since we are interested
in arrangements, there are 39! different configurations of the non-hearts and 13!
different configurations of the hearts. The total number of arrangements is thus
40
39!13!.
13
20161284
M+W2
M
CT
= 50400
3!3!2!
20
= 73180800
9!
= 542640.
200
12
= 542640.
Aliter: Choose the chairman first. This can be done in twenty ways. Out of the
19
nineteen remaining people, we just have to choose six, this can be done in
6
199
= 13305600
3!3!
10
198
11!
S!E!(F + I)!
= 4989600
2!2!2!
S!(E + F + I)!
20
= 3326400
2!3!
S!(E + F + I)!
; n 1;
n n1
3
= 104857600000000000000000000
= 840
c!
46
Chapter 2
227
10
28
236
24
228
We have
237
n 1
n 1
k1
(n 1)!
=
=
=
238
175308642
239
Hint: There are k occupied boxes and n k empty boxes. Align the balls
k+1
.
nk
240 There are n k empty seats. Sit the people in between those seats.
nk+1
.
k
first!
249
A combinatorial interpretation can be given as follows. Suppose we have a bag
with n red balls. The number of ways of choosing k balls is n. If we now paint
one of these balls blue, the number of ways of choosing k balls is the number of
ways of choosing balls if we always include the blue ball (and this can be done in
n1 ) ways, plus the number of ways of choosing k balls if we always exclude
k1
n1
k
36
ways).
229 The sinistral side counts the number of ways of selecting r elements from a
set of n, then selecting k elements from those r. The dextral side counts how
many ways to select the k elements first, then select the remaining r k
elements to be chosen from the remaining n k elements.
250
251
230
5!
k!(n k 1)!
1
1
+
(n k 1)!(k 1)!
nk
k
n
(n 1)!
(k 1)!(n k)!
(n 1)!
(n 1)!
252
14
4
nn
0
nn
nn
2
+ +
nn
implies that
y1 + y2 + + y100 = n 4950.
.
n
n
Hence there are
nn
0
n
1
n1
n
2
+ +
n2
nn
253
n4951
99
solutions.
Now consider a bag with 2n balls, n of them red and n of them blue. The above
sum is counting the number of ways of choosing 0 red balls and n blue balls, 1
red ball and n 1 blue balls, 2 red balls and n 2 blue balls, etc.. This is
clearly the number of ways of choosing n balls of either colour from the bag,
2n
which is
.
n
231 The numbers belong to the following categories: (I) all six digits are
identical; (II) there are exactly two different digits used, three of one kind, three
of the other; (III) there are exactly two different digits used, two of one kind, four
of the other; (IV) there are exactly three different digits used, two of each kind.
(2a
1) + + (2d
50
3
1) = 98
+ + d
= 51.
= 19600 solutions.
274
275
Consider choosing n balls from a bag of r yellow balls and s white balls.
276
There are clearly 9 numbers belonging to category (I). To count the numbers in
the remaining categories, we must consider the cases when the digit 0 is used or
6!
9
= 720 integers in category (II);
not. If 0 is not used, then there are
2
3!3!
6!
6!
9
8
9
= 1080 integers in category (III); and
= 7560
1
1
3
2!4!
2!2!2!
integers in category (IV). If 0 is used, then the integers may not start with 0.
5!
5!
5!
9
9
= 90 in category (II) ;
(
+
) = 135 in
There are
1
1
2!3!
1!4!
3!2!
5!
9
category (III) ; and
= 3240 in category (IV). Thus there are
2
2
1!2!2!
altogether
Observe that person d changes the status of door n if and only if d divides
n
n
, and unless d =
, n would
d
d
have an even number of divisors. Thus the doors closed are those for which n has
2
an odd number of divisors, i.e. d = n, or n is a square. Hence doors 1, 4, 9,
16, 25, 36, 49, 64, 81, and 100 are closed.
n. Each divisor d of n can be paired off with
There are clearly 9 numbers belonging to category (I). To count the numbers in
the remaining category (II), we must consider the cases when the digit 0 is used
7!
9
8
or not. If 0 is not used, then there are
= 2520 integers in
1
1
3!4!
category (II). If 0 is used, then the integers may not start with 0. There are
6!
6!
9
9
j
g(r) =
432
234
15
235
29.
100(100+1)(2(100)+1)
6
338350.
10r 1
j 9 10j1 = r10r
.
9
j=1
233
280 There are 9 10j1 j-digit positive integers. The total number of digits in
numbers with at most r digits is the arithmetic-geometric sum
As 0 <
10r 1
r
< 10 , we get
9
r
r
(r 1)10 < g(r) < r10 .
; 15!/6!
Thus g(1983) < 1983 101983 < 104 101983 = 101987 and
g(1984) > 1983 101984 > 103 101984 = 101987 . Therefore
f(1987) = 1984.
Chapter
Discrete Probability
3.1
Probability Spaces
282 Definition A probability P () is a real valued rule defined on subsets of a sample space and satisfying the
following axioms:
0 P (A) 1 for A ,
P () = 1,
for a finite or infinite sequence A1 , A2 , . . . of disjoint events,
P (Ai ) =
P (Ai ) .
i
Whence
40
27
,
40
9
P (b) = 9P (d) =
,
40
3
P (c) = 3P (d) =
.
40
284 Definition A random variable X is a rule that to each outcome point of the sample space (the inputs) assigns
a real number output. This output is not fixed, but assigned with a certain probability. The range or image of X
is the set of outputs assumed by X.
47
48
Chapter 3
285 Example A fair die is tossed. If the resulting number is even, you add 1 to your score and get that many
dollars. If the resulting number is odd, you add 2 to your score and get that many dollars. Let X be the random
variable counting your gain, in dollars. Then the range of X is {3, 5, 7}.
286 Example A hand of three cards is chosen from a standard deck of cards. You get $3 for each heart in your
hand. Let Z be the random variable measuring your gain. Then the range of Z is {0, 3, 6, 9}.
287 Example The six faces of a die are numbered 1, 2, 3, 4, 5, 6, but the die is loaded so that the the probability of
obtaining a given number is proportional to the number of the dots. If X is the random variable counting the
number of dots, find P (X = k) for k = 1, 2, . . . , 6.
Solution: Let P (X = k) = k. Then
1 = P (X = 1) + + P (X = 6) = (1 + + 6) = 21
giving =
1
21
and P (X = k) =
k
21
Probabilities are numbers between 0 and 1. Attaching to an event a probability outside this
range is nonsensical.
We will now deduce some results that will facilitate the calculation of probabilities in the future.
288 Theorem Let Y X. Then P (X \ Y) = P (X) P (Y).
Proof:
Observe that
A B = (A \ (A B)) (B \ (A B)) (A B),
49
Homework
292 Example Let P (A) = 0.8, P (B) = 0.5 and P (A B) = 0.4. Find P (Ac Bc ) and P (Ac Bc ).
Solution: By Theorem 291,
P (A B) = 0.8 + 0.5 0.4 = 0.9.
By Corollary 289 and the De Morgan Laws,
P (Ac Bc ) = P ((A B)c ) = 1 P (A B) = 1 0.9 = 0.1,
P (Ac Bc ) = P ((A B)c ) = 1 P (A B) = 1 0.4 = 0.5.
293 Example Let P (A) = 0.9, P (B) = 0.6. Find the maximum and minimum possible values for P (A B).
Solution: The maximum is 0.6, it occurs when B A. Now by Theorem 291 and using the fact that
P (A B) 1, we have
P (A B) = P (A) + P (B) P (A B) 1.5 1 = 0.5,
whence the minimum value is 0.5.
In the manner of proving Theorem 57 we may prove
294 Theorem (Probabilistic three-set Inclusion-Exclusion)
P (A1 A2 A3 ) =
Homework
295 Problem Let S = {a, b, c, d} be a sample space.
Outcome a is 2 times as likely as outcome b; outcome b is 4
times as likely as outcome c; outcome c is 2 times as likely
as outcome d. Find
P (a) , P (b) , P (c) , P (d) .
296 Problem Let S = {a, b, c, d} be a sample space.
Outcome a is 5 times as likely as outcome b; outcome b it 5
times as likely as event c; outcome c it 5 times as likely as
event d. Find P (a), P (b), P (c), P (d).
297 Problem Let S = {a, b, c, d} be a probabilistic outcome
space. It is known that outcome d is twice as likely as
outcome c, outcome c is four times as likely as outcome b,
and outcome b is half as likely as outcome a. Find P (a),
P (b), P (c), P (d).
298 Problem The six faces of a die are numbered
1, 2, 3, 4, 5, 6, but the die is loaded so that the the
probability of obtaining a given number is proportional to
the square of the number of the dots. If X is the random
variable counting the number of dots, find P (X = k) for
k = 1, 2, . . . , 6.
3
299 Problem (AHSME 1983) It is known that P (A) =
4
2
5
2
and P (B) = . Shew that
P (A B) .
3
12
3
300 Problem Three fair dice, a red, a white and a blue one
are thrown. The sum of the dots is given by the random
variable Y. What is the range of the random variable Y?
301 Problem Two fair dice, a red and a blue one are thrown.
The product of the dots is given by the random variable Y.
What is the range of the random variable Y?
302 Problem A fair die is tossed. If the resulting number is
either 2 or 3, you multiply your score by 2 and get that
many dollars. If the resulting number is either 1 or 4, you
add 1 to your score and get that many dollars. If the
resulting number is either 5 or 6, you get that many dollars.
Let X be the random variable counting your gain, in dollars.
Give the range of X.
303 Problem There are two telephone lines A and B. Let E1
be the event that line A is engaged and let E2 be the event
that line B is engaged. After a statistical study one finds
50
Chapter 3
3.2
Consider a non-empty finite set with card () number of elements and let A, B be disjoint subsets of . It is
clear that
0
card (A)
card ()
card ()
card ()
1,
= 1,
card (A B)
card ()
card (A)
card ()
card (A)
card ()
card (B)
card ()
when A B = .
P (A) =
card (A)
.
card ()
(3.1)
1
, that is, every outcome is equally
card ()
be a finite sample space. A uniform discrete random variable X defined on is a function that achieves the
distinct values xk with equal probability:
P (X = xk ) =
Since
P (X = xk ) =
k=1
k=1
1
card ()
1
card ()
card ()
card ()
= 1,
1
2
= P (T ) .
308 Example If the experiment is rolling a red fair die and a blue fair die and then adding their scores, the sample
space consists of 6 6 = 36 possible outcomes. If S denotes the random variable of the sum obtained then
2 S 12. These sums are obtained in the following fashion:
51
(red, blue)
(1, 1)
(1, 6), (6, 1), (2, 5), (5, 2), (3, 4), (4, 3)
1
,
36
2
=
36
3
=
36
4
=
36
5
,
36
6
=
36
1
,
18
1
,
12
1
,
9
1
,
6
P (S = 8) =
5
,
36
P (S = 9) =
4
1
= ,
36
9
P (S = 10) =
3
1
=
,
36
12
P (S = 11) =
2
1
=
,
36
18
P (S = 12) =
1
.
36
In a fair die there are 7 x dots on the face opposite x dots. Hence
P (S = x) = P (S = 14 x).
309 Example A number X is chosen at random from the set {1, 2, . . . , 25}. Find the probability that when divided
by 6 it leaves remainder 1.
Solution: There are only 5 numbers in the set that leave remainder 1 upon division by 6, namely {1, 7, 13, 19, 25}.
5
1
The probability sought is thus
= .
25 5
310 Example A number is chosen at random from the set
{1, 2, . . . , 1000}.
What is the probability that it is a palindrome?
52
Chapter 3
Solution: There are 9 palindromes with 1-digit, 9 with 2 digits and 90 with three digits. Thus the number of
27
108
palindromes in the set is 9 + 9 + 90 = 108. The probability sought is
=
.
1000 250
311 Example A fair die is rolled three times and the scores added. What is the probability that the sum of the
scores is 6?
Solution: Let A be the event of obtaining a sum of 6 in three rolls, and let be the sample space created when
rolling a die thrice. The sample space has 63 = 216 elements, since the first roll can land in 6 different ways, as can
the second and third roll. To obtain a sum of 6 in three rolls, the die must have the following outcomes:
A
{(2, 2, 2), (4, 1, 1), (1, 4, 1), (1, 1, 4), (1, 2, 3),
(1, 3, 2), (2, 1, 3), (2, 3, 1), (3, 1, 2), (3, 2, 1)}
10
5
=
.
216 108
312 Example Consider a standard deck of cards. One card is drawn at random.
Solution:
The size of the
sample space for this experiment is
card (S) = 52
= 52.
1
Since there are 4 kings, card (K) = 4. Hence
4
1
P (K) = 52
= 13
.
Since there are 4 knaves, card (J) = 4. Hence
4
1
P (J) = 52
= 13
.
Since there are 26 red cards, card (R) = 26. Hence
26
P (R) = 52
= 12 .
Since a card is both a king and red in only two
instances (when it is K or K), we have
2
1
= 26
.
P (K R) = 52
By Inclusion-Exclusion we find
P (K R) = P (K) + P (R) P (K R) =
7
.
13
313 Example Phone numbers in a certain town are 7-digit numbers that do not start in 0, 1, or 9. What is the
probability of getting a phone number in this town that is divisible by 5?
Solution: The sample space consists of all possible phone numbers in this town: 7 106 . A phone number will be
divisible by 5 if it ends in 0 or 5 and so there are 7 105 2 phone numbers that are divisible by 5. The probability
sought is
7 105 2
2
1
=
= .
6
7 10
10 5
314 Example Consider a standard deck of cards. Four cards are chosen at random without regards to order and
without replacement. Then
1A
knave is what refined people call a jack. Cf. Charles Dickens Great Expectations.
53
= 270725.
2 26
52 4
(2)(14950)
92
=
.
270725
833
315 Example A hat contains 20 tickets, each with a different number from 1 to 20. If 4 tickets are drawn at
random, what is the probability that the largest number is 15 and the smallest number is 9?
Solution: For this to happen, we choose the ticket numbered 9, the one numbered 15 and the other two tickets
must be chosen from amongst the five tickets numbered 10, 11, 12, 13, 14. The probability sought is thus
5
2
20
=
4
10
2
=
.
4845 969
316 Example A box contains four $10 bills, six $5 bills, and two $1 bills. Two bills are taken at random from the
box without replacement. What is the probability that both bills will be of the same denomination?
11 = 11 + 12 0, 23 = 11 + 12 1, 35 = 11 + 12 2, . . . , 299 = 11 + 12 24
belong to both progressions and the probability sought is
25
10000
1
400
54
Chapter 3
318 Example A number N is chosen at random from {1, 2, . . . , 25}. Find the probability that N2 + 1 be divisible
by 10.
Solution: N2 + 1 is divisible by 10 if it ends in 0. For that N2 must end in 9. This happens when
5
1
N {3, 7, 13, 17, 23}. Thus the probability sought is
= .
25 5
319 Example (Poker Hands) A poker hand consists of 5 cards from a standard deck of 52 cards, and so there are
= 2598960 ways of selecting a poker hand. Various hands, and their numbers, are shewn below.
5
52
4
2
12
3
4
1
= 1098240
The number of ways of getting this is 41 10 = 40, and
40
the probability of this event is
0.000015.
2598960
royal flush occurs when you have the ace, king,
queen, knave, and 10 in the samesuit.
The number of
ways of obtaining a royal flush is 41 (1) = 4 and so the
4
probability of this event is
0.0000015390.
2598960
flush occurs when you have five non-consecutive cards
of the same suit, but neither a royal nor a straight
flush, as in 2, 4, 7, 8, 10.
The number of
ways of obtaining a flush is 41 13
40 = 5068 and
5
5068
0.00195.
so the probability of this event is
2598960
full house occurs when 3 cards have the same face
and the other two cards have the same face (different
from the first three cards), as in 8, 8, 8, 7, 7.
The number of ways of getting this is
13
1
4
3
12
1
4
2
= 3774
4
4
12
1
4
1
= 624,
320 Example (The Birthday Problem) If there are n people in a classroom, what is the probability that no pair
of them celebrates their birthday on the same day of the year?
Solution: To simplify assumptions, let us discard 29 February as a possible birthday and let us assume that a year
has 365 days. There are 365n n-tuples, each slot being the possibility of a day of the year for each person. The
number of ways in which no two people have the same birthday is
365 364 363 (365 n + 1),
as the first person can have his birthday in 365 days, the second in 364 days, etc. Thus if A is the event that no
two people have the same birthday, then
P (A) =
55
Homework
The probability sought is
P (Ac ) = 1 P (A) = 1
A numerical computation shews that for n = 23, P (A) < 21 , and so P (Ac ) > 12 . This means that if there are 23
people in a room, the probability is better than 12 that two will have the same birthday.
321 Example Three fair dice, a red, a white, and a blue one are tossed, and their scores registered in the random
variables R, W, B respectively. What is the probability that R W B?
Solution: Each of the dice may land in 6 ways and hence the size of the sample space for this experiment is
63 = 216. Notice that there is a one to one correspondence between vectors
(R, W, B),
1RWB6
and vectors
(R , W , B ),
1 R < W < B 8.
This can be seen by putting R = R, W = W + 1, and B = B + 2. Thus the number of vectors (R , W , B ) with
1 R < W < B 8 is 83 = 56. The probability sought is thus
56
7
=
.
216 27
322 Example A hat contains three tickets, numbered 1, 2 and 3. The tickets are drawn from the box one at a
time. Find the probability that the ordinal number of at least one ticket coincides with its own number.
Solution: Let Ak , k = 1, 2, 3 be the event that when drawn from the hat, ticket k is the k-th chosen. We want
P (A1 A2 A3 ) .
By inclusion-exclusion for three sets Theorem 294
P (A1 A2 A3 ) =
By symmetry,
P (A1 ) = P (A2 ) = P (A3 ) =
2!
3!
1
3
1
3!
1
6
1!
3!
Homework
1
1
1 2
3 + = .
3
6
6 3
1
6
56
Chapter 3
Find P (E R) .
Find P (E B) .
Find P (E R) .
Find P (E B) .
Find P (E \ B) .
Find P (B \ E) .
57
Homework
341 Problem What is the probability that a random integer
taken from {1, 2, 3, . . . , 100} has no factors in common with
100?
342 Problem A number N is chosen at random from
{1, 2, . . . , 25}. Find the probability that N2 1 be divisible
by 10.
343 Problem Three integers are drawn at random and
without replacement from the set of twenty integers
{1, 2, . . . , 20}. What is the probability that their sum be
divisible by 3?
344 Problem There are twenty guns in a row, and it is
known that exactly three will fire. A person fires the guns,
one after the other. What is the probability that he will have
to try exactly seventeen guns in order to know which three
will fire?
345 Problem Two different numbers X and Y are chosen
from {1, 2, . . . , 10}. Find the probability that X2 + Y 2 27.
346 Problem Ten different numbers are chosen at random
from the set of 30 integers {1, 2, . . . , 30}. Find the
probability that
all the numbers are odd.
exactly 5 numbers be divisible by 3.
exactly 5 numbers are even, and exactly one of them is
divisible by 10.
347 Problem There are two winning tickets amongst ten
tickets available. Determine the probability that (a) one, (b)
both tickets will be among five tickets selected at random.
and
10
1+3+6
1+4+5
2+2+6
2+3+5
2+4+4
3 + 3 + 4.
1+2+6
1+3+5
1+4+4
2+2+5
2+3+4
3 + 3 + 3,
58
Chapter 3
x2 + Ax + B = 0.
Find the probability that
the equation has 2 distinct roots.
the equation has a double root.
x = 3 be a root of the equation,
x = 3 be a root of the equation.
3.3
x 2y = 3.
Independence
1
.
2
Find P (A).
2
P (A) = x = 1 2 .
More often than not independence is built into a problem physically, that is, an event A does
not physically influence an event B. In particular, in problems where sampling is done with
replacement, we should infer independence.
369 Example Two dice, a red one and a blue one, are thrown. If A is the event: the red die lands on an even
number and B is the event: the blue die lands on a prime number then A and B are independent, as they do not
physically influence one another.
59
Independence
k
,
370 Example A die is loaded so that if D is the random variable giving the score on the die, then P (D = k) = 21
where k = 1, 2, 3, 4, 5, 6. Another die is loaded differently, so that if X is the random variable giving the score on
2
the die, then P (X = k) = k91 . Find P (D + X = 4).
Solution: Clearly the value on which the first die lands does not influence the value on which the second die lands.
Thus by independence
P (D + X = 4)
P (D = 1 X = 3) + P (D = 2 X = 2)
+P (D = 3 X = 1)
P (D = 1) P (X = 3) + P (D = 2) P (X = 2)
+P (D = 3) P (X = 1)
=
=
1
91
3
21
20
1911
4
91
2
21
9
91
1
21
371 Example Two men, A and B are shooting a target. The probability that A hits the target is P (A) =
the probability that B shoots the target is P (B) =
1
5
1
, and
3
1 2
= .
3 3
P (A B) = P (A) P (B) =
1 1
1
=
.
3 5 15
P (A B) = P (A) + P (B) P (A B) =
1
1
1
7
+
=
.
3
5
15 15
7
15
8
15
372 Example A certain type of missile hits its target 30% of the time. Determine the minimum number of
missiles that must be shot at a certain target in order to obtain a change higher than 80% of hitting the target.
Solution: The probability that n missiles miss the target is (0.7)n . The probability that at least one of the n
missiles hits the target is thus 1 (0.7)n . We need 1 (0.7)n > 0.8 and by a few calculations, the minimum n is
found to be n = 5. When we deal with more than two events, the following definition is pertinent.
373 Definition The events A1 , A2 , . . . , An are independent if for any choice of k (2 k n) indexes
{i1 , i2 , . . . , lk } we have
P (Ai1 Ai2 Aik ) = P (Ai1 ) P (Ai2 ) P (Aik ) .
60
Chapter 3
Considerations of independence are important in the particular case when trials are done in succession.
374 Example A biased coin with P (H) =
obtain HHT , in that order.
2
is tossed three times in a row. Find the probability that one will
5
Solution: Each toss is physically independent from the other. The required probability is
P (HHT ) = P (H) P (H) P (T ) =
2
5
2
5
3
5
12
125
375 Example An urn has 3 white marbles, 4 red marbles, and 5 blue marbles. Three marbles are drawn in
succession from the urn with replacement, and their colour noted. What is the probability that a red, a white and
another white marble will be drawn, in this order?
Solution: Since the marbles are replaced, the probability of successive drawings is not affected by previous
drawings. The probability sought is thus
3
3
1
4
=
.
12 12 12 48
376 Example Two numbers X and Y are chosen at random, and with replacement, from the set
{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}.
Find the probability that X2 Y 2 be divisible by 3.
Solution: Notice that the sample space of this experiment has size 10 10 since X and Y are chosen with
replacement. Observe that if N = 3k then N2 = 9k2 , leaves remainder 0 upon division by 3. If N = 3k + 1 then
N2 = 9k2 + 6k + 1 = 3(3k2 + 2k) + 1 leaves remainder 1 upon division by 3. Also, if N = 3k + 2 then
N2 = 9k2 + 12k + 4 = 3(3k2 + 4k + 1) + 1 leaves remainder 1 upon division by 3. Observe that there are 3
numbers3, 6, 9divisible by 3 in the set, 4 numbers1, 4, 7, 10of the form 3k + 1, and 3
numbers2, 5, 8of the form 3k + 2 in the set. Now, X2 Y 2 is divisible by 3 in the following cases: (i) both X
and Y are divisible by 3, (ii) both X and Y are of the form 3k + 1, (iii) both X and Y are of the form 3k + 2, (iv)
X is of the form 3k + 1 and Y of the form 3k + 2, (v) X is of the form 3k + 2 and Y of the form 3k + 1. Case (i)
occurs 3 3 = 9 instances, case (ii) occurs in 4 4 = 16 instances, case (iii) occurs in 3 3 = 9 instances, case (iv)
occurs in 4 3 = 12 instances and case (v) occurs in 3 4 = 12 instances. The favourable cases are thus
58
29
9 + 16 + 9 + 12 + 12 = 58 in number and the desired probability is
=
.
100 50
377 Example A box contains 20 white balls, 30 blue balls, and 50 red balls. Ten balls are selected, one at a time,
with replacement. Find the probability that at least one colour will be missing from the ten selected balls.
Solution: Let W be the event that the white balls are not represented among the ten selected balls, and similarly
define R and W. Since selection is done with replacement, these events are independent.Then by
inclusion-exclusion
P (W B R)
0.1356.
Homework
61
3.4
n k
p (1 p)nk ,
k
k = 0, 1, . . . , n.
where n is the number of trials, p is the probability of success in one trial, and k is the number of successes.
Since
P (X = k) =
k=0
k=0
n
k
pk (1 p)nk = (p + (1 p))n = 1,
62
Chapter 3
Find the probability of obtaining 3 heads.
Find the probability of obtaining 3 tails.
Find the probability of obtaining at most one head.
Solution:
Let X be the random variables counting the number of heads. Here p = 1 p =
P (X = 3) =
5
16
1
.
2
Hence
5
16
+
32
32
3
.
16
396 Example A multiple-choice exam consists of 10 questions, and each question has 3 choices. It is assumed that
for every question one, and only one of the choices is the correct answer.
Find n, the number of trials, p, the probability of success, and 1 p, the probability of failure.
Find the probability of answering exactly 7 questions right.
Find the probability of answering 8 or more questions right.
Find the probability of answering at most one question.
Solution:
Clearly n = 10, p =
1
,
4
and also, 1 p =
3
.
4
Let X be the random variables counting the number of right questions. Then
P (X = 7) =
10
405
131072
10
10
10
+
=
10
10
1048576
109
4
1
4
1
405
262144
3
4
3
4
15
524288
1
1048576
63
Homework
Homework
397 Problem When two fair coins are tossed, what is the
probability of getting no heads exactly four times in five
tosses?
398 Problem A coin is loaded so that P (H) = 43 and
P (T ) = 41 . The coin is flipped 5 times and its outcome
recorded. Find the probability that heads turns up at least
once.
399 Problem A fair coin is to be flipped 1000 times. What is
the probability that the number of heads exceeds the
number of tails?
400 Problem In the world series of foosball, a five-game
match is played, and the player who wins the most games is
the champion. The probability of Player A winning any
1
given game against player B is constant and equals . What
3
is the probability that Player A will be the champion? You
may assume that all five games are played, even when a
3.5
404 Definition (Geometric Random Variable) Let 0 < p < 1. A random variable is said to have a geometric or
Pascal distribution if
P (X = k) = (1 p)k1 p,
k = 1, 2, 3, . . . .
Thus the random variable X counts the number of trials necessary until success occurs.
Since
P (X = k) =
k=1
(1 p)k1 p =
k=1
p
1 (1 p)
= 1,
k = 1, 2, 3, . . . ,
(3.2)
since the probability that at least k trials are necessary for success is equal to the probability that the first k 1
trials are failures.
405 Example An urn contains 5 white, 4 black, and 1 red marble. Marbles are drawn, with replacement, until a
red one is found. If X is the random variable counting the number of trials until a red marble appears, then
P (X = 1) =
P (X = 2) =
P (X = k) =
1
10
9
10
1
10
9k1
10k
9
100
is the probability that the red marble appears on the second trial.
406 Example A drunk has five keys in his key-chain, and an only one will start the car 3 He tries each key until he
finds the right one (he is so drunk that he may repeat the wrong key several times), then he starts his car and (by
3 Caution:
64
Chapter 3
cheer luck), arrives home safely, where his wife is waiting for him, frying pan in hand. If X is the random variable
counting the number of trials until he find the right key, then
P (X = 1) =
P (X = 2) =
P (X = 3) =
P (X = 4) =
P (X = 5) =
P (X = 6) =
1
5
4
5
4
5
1
5
4
5
4
25
1
5
4 4 4 1
64
=
is the probability that he finds the key on the fourth trial.
5 5 5 5 625
4
5
4
5
4
5
4
5
4
5
4
5
4
5
4
5
1
5
4
5
256
3125
1
5
1024
15625
407 Example An urn contains 5 white, 4 black, and 1 red marble. Marbles are drawn, with replacement, until a
red one is found. If X is the random variable counting the number of trials until the red marble appears.
Find the probability that it takes at most 3 trials to obtain a red marble.
Find the probability that it takes more than 3 trials to obtain a red marble.
Solution:
This is asking for P (X = 1) + P (X = 2) + P (X = 3) =
1
9
81
271
+
+
=
.
10
100
1000 1000
P (X = k) =
k=4
k=4
9k1
10k
We can sum this directly, or we may resort to the fact that the event more than 3 trials is complementary
to the event at most 3 trials. Thus
P (X > 3) = 1 (P (X = 1) + P (X = 2) + P (X = 3)) = 1
271
1000
729
1000
P (X > 3) = P (X 4) =
9
10
41
729
1000
408 Example Three people, X, Y, Z, in order, roll a fair die. The first one to roll an even number wins and the
game is ended. What is the probability that X will win?
65
Homework
Solution: We have
P (X wins) =
1
2
1
4
.
7
1
23
409 Example A sequence of independent trials is performed by rolling a pair of fair dice. What is the probability
that an 8 will be rolled before rolling a 7?
5
n1
11
36
5
36
25
n1
36
5
36
P
n=1 An =
P (An ) =
n=1
n=1
25
36
n1
5
36
5
11
Homework
410 Problem An urn has three red marbles and two white
ones. Homer and Marge play alternately (Homer first, then
Marge, then Homer, etc.) drawing marbles with replacement
until one of them draws a white one, and then the game
ends. What is the probability that Homer will eventually
win?
411 Problem Two people, X, Y, in order, roll a die. The first
one to roll either a 3 or a 6 wins and the game is ended.
3.6
Consider a binomial random variable X with probability of success p and number of trials n. Observe that
P (X = k) =
n(n 1) (n k + 1)
k!
pk (1 p)nk .
66
Chapter 3
nk
k!
pk (1 p)n =
(np)k
k!
(1 p)1/p
np
Now, since
lim (1 x)1/x = e1
x 0
k!
Since = np is the product of a large number n and a very small number p, we expect to be a medium-sized
number. The value = np is the average number of successes in n trials.
415 Definition A Poisson random variable X is a discrete random variable taking on the values 0, 1, 2, . . . with
probabilities
k
P (X = k) =
e
k0
k!
It is easy to check that
k=0
k
k
e
= e
= e e = e0 = 1,
k!
k!
k=0
e =
k=0
xk
k!
416 Example In a certain book, there is 1 misprint per 2 pages, on the average. What is the probability that there
are 2 or more misprints on a given, randomly chosen page? (This is a Poisson process.)
Solution: There is an average of =
1
2
e1/2
3e1/2
=1
.
2
2
417 Example During business hours, the help desk for a companys computer system receives an average of 10
calls per hour. What is the probability that fewer than 3 calls come in during a randomly chosen half-hour period
during business hours?
Solution: There is an average of = 5 calls per half-hour. Hence the required probability is
P (0 calls) + P (1 call) + P (2 calls) = e5 + 5e5 +
25e5 37e5
=
.
2
2
Answers
295 We are given that P (a) = 2P (b), P (b) = 4P (c), P (c) = 2P (d).
Hence
and
27P (d) = 1,
67
Answers
1
whence P (d) =
Again, we must assume that Peter and Mary belong to the original set of
people, otherwise the probability will be 1. Observe that one of the
following three situations may arise: (1) Peter is in a committee, Mary is
not, (ii) Mary is in a committee, Peter is not, (iii) Neither Peter nor
Mary are in a committee. Perhaps the easiest way to count these options
(there are many ways of doing this) is to take the total number of
committees and subtract those including (simultaneously) Peter and
Mary. The desired probability is thus
. This yields
27
16
27
8
P (b) = 8P (d) =
A+B
,
27
and
2
P (c) = 2P (d) =
The
number of committees that include Peter but exclude Mary is
Aliter:
A+B2
, the number of committees that include Mary but exclude
C1
A+B2
, and the number of committees that exclude both
Peter is
C1
A+B2
2
2
1 = P (X = 1) + + P (X = 6) = (1 + + 6 ) = 91
1
and P (X = k) =
91
A+B2
91
303
305
0.8
Let P (X = k) = k. Then
giving =
C2
A+B
27
298
A+B2
C1
A+B2
C1
A+B
A+B2
C
323
10
10
100
; 0;
100
13
100
25
29
50
100
332
324
36
345
1
325
12
The experiment is choosing five people from amongst 12, and so the sample
12
= 792. The women will outnumber the men if there are (a)
5
3 women and 2 men; (b) 4 women and 1 man; or (c) 5 women. The numbers of
successes is thus
space has size
11
1
=
57
11
3
The probability sought is thus
326
57
246
5
41
792
= 246.
132
13
1
327
card (C F S)
221
+card (C F S)
20825
6327
20825
330
4
9
331
We have
328
329
57
30 + 50 + 75 15 30 12 + 7
105,
students speak at least one language, hence 120 105 = 15 students speak none
15
1
=
.
of the languages. The probability sought is
120
8
A+B
C
334
.
A
CT
A+B
10!
B
C2
B
C1
A+B
BA
C
0
.
335
We must assume that Peter and Mary belong to the original set of
people, otherwise the probability will be 0. Since Peter and Mary must
belong to the committee, we must choose C 2 other people from the
pool of the A + B 2 people remaining. The desired probability is thus
A+B2
125
216
35
91
216
1
2
337
52
52 ;
6
52
6
52
6
52
6
7
18
339
C2
A+B
7!
Aliter: Observe that the position of the red balls is irrelevant for success. Thus we
only worry about permutations of of RRRWWWW and only one of this is
1
1
4!3!
successful. The desired probability is
=
=
.
7!
7!
35
4!3!
3!4!
3!4!3!
7!3!
10!
68
Chapter 3
N
358
340
341
3
1
4
) ways, to be the three
343
1
lowest cards. The probability required is thus
342
343 In the numbers {1, 2, . . . , 20} there are 6 which are multiples of 3, 7
which leave remainder 1 upon division by 3, and 7 that leave remainder 2 upon
division by 3. The sum of three numbers will be divisible by 3 when (a) the three
numbers are divisible by 3; (b) one of the numbers is divisible by 3, one leaves
remainder 1 and the third leaves remainder 2 upon division by 3; (c) all three
leave remainder 1 upon division by 3; (d) all three leave remainder 2 upon
division by 3. The required probability is thus
6
3
677
1
20
7
3
7
3
32
344 The person will have to try exactly 17 guns if either the third firing gun
occurs on the seventeenth place or the firing guns occur on the last three places.
16
+1
2
121
.
Hence the probability sought is
=
20
1140
3
This is plainly
3n
345 The possible pairs with X < Y are (1, 2), (1, 3), (1, 4), (1, 5), (2, 3),
(2, 4), (2, 5), and (3, 4) for a total of 8 pairs. There are also eight
64
64
corresponding pairs with Y < X. The probability sought is
=
.
27
351
2
3n
3n
1
=
3n(n 1) + 6n
3n(3n 1)
n+1
.
3n 1
2
361
5; 2
9 9
362
106
25
648
448
108
363
349
3
55
95
348
347
12
This is plainly
10
52
858
20825
13
2
364
350 The sample space has size 63 = 216. A simple count yields 25 ways of
obtaining a 9 and 27 of getting a 10. Hence P (S = 9) = 25 0.1157, and
216
27
P (S = 10) =
= 1 = 0.125.
8
216
365
351
Since the probability of obtaining the sum 1994 is positive, there are
1994
n
= 333 dice. Let x1 + x2 + + xn = 1994 be the sum of the
6
faces of the n dice adding to 1994. We are given that
(7 x1 ) + (7 x2 ) + + (7 xn ) = S
or 7n 1994 = S. The minimal sum will be achieved with the minimum dice, so
putting n = 333 we obtain the minimal S = 7(333) 1994 = 337.
352
353
360
2401
118
4
3
4
35
355
1
3
356
We have
n
3
2n
3
1
12
n(n 1)(n 2)
2n(2n 1)(2n 2)
4(2n 1)
134
If one of the Xi = 7W then another one must be 1W and the third must be 0W,
so there are 3! = 6 configurations of this type. Similarly, if one of the Xi = 8W,
3!
= 3 configurations of this
the other two must be 0W and again there are
2!
9
1
=
.
type. The desired probability is hence
45
5
366 By subtracting A times the second equation from the first, the system
becomes
(2A B)x = (C 3A)y;
x 2y = 3.
231
354
n2
1
12
3(n 2) = 2n 1
1
12
n = 5.
378
1
27
357
52
4
379
5
144
48
69
Answers
380
392 The r 1 integers before i must be taken from the set {1, 2, . . . , i 1}
and the k r after i must be taken from the set {i + 1, i + 2, . . . , n}. Hence
i1
ni
r1
kr
P (i, r, k, n) =
.
n
k
381
52
382
393
Theorem 294.
23
( 7 )10
9
15
397
1024
32
384
41
81
383
398 Let A denote the event whose probability we seek. Then Ac is the event
that no heads turns up. Thus
We have
P (|X Y | = 1)
P (X Y = 1) + P (Y X = 1)
2P (X Y = 1)
2(P (X = 1 Y = 0) + P (X = 2 Y = 1))
2(P (X = 1) P (Y = 0) + P (X = 2) P (Y = 1))
5
5
Hence
P (A) = 1 P
= 1
1024
=
1024
1023
1024
2((.4)(.2) + (.4)(.4))
Notice that if we wanted to find this probability directly, we would have to add
the five terms
.48,
P (A)
5 1 4 5 2 3 5 3 2
3
1
3
1
3
1
+
+
1
4
5 4 4 4 1 25 4 5 4 0 3 4
3
4
385
4
15
1024
1023
1
4
90
1024
270
3
4
405
5
+
1024
1
.
4
243
1024
1024
1024
1000
399
500
21001
3
400
We need
n
4
0.9
3
and with a calculator we may verify that this happens for n 10.
401
The probability of not obtaining a six in a single trial is 5 . The probability
6
of not obtaining a single six in the three trials is ( 5 )3 = 125 . Hence the
6
216
probability of obtaining at least one six in three rolls is 1 125 = 91 .
216
216
By inclusion-exclusion and by independence,
P (A B C)
3
19
402
20
155
2
525
1140
390
35
391
411
412
76
17
81
2
1; 2; 8 ;
3 9 81 5
4
413
57
4
12
5
57
5
0
=
Let Xi be the random variable counting the number of times until heads
1
Xi = n =
(in fact, Xi is
2n
geometric with p = 1 ). Hence the desired probability is
2
appears for times i = 1, 2, 3. Observe that P
This is plainly
63
57
8
= 1140 ways. Success means
The experiment consists of choosing 3 people out of 10, and so the sample
10
= 120. Success occurs when one man and two women chosen,
3
36
3
6
4
which can be done in
= 36 ways. The probability sought is
=
.
1
2
120
10
space size is
100 L s and 75 R s
sought is thus
403 For the patient to notice for the first time that the left dispenser is empty,
he must have pulled out 100 sheets from the left, 75 from the right, and on the
101st attempt on the left he finds that there is no sheet. So we have a
configuration like
...L...R...
L,
410
20
16
27
389
where all the Ls, except for the one on the last position, can be in any order, and
all the Rs can be in any order. This happens with probability
175
175
( 1 )75 ( 1 )100 1 =
( 1 )176 . The same probability can be
75
75
2
2
2
2
obtained for the right dispenser and hence the probability sought is
175
175
2
( 1 )176 =
( 1 )175 .
75
75
2
2
155
388
27
2133
P (B C) + P (A B C)
=
3125
386
387
This is plainly
n=1
41
.
132
414
52
68
X1 = n
X2 = n
X3 = n
n=1
1
8n
1
1
8
=
.
7
1 1
8
Chapter
Conditional Probability
4.1
Conditional Probability
418 Definition Given an event B, the probability that event A happens given that event B has occurred is defined
and denoted by
P (A B)
P (A|B) =
, P (B) = 0.
P (B)
419 Example Ten cards numbered 1 through 10 are placed in a hat, mixed and then one card is pulled at random.
If the card is an even numbered card, what is the probability that its number is divisible by 3?
Solution: Let A be the event the cards number is divisible by 3 and B be the event the card is an even
5
= 12 . Now the event A B is the event that the
numbered card. We want P (A|B) . Observe that P (B) = 10
cards number is both even and divisible by 3, which happens only when the number of the card is 6. Hence
1
P (A B) = 10
. The desired probability is
P (A|B) =
P (A B)
P (B)
1
10
1
2
1
5
420 Example A coin is tossed twice. What is the probability that in both tosses appear heads given that in at
least one of the tosses appeared heads?
Solution: Let E = {(H, H)} and F = {(H, H), (H, T ), (T, H)}. Then
P (E|F) =
P (E F)
P (F)
P ({(H, H)})
P ({(H, H), (H, T ), (T, H)})
1
4
3
4
1
3
The conditional probability formula can be used to obtain probabilities of intersections of events. Thus
P (A B) = P (B) P (A|B)
(4.1)
Observe that the sinistral side of the above equation is symmetric. Thus we similarly have
P (A B) = P (B A) = P (A) P (B|A)
(4.2)
421 Example Darlene is undecided on whether taking Statistics or Philosophy. She knows that if she takes
Statistics she will get an A with probability 31 , while if she takes Philosophy she will receive an A with probability
1
. Darlene bases her decision on the flip of a coin. What is the probability that Darlene will receive an A in
2
Statistics?
70
71
Homework
Solution: Let E be the event that Darlene takes Statistics and let F be the event that she receives an A in whatever
course she decides to take. Then we want P (E F) . But
P (E F) = P (E) P (F|E) =
1 1 1
= .
2 3 6
422 Example An urn contains eight black balls and three white balls. We draw two balls without replacement.
What is the probability that both balls are black?
Solution: Let B1 be the event that the first ball is black and let B2 be the event that the second ball is black.
8
Clearly P (B1 ) = 11
. If a black ball is taken out, there remain 10 balls in the urn, 7 of which are black. Thus
7
P (B2 |B1 ) = 10 . We conclude that
P (B1 B2 ) = P (B1 ) P (B2 |B1 ) =
8
11
7
10
28
55
The formula for conditional probability can be generalised to any number of events. Thus if A1 , A2 , . . . An are
events, then
P (A1 A2 . . . An ) = P (A1 )
(4.3)
423 Example An urn contains 5 red marbles, 4 blue marbles, and 3 white marbles. Three marbles are drawn in
succession, without replacement. Find the probability that the first two are white and the third one is blue.
Solution: Let the required events be W1 , W2 , B3 . Then
P (W1 W2 B3 ) = P (W1 ) P (W2 |W1 ) P (B3 |W1 W2 ) =
3
12
2
11
4
10
1
55
Homework
424 Problem Two cards are drawn in succession from a
well-shuffled standard deck of cards. What is the probability
of successively obtaining
a red card and then a black card?
4.2
Conditioning
Sometimes we may use the technique of conditioning, which consists in decomposing an event into mutually
exclusive parts. Let E and F be events. Then
P (E) =
=
P (E F) + P (E Fc )
c
(4.4)
c
72
Chapter 4
.02
S
1
4
0.53
0.47
.98
.001
.999
1
52
51
52
3
4
Cc
1
51
50
51
A
Ac
A
Ac
427 Example A population consists of 53% men. The probability of colour blindness is .02 for a man and .001 for
a woman. Find the probability that a person picked at random is colour blind.
Solution: We condition on the sex of the person. Let M be the event that the person is a man and let C be the
event that the person is colour-blind. Then
P (C) = P (C M) + P (C Mc ) .
But P (C M) = P (M) P (C|M) = (.53)(.02) = 0.106 and
P (C Mc ) = P (Mc ) P (C|Mc ) = (.47)(.001) = .00047 and so P (C) = 0.10647. A tree diagram explaining
this calculation can be seen in figure 4.1.
428 Example Draw a card. If it is a spade, put it back and draw a second card. If the first card is not a spade, draw
a second card without replacing the second one. Find the probability that the second card is the ace of spades.
Solution: We condition on the first card. Let S be the event that the first card is a spade and let A be the event
that the second card is the ace of spades. Then
P (A) = P (A S) + P (A Sc ) .
But P (A S) = P (S) P (A|S) =
1
4
1
52
1
108
P (A) =
1
108
1
68
11
459
3
4
1
51
1
.
68
We thus have
73
Conditioning
Now P (K R) = P (K) P (R|K) = (.75)(.8) = .6 and
P (Kc R) = P (Kc ) P (R|Kc ) = (.25)(.2) = .05.
Therefore P (R) = .6 + .05 = .65.
If instead of conditioning on two disjoint sets we conditioned in n pairwise disjoint sets, we would obtain
430 Theorem (Law of Total Probability) Let F = F1 F2 Fn , where Fj Fk = if j = k, then
P (E F) = P (F1 ) P (E|F1 ) + P (F2 ) P (E|F2 ) + + P (Fn ) P (E|Fn ) .
431 Example An urn contains 4 red marbles and 5 green marbles. A marble is selected at random and its colour
noted, then this marble is put back into the urn. If it is red, then 2 more red marbles are put into the urn and if it
is green 1 more green marble is put into the urn. A second marble is taken from the urn. Let R1 , R2 be the events
that we select a red marble on the first and second trials respectively, and let G1 , G2 be the events that we select a
green marble on the first and second trials respectively.
Find P (R2 ).
Find P (R2 R1 ).
Find P (R1 |R2 ).
Solution: Plainly,
P (R2 ) =
4
9
P (R2 R1 ) =
P (R1 |R2 ) =
11
4
9
3
5
6
11
P (R2 )
33
P (R2 R1 )
19
33
=
8
19
432 Example An urn contains 10 marbles: 4 red and 6 blue. A second urn contains 16 red marbles and an
unknown number of blue marbles. A single marble is drawn from each urn. The probability that both marbles are
the same colour is 0.44. Calculate the number of blue marbles in the second urn.
Solution: Let b be the number of blue marbles in the second urn, let Rk , k = 1, 2 denote the event of drawing a
red marble from urn k, and similarly define Bk , k = 1, 2. We want
P ((R1 R2 ) (B1 B2 )) .
Observe that the events R1 R2 and B1 B2 are mutually exclusive, and that R1 is independent of R2 and B1 is
independent of B2 (drawing a marble from the first urn does not influence drawing a second marble from the
second urn). We then have
0.44
= P ((R1 R2 ) (B1 B2 ))
= P (R1 R2 ) + P (B1 B2 )
= P (R1 ) P (R2 ) + P (B1 ) P (B2 )
=
4
10
16
b+16
6
10
b
.
b+16
Clearing denominators
0.44(10)(b + 16) = 4(16) + 6b b = 4.
74
Chapter 4
433 Example A sequence of independent trials is performed by rolling a pair of fair dice. What is the probability
that an 8 will be rolled before rolling a 7?
Solution: This is example 409. Here we give a solution using conditioning. Let A be the event that an 8 occurs
before a 7. Now, either: (i) the first trial will be an 8, which we will call event X, or (ii) the first trial will be a 7,
which we will call event Y, or (iii) the first trial will be neither an 8 nor a 7, which we will call event Z. Since X ,
Y, Z partition A we have
P (A) = P (A|X) P (X) + P (A|Y) P (Y) + P (A|Z) P (Z) .
Observe that
5
P (A|X) P (X) = 1
36
P (A|Y) P (Y) = 0
36
,
,
and
P (A|Z) P (Z) = P (A)
25
36
where the last equality follows because if the first outcome is neither an 8 nor a 7 we are in the situation as in the
beginning of the problem. Thus
P (A) =
5
36
25
36
P (A) P (A) =
5
11
a1
a+b2
b
a+b
a
a+b2
a
a+b
1+
1
a+b2
This is greater than the probability on the first strategy, so the second strategy is better.
435 Example A simple board game has four fields A, B, C, and D. Once you end up on field A you have won and
once you end up on field B you have lost. From fields C and D you move to other fields by flipping a coin. If you
are on field C and you throw a head, then you move to field A, otherwise to field D. From field D, you move to
field C if you throw a head, and otherwise you mover to field B.
Suppose that you start in field D. What is the probability that you will win (i.e., what is the probability that you
will end up on field A)?
75
Homework
Solution: We want P (A|D). This can happen in two moves (from D to C to A) with probability 21 12 = 14 , or it
1
can happen in 4 moves (from D to C to D to C to A) with probability 12 21 12 21 = 16
, or in six moves, . . . ,etc.
We must sum thus the infinite geometric series
1
4
The required probability is therefore
1
42
1
43
+ =
1
4
1
4
1
3
1
.
3
Homework
436 Problem A and B are two events from the same sample
space satisfying
P (A) =
1
;
2
P (B) =
2
;
3
P (A|B) =
1
.
4
Find P (Ac Bc ).
437 Problem A cookie jar has 3 red marbles and 1 white
marble. A shoebox has 1 red marble and 1 white marble.
Three marbles are chosen at random without replacement
from the cookie jar and placed in the shoebox. Then 2
marbles are chosen at random and without replacement from
the shoebox. What is the probability that both marbles
chosen from the shoebox are red?
438 Problem A fair coin is tossed until a head appears.
Given that the first head appeared on an even numbered
toss, what is the conditional probability that the head
appeared on the fourth toss?
439 Problem Three fair standard dice are tossed, and the
sum is found to be 6. What is the probability that none of
the dice landed a 1?
7. Find P (R2 ).
2. Find P (G1 ).
8. Find P (G2 ).
9. Find P (R2 R1 ).
76
Chapter 4
4.3
Bayes Rule
P (Ak |B) =
P (B)
P (Ak B)
=
P (B)
n
k=1
P (Ak B)
.
P (Ak ) P (B|Ak )
448 Example A supermarket buys its eggs from three different chicken ranches. They buy 1/3 of their eggs from
EggsR Us, 1/2 of their eggs from The Yolk Ranch, and 1/6 of their eggs from Cheap Eggs. The supermarket
determines that 1% of the eggs from EggsR Us are cracked, 2% of the eggs from the Yolk Ranch are cracked, and
5% of the eggs from Cheap Eggs are cracked. What is the probability that an egg chosen at random is from Cheap
Eggs, given that the egg is cracked?
Solution: See figure 4.3 for a tree diagram. We have
P (cracked) =
=
=
+
+
3 100
2 100
6 100
13
600
and so,
P (ChE cracked)
P (ChE|cracked) =
P (cracked)
P (cracked|ChE) P (ChE)
P (cracked)
100 6
13
600
5
13
449 Example 6% of Type A spark plugs are defective, 4% of Type B spark plugs are defective, and 2% of Type C
spark plugs are defective. A spark plug is selected at random from a batch of spark plugs containing 50 Type A
plugs, 30 Type B plugs, and 20 Type C plugs. The selected plug is found to be defective. What is the probability
that the selected plug was of Type A?
Solution: Let A, B, C denote the events that the plug is type A, B, C respectively, and D the event that the plug is
defective. We have
P (D) = P (D|A) P (A) + P (D|B) P (B) + P (D|C) P (C)
=
=
6
100
23
500
50
100
4
100
30
100
2
100
20
100
77
Bayes Rule
R Us
1/3
YR
.01
cracked
.99
not cracked
.02
cracked
.98
not cracked
.05
cracked
.95
not cracked
1/2
1/6 ChE
Hence
P (A|D) =
=
P (A D)
P (D)
P (D|A) P (A)
P (D)
50
100 100
23
6
500
15
.
23
450 Example Two distinguishable dice have probabilities p, and 1 respectively of throwing a 6. One of the dice is
chosen at random and thrown. A 6 appeared.
Find the probability of throwing a 6.
What is the probability that one simultaneously chooses die I and one throws a 6?
What is the probability that the die chosen was the first one?
Solution:
P (6) = P (6 I) + P (6 II) =
P (6 I) =
1
2
p=
1
2
p+
1
2
1=
p+1
2
p
2
P (I|6) =
P (6 I)
p
=
.
P (6)
p+1
451 Example Three boxes identical in appearance contain the following coins: Box I has two quarters and a dime;
Box II has 1 quarter and 2 dimes; Box III has 1 quarter and 1 dime. A coin drawn at random from a box selected
is a quarter.
Find the probability of obtaining a quarter.
What is the probability that one simultaneously choosing box III and getting a quarter?
78
Chapter 4
What is the probability that the quarter came from box III?
Solution:
P (Q) =
1
3
2
3
1
3
P (Q III) =
P (III|Q) =
1
3
1
3
1
2
1
3
=
P (III Q)
P (Q)
1
2
1
2
1
6
=
1
3
Homework
452 Problem There are three coins in a box. When tossed,
one of the coins comes up heads only 30% of the time, one
of the coins is fair, and the third comes up heads 80% of the
time. A coin is selected at random from the box and tossed
three times. If two heads and a tails come upin this
orderwhat is the probability that the coin was the fair
coin?
453 Problem On a day when Tom operates the machinery,
70% of its output is high quality. On a day when Sally
operates the machinery, 90% of its output is high quality.
Tom operates the machinery 3 days out of 5. Three pieces of
a random days output were selected at random and 2 of
them were found to be of high quality. What is the
probability that Tom operated the machinery that day?
454 Problem There are three urns, A, B, and C. Urn A has
a red marbles and b green marbles, urn B has c red marbles
and d green marbles, and urn C has a red marbles and c
green marbles. Let A be the event of choosing urn A, B of
choosing urn B and, C of choosing urn C. Let R be the event
of choosing a red marble and G be the event of choosing a
green marble. An urn is chosen at random, and after that,
from this urn, a marble is chosen at random.
Find P (G).
Find P (G|C).
Find P (C|G).
Find P (R).
Find P (R|A).
Find P (A|R).
455 Problem Three dice have the following probabilities of
throwing a 6: p, q, r, respectively. One of the dice is chosen
at random and thrown. A 6 appeared. What is the
probability that the die chosen was the first one?
456 Problem Three boxes identical in appearance contain
the following coins: Box A has two quarters; Box B has 1
79
Answers
4
3
;
P (D = H) = ,
5
5
and they land tails otherwise. A coin is chosen at random
and flipped three times. On the first and second flips it lands
heads, on the third, tails. Which of the four coins is it the
most likely to be?
1
;
5
P (A = H) =
P (B = H) =
P (C = H) =
2
;
5
Answers
424
13
425
25
51
4
1
;
663 221
102
453 Let T denote the event that Tom operates the machinery, S the event that
Sally operates the machinery and H that two out of three pieces of the output be
of high quality. Then
1
116
426
P (H)
473
16215
436
We have
1
P (A B) = P (A|B) P (B) =
6
whence
P
437
= P
=
, P (A B) = P (A)+P (B)P (A B) = 1
(A B)
+ 3
2
2
100
100
5
1809
,
5000
P (T |H)
2
5
P (H|T ) P (T )
P (H)
70
100
30
100
3
5
1809
3
16
439 Observe that there are 10 ways of getting a sum of six in three dice: the 3
permutations of (1, 1, 4), the 6 permutations of (1, 2, 3), and the 1
permutation of (2, 2, 2). Of these, only (2, 2, 2) does not require a 1. Let S be
the event that the sum of the dice is 6 and let N be the event that no die landed
on a 1. We need
1
P (N|S) =
P (N S)
P (S)
5000
49
.
67
454
1
216
=
.
10
10
P (G)
b
d
c
1 +
1 +
1.
a+c
a+b
3
c+d
3
3
216
441
10
100
whence
= 1 P (A B) = 0.
8
438
90
100
1
c .
a+c
This is clearly
442
30
31
443
7
18
445
P (C|G)
Let A be the event that Peters letter is received by Paul and B be the event
that Pauls letter is received by Peter. Then we want P A|Bc . Then
A|Bc
P (G)
P (G|C) P (C)
=
A Bc
P (Bc )
P
Bc |A
=
P (A)
A|I
c
P
= 1
27
3
51
26
27
P (R)
1000
79
,
750
555
1000
882
1000
This is clearly
a .
a+b
=
=
43
459
452 Let Y, F, E denote the events of choosing the 30% heads, the 50% heads,
and the 80% heads, respectively. Now,
=
P (A|R)
1
3
=
=
P (A R)
P (R)
P (R|C) P (C)
P (R)
whence
P (F|HHT )
c
1
a+c
3
b
d
c
1 +
1 +
1
a+c
a+b
3
c+d
3
3
c
a+c
b
d
c
+
+
a+c
a+b
c+d
446 We condition on whether the interchanged card is the one selected on the
second half. Let A be the event that the selected on the second half card was an
ace, and let I be the event that the card selected was the interchanged one. Then
P (C G)
P (G)
=
P (HHT )
=
=
P (F HHT )
=
P (HHT )
P (HHT |F) P (F)
P (HHT )
555
1
1000
3
79
125
316
455
p+q+r
750
457
10
17
a
1
a+b
3
a
c
a
1 +
1 +
1
a+c
a+b
3
c+d
3
3
a
a+b
a
c
a
+
+
a+c
a+b
c+d
80
458
Chapter 4
91
Hence
371
459
1
P (A|HHT ) =
15
4
53
P (HHT )
25
43
1
460
2
P (B|HHT ) =
461
1
P (C|HHT ) =
We have
P (D|HHT ) =
1
4
4
53
1
4
12
53
1
4
18
53
1
4
16
53
1
.
10
18
53
9
,
25
16
53
P (HHT )
P (HHT ) =
6
25
P (HHT )
1
3
463
12
53
P (HHT )
35
462
8
,
25
Chapter
464 Definition Let X be a discrete random variable taking on the values x1 , x2 , . . . , xk , . . .. The mean value or
expectation of X, denoted by E (X) is defined by
E (X) =
xk P (X = xk ) .
k=1
465 Example A player is paid $1 for getting heads when flipping a fair coin and he loses $0.50 if he gets tails.
Let G denote the random variables measuring his gain. What is the image of G?
Find the distribution of G.
What is his expected gain in the long run?
Solution:
G can either be 1 or 0.50.
P (G = 1) =
1
,
2
and P (G = 0.5) =
1
,
2
3
4
466 Example A player is playing with a fair die. He gets $2 if the die lands on a prime, he gets nothing if the die
lands on 1, and he loses $1 if the die lands on a composite number.
Let G denote the random variables measuring his gain. What is the image of G?
Find the distribution of G.
What is his expected gain in the long run?
Solution:
G can either be 2, 0 or 1.
P (G = 2) =
3
,
6
P (G = 0) =
1
,
6
and P (G = 1) =
2
.
6
E (G) = 2P (G = 2) + 0P (G = 0) 1P (G = 1) =
81
6
6
+0
2
6
2
3
82
Chapter 5
467 Example A player chooses, without replacement, two cards from a standard deck of cards. He gets $2 for each
heart suit card.
Let G denote the random variables measuring his gain. What is the image of G?
Find the distribution of G.
What is his expected gain in the long run?
Solution:
G can either be 0, 1 or 2.
1339
0
522
P (G = 0) =
1339
1
521
P (G = 1) =
and
1339
2
520
P (G = 2) =
19
34
13
34
1
.
17
E (G) = 0P (G = 0) + 1P (G = 1) + 2P (G = 2) = 0 +
13
34
2
17
1
2
468 Definition Let X be a discrete random variable taking on the values x1 , x2 , . . . , xk , . . .. Then E X2 is
defined by
E X2 =
x2k P (X = xk ) .
k=1
469 Definition Let X be a random variable. The variance var (X) of X is defined by
P (X)
2k
3k
4k
Find E X2 .
Find var (X).
Solution:
83
1
9
P (X = 1) = 2k =
P (X = 1) = 3k =
P (X = 2) = 4k =
2
9
3
,
9
4
9
E (X) = 1P (X = 1) + 1P (X = 1) + 2P (X = 2) = 1
2
9
E X2 = (1)2 P (X = 1) + 12 P (X = 1) + 22 P (X = 2) = 1
21
9
12 =
+1
2
9
4
3
3
9
+1
+2
3
9
= 1.
+4
4
9
21
9
471 Example John and Peter play the following game with three fair coins: John plays a stake of $10 and tosses
the three coins in turn. If he obtains three heads, his stake is returned together with a prize of $30. For two
consecutive heads, his stake money is returned, together with a prize of $10. In all other cases, Peter wins the
stake money. Is the game fair?
Solution: The game is fair if the expected gain of both players is the same. Let J be the random variable
measuring Johns gain and let P be the random variable measuring Peters gain. John wins when the coins shew
HHH, HHT, THH. Thus
E (J) = 30P (HHH) + 10P (HHT ) + 10P (THH)
= 30
=
25
4
1
8
+ 10
1
8
+ 10
1
8
Peter wins when the coins shew HTH, HTT, THT, TTH, TTT . Thus
E (P) =
10P (HTH) + 10P (HTT ) + 10P (THT ) + 10P (TTH) + 10P (TTT )
10
25
,
4
1
8
+ 10
1
8
+ 10
1
8
+ 10
1
8
+ 10
1
8
84
Chapter 5
Solution: Let X be the random variable counting the number of drawings. Now, X = 2 means that matching socks
are obtained when 2 socks are drawn. Hence
24
1
82 =
P (X = 2) =
and thus P (X = 3) =
4
7
3
7
. Therefore
EX = 2P (X = 2) + 3P (X = 3) = 2
3
4 18
+3 =
.
7
7
7
473 Example Suppose that a player starts with a fortune of $8. A fair coin is tossed three times. If the coin comes
up heads, the players fortune is doubled, otherwise it is halved. What is the players expected fortune?
Solution: The player may have:
3
3
( 12 )3 =
1
8
3
0
( 12 )3 =
( 12 )3 =
1
8
3
8
( 12 )3 =
3
,
8
1
8
+2
3
8
1
2
3
8
1
8
1
8
125
8
Homework
474 Problem A fair die is tossed. If the resulting number is
even, you multiply your score by 2 and get that many
dollars. If the resulting number is odd, you add 1 to your
score and get that many dollars. Let X be the random
variable counting your gain, in dollars.
P (X)
0.3
5k
2k
85
5.2
GBBGGGBGBGGGBGBGGBGG,
with k = 7, n = 20 we have S = 12. Shew that the average
value of S is 2k(nk)
.
n
483 Example Six different pairs of socks are put in the laundry (12 socks in all, and each sock has only one mate),
but only 7 socks come back. What is the expected number of pairs of socks that come back?
Solution: Let Xi = 0 if the i-th pair does not come back, and Xi = 1 if it does. We want
EX1 + + EX6 = 6EX1 = 6P (X1 = 1) ,
since the Xi have the same distribution. Now
2 10
P (X1 = 1) =
125
7
21
11
7
22
484 Example A standard deck of cards is turned face up one card at a time. What is the expected number of cards
turned up in order to obtaina king?
Solution: (1) Consider the 48 cards which are not kings and for 1 i 48 put
Xi =
Then
48
X=1+
Xi
i=1
is the number of cards turned up in order to obtain a king. Let us prove that P (Xi = 1) =
86
Chapter 5
52!
1
P (Xi = 1) = 5!47! = .
52!
5
4!47!
Notice that
P (Xi = 1) =
EX = 1 +
48
5
53
5
485 Example An urn contains 30 cards: two numbered 1, two numbered 2, . . . , two numbered 15. Ten cards are
drawn at random from the urn. What is the expected number of pairs remaining in the urn?
Solution: For 1 i 15 put put
Xi =
otherwise
Then
282
P (Xi = 1) =
15 38
87
190
29
10 2
30
10
28!
38
,
= 18!10! =
30!
87
20!18!
486 Example Suppose that a class contains 10 boys and 15 girls, and suppose that 8 students are to be selected at
random from the class without replacement. Let X denote the number of boys that are selected and let Y denote
the number of girls that are selected. Find E(X Y).
Solution: The fastest way to do this
is perhaps the following. Let Xi = 1 if the i-th boy is selected, Xi = 0
24
8
10 8 16
7
otherwise. Then P (Xi = 1) = 25
and EX =
=
. Similarly, let Yi = 1 if the i-th girl is selected,
=
25
25
5
8
24
7
Yi = 0 otherwise. Then P (Yi = 1) = 25
=
8
8
25
and EY =
15 8
25
24
5
8
. Thus E(X Y) = EX EY = .
5
Homework
487 Problem A standard deck of cards is turned face up one
card at a time. What is the expected number of cards turned
up in order to obtain a heart?
488 Problem If X denotes the number of 1s when 72 dice
are thrown, find EX2 .
5.3
Conditional Expectation
490 Example A fair coin is tossed. If a head occurs, one fair die is rolled, else, two fair dice are rolled. Let X be
the total on the die or dice. Find EX.
87
Homework
21
Solution: EX =
491 Example In the city of Jerez de la Frontera, in Cdiz, Spain, true sherry is made according to a multistage
system called Solera. Assume that a winemaker has three barrels, A, B, and C. Every year, a third of the wine
from barrel C is bottled and replaced by wine from B; then B is topped off with a third of the wine from A; finally
A is topped off with new wine. Find the mean of the age of the wine in each barrel, under the assumption that the
operation has been going on since time immemorial.
Solution: We start with barrel A. Abusing notation, we will let A the random variable indicating the number of
years of wine in barrel A, etc. After the transfer has been made, the mean age of the new wine is 0 years and the
mean age of the old wine is a year older than what it was. Hence
A=
1
3
Anew +
2
3
Aold EA =
1
3
EAnew +
EAold EA =
1
3
0+
2
3
(1 + EA) EA = 2.
1
3
Bnew +
Bold =
1
3
Aold +
2
3
Bold EB =
1
3
3+
2
3
EBold EB =
2
3
(1 + EB) EB = 5.
1
2
1
2
1
2
6
2
Cnew + Cold = Bold + Cold EC = 6 + ECold EC = + (1 + EC) EC = 8.
3
3
3
3
3
3
3
3
Homework
492 Problem A fair coin is tossed repeatedly until heads is
produced. If it is known that the coin produces heads within
Answers
475 Let G be the random variable denoting the gain of the player. Then G has
image {0, 1, 3, 5} and
P (G = 0) =
P (G = 1) = P (G = 3) = P (G = 5) =
,
2
481
Lose.
487
1+
39
14
53
14
6
488
Thus
72
= 12 and
EG = 0P (G = 0) + 1P (G = 1) + 3P (G = 3) + 5P (G = 5) =
1+3+5
6
3
2
varX = np(1 p) = 72
,
= 10. But
6
6
2
2
2
EX = var(X) + (EX) = 10 + 12 = 154.
212
1
489
212
14
3
=
55
13
5
P (G = 1) =
38
,
P (G = 1) =
52
13
,
52
P (G = 12) =
1
.
52
Thus
EG
=
=
=
492 Let F be the random variable counting the number of flips till the first
heads. Then Im (F) = {1, 2, 3}. Let A be the event that heads is produced
within the first three flips. Then
P (A) =
1P (G = 1) + 1P (G = 1) + 12P (G = 13)
13
52
P (F = 1|A) =
1
8
P ((F = 1) A)
1
4
2
=
;
7
7
8
P ((F = 2) A)
1
2
4
=
;
7
7
8
1
1
8
=
.
7
7
8
P (A)
P (F = 3) =
480
0.25,
P (A)
P (F = 2|A) =
478
Hence
38 + 13 + 12
52
=
P ((F = 3|A) A)
P (A)
Thus
E(F|A) = 1
4
7
+2
2
7
+3
1
7
11
7
Chapter
Markov Chains
6.1
493 Definition If a random variable X has image S , where S is a finite or countably infinite set, we say that X is
a discrete random variable, having S as its (discrete) state space.
In this chapter, unless otherwise noted, we will only consider discrete random variables.
494 Example When flipping a fair coin and watching for the outcome, the state space of the outcome is {H, T },
where H denotes heads and T tails.
495 Example When rolling a fair die and watching for the number of dots, the state space of the random variable
X counting the number of dots is {1, 2, 3, 4, 5, 6}.
496 Example When rolling a fair die and watching for a 6 to appear, the state space of the random variable X
counting the number of trials is the countably infinite set {1, 2, 3, . . . , }.
497 Definition A sequence of random variables X1 , X2 , . . . , Xn , . . . , all having state space S is said to be a
discrete time stochastic process. Here the subindices indicate the time or step, so Xk is the process at step k. If
Xk = s, for s S , we say that the process is in state s at time k.
498 Definition A stochastic process X1 , X2 , . . . , Xn , . . . , is said to be a Markov Chain if
P (Xn+1 = xn+1 |X1 = x1 , X2 = x2 , . . . , Xn = xn ) = P (Xn+1 = xn+1 |Xn = xn ) ,
that is, the probability that the process changes from one step to another only depends on the immediate past and
not in the whole history of steps. The probability P (Xn+1 = xn+1 |Xn = xn ) is called the transition probability
and we write
P (Xn+1 = xn+1 |Xn = xn ) = pxn xn+1 .
The matrix P = [pxi xj ] is called the transition matrix of the Markov chain.
499 Definition A Markov Chain X1 , X2 , . . . , Xn , . . . , is said to be a stationary if the transition probabilities
have the same value for every time n, that is, if for all states x, y,
P (Xn+1 = y|Xn = x) = P (Xk+1 = y|Xk = x) = pxy .
From here on we will only consider stationary finite Markov Chains. Thus a Markov chain will have states
x1 , x2 , . . . , xk .
88
89
Homework
500 Example A tourist with a very short memory wants to visit four capitals: London, Dublin, Edinburgh, and
Athens. He picks the first capital at random. If he selects London, he next chooseswith equal
probabilitybetween Dublin, Edinburgh, or Athens. If he then selects Dublin, he next chooses between London,
Edinburgh, or Athens. His memory is so short that he forgets that he has already visited London. Next time again
he chooses between three capitals, and so on. Observe that the process of moving from city to city is a Markov
Chain, since the movement from one step to the next only depends on the previous step. The states are the
different capitals. If each capital is denoted by its initial, what is the transition matrix of this process is
L
0
L
D
E
A
1
3
1
3
1
3
1
3
1
3
1
3
1
3
1
3
1
3
0
1
3
1
3
0
1
3
501 Example Rich widow A owns two paintings by Goya, three by Velzquez, and four by Bosch. She displays
only one of these paintings at her dinner parties. From party to party, the painting on the display is replaced by a
randomly chosen one from the other eight paintings. Let G be the state a Goya is on display, V be a Velzquez is
on display, and B be a Bosch is on display. This process is clearly a Markov Chain. Its transition matrix is
G
V
B
1
8
1
4
1
4
3
8
1
4
3
8
1
2
1
2
3
8
Homework
502 Problem A witch has a pet collection: a tarantula, a
lizard, and a frog. From day to day, she likes to pet a single
animal in the following fashion: she never pets the same
animal two days in a row. If she pets the tarantula today,
she will pet the the lizard tomorrow with probability 0.2; if
she pets the lizard today, she will pet the frog tomorrow
with probability 0.5; if she pets the frog today she will pet
the tarantula tomorrow with probability 0.3. Assume that
the day-to-day petting is a Markov Chain, where the animal
petted represents the state of the chain. If T stands for
6.2
504 Example Using data collected for a particular region over many years, an insurance company has ascertained
that 20% of the drivers involved in an automobile accident one year are also involved in an accident the following
year, while only 10% of the drivers not involved in an accident one year are involved in an accident the following
year. Use these percentages as approximate empirical probabilities to find the probability that (in the long run) a
driver chosen at random will be involved in an accident during any given year.
Solution: The transition matrix is
0.20
0.80
.
0.10
Solving
0.20
a
0.90
0.80
= a 1a
1a
0.10
0.90
90
Chapter 6
we get a =
1
9
1
9
505 Example Three people, A, B, C, are playing catch. The probabilities each will throw the other are
1
1
3
1
1
1
P (A B) = , P (A C) = , P (B A) = , P (B C) = , P (C A) = , and P (C B) = .
2
2
4
4
2
2
What is the probability that A will have the ball in the long run?
Solution: The transition matrix is
Solving
1/2 1/2
3/4 .
1/4
1/2
1/2
0
a b
we get a =
5
18
,b =
1
3
1ab
1/2 1/2
3/4 = a b
1/4
1/2
1/2
5
18
1ab
Answers
502
Today
T
L
F
T
0
0.5
0.3
Tomorrow
L
F
0.2
0.8
0
0.5
0.7
0
G
503
V
B
G
0
1
3
2
5
V
3
7
0
3
5
B
4
7
2
3
0
Chapter
P (X A) =
meas (C)
This means that the probability of of an event is proportional to the length (respectively, area or volume) that this
body A occupies in C.
507 Example A dartboard is made of three concentric circles of radii 3, 5, and 7, as in figure 7.1. A dart is thrown
and it is assumed that it always lands on the dartboard. Here the inner circle is blue, the middle ring is white and
the outer ring is red.
The size of the sample space for this experiment is (7)2 = 49.
The probability of landing on blue is
(3)2
49
9
49
16
(5)2 (3)2
=
.
49
49
(7)2 (5)2
49
24
49
3
5
7
Figure 7.1: Example 507
92
Chapter 7
1
(8)
18
4
.
9
P (3 X 4) is the area of a trapezoid of bases of length 2.5 and 5 and height 1, thus
1
5
P (3 X 4) = 18
12 ( 25 + 5) = 24
.
7
6
0
0
93
1
2
and
Solution:
In [0; 3] the figure is a triangle with base 3 and height 4, and so its area is 6. In [3; 5] the figure is a rectangle,
with base 2 and height 4, and so its area is 8. In [5; 6] the figure is a rectangle, with base 1 and height 2, and
so its area is 2. In [6; 7] the figure is a trapezium, with bases 2 and 4 and height 1, and so its area is 3.
Adding all these areas together we obtain 6 + 8 + 2 + 3 = 19. Since
1 = P (X 7) = A(7) = (19),
we obtain =
1
.
19
This measures the proportion of the area enclosed by the triangle, and so P (X 3) =
6
.
19
This measures the proportion of the area enclosed by the triangle and the first rectangle, and so
14
P (X 5) = 6+8
= 19
.
19
This measures the proportion of the area enclosed by the triangle, and the first and second rectangle, and so
= 16
.
P (X 6) = 6+8+2
19
19
The area sought is that of a trapezium. One (of many possible ways to obtain this) is to observe that
P (1 X 2) = P (X 2) P (X 1) .
To find P (X 2) observe that the triangle with base on [0; 4] is similar to the one with base on [0; 2]. If its
height is h1 then h41 = 23 , whence h1 = 38 , and
P (X 2) =
19
8
3
8
57
To find P (X 1) observe that the triangle with base on [0; 4] is similar to the one with base on [0; 1]. If its
height is h2 then h42 = 13 , whence h2 = 34 , and
P (X 1) =
1
19
1
4
1
2
3
2
.
57
Finally,
P (1 X 2) = P (X 2) P (X 1) =
8
57
2
57
2
19
2
19
From parts (2) and (3), 3 < m < 5. For m in this range, a rectangle with base m 3 and height 4 has area
4(m 3). Thus we need to solve
1
2
= P (X m) =
6 + 4(m 3)
19
which implies
19
2
= 6 + 4(m 3) m =
31
8
= 3.875.
94
Chapter 7
l
l
2
K
l
2
511 Example A rod of length l is broken into three parts. What is the probability that these parts form a triangle?
Solution: Let x, y, and l x y be the lengths of the three parts of the rod. If these parts are to form a triangle,
then the triangle inequality must be satisfied, that is, the sum of any two sides of the triangle must be greater than
the third. So we simultaneously must have
x+y>lxy x+y>
x+lxy>y y<
y+lxy>x x<
2
l
l
2
.
2
Since trivially 0 x + y l, what we are asking is for the ratio of the area of the region
A = {(x, y) : 0 < x <
l
2
,0 < y <
l
2
,x+y >
l
2
to that of the triangle with vertices at (0, 0), (l, 0) and (0, l). This is depicted in figure 7.4. The desired
probability is thus
l2
1
8
= .
l2
4
2
512 Example Two points are chosen at random on a segment of length L. Find the probability that the distance
between the points is at most K, where 0 < K < L.
Solution: Let the points chosen be X and Y with 0 X L, 0 Y L, as in figure 7.5. The distance of the
points is at most K if |X Y| K, that is
X K Y X + K.
The required probability is the ratio of the area shaded inside the square to the area of the square:
L2 2 (KL)
2
L2
K(2L K)
.
L2
95
514 Example Two points (x, y) are chosen at random on a rectangle 5 feet by 3 feet. What is the probability that
the two points are within one foot of each other?
Solution: We want P (|x y| < 1) = P (1 + x < y < 1 + x). This is the area shaded in figure 7.6. The area of the
. The
rectangle is 3 5 = 15, of the white triangle 21 (2)(2) = 2, and of the white trapezoid 12 (1 + 4)(3) = 15
2
desired probability is thus
15 2 15
11
2
=
.
15
30
4
3
2
1
0
0
Appendix
The Integers
515 Definition Let a, b be integers with a = 0. Write a|b (read a divides b) if there exists an integer t such
that b = at. We say that a is a factor of b and that b is a multiple of a.
For example 5|10 (5 divides 10) because 10 = (2)(5). If c does not divide d we write c d.
97
The Integers
Thus
2Z + 1 = {. . . , 5, 3, 1, 1, 3, 5, . . .}
is the set of odd integers. Notice also that 2Z + 1 = 2Z 1.
3Z + 2 = {. . . , 7, 4, 1, 2, 5, 8, . . .}
is the set of integers leaving remainder 2 upon division by 3.
520 Definition Let x be a real number. The floor of x, denoted by x is the greatest integer less than or equal to
x. That is, x is the unique integer satisfying the inequalities
x 1 < x x.
521 Example
0.5 = 0,
0.5 = 1,
2.2 = 2,
2.9 = 2,
2.2 = 3,
2 = 2.
522 Definition Let x be a real number. The ceiling of x, denoted by x is the least integer greater than or equal
to x. That is, x is the unique integer satisfying the inequalities
x x < x + 1.
523 Example
0.5 = 1,
0.5 = 0,
2.2 = 3,
2.9 = 3,
2.2 = 2,
2 = 2.
524 Example In the set A = {1, 2, . . . , 500} of 500 integers there are
500
2
500
3
500
5
500
7
500
11
500
77
500
251
250
166
100
71
45
98
Appendix A
525 Theorem (Division Algorithm) Let a > 0 be an integer. For every integer n there exist unique integers q and
r such that
0 r < a.
n = qa + r,
Here a is the divisor, n the dividend, q the quotient, and r the remainder.
Proof: n must lie between two consecutive multiples of a, that is, there exist q such that
qa n < (q + 1)a. This gives
n
< q + 1.
q
a
It follows that
q=
n
a
n
a
a.
There are exactly a possible remainders when an arbitrary integer is divided by a. Our
version of the Division Algorithm says that these remainders may be either 0, or 1, or 2, . . . , or
a 1.
526 Example For the divisor a = 3, we have
100 = 3(33) + 1,
101 = 3(33) + 2,
103 = 3(34) + 0,
100 = 3(34) + 2.
Notice that our version of the Division Algorithm requires that the remainder r satisfy 0 r < 3.
It is important to realise that given an integer n > 0, the Division Algorithm makes a partition of all the integers
according to their remainder upon division by n. For example, every integer lies in one of the families 3k, 3k + 1
or 3k + 2 where k Z. Observe that the family 3k + 2, k Z, is the same as the family 3k 1, k Z. Thus
Z=ABC
where
A = {. . . , 9, 6, 3, 0, 3, 6, 9, . . .}
is the family of integers of the form 3k, k Z,
B = {. . . 8, 5, 2, 1, 4, 7, . . .}
is the family of integers of the form 3k + 1, k Z and
C = {. . . 7, 4, 1, 2, 5, 8, . . .}
is the family of integers of the form 3k 1, k Z.
99
Homework
Again, we can arrange all the integers in five columns as follows:
..
.
..
.
..
.
..
.
..
.
10 9
..
.
..
.
..
.
..
.
..
.
The arrangement above shews that any integer comes in one of 5 flavours: those leaving remainder 0 upon division
by 5, those leaving remainder 1 upon division by 5, etc. We let
5Z = {. . . , 15, 10, 5, 0, 5, 10, 15, . . .},
5Z + 1 = {. . . , 14, 9, 4, 1, 6, 11, 16, . . .},
5Z + 2 = {. . . , 13, 8, 3, 2, 7, 12, 17, . . .},
5Z + 3 = {. . . , 12, 7, 2, 3, 8, 13, 18, . . .},
5Z + 4 = {. . . , 11, 6, 1, 4, 9, 14, 19, . . .}.
527 Example Which number of {330, 331, 332, 334, 335, 336, 337, 338, 339} lies in the sequence
9, 3, 15, . . . ?
Solution: The numbers of the sequence have the form 12k + 3, k = 1, 0, 1, 2, . . . ,, that is, they leave remainder 3
upon division by 12. Now, 339 = 12 28 + 3, and so 339 is the only integer in the group that lies in the sequence.
Homework
528 Problem Determine the set 4Z 10Z.
529 Problem Find
100
,
3
3
100
3
,
, and
.
100
3
100
Appendix
Divisibility Tests
In this section we study some divisibility tests. These will help us further classify the integers. We start with the
simple
534 Theorem An integer n is divisible by 5 if and only if its last digit is a 0 or a 5.
Proof: We derive the result for n > 0, for if n < 0 we simply apply the result to n > 0. Now, let
the decimal expansion of n be
n = as 10s + as1 10s1 + + a1 10 + a0 ,
where 0 ai 9, as = 0. Then
n = 10(as 10s1 + as1 10s2 + + a1 ) + a0 .
The first summand is divisible by 10 and it the divisibility of n by 5 thus depends on whether a0
is divisible by 5, whence the result follows.
535 Theorem Let k be a positive integer. An integer n is divisible by 2k if and only if the number formed by the
last k digits of n is divisible by 2k .
Proof: If n = 0 there is nothing to prove. If we prove the result for n > 0 then we can deduce
the result for n < 0 by applying it to n = (1)n > 0. So assume that n Z, n > 0 and let its
decimal expansion be
n = as 10s + as1 10s1 + + a1 10 + a0 ,
where 0 ai 9, as = 0. Now, each of 10k = 2k 5k , 10k+1 = 2k+1 5k+1 , . . . , 10s = 2s 5s , is
divisible by 2k , hence
n =
=
so n is divisible by 2k if and only if the number formed by the last k digits of n is divisible by 2k .
536 Example The number 987654888 is divisible by 23 = 8 because the number formed by its last three digits,
888 is divisible by 8.
100
101
Divisibility Tests
537 Example The number 191919191919193216 is divisible by 24 = 16 because the number formed by its last
four digits, 3216 is divisible by 16.
538 Example By what digits may one replace A so that the integer 231A2 be divisible by 4?
Solution: The number 231A2 is divisible by 4 if and only if A2 is divisible by 4. This happens when A = 1
(A2 = 12), A = 3 (A2 = 32), A = 5 (A2 = 52), A = 7 (A2 = 72), and A = 9 (A2 = 92). Thus the five numbers
23112, 23132, 2315223172, 23192,
are all divisible by 4.
539 Example Determine digits a, b so that 235ab be divisible by 40.
Solution: 235ab will be divisible by 40 if and only if it is divisible by 8 and by 5. If 235ab is divisible by 8 then,
a fortiori, it is even and since we also require it to be divisible by 5 we must have b = 0. Thus we need a digit a
so that 5a0 be divisible by 8. Since 0 a 9, a quick trial an error gives that the desired integers are
23500, 23520, 23540, 23560, 23580.
540 Lemma If k is a positive integer, 9|(10k 1).
Proof:
The only number in the range 10 to 19 divisible by 9 is 18, thus d = 8. One can easily verify that 3285 is divisible
by 9.
Since 3|(10k 1) for positive integer k, we also obtained the following corollary.
102
Appendix B
543 Corollary An integer n is divisible by 3 if and only if its digital sum is divisible by 3.
544 Example Is there a digit d so that 125d be divisible by 45?
Solution: If 125d were divisible by 45, it must be divisible by 9 and by 5. If it were divisible by 5, then d = 0 or
d = 5. If d = 0, the digital sum is 1 + 2 + 5 + 0 = 8, which is not divisible by 9. Similarly, if d = 5, the digital
sum is 1 + 2 + 5 + 5 = 13, which is neither divisible by 9. So 125d is never divisible by 45.
545 Definition If the positive integer n has decimal expansion
n = as 10s + as1 10s1 + + a1 10 + a0 ,
the alternating digital sum of n is
as as1 + as2 as3 + + (1)s1 a0
546 Example The alternating digital sum of 135456 is
1 3 + 5 4 + 5 6 = 2.
547 Lemma If t is even, then 11|(10t 1) and if t is odd, 11|(10t + 1).
Proof:
103
Homework
and the result follows from this. Similarly, if s is odd,
n
Homework
550 Problem For which numbers N {1, 2, . . . , 25} will
N2 + 1 be divisible by 10?
383
936
203
76,
Appendix
Arithmetic Sums
562 Definition The sum a1 + a2 + + an is denoted by
n
k=1
ak = a1 + a2 + + an .
563 Example
ak = a1 + a2 + a3 + a4 .
k=1
4
k2 = 12 + 22 + 32 + 42 = 1 + 4 + 9 + 16 = 30.
564 Example
k=1
5
565 Example
2 = 2 + 2 + 2 + 2 + 2 = 10.
k=1
566 Example
5
k=1 (2k
105
Arithmetic Sums
21 = 9 + 2 10,
31 = 9 + 3 10,
etc. Hence the 300-th term is 9 + 299(10) = 2981.
569 Example Consider the progressions
P1 :
4, 9, 14, , 499,
P2 :
2, 5, 8, , 299.
9, 3, 15, . . . , 1263,
7, 12, 17, . . . , 502.
502 27
60
= 7.
106
Appendix C
Proof:
n(2a + (n 1)d)
2
Put
S = (a) + (a + d) + (a + 2d) + + (a + (n 1)d).
Adding from the first to the last term is the same as adding from the last term to the first, so we
have
S = (a + (n 1)d) + (a + (n 2)d) + (a + (n 3)d) + + (a).
Adding term by term, this gives
2S = (2a + (n 1)d) + (2a + (n 1)d) + (2a + (n 1)d) + + (2a + (n 1)d),
or
2S = n(2a + (n 1)d),
from where the theorem follows.
572 Example Consider the following progression.
16, 20, 24, . . . .
You may assume that this pattern is preserved.
Find the common difference.
Find a formula for the n-th term.
Find the 100-th term of the progression.
Find the sum of the first 100 terms of the progression.
Solution:
The common difference is +4.
The n-th term is 16 + 4(n 1), n = 1, 2, 3, . . . .
The 100-th term is 16 + 4(99) = 412
If
S = 16 + 20 + + 412,
then
2S = (16 + 412) + (20 + 408) + + (412 + 16) = (428)(100),
whence S = 21400.
One important arithmetic sum is
An =
k=1
k = 1 + 2 + + n.
k = 1 + 2 + + n =
n(n+1)
.
2
107
Arithmetic Sums
573 Example
1 + 2 + 3 + + 100 =
100(101)
2
= 5050.
574 Example Find the sum of all the integers from 1 to 1000 inclusive, which are not multiples of 3 or 5.
Solution: We compute the sum of all integers from 1 to 1000 and weed out the sum of the multiples of 3 and the
sum of the multiples of 5, but we put back the multiples of 15, which we have counted twice. Put
An = 1 + 2 + 3 + + n,
B = 3 + 6 + 9 + + 999 = 3(1 + 2 + + 333) = 3A333 ,
C = 5 + 10 + 15 + + 1000 = 5(1 + 2 + + 200) = 5A200 ,
D = 15 + 30 + 45 + + 990 = 15(1 + 2 + + 66) = 15A66 .
The desired sum is
A1000 B C + D
266332.
575 Example Each element of the set {10, 11, 12, . . . , 19, 20} is multiplied by each element of the set
{21, 22, 23, . . . , 29, 30}. If all these products are added, what is the resulting sum?
Solution: This is asking for the product (10 + 11 + + 20)(21 + 22 + + 30) after all the terms are
multiplied. But
(20 + 10)(11)
10 + 11 + + 20 =
= 165
2
and
(30 + 21)(10)
21 + 22 + + 30 =
= 255.
2
The required total is (165)(255) = 42075.
576 Example Find the sum of all integers between 1 and 100 that leave remainder 2 upon division by 6.
Solution: We want the sum of the integers of the form 6r + 2, r = 0, 1, . . . , 16. But this is
16
16
(6r + 2) = 6
r=0
16
r+
r=0
2=6
r=0
16(17)
2
+ 2(17) = 850.
108
Appendix C
Homework
5
(k2 + k + 1).
a, a b, a 2b, . . . .
k2 1
.
k2 + 1
5, 9, 13, . . . , 405,
P2 :
4, 9, 14, . . . , 504?
5, 9, 13, . . . , 405,
Then find the sum of the first 100 terms.
P2 :
{7, 9, 11},
{13, 15, 17, 19},
..
.
Shew that the sum of the n-th group is n3 .
Appendix
Geometric Sums
585 Definition A geometric progression is one of the form
a, ar, ar2 , ar3 , . . . , arn1 , . . . ,
with a = 0, r = 0. Here a is the first term and r is the common ratio.
586 Example Find the 30-th term of the geometric progression
1024 512
3
512
3
256
3
1024
....
= 2.
3
1024
(2)29 =
3
210
a arn
1r
that is,
a + ar + + arn1 =
a arn
1r
which yields
587 Theorem (Sum of a Finite Geometric Progression) Let r = 1. Then
n
k=1
ark1 = a + ar + + arn1 =
aarn
.
1r
588 Corollary (Sum of an Infinite Geometric Progression) Let |r| < 1. Then
109
110
Appendix D
k=1
ark1 = a + ar + + arn1 + =
a
.
1r
If |r| < 1 then rn 0 as n . The result now follows from Theorem 587.
Proof:
x=
Solution: We have
1
3
x=
32
1
33
+ +
1
399
1
3100
Then
2
x
3
= x 13 x
=
1
3
1
32
1
3
+
1
32
1
33
+ +
1
33
1
399
+ +
1
399
1
3100
1
.
3100
1
2
1
2 399
1
Sn = (1 + 1/2 + 1/4 + + 1/2n ) (1/2 + 1/4 + + 1/2n + 1/2n+1 ) = 1 1/2n .
2
Whence
Sn = 2 1/2n .
111
Geometric Sums
So as n varies, we have:
S1
= 2 1/20
= 1
S2
= 2 1/2
= 1.5
S3
= 2 1/22
= 1.875
S4
= 2 1/23
= 1.875
S5
= 2 1/24
= 1.9375
S6
= 2 1/25
= 1.96875
S10
= 2 1/29
= 1.998046875
3
Solution: The first term is a =
that the sum is
20
40
27
80
81
+ .
10
and the common ratio is r = 23 . Since |r| < 1 we find in view of Theorem 588
3
a
1r
10
3
1 23
= 2.
593 Example A fly starts at the origin and goes 1 unit up, 1/2 unit right, 1/4 unit down, 1/8 unit left, 1/16 unit
up, etc., ad infinitum. In what coordinates does it end up?
Solution: Its x coordinate is
1
2
1
8
1
32
1
2
1
4
2
5
Its y coordinate is
1
1
4
1
16
1
1
1
4
4
5
10 410
3
410 1
9
112
Appendix D
Homework
Find the 10-th term of the progression.
1
2
1
2
1
2
10
1
3
2
3
1
3
2
3
1
3
1
1
1
1
+
+
+
+ .
n1
n2
n3
n4
Answers
579 The shared terms are of the form 9 + 20k. We need 9 + 20k 405, hence
k 19 and so there are 19 + 1 = 20 elements shared.
528
20Z
529
33, 0, 34, 1.
530
85; 60; 4
531
42; 30; 2
532
2002
533
None.
550
551
552
d = 5
553
d = 6
582
554
583 The n-th term is a 2d + d(n 1) = a + d(n 3). The sum of the
first 100 terms is 50(2a + 95d).
580 The shared terms are of the form 37 + 36k. We need 37 + 36k 405,
hence k 10 and so there are 10 + 1 = 11 elements shared.
581 The common difference is 8. The 51-st term is 98 + (50)(8) = 302.
The sum of the first 51 terms is
98
90
294
302
302
294
90
98
2S
204
204
204
204.
4
7
596
3
4
597
1
5;
; 3125 ;
5
598
1+
The last digit must be 0 or 5, the other digits can be arranged at random.
625
2441406
1
2
1
22
1
23
1+
1
3
1
32
1
33
1 = 2.