7/29/2019 Discrete Maths.Class 10
1/17
M. HauskrechtCS 441 Discrete mathematics for CS
CS 441 Discrete Mathematics for CS
Lecture 10
Milos Hauskrecht
5329 Sennott Square
Sequences and summations
M. HauskrechtCS 441 Discrete mathematics for CS
Course administrivia
Weekly homework assignments
Assigned in class and posted on the course web page
Due one week later at the beginning of the lecture
No extension policy
Collaboration policy: You may discuss the material covered in the course
with your fellow students in order to understand it better
However, homework assignments should be worked on
and written up individually
7/29/2019 Discrete Maths.Class 10
2/17
M. HauskrechtCS 441 Discrete mathematics for CS
Course administration
Midterm:
Tuesday, October 6, 2009 Closed book, in-class
Covers Chapters 1 and 2.1-2.3 of the textbook
No Homework assignment this week
Course web page:
http://www.cs.pitt.edu/~milos/courses/cs441/
M. HauskrechtCS 441 Discrete mathematics for CS
Midterm
Propositional logic
Syntax/Logical connectives
Truth values/tables
Translation of English sentences
Equivalences
Predicate logic Syntax, quantified sentences
Truth values for sentences in predicate logic
Translations
Rules of inference
7/29/2019 Discrete Maths.Class 10
3/17
M. HauskrechtCS 441 Discrete mathematics for CS
Midterm
Proofs
Formal proofs Informal proofs
Types of proofs: direct, indirect, contradiction
Sets
Basics: Set subsets, power set
Cardinality of the set
N-tuples
Cartesian products
Set operators
Representation of sets
M. HauskrechtCS 441 Discrete mathematics for CS
Midterm
Functions
Basic definition
Function properties: injection, surjection, bijection
Function inverse
Composition of functions
7/29/2019 Discrete Maths.Class 10
4/17
M. HauskrechtCS 441 Discrete mathematics for CS
Midterm
Types of problems on midterm:
Knowledge of definitions, concepts, methods E.g what is a proposition, what is a set
Problems similar to homework assignments and
exercises
E.g. prove is n is even than 3n+2 is even
If needed you will receive a list of logical equivalences
and/or a list of inference rules
M. HauskrechtCS 441 Discrete mathematics for CS
Sequences
Definition: A sequence is a function from a subset of the set of
integers (typically {0,1,2,...} or {1,2,3,...} to a set S. We use the
notation an to denote the image of the integer n. We call an a
term of the sequence.
Notation: {an} is used to represent the sequence (note {} is the
same notation used for sets, so be careful). {an} represents the
ordered list a1, a2, a3, ... .
{an}
1 2 3 4 5 6 .
a1 a2 a3 a4 a5 a6 .
7/29/2019 Discrete Maths.Class 10
5/17
M. HauskrechtCS 441 Discrete mathematics for CS
Sequences
Examples:
(1) an = n2, where n = 1,2,3...
What are the elements of the sequence?
1, 4, 9, 16, 25, ...
(2) an = (-1)n, where n=0,1,2,3,...
Elements of the sequence?
1, -1, 1, -1, 1, ...
3) an = 2n, where n=0,1,2,3,...
Elements of the sequence?
1, 2, 4, 8, 16, 32, ...
M. HauskrechtCS 441 Discrete mathematics for CS
Arithmetic progression
Definition: An arithmetic progression is a sequence of the form
a, a+d,a+2d, , a+nd
where a is the initial term and d is common difference, such that
both belong to R.
Example:
sn= -1+4n for n=0,1,2,3, members: -1, 3, 7, 11,
7/29/2019 Discrete Maths.Class 10
6/17
M. HauskrechtCS 441 Discrete mathematics for CS
Geometric progression
Definition A geometric progression is a sequence of the form:
a, ar, ar2, ..., ark,
where a is the initial term, and r is the common ratio. Both a and r
belong to R.
Example:
an = ( )n for n = 0,1,2,3,
members: 1,, , 1/8, ..
M. HauskrechtCS 441 Discrete mathematics for CS
Sequences
Given a sequence finding a rule for generating the sequence is
not always straightforward
Example:
Assume the sequence: 1,3,5,7,9, .
What is the formula for the sequence?
Each term is obtained by adding 2 to the previous term. 1, 1+2=3, 3+2=5, 5+2=7
It suggests an arithmetic progression: a+nd
with a=1 and d=2
an=1+2n or an=1+2n
7/29/2019 Discrete Maths.Class 10
7/17
M. HauskrechtCS 441 Discrete mathematics for CS
Sequences
Given a sequence finding a rule for generating the sequence is
not always straightforward
Example 2:
Assume the sequence: 1, 1/3, 1/9, 1/27,
What is the sequence?
The denominators are powers of 3.
1, 1/3= 1/3, (1/3)/3=1/(3*3)=1/9, (1/9)/3=1/27
What type of progression this suggests?
M. HauskrechtCS 441 Discrete mathematics for CS
Sequences
Given a sequence finding a rule for generating the sequence is
not always straightforward
Example 2:
Assume the sequence: 1, 1/3, 1/9, 1/27,
What is the sequence?
The denominators are powers of 3.1, 1/3= 1/3, (1/3)/3=1/(3*3)=1/9, (1/9)/3=1/27
This suggests a geometric progression: ark
with a=1 and r=1/3
(1/3 )n
7/29/2019 Discrete Maths.Class 10
8/17
M. HauskrechtCS 441 Discrete mathematics for CS
Summations
Summation of the terms of a sequence:
The variable j is referred to as the index of summation.
m is the lower limit and
n is the upper limit of the summation.
n
n
mj
mmj aaaa +++==+ ...1
M. HauskrechtCS 441 Discrete mathematics for CS
Summations
Example:
1) Sum the first 7 terms of {n2} where n=1,2,3, ... .
2) What is the value of
14049362516417
1
7
1
2 =+++++== = =j j
j ja
11)1(1)1(1)1(8
4
8
4
=++++== = =k k
j
ja
7/29/2019 Discrete Maths.Class 10
9/17
M. HauskrechtCS 441 Discrete mathematics for CS
Arithmetic series
Definition: The sum of the terms of the arithmetic progression
a, a+d,a+2d, , a+nd is called an arithmetic series.
Theorem: The sum of the terms of the arithmetic progression
a, a+d,a+2d, , a+nd is
Why?
2
)1()(
1 1
++=+=+=
= =
nndnajdnajdaS
n
j
n
j
M. HauskrechtCS 441 Discrete mathematics for CS
Arithmetic series
Theorem: The sum of the terms of the arithmetic progression
a, a+d,a+2d, , a+nd is
Proof:
2
)1()(
1 1
++=+=+=
= =
nndnajdnajdaS
n
j
n
j
== ==
+=+=+=n
j
n
j
n
j
n
j
jdnadjajdaS11 11
)(
7/29/2019 Discrete Maths.Class 10
10/17
7/29/2019 Discrete Maths.Class 10
11/17
M. HauskrechtCS 441 Discrete mathematics for CS
Arithmetic series
Theorem: The sum of the terms of the arithmetic progression
a, a+d,a+2d, , a+nd is
Proof:
== ==
+=+=+=n
j
n
j
n
j
n
j
jdnadjajdaS11 11
)(
nnnjn
j
+++++++==
)1()2(....43211
1+(n-1)=n n n
2
)1()(
1 1
++=+=+=
= =
nndnajdnajdaS
n
j
n
j
M. HauskrechtCS 441 Discrete mathematics for CS
Arithmetic series
Theorem: The sum of the terms of the arithmetic progression
a, a+d,a+2d, , a+nd is
Proof:
2
)1()(
1 1
++=+=+=
= =
nndnajdnajdaS
n
j
n
j
== ==
+=+=+=n
j
n
j
n
j
n
j
jdnadjajdaS11 11
)(
nnnjn
j
+++++++==
)1()2(....43211
1+(n-1)=n n n
nn
*2
)1( +
7/29/2019 Discrete Maths.Class 10
12/17
M. HauskrechtCS 441 Discrete mathematics for CS
Arithmetic series
Example: =
=+=5
1
)32(j
jS
= = =+=5
1
5
1
32j j
j
= =
=+=5
1
5
1
312j j
j
=+= =
5
1
35*2j
j
=+
+= 5*2
)15(310
554510 =+=
M. HauskrechtCS 441 Discrete mathematics for CS
Arithmetic series
Example 2: =
=+=5
3
)32(j
jS
+
+=
= == =
2
1
2
1
5
1
5
1
312312j jj j
jj
421355 ==
+
+=
==
2
1
5
1
)32()32(jj
jj Trick
7/29/2019 Discrete Maths.Class 10
13/17
M. HauskrechtCS 441 Discrete mathematics for CS
Double summations
Example: = =
==4
1
2
1
)2(i j
jiS
= = =
=
=
4
1
2
1
2
1
12i j j
ji
= = = =
=
4
1
2
1
2
12
i j jji
= =
=
=
4
1
2
1
2*2i j
ji
[ ]=
==4
1
32*2i
i
= =
==4
1
4
1
34
i i
i
= =
==4
1
4
1
134i i
i 284*310*4 =
M. HauskrechtCS 441 Discrete mathematics for CS
Geometric series
Definition: The sum of the terms of a geometric progression a, ar,
ar2, ..., ark is called a geometric series.
Theorem: The sum of the terms of a geometric progression a, ar,
ar2, ..., arn is
===
+
= =
1
1)(
1
0 0 r
raraarS
nn
j
n
j
jj
7/29/2019 Discrete Maths.Class 10
14/17
M. HauskrechtCS 441 Discrete mathematics for CS
Geometric series
Theorem: The sum of the terms of a geometric progression a, ar,
ar2, ..., arn is
Proof:
===
+
= = 11
)(
1
0 0 r
raraarS
nn
j
n
j
jj
nn
j
j ararararaarS +++++== =
...32
0
M. HauskrechtCS 441 Discrete mathematics for CS
Geometric series
Theorem: The sum of the terms of a geometric progression a, ar,
ar2, ..., arn is
Proof:
multiply S by r
===
+
= =
1
1)(
1
0 0 r
raraarS
nn
j
n
j
jj
132
0
... +=
++++== n
n
j
j arararararrrS
nn
j
j ararararaarS +++++== =
...32
0
7/29/2019 Discrete Maths.Class 10
15/17
M. HauskrechtCS 441 Discrete mathematics for CS
Geometric series
Theorem: The sum of the terms of a geometric progression a, ar,
ar2, ..., arn is
Proof:
multiply S by r
Substract
===
+
= = 11
)(
1
0 0 r
raraarS
nn
j
n
j
jj
132
0
... +
=
++++== nn
j
j arararararrrS
nn
j
j ararararaarS +++++== =
...32
0
nn arararaararararSrS +++++++= + ..... 2132
M. HauskrechtCS 441 Discrete mathematics for CS
Geometric series
Theorem: The sum of the terms of a geometric progression a, ar,
ar2, ..., arn is
Proof:
multiply S by r
Substract
===
+
= =
1
1)(
1
0 0 r
raraarS
nn
j
n
j
jj
132
0
... +=
++++== n
n
j
j arararararrrS
nn
j
j ararararaarS +++++== =
...32
0
nn arararaararararSrS +++++++= + ..... 2132
aarn = +1
7/29/2019 Discrete Maths.Class 10
16/17
M. HauskrechtCS 441 Discrete mathematics for CS
Geometric series
Theorem: The sum of the terms of a geometric progression a, ar,
ar2, ..., arn is
Proof:
multiply S by r
Substract
===
+
= = 11
)(
1
0 0 r
raraarS
nn
j
n
j
jj
132
0
... +
=
++++== nn
j
j arararararrrS
nn
j
j ararararaarS +++++== =
...32
0
nn arararaararararSrS +++++++= + ..... 2132
aar
n = +1
=
=
++
1
1
1
11
r
ra
r
aarS
nn
M. HauskrechtCS 441 Discrete mathematics for CS
Geometric series
Example:
General formula:
===
+
= =
1
1)(
1
0 0 r
raraarS
nn
j
n
j
jj
=
==3
0
)5(2j
jS
=
==
= 15
15*2)5(2
43
0j
jS
312156*24
624*2
4
1625*2 ===
=
7/29/2019 Discrete Maths.Class 10
17/17
M. HauskrechtCS 441 Discrete mathematics for CS
Infinite geometric series
Infinite geometric series can be computed in the closed form
for x