- 3. Examples
Show Correctness, Recursion and Recurrences [References to literatur at the examples]
41
3. Examples Show Correctness, Recursion and Recurrences [References - - PowerPoint PPT Presentation
3. Examples Show Correctness, Recursion and Recurrences [References to literatur at the examples] 41 3.1 Ancient Egyptian Multiplication Ancient Egyptian Multiplication Example on how to show correctness of algorithms. 42 Ancient Egyptian
41
42
3
3Also known as russian multiplication
43
44
45
2
2
46
2
2
47
2)
2 )
48
49
2)
2 )
50
!
0<·≤b
i.H.
i.H.
52
53
54
55
56
58
59
b 2n ≤ 1 holds for n ≥ log2 b. Consequently not more than 6⌈log2 b⌉
60
61
62
63
64
65
66
n
2
67
68
!
69
R
R
H(k)
71
4In March 2019, David Harvey and Joris van der Hoeven have shown an O(n log n)
algorithm that is practically irrelevent yet. It is conjectured, but yet unproven that this is the best lower bound we can get.
72
2n
73
i=0 ̺i mit ̺ = 2/3 konvergiert für k → ∞ gegen 1 1−̺ = 3.
74
75
76
j
k=i ak.
1 2 3 4 5 6 7 8 9 50 100
77
k=I ak maximal.
k=i ak
78
n
n
n
n−i
n
n−i+1
n
n
n
n
n(2n + 1)(n + 1)
j
j
i−1
i
80
k=J ak maximal.
81
n
n
n
n
n
83
84
85
1≤i≤n/2 n/2<j≤n j
1≤i≤n/2 n/2<j≤n
n/2
j
1≤i≤n/2 n/2
n/2<j≤n j
1≤i≤n/2 Sn/2 − Si−1
n/2<j≤n Sj − Sn/2
86
k=i′ ak.
87
88
k=i′ ak.
89
2) + a · n
90
k−1
92
j
k=i ak}.
93
94
95
97
n
98
n
n
n
n
n
n
99
n
n
n
n−1
n
n
n
n
i=1 ik ∈ Θ(nk+1).
100
n
!
n
n
n
n
n+1
∞
101