View
4
Download
0
Category
Preview:
Citation preview
이산수학이산수학(Discrete Mathematics) (Discrete Mathematics) 수열과수열과 합합
(S d S ti )(S d S ti )(Sequences and Summations)(Sequences and Summations)
20112011년년 봄학기봄학기
강원대학교강원대학교 컴퓨터과학전공컴퓨터과학전공 문양세문양세강원대학교강원대학교 컴퓨터과학전공컴퓨터과학전공 문양세문양세
IntroductionIntroduction3.2 Sequences and Summations
A sequence or series is just like an ordered n-tuple (a1, a2, …, an), except:, n), p
• Each element in the sequences has an associated index number.(각 element는 색인(index) 번호와 결합되는 특성을 가진다.)
• A sequence or series may be infinite. (무한할 수 있다.)
• Example: 1, 1/2, 1/3, 1/4, …
A summation is a compact notation for the sum of all A summation is a compact notation for the sum of all terms in a (possibly infinite) series. ()
Discrete Mathematicsby Yang-Sae MoonPage 2
SequencesSequences3.2 Sequences and Summations
Formally: A sequence {an} is identified with a generating function f:SA for some subset SN (S=N or S=N{0}) and f f ( { })for some set A. (수열 {an}은 자연수 집합으로부터 A로의 함수…)
If f is a generating function for a sequence {a } then for If f is a generating function for a sequence {an}, then for nS, the symbol an denotes f(n).
Th i d f i (O ft i i d )The index of an is n. (Or, often i is used.)
S Af
123
a1 = f(1)a2 = f(2)a = f(3)3
4
a3 = f(3)a4 = f(4)
Discrete Mathematicsby Yang-Sae MoonPage 3
Sequence ExamplesSequence Examples3.2 Sequences and Summations
Example of an infinite series (무한 수열)
• Consider the series {a } = a1 a2 where (n1) a = f(n) = 1/n• Consider the series {an} = a1, a2, …, where (n1) an= f(n) = 1/n.
• Then, {an} = 1, 1/2, 1/3, 1/4, …
Example with repetitions (반복 수열)p p
• Consider the sequence {bn} = b0, b1, … (note 0 is an index) where bn = (1)n.
• {bn} = 1, 1, 1, 1, …
• Note repetitions! {bn} denotes an infinite sequence of 1’s and 1’s, p { n} q ,not the 2-element set {1, 1}.
Discrete Mathematicsby Yang-Sae MoonPage 4
Recognizing Sequences (1/2)Recognizing Sequences (1/2)3.2 Sequences and Summations
Sometimes, you’re given the first few terms of a sequence,
and you are asked to find the sequence’s generating
function, or a procedure to enumerate the sequence., p q(순열의 몇몇 값들에 기반하여 f(n)을 발견하는 문제에 자주 직면하게 된다.)
Examples: What’s the next number and f(n)?p f( )
• 1, 2, 3, 4, … (the next number is 5. f(n) = n
• 1, 3, 5, 7, … (the next number is 9. f(n) = 2n − 1
Discrete Mathematicsby Yang-Sae MoonPage 5
Recognizing Sequences (2/2)Recognizing Sequences (2/2)3.2 Sequences and Summations
Trouble with recognition (of generating functions)
• The problem of finding “the” generating function given just an
initial subsequence is not well defined. (잘 정의된 방법이 없음)
• This is because there are infinitely many computable functions that
will generate any given initial subsequencewill generate any given initial subsequence.(세상에는 시퀀스를 생성하는 셀 수 없이 많은 함수가 존재한다.)
Discrete Mathematicsby Yang-Sae MoonPage 6
What are Strings? (1/2)What are Strings? (1/2) -- skipskip3.2 Sequences and Summations
Strings are often restricted to sequences composed of symbols drawn from a finite alphabet, and may be indexed y p , yfrom 0 or 1. (스트링은 유한한 알파벳으로 구성된 심볼의 시퀀스이고, 0(or 1)부터 색인될 수 있다.)
More formally,
• Let be a finite set of symbols, i.e. an alphabet.y p
• A string s over alphabet is any sequence {si} of symbols, si, indexed by N or N{0}.
• If a, b, c, … are symbols, the string s = a, b, c, … can also be written abc …(i.e., without commas).
• If s is a finite string and t is a string, the concatenation of s with t, written st, is the string consisting of the symbols in s followed by the symbols in t
Discrete Mathematicsby Yang-Sae MoonPage 7
the symbols in t.
What are Strings? (2/2)What are Strings? (2/2) -- skipskip3.2 Sequences and Summations
More string notation
Th l gth | | f fi it t i g i it b f iti (i it • The length |s| of a finite string s is its number of positions (i.e., its number of index values i).
If s is a finite string and n N sn denotes the concatenation of n• If s is a finite string and nN, sn denotes the concatenation of ncopies of s. (스트링 s를 n번 concatenation하는 표현)
denotes the empty string the string of length 0• denotes the empty string, the string of length 0.
• If is an alphabet and nN,
− n {s | s is a string over of length n} (길이 n인 스트링)
− * {s | s is a finite string over } (상에서 구현 가능한 유한 스트링)
Discrete Mathematicsby Yang-Sae MoonPage 8
Summation NotationSummation Notation3.2 Sequences and Summations
Given a sequence {an}, an integer lower bound j0, and an
integer upper bound kj then the summation of {a } from integer upper bound kj, then the summation of {an} from
j to k is written and defined as follows:({a }의 j번째에서 k번째까지의 합 즉 a 로부터 a 까지의 합)({an}의 j번째에서 k번째까지의 합, 즉, aj로부터 ak까지의 합)
kjjk
i
k
i a...aa:aa 1
H i i ll d th i d f ti
kjjji iji
i a...aa:aa
1
Here, i is called the index of summation.
Discrete Mathematicsby Yang-Sae MoonPage 9
Generalized SummationsGeneralized Summations3.2 Sequences and Summations
For an infinite series, we may write:
...aa:a jjji
i 1
To sum a function over all members of a set X={x1, x2, …}:(집합 X의 모든 원소 x에 대해서)
...)x(f)x(f:)x(fXx
21
Or, if X={x|P(x)}, we may just write:(P( )를 t 로 하는 모든 에 대해서)(P(x)를 true로 하는 모든 x에 대해서)
...)x(f)x(f:)x(f)(P
21
Discrete Mathematicsby Yang-Sae MoonPage 10
)x(P
Summation ExamplesSummation Examples3.2 Sequences and Summations
A simple example
4
2 2 2 2
21 2 1 3 1 4 1
ii
( ) ( ) ( )2
4 1 9 1 16 15 10 1732
i
( ) ( ) ( )
An infinite sequence with a finite sum:
32
An infinite sequence with a finite sum:
21222 41
2110
0
......i
i
Using a predicate to define a set of elements to sum over:
874925947532x 22222 Discrete Mathematicsby Yang-Sae MoonPage 11
874925947532x10) prime is (
xx
Summation Manipulations (1/2)Summation Manipulations (1/2)3.2 Sequences and Summations
Some useful identities for summations:
( ) ( )cf x c f x (Distributive law)
( ) ( )x xcf x c f x
( ) ( ) ( ) ( )x x xf x g x f x g x (Application of
commutativity)
( ) ( )k k n
f i f i n
( ) ( )i j i j nf i f i n
(Index shifting)
Discrete Mathematicsby Yang-Sae MoonPage 12
Summation Manipulations (2/2)Summation Manipulations (2/2)3.2 Sequences and Summations
Some more useful identities for summations:
1( ) ( ) ( ) if
k m k
i j i j i mf i f i f i j m k
(Series splitting)1i j i j i m
0( ) ( )
k jk
i j if i f k i
(Order reversal)
2k k
2
0 0( ) (2 ) (2 1)
k k
i if i f i f i
(Grouping)
Discrete Mathematicsby Yang-Sae MoonPage 13
An Interesting ExampleAn Interesting Example3.2 Sequences and Summations
“I’m so smart; give me any 2-digit number n, and I’ll add
ll h b f 1 i h d i j f all the numbers from 1 to n in my head in just a few
seconds.” (1에서 n까지의 합을 수초 내에 계산하겠다!)n
I.e., Evaluate the summation:
n
i
i1
There is a simple formula for the result, discovered by p , y
Euler at age 12!
Discrete Mathematicsby Yang-Sae MoonPage 14
Euler’s Trick, IllustratedEuler’s Trick, Illustrated3.2 Sequences and Summations
Consider the sum:
1 + 2 + … + (n/2) + ((n/2)+1) + … + (n-1) + n
n+1…
n+1n+1n+1
nn/2 pairs of elements, each pair summing to /2 pairs of elements, each pair summing to nn+1, for a +1, for a
total of (total of (nn/2)(n+1). /2)(n+1). (합이 n+1인 두 쌍의 element가 n/2개 있다.)
21)n(n
in
Discrete Mathematicsby Yang-Sae MoonPage 15
21i
Symbolic Derivation of Trick (1/2) Symbolic Derivation of Trick (1/2) -- skipskip3.2 Sequences and Summations
))k(i(iiiii)k(n
i
k
i
n
ki
k
i
k
i
n
i
11
0111
2
11
))k()i))k(n((i)k(nk
iikiiii
111
011111
kk
jk
i
k
ji
)ik(f)i(f
)ik(f)i(f0
))i((i)i(i
))()))(((
knk)k(nk
ii
11
01
ii
)ik(f)i(f00
))i(n(i)in(i
kkknk
iiii
11101
...)in(i)in(ik
i
k
i
kn
i
k
i
111111
Discrete Mathematicsby Yang-Sae MoonPage 16
kn 2 since
Symbolic Derivation of Trick (2/2) Symbolic Derivation of Trick (2/2) -- skipskip3.2 Sequences and Summations
kkkn 1 1
1111
)ini()in(iik
i
k
i
k
i
n
i
111 21
)n()n(k)n( nk
i
211
/)n(ni
So, you only have to do 1 easy multiplication in your head,
then cut in half.
Also works for odd n (prove it by yourself).
Discrete Mathematicsby Yang-Sae MoonPage 17
Geometric Progression (Geometric Progression (등비수열등비수열))3.2 Sequences and Summations
A geometric progression is a series of the form a, ar, ar2, 3 k h Rar3, …, ark, where a,rR.
The sum of such a sequence is given by:q g y
k
iarS
We can reduce this to closed form via clever manipulation
i 0
We can reduce this to closed form via clever manipulation
of summations...
1 11
kki rS ar a
Discrete Mathematicsby Yang-Sae MoonPage 18
0 1i r
Derivation of Geometric Sum (1/3) Derivation of Geometric Sum (1/3) -- skipskip3.2 Sequences and Summations
Sn
iarS
nnnn
i
i
0
rararrrararrrS
nnn
i
i
i
i
i
i
i
i
11
0
1
000
arararn
i
in
i
)i(n
i
i
1
1
1
1
11
0
1
...arararar nn
i
in
ni
in
i
i
1
1
1
11
Discrete Mathematicsby Yang-Sae MoonPage 19
Derivation of Geometric Sum (2/3) Derivation of Geometric Sum (2/3) -- skipskip3.2 Sequences and Summations
ni
ni 00
arar)arar(ararrS n
i
in
i
i 1
1
001
1
arararar nn
i
i 01
1
0
aararar nn
i
i
i
i 1
1
0
0
)r(aS)r(aar nnn
i
ii
11 11
10
)()(i 0
Discrete Mathematicsby Yang-Sae MoonPage 20
Derivation of Geometric Sum (3/3)Derivation of Geometric Sum (3/3) -- skipskip3.2 Sequences and Summations
)r(aSrS n 11
)r(aSrS
)r(aSrSn 1
11
r
)r(a)r(Sn
n
1
111
1
rr
raS 1 en wh
11
a)n(aaarSrn
i
n
i
in
i
i 111 ,1 when000
Discrete Mathematicsby Yang-Sae MoonPage 21
Nested SummationsNested Summations3.2 Sequences and Summations
These have the meaning you’d expect.
32144 34 34 3
ijiijij
432166644
11 11 11 1
)(ii
ii ji ji j
6010611
ii
Discrete Mathematicsby Yang-Sae MoonPage 22
Some Shortcut ExpressionsSome Shortcut Expressions3.2 Sequences and Summations
Sum Closed Form
1 rarn
k )r(a n 11
n
k
10
r,ark )r( 1
1)n(n k
k1
n
k2
2)(
121 )n)(n(n
n
k3
k
k1 6
))((
1 22 )n(n k
k1
1
xxk
4)(
110
x,xk
11
xkxk
x1
1Infinite series
(무한급수)
Discrete Mathematicsby Yang-Sae MoonPage 23
11
x,kxk
21 )x(
Infinite Series (Infinite Series (무한급수무한급수) (1/2) ) (1/2) -- skipskip3.2 Sequences and Summations
10
x,x
nn
11k
• Let a = 1 and r = x, then 11
0
1
k
n
kn
xx
kx
n
kj aar 1
i
jj
rar
0 1 since
• If k , then xk+1 0
• Therefore, xn
1
1Therefore,
xxx
n 1
10
Discrete Mathematicsby Yang-Sae MoonPage 24
Infinite Series (Infinite Series (무한급수무한급수) (2/2) ) (2/2) -- skipskip3.2 Sequences and Summations
10
1
x,kx
nn
xn
n
11
0 xn 10
dx
d n 1 d
1
xdxx
dx nn
10
1
recall)x('g)x(f)x(g)x('f
)(fd
nxxdxd nn
211
11
)x(nx
nn
2))x(g()(g)(f)(g)(f
)x(fdx
Discrete Mathematicsby Yang-Sae MoonPage 25
Using the ShortcutsUsing the Shortcuts3.2 Sequences and Summations
Example: Evaluate .
100
50
2
k
k
• Use series splitting.
50k
1002
492
1002
• Solve for desired
summation.
kkkkkk
49100100
50
2
1
2
1
2
• Apply quadratic
series rule
kkkkkk
49
1
2100
1
2100
50
2
series rule.
• Evaluate. 6995049
6201101100
.,,,
92529742540350338
Discrete Mathematicsby Yang-Sae MoonPage 26
Cardinality: Formal DefinitionCardinality: Formal Definition3.2 Sequences and Summations
For any two (possibly infinite) sets A and B, we say that A
and B have the same cardinality (written |A|=|B|) iff and B have the same cardinality (written |A|=|B|) iff
there exists a bijection (bijective function) from A to B.(집합 A에서 집합 B로의 전단사함수가 존재하면 A와 B의 크기는 동일하다 )(집합 A에서 집합 B로의 전단사함수가 존재하면, A와 B의 크기는 동일하다.)
When A and B are finite, it is easy to see that such a
function exists iff A and B have the same number of function exists iff A and B have the same number of
elements nN.(집합 A B가 유한집합이고 동일한 개수의 원소를 가지면 A와 B가 동일한 크기(집합 A, B가 유한집합이고 동일한 개수의 원소를 가지면, A와 B가 동일한 크기
임을 보이는 것은 간단하다.)
Discrete Mathematicsby Yang-Sae MoonPage 27
Countable versus UncountableCountable versus Uncountable3.2 Sequences and Summations
For any set S, if S is finite or if |S|=|N|, we say S is
countable Else S is uncountablecountable. Else, S is uncountable.(유한집합이거나, 자연수 집합과 크기가 동일하면 countable하며, 그렇지 않으
면 uncountable하다.)면 하다 )
Intuition behind “countable:” we can enumerate
( ti ll li t) l t f S E l N Z(sequentially list) elements of S. Examples: N, Z.(집합 S의 원소에 번호를 매길 수(순차적으로 나열할 수) 있다.)
Uncountable means: No series of elements of S (even an
infinite series) can include all of S’s elements.
Examples: R, R2
(어떠한 나열 방법도 집합 S의 모든 원소를 포함할 수 없다. 즉, 집합 S의 원소에
Discrete Mathematicsby Yang-Sae MoonPage 28
번호를 매길 수 있는 방법이 없다.)
Countable Sets: Examples Countable Sets: Examples 3.2 Sequences and Summations
Theorem: The set Z is countable.
P f C id f Z N h f(i) 2i f i 0 d f(i) 2i 1 f i 0 • Proof: Consider f:ZN where f(i)=2i for i0 and f(i) = 2i1 for i<0.
Note f is bijective. (…, f(2)=3, f(1)=1, f(0)=0, f(1)=2, f(2)=4, …)
Theorem: The set of all ordered pairs of natural numbers
(n,m) is countable.
(1,1)
(1 2)
(2,1)
(2 2)
(3,1)
(3 2)
(4,1)
(4 2)
(5,1)
(5 2)
… consider sum is 2, thenconsider sum is 3, thenconsider sum is 4, then
(1,2)
(1,3)
(2,2)
(2,3)
(3,2)
(3,3)
(4,2)
(4,3)
(5,2)
(5,3)
…
…
consider sum is 5, thenconsider sum is 6, thenconsider …
(1,4)
(1,5)
(2,4)
(2,5)
(3,4)
(3,5)
(4,4)
(4,5)
(5,4)
(5,5)
…
…Note a set of rational numbers is countable!
Discrete Mathematicsby Yang-Sae MoonPage 29
… … … … … …
Uncountable Sets: Example (1/2) Uncountable Sets: Example (1/2) –– skipskip3.2 Sequences and Summations
Theorem: The open interval
[0,1) : {rR| 0 r < 1} is uncountable. ([0,1)의 실수는 uncountable)[0,1) : {rR| 0 r < 1} is uncountable. ([0,1)의 실수는 uncountable)
Proof by Cantor
• Assume there is a series {ri} = r1, r2, ... containing all elements r[0,1).
• Consider listing the elements of {ri} in decimal notation in order of
increasing index:
r1 = 0.d1,1 d1,2 d1,3 d1,4 d1,5 d1,6 d1,7 d1,8…
r2 = 0.d2,1 d2,2 d2,3 d2,4 d2,5 d2,6 d2,7 d2,8…
r3 = 0.d3,1 d3,2 d3,3 d3,4 d3,5 d3,6 d3,7 d3,8…
0 d d d d d d d dr4 = 0.d4,1 d4,2 d4,3 d4,4 d4,5 d4,6 d4,7 d4,8…
…
Discrete Mathematicsby Yang-Sae MoonPage 30
• Now, consider r’ = 0.d1 d2 d3 d4 … where di = 4 if dii 4 and di = 5 if dii = 4.
Uncountable Sets: Example (2/2)Uncountable Sets: Example (2/2) –– skipskip3.2 Sequences and Summations
• E.g., a postulated enumeration of the reals:
r1 = 0 3 0 1 9 4 8 5 7 1 r1 0.3 0 1 9 4 8 5 7 1 …
r2 = 0.1 0 3 9 1 8 4 8 1 …
r3 = 0.0 3 4 1 9 4 1 9 3 …3
r4 = 0.9 1 8 2 3 7 4 6 1 …
……
• OK, now let’s make r’ by replacing dii by the rule.
(Rule: r’ = 0 d1 d2 d3 d4 where di = 4 if dii 4 and di = 5 if dii = 4)(Rule: r 0.d1 d2 d3 d4 … where di 4 if dii 4 and di 5 if dii 4)
• r’ = 0.4454… can’t be on the list anywhere!
• This means that the assumption({ri} is countable) is wrong,
and thus, [0,1), {ri}, is uncountable.
Discrete Mathematicsby Yang-Sae MoonPage 31
Recommended