Lenstra Chapter 2
Lenstra Chapter 2
here:
1. brief review of basic set-related concepts
2. brief mention of functions
3. focus on sequences and sums
A B A B A B A B A B
0 0 0 1 1 1 1
0 1 1 0 1 0 0
1 0 1 0 0 1 0
1 1 1 0 0 0 0
A B {x | x A B}
{x | ( x ( A B))}
{x | ( x A x B)}
{x | ( x A) ( x B)}
{x | ( x A) ( x B)}
{x | x A x B}
{x | x A B}
A B
prove A (A B)=A by showing and
• A (A B) A:
if x A (A B), then x A or x A B,
so:
x A
or
(x A and x B)
in either case x A
it thus follows that A (A B) A
• A (A B) A:
if x A, then x A (A B)
it thus follows that A (A B) A
Note on Venn diagrams
• Venn diagrams are pictures of sets,
drawn as subsets of some universal set U
• may be used for pictorial purposes
but never for proofs
• three sets intersecting
in all possible ways:
• four sets:
Note on Venn diagrams
• Venn diagrams are pictures of sets,
drawn as subsets of some universal set U
• may be used for pictorial purposes
but never for proofs
• 5, 7, and 11 sets intersecting
in all possible ways:
Returning to sets, a note on cardinalities
given finite sets A and B, what is |A B| ?
|A| is the cardinality of A
|B| is the cardinality of B
|A| + |B| is the cardinality of the union
A B of A and B, where all elements that
belong to both A and B are counted twice
thus: |A| + |B| = | A B | + | A B |
equivalently: | A B | = |A| + |B| | A B |
known as
the principle of inclusion and exclusion
(and an example of “proof by intimidation”; how to really prove this? )
Inclusion/exclusion example
A = {n Z : 0 n 100, n multiple of 5}
= {n Z : 0 n 100, 5|n}
B = {n Z : 0 n 100, 7|n}
|A| = 21, |B | = 15
what is |A B| ?
A B = {n Z:0 n 100, 5|n or 7|n }
|A| + |B| = 21 +15 = 36
counts multiples of both 5 and 7 twice:
A B = {n Z : 0 n 100, 5|n and 7|n }
= {0, 35, 70}
|A B| = |A| + |B| |A B| = 21 + 15 3 = 33
more complicated
A = {n Z : 0 n 100, 5|n}, |A| = 21
B = {n Z : 0 n 100, 7|n}, |B| = 15
C = {n Z : 0 n 100, 3|n}, |C| = 34
what is |A B C| ?
|A B C|=|A|+|B|+|C| |A B| |A C| |B C|+|A B C|
informally:
a sequence is a possibly infinite ordered list with
a first, a second, a third, a fourth, … element
slightly more formally:
a sequence is a function f from a subset of
the set of natural numbers (with or without 0)
to some other set S:
a1, a2, a3, … S
or
a0, a1, a2, … S
where ai = f(i)
common sequences
• 0, 1, 2, 3, 4, …
sequence of natural numbers, ni = i, i 0
• 0, 2, 4, 6, 8, …
sequence of even numbers 0, mi = 2i, i 0
• 1, 1, 2, 6, 24, 120, 720,…
sequence of factorials, fi = i!, i 0
• 2, 3, 5, 7, 11, 13, 17, 19, …
sequence of primes, pi is ith prime, i 1
• 0, 1, 1, 2, 3, 5, 8, 13, 21,…
Fibonacci sequence:
Fi = i for i = 0, 1, Fi = Fi 2+Fi 1 for i 2
crazy sequences
• 2, 2, 3, 3, 4, 4, 5, 5, 5, 5, 5, 6, …
bi = bitlength of pi, i 1
• 4, 3, 3, 5, 4, 4, 3, 5, 5, 4, 3, 6, …
(in French: 4, 2, 4, 5, 6, 4, 3, 4, 4, 4, 3, 4, …)
• 5, 6, 5, 6, 5, 5, 7, 6, 5, 5, 8, 7, …
(in French: 7, 8, 9, 9, 9, 7, 8, 8, 8, 7, 7, 8, ...)
• given an integer sequence
(such as 171, 277, 367, 561, 567, 18881,…),
how to find what it is?
encyclopedia of integer sequences
http://oeis.org/
Remarks on sequences
sequences do not necessarily consist of integers:
• xi =1/i (i>0)
• yi = ri for r R
sequences are not necessarily infinite:
• si = ith SD student (lexicographically or sciper-wise)
sequences are not necessarily well understood
2i
• 3, 5, 17, 257, 65537, …, primes 2 1
(are there more than five Fermat primes?)
• 3, 5, 7, 11, 13, 17, 19, 29, 31, 41, 43, …
(are there infinitely many twin primes?)
• primes 123456789101112131415…: any?
Common sequences
arithmetic progression: a sequence of the form
a, a+d, a+2d, a+3d,… , a+kd, … for a, d R
with initial term a and common difference d:
ith term ai equals a+id ( i>0 ai ai 1 = d )
k 1 Xk 1 1
thus Xf ( X ) f (X ) X 1 and f ( X ) (if X 1)
X 1
k
cleaner (without dots) : f ( X ) X i , then
i 0
k k k
i i
( X 1) f ( X ) ( X 1) X X X Xi
i 0 i 0 i 0
k k k 1 k k 1 k
i 1 i j i i
X X X X X Xi
i 0 i 0 j 1 i 0 i 1 i 0
k k
k 1 i 0
X X X Xi Xk 1
1
i 1 i 1
Sum of an arithmetic progression
k
ai a id , then a0 a1 a2 ... ak ai
i 0
k k k
(a id ) a id
i 0 i 0 i 0
k
(k 1)a d i
i 0
k (k 1) dk
here we use : (k 1)a d (k 1)(a )
k k k
2 2
i i i /2
i 1 i 1 i 1
let j=k+1 i, thus i=k+1 j; j=k when i=1 and j=1 when i=k; thus
k k k
i i (k 1 j ) / 2
i 1 i 1 j 1
k k k
j (k 1 j ) / 2 ( j (k 1 j )) / 2
j 1 j 1 j 1
k
k (k 1)
(k 1) / 2
j 1 2
k
Similar sum T (r ) ir i 1 , determined in two ways (for r 1)
i 0
k
rk 1 1
1 differentiating S (r ) ri leads to T (r ) S ' (r ) :
i 0 r 1
(k 1)r k (r 1) (r k 1
1) kr k 1
(k 1)r k 1
T (r ) S ' (r )
(r 1) 2 (r 1) 2
2 directly :
k k k
T (r ) ir i 1
ri 1
(i 1)r i 1
i 1 i 1 i 1
k 1 k k 1 k 1
ri r (i 1)r i 2
ri r ir i 1
i 0 i 1 i 0 i 0
k
r 1
r (T (r ) kr k 1 ) T (r ) follows
r 1