![Page 1: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/1.jpg)
IntroductionMaths
Complexité
Ivan Noyer
Lycée Thiers
1/30 Ivan Noyer Complexité
![Page 2: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/2.jpg)
IntroductionMaths
1 Introduction
2 MathsRécurrences d'ordre 1Diviser pour régner
2/30 Ivan Noyer Complexité
![Page 3: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/3.jpg)
IntroductionMaths
1 Introduction
2 MathsRécurrences d'ordre 1Diviser pour régner
3/30 Ivan Noyer Complexité
![Page 4: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/4.jpg)
IntroductionMaths
Crédits
1 � Option informatique MPSI, MP/MP* �, Roger Mansuy,paru chez Vuibert.
2 Cours � diviser pour régner �, Becirspahic
3 Wikipédia : Analyse de la compléxité des algorithmes.
4/30 Ivan Noyer Complexité
![Page 5: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/5.jpg)
IntroductionMaths
Crédits
1 � Option informatique MPSI, MP/MP* �, Roger Mansuy,paru chez Vuibert.
2 Cours � diviser pour régner �, Becirspahic
3 Wikipédia : Analyse de la compléxité des algorithmes.
4/30 Ivan Noyer Complexité
![Page 6: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/6.jpg)
IntroductionMaths
Crédits
1 � Option informatique MPSI, MP/MP* �, Roger Mansuy,paru chez Vuibert.
2 Cours � diviser pour régner �, Becirspahic
3 Wikipédia : Analyse de la compléxité des algorithmes.
4/30 Ivan Noyer Complexité
![Page 7: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/7.jpg)
IntroductionMaths
Dé�nition
L'analyse de la complexité d'un algorithme consiste en l'étudeformelle de la quantité de ressources (par exemple de temps oud'espace) nécessaire à l'exécution de cet algorithme.
En temps Il s'agit de savoir si une fonction termine dans untemps raisonnable.
En mémoire Il s'agit de déterminer si la fonction dispose biende toutes les ressources physiques pour s'exécuter.
5/30 Ivan Noyer Complexité
![Page 8: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/8.jpg)
IntroductionMaths
Dé�nition
L'analyse de la complexité d'un algorithme consiste en l'étudeformelle de la quantité de ressources (par exemple de temps oud'espace) nécessaire à l'exécution de cet algorithme.
En temps Il s'agit de savoir si une fonction termine dans untemps raisonnable.
En mémoire Il s'agit de déterminer si la fonction dispose biende toutes les ressources physiques pour s'exécuter.
5/30 Ivan Noyer Complexité
![Page 9: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/9.jpg)
IntroductionMaths
Temps et espace
Soit f un programme prenant en paramètre une donnée d
Complexité en espace pour une donnée d : dénombrer toutesles a�ectations di�érentes lors de l'appel f (d).
Complexité en temps pour une donnée d : dénombrer toutesles opérations e�ectuées lors de l'appel f (d) et faire la sommede la durée de chacune.
En général, on ne s'intéresse qu'à certaines opérations (çadépend de ce qu'on veut étudier).
6/30 Ivan Noyer Complexité
![Page 10: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/10.jpg)
IntroductionMaths
Temps et espace
Soit f un programme prenant en paramètre une donnée d
Complexité en espace pour une donnée d : dénombrer toutesles a�ectations di�érentes lors de l'appel f (d).
Complexité en temps pour une donnée d : dénombrer toutesles opérations e�ectuées lors de l'appel f (d) et faire la sommede la durée de chacune.
En général, on ne s'intéresse qu'à certaines opérations (çadépend de ce qu'on veut étudier).
6/30 Ivan Noyer Complexité
![Page 11: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/11.jpg)
IntroductionMaths
Temps et espace
Soit f un programme prenant en paramètre une donnée d
Complexité en espace pour une donnée d : dénombrer toutesles a�ectations di�érentes lors de l'appel f (d).
Complexité en temps pour une donnée d : dénombrer toutesles opérations e�ectuées lors de l'appel f (d) et faire la sommede la durée de chacune.
En général, on ne s'intéresse qu'à certaines opérations (çadépend de ce qu'on veut étudier).
6/30 Ivan Noyer Complexité
![Page 12: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/12.jpg)
IntroductionMaths
Dé�nition
Dé�nition
Notons Dn l'ensemble des données de taille n et C (d) la complexitéd'un certain programme pour une donnée d .
1 La complexité dans le pire cas est Cmax(n) = maxd∈Dn
C (d)
2 La complexité dans le meilleur cas est Cmin(n) = mind∈Dn
C (d)
3 La complexité en moyenne est Cmoy(n) =∑d∈Dn
P(d)C (d) où
P désigne la loi de probabilité associée à l'apparition desdonnées de taille n.
7/30 Ivan Noyer Complexité
![Page 13: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/13.jpg)
IntroductionMaths
Dé�nition
Dé�nition
Notons Dn l'ensemble des données de taille n et C (d) la complexitéd'un certain programme pour une donnée d .
1 La complexité dans le pire cas est Cmax(n) = maxd∈Dn
C (d)
2 La complexité dans le meilleur cas est Cmin(n) = mind∈Dn
C (d)
3 La complexité en moyenne est Cmoy(n) =∑d∈Dn
P(d)C (d) où
P désigne la loi de probabilité associée à l'apparition desdonnées de taille n.
7/30 Ivan Noyer Complexité
![Page 14: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/14.jpg)
IntroductionMaths
Dé�nition
Dé�nition
Notons Dn l'ensemble des données de taille n et C (d) la complexitéd'un certain programme pour une donnée d .
1 La complexité dans le pire cas est Cmax(n) = maxd∈Dn
C (d)
2 La complexité dans le meilleur cas est Cmin(n) = mind∈Dn
C (d)
3 La complexité en moyenne est Cmoy(n) =∑d∈Dn
P(d)C (d) où
P désigne la loi de probabilité associée à l'apparition desdonnées de taille n.
7/30 Ivan Noyer Complexité
![Page 15: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/15.jpg)
IntroductionMaths
Landau
Dé�nition
Soient U = (un) et V = (vn) deux suites réelles positives. On ditque :
1 U est dominée par V si il existe λ ∈ R+ et N ∈ N tels quepour tout n ∈ N, si n ≥ N alors un ≤ λvn. On le noteun = O(vn).On dit aussi que V domine U.
2 U et V sont de même ordre (de grandeur) si U domine V etV domine U (i.e. un = O(vn) et vn = O(un)). On le noteun = Θ(vn) (� un est en grand theta de vn �).
Remarque
Si un ∼ vn alors un = Θ(vn).
8/30 Ivan Noyer Complexité
![Page 16: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/16.jpg)
IntroductionMaths
Landau
Dé�nition
Soient U = (un) et V = (vn) deux suites réelles positives. On ditque :
1 U est dominée par V si il existe λ ∈ R+ et N ∈ N tels quepour tout n ∈ N, si n ≥ N alors un ≤ λvn. On le noteun = O(vn).On dit aussi que V domine U.
2 U et V sont de même ordre (de grandeur) si U domine V etV domine U (i.e. un = O(vn) et vn = O(un)). On le noteun = Θ(vn) (� un est en grand theta de vn �).
Remarque
Si un ∼ vn alors un = Θ(vn).
8/30 Ivan Noyer Complexité
![Page 17: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/17.jpg)
IntroductionMaths
Ordres de grandeur
Pour une donnée de taille n :Dénomination Dé�nition Exemple
logarithmique Θ(log(n)) Recherche dans une liste triée
linéaire Θ(n) Inversion d'une liste
quasi-linéaire Θ(n log(n)) Tri fusion
polynomiale Θ(nk) pour un k > 1 Calcul matriciel naïf en O(n3)
exponentielle Θ(αn) pour un α > 1 Satis�abilité d'une formule
9/30 Ivan Noyer Complexité
![Page 18: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/18.jpg)
IntroductionMaths
Remarques
Un terme en Θ(n) est en Θ(kn) pour tout k > 0
Un terme en Θ(log(n)) est en Θ(logk(n)) pour tout k > 0
10/30 Ivan Noyer Complexité
![Page 19: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/19.jpg)
IntroductionMaths
Récurrences d'ordre 1Diviser pour régner
1 Introduction
2 MathsRécurrences d'ordre 1Diviser pour régner
11/30 Ivan Noyer Complexité
![Page 20: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/20.jpg)
IntroductionMaths
Récurrences d'ordre 1Diviser pour régner
1 Introduction
2 MathsRécurrences d'ordre 1Diviser pour régner
12/30 Ivan Noyer Complexité
![Page 21: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/21.jpg)
IntroductionMaths
Récurrences d'ordre 1Diviser pour régner
Sommes
Dans ce qui suit,sauf mention du contraire les nombres et les suitesconsidérés sont positifs.
Proposition
Pour tous q > 1, α > 0, β > 0∑nk=0 q
k = Θ(qn+1)∑nk=0 k
α = Θ(nα+1)∑nk=0 k
α(ln k)β = Θ(nα+1 ln(n)β)
13/30 Ivan Noyer Complexité
![Page 22: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/22.jpg)
IntroductionMaths
Récurrences d'ordre 1Diviser pour régner
Récurrences d'ordre 1
Proposition
Soient a, b, λ des réels > 0.Soient (bn) et (un) deux suites réelles véri�ant pour tout n ∈ N :
un+1 = aun + bn1 Si bn = o(nα) (α quelconque) et a > 1, alors un = Θ(an)
2 Si bn ∼ λbn avec λ > 0
1 si b < a alors un = Θ(an)2 si b > a alors un = Θ(bn)
3 si bn ∼ λan avec λ > 0 alors un = Θ(nan)
14/30 Ivan Noyer Complexité
![Page 23: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/23.jpg)
IntroductionMaths
Récurrences d'ordre 1Diviser pour régner
Récurrences d'ordre 1
Proposition
Soient a, b, λ des réels > 0.Soient (bn) et (un) deux suites réelles véri�ant pour tout n ∈ N :
un+1 = aun + bn1 Si bn = o(nα) (α quelconque) et a > 1, alors un = Θ(an)2 Si bn ∼ λbn avec λ > 0
1 si b < a alors un = Θ(an)2 si b > a alors un = Θ(bn)
3 si bn ∼ λan avec λ > 0 alors un = Θ(nan)
14/30 Ivan Noyer Complexité
![Page 24: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/24.jpg)
IntroductionMaths
Récurrences d'ordre 1Diviser pour régner
Récurrences d'ordre 1
Proposition
Soient a, b, λ des réels > 0.Soient (bn) et (un) deux suites réelles véri�ant pour tout n ∈ N :
un+1 = aun + bn1 Si bn = o(nα) (α quelconque) et a > 1, alors un = Θ(an)2 Si bn ∼ λbn avec λ > 0
1 si b < a alors un = Θ(an)
2 si b > a alors un = Θ(bn)
3 si bn ∼ λan avec λ > 0 alors un = Θ(nan)
14/30 Ivan Noyer Complexité
![Page 25: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/25.jpg)
IntroductionMaths
Récurrences d'ordre 1Diviser pour régner
Récurrences d'ordre 1
Proposition
Soient a, b, λ des réels > 0.Soient (bn) et (un) deux suites réelles véri�ant pour tout n ∈ N :
un+1 = aun + bn1 Si bn = o(nα) (α quelconque) et a > 1, alors un = Θ(an)2 Si bn ∼ λbn avec λ > 0
1 si b < a alors un = Θ(an)2 si b > a alors un = Θ(bn)
3 si bn ∼ λan avec λ > 0 alors un = Θ(nan)
14/30 Ivan Noyer Complexité
![Page 26: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/26.jpg)
IntroductionMaths
Récurrences d'ordre 1Diviser pour régner
Récurrences d'ordre 1
Proposition
Soient a, b, λ des réels > 0.Soient (bn) et (un) deux suites réelles véri�ant pour tout n ∈ N :
un+1 = aun + bn1 Si bn = o(nα) (α quelconque) et a > 1, alors un = Θ(an)2 Si bn ∼ λbn avec λ > 0
1 si b < a alors un = Θ(an)2 si b > a alors un = Θ(bn)
3 si bn ∼ λan avec λ > 0 alors un = Θ(nan)
14/30 Ivan Noyer Complexité
![Page 27: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/27.jpg)
IntroductionMaths
Récurrences d'ordre 1Diviser pour régner
Lemme
Lemme
Soient∑
un et∑
vn deux séries ATP non nulles (alors∑nk=0 vk 6= 0 apcr). Si un ∼ vn (resp. un = Θ(vn)) et
∑un diverge
alors∑n
k=0 uk ∼∑n
k=0 vk (resp.∑n
k=0 uk = Θ(∑n
k=0 vk)).
15/30 Ivan Noyer Complexité
![Page 28: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/28.jpg)
IntroductionMaths
Récurrences d'ordre 1Diviser pour régner
Preuve du lemme
Si un ∼ vn. Soit 1 > ε > 0 et N tel que si N < n on a(1− ε)vn ≤ un ≤ (1 + ε)vn. On prend donc n > N :
N∑k=0
uk + (1− ε)n∑
k=N+1
vk ≤n∑
k=0
uk =N∑
k=0
uk +n∑
k=N+1
uk
≤N∑
k=0
uk + (1 + ε)n∑
k=N+1
vk
Encadrement∑n
0 uk par∑N
k=0 uk + (1± ε)∑n
k=N+1 vk
16/30 Ivan Noyer Complexité
![Page 29: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/29.jpg)
IntroductionMaths
Récurrences d'ordre 1Diviser pour régner
Preuve du lemme
Si un ∼ vn. Soit 1 > ε > 0 et N tel que si N < n on a(1− ε)vn ≤ un ≤ (1 + ε)vn. On prend donc n > N :
Encadrement∑n
0 uk par∑N
k=0 uk + (1± ε)∑n
k=N+1 vk
Comme∑
vk diverge,
−∑N
k=0 vk∑nk=0 vk︸ ︷︷ ︸→0
+
∑nk=0 vk∑nk=0 vk︸ ︷︷ ︸=1
=
∑nk=N+1 vk∑nk=0 vk
rqe : dénomin. non nul apcr
donc∑n
k=N+1 vk ∼n→+∞∑n
k=0 vk
16/30 Ivan Noyer Complexité
![Page 30: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/30.jpg)
IntroductionMaths
Récurrences d'ordre 1Diviser pour régner
Preuve du lemme
Si un ∼ vn. Soit 1 > ε > 0 et N tel que si N < n on a(1− ε)vn ≤ un ≤ (1 + ε)vn. On prend donc n > N :
Encadrement∑n
0 uk par∑N
k=0 uk + (1± ε)∑n
k=N+1 vk
donc∑n
k=N+1 vk ∼n→+∞∑n
k=0 vk
On achève la preuve avec :∑Nk=0 uk∑nk=0 vk︸ ︷︷ ︸→0
+(1− ε)
∑nk=N+1 vk∑nk=0 vk︸ ︷︷ ︸→1
≤∑n
k=0 uk∑nk=0 vk
≤∑N
k=0 uk∑nk=0 vk
+ (1 + ε)
∑nk=N+1 vk∑nk=0 vk
16/30 Ivan Noyer Complexité
![Page 31: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/31.jpg)
IntroductionMaths
Récurrences d'ordre 1Diviser pour régner
PreuveObservation préliminaire
un+1 = aun + bn. On pose vn =unan
(notamment v0 = u0).
Alors un = anvn et vn+1 = vn +bnan+1
.
Donc
vn+1 = vn−1+bnan+1
+bn−1an
= vn−2+bnan+1
+bn−1an
+bn−2an−1
= . . .
Alors
vn = v0︸︷︷︸=u0
+n−1∑k=0
bkak+1
Donc un = an(u0 +n−1∑k=0
bkak+1
)
17/30 Ivan Noyer Complexité
![Page 32: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/32.jpg)
IntroductionMaths
Récurrences d'ordre 1Diviser pour régner
PreuveObservation préliminaire
un+1 = aun + bn. On pose vn =unan
(notamment v0 = u0).
Alors un = anvn et vn+1 = vn +bnan+1
.
Donc
vn+1 = vn−1+bnan+1
+bn−1an
= vn−2+bnan+1
+bn−1an
+bn−2an−1
= . . .
Alors
vn = v0︸︷︷︸=u0
+n−1∑k=0
bkak+1
Donc un = an(u0 +n−1∑k=0
bkak+1
)
17/30 Ivan Noyer Complexité
![Page 33: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/33.jpg)
IntroductionMaths
Récurrences d'ordre 1Diviser pour régner
PreuveObservation préliminaire
un+1 = aun + bn. On pose vn =unan
(notamment v0 = u0).
Alors un = anvn et vn+1 = vn +bnan+1
.
Donc
vn+1 = vn−1+bnan+1
+bn−1an
= vn−2+bnan+1
+bn−1an
+bn−2an−1
= . . .
Alors
vn = v0︸︷︷︸=u0
+n−1∑k=0
bkak+1
Donc un = an(u0 +n−1∑k=0
bkak+1
)
17/30 Ivan Noyer Complexité
![Page 34: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/34.jpg)
IntroductionMaths
Récurrences d'ordre 1Diviser pour régner
PreuveObservation préliminaire
un+1 = aun + bn. On pose vn =unan
(notamment v0 = u0).
Alors un = anvn et vn+1 = vn +bnan+1
.
Donc
vn+1 = vn−1+bnan+1
+bn−1an
= vn−2+bnan+1
+bn−1an
+bn−2an−1
= . . .
Alors
vn = v0︸︷︷︸=u0
+n−1∑k=0
bkak+1
Donc un = an(u0 +n−1∑k=0
bkak+1
)
17/30 Ivan Noyer Complexité
![Page 35: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/35.jpg)
IntroductionMaths
Récurrences d'ordre 1Diviser pour régner
PreuveCas bn = o(nα)
un = an(u0 +n−1∑k=0
bkak+1
). Si bn = o(nα) et a > 1 :
Pour ε > 0, existe Nε > 0 tel que si k > Nε > 0 : |bk | < εkα
Donc pourk > Nε :|bk |ak+1
≤ ε kα
ak+1∑ bkak+1
est ACV.
Donc . Alors un = Θ(an)
Si bn ∼ λbn et b < a, même résultat car∑ bk
ak+1converge
aussi (même comportement que1
a
∑(b
a
)k
).
18/30 Ivan Noyer Complexité
![Page 36: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/36.jpg)
IntroductionMaths
Récurrences d'ordre 1Diviser pour régner
PreuveCas bn = o(nα)
un = an(u0 +n−1∑k=0
bkak+1
). Si bn = o(nα) et a > 1 :
Pour ε > 0, existe Nε > 0 tel que si k > Nε > 0 : |bk | < εkα
Donc pourk > Nε :|bk |ak+1
≤ ε kα
ak+1
∑ bkak+1
est ACV.
Donc . Alors un = Θ(an)
Si bn ∼ λbn et b < a, même résultat car∑ bk
ak+1converge
aussi (même comportement que1
a
∑(b
a
)k
).
18/30 Ivan Noyer Complexité
![Page 37: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/37.jpg)
IntroductionMaths
Récurrences d'ordre 1Diviser pour régner
PreuveCas bn = o(nα)
un = an(u0 +n−1∑k=0
bkak+1
). Si bn = o(nα) et a > 1 :
Pour ε > 0, existe Nε > 0 tel que si k > Nε > 0 : |bk | < εkα
Donc pourk > Nε :|bk |ak+1
≤ ε kα
ak+1
On a a > 1 d'où k2kα
ak=
k2+α
ak= ok→+∞(1) (th. des
croissances comparées) donckα
ak= o( 1
a2). Il vient que
1
aε∑ kα
akconverge. Donc
∑ bkak+1
est ACV.
Donc . Alors un = Θ(an)
Si bn ∼ λbn et b < a, même résultat car∑ bk
ak+1converge
aussi (même comportement que1
a
∑(b
a
)k
).
18/30 Ivan Noyer Complexité
![Page 38: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/38.jpg)
IntroductionMaths
Récurrences d'ordre 1Diviser pour régner
PreuveCas bn = o(nα)
un = an(u0 +n−1∑k=0
bkak+1
). Si bn = o(nα) et a > 1 :
Pour ε > 0, existe Nε > 0 tel que si k > Nε > 0 : |bk | < εkα
Donc pourk > Nε :|bk |ak+1
≤ ε kα
ak+1∑ bkak+1
est ACV.
Donc un = an (u0 +n−1∑k=0
bkak+1
)︸ ︷︷ ︸CV
. Alors un = Θ(an)
Si bn ∼ λbn et b < a, même résultat car∑ bk
ak+1converge
aussi (même comportement que1
a
∑(b
a
)k
).
18/30 Ivan Noyer Complexité
![Page 39: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/39.jpg)
IntroductionMaths
Récurrences d'ordre 1Diviser pour régner
PreuveCas bn = o(nα)
un = an(u0 +n−1∑k=0
bkak+1
). Si bn = o(nα) et a > 1 :
Pour ε > 0, existe Nε > 0 tel que si k > Nε > 0 : |bk | < εkα
Donc pourk > Nε :|bk |ak+1
≤ ε kα
ak+1∑ bkak+1
est ACV.
Donc un = an(u0 +n−1∑k=0
bkak+1
). Alors un = Θ(an)
Si bn ∼ λbn et b < a, même résultat car∑ bk
ak+1converge
aussi (même comportement que1
a
∑(b
a
)k
).
18/30 Ivan Noyer Complexité
![Page 40: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/40.jpg)
IntroductionMaths
Récurrences d'ordre 1Diviser pour régner
PreuveCas bn ∼ λan
On abkak+1
∼ λak
ak+1∼ λ
aet∑ λ
adiverge
Doncn−1∑k=0
bkak+1
∼n−1∑k=0
λak
ak+1. Donc
n−1∑k=0
bkak+1
∼ nλ
a
Donc un ∼ an(u0 + nλ
a). Ainsi un est de l'ordre de grandeur de
1ana
n, i.e. de nan.
19/30 Ivan Noyer Complexité
![Page 41: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/41.jpg)
IntroductionMaths
Récurrences d'ordre 1Diviser pour régner
PreuveCas bn ∼ λan
On abkak+1
∼ λak
ak+1∼ λ
aet∑ λ
adiverge
Doncn−1∑k=0
bkak+1
∼n−1∑k=0
λak
ak+1. Donc
n−1∑k=0
bkak+1
∼ nλ
a
Donc un ∼ an(u0 + nλ
a). Ainsi un est de l'ordre de grandeur de
1ana
n, i.e. de nan.
19/30 Ivan Noyer Complexité
![Page 42: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/42.jpg)
IntroductionMaths
Récurrences d'ordre 1Diviser pour régner
PreuveCas bn ∼ λan
On abkak+1
∼ λak
ak+1∼ λ
aet∑ λ
adiverge
Doncn−1∑k=0
bkak+1
∼n−1∑k=0
λak
ak+1. Donc
n−1∑k=0
bkak+1
∼ nλ
a
Donc un ∼ an(u0 + nλ
a). Ainsi un est de l'ordre de grandeur de
1ana
n, i.e. de nan.
19/30 Ivan Noyer Complexité
![Page 43: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/43.jpg)
IntroductionMaths
Récurrences d'ordre 1Diviser pour régner
PreuveCas bn ∼ λbn et b > a
On abkak+1
∼ λbk
ak+1∼ λ
a
(b
a
)k
avecb
a> 1
Par le lemme (puisque∑
k
(b
a
)k
diverge) :
n∑k=0
bkak+1
∼ λ
a
n∑k=0
(b
a
)k
Donc
un = an(u0 +n−1∑k=0
bkak+1
) ∼ an+1(u0 +λ
a
n−1∑k=0
(b
a
)k
)
= Θ
(an(u0 +
(b
a
)n
)
)= Θ(bn).
20/30 Ivan Noyer Complexité
![Page 44: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/44.jpg)
IntroductionMaths
Récurrences d'ordre 1Diviser pour régner
PreuveCas bn ∼ λbn et b > a
On abkak+1
∼ λbk
ak+1∼ λ
a
(b
a
)k
avecb
a> 1
Par le lemme (puisque∑
k
(b
a
)k
diverge) :
n∑k=0
bkak+1
∼ λ
a
n∑k=0
(b
a
)k
Donc
un = an(u0 +n−1∑k=0
bkak+1
) ∼ an+1(u0 +λ
a
n−1∑k=0
(b
a
)k
)
= Θ
(an(u0 +
(b
a
)n
)
)= Θ(bn).
20/30 Ivan Noyer Complexité
![Page 45: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/45.jpg)
IntroductionMaths
Récurrences d'ordre 1Diviser pour régner
PreuveCas bn ∼ λbn et b > a
On abkak+1
∼ λbk
ak+1∼ λ
a
(b
a
)k
avecb
a> 1
Par le lemme (puisque∑
k
(b
a
)k
diverge) :
n∑k=0
bkak+1
∼ λ
a
n∑k=0
(b
a
)k
Donc
un = an(u0 +n−1∑k=0
bkak+1
) ∼ an+1(u0 +λ
a
n−1∑k=0
(b
a
)k
)
= Θ
(an(u0 +
(b
a
)n
)
)= Θ(bn).
20/30 Ivan Noyer Complexité
![Page 46: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/46.jpg)
IntroductionMaths
Récurrences d'ordre 1Diviser pour régner
1 Introduction
2 MathsRécurrences d'ordre 1Diviser pour régner
21/30 Ivan Noyer Complexité
![Page 47: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/47.jpg)
IntroductionMaths
Récurrences d'ordre 1Diviser pour régner
Présentation
Dé�nition
Une suite (un)n>0 est de type diviser pour régner (en abrégé, DPR)si s'il existe une suite (bn)n ATP et deux réels positifs a, b non tousdeux nuls tels que
un = aubn/2c + budn/2e + bn
22/30 Ivan Noyer Complexité
![Page 48: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/48.jpg)
IntroductionMaths
Récurrences d'ordre 1Diviser pour régner
Simpli�er le dernier terme
Proposition (dernier terme simpli�é)
Soient (un)n>0 et (vn)n>0 deux suites ATP, deux entiers a, bpositifs non tous deux nuls, (bn) et (b′n) deux suites positives de
même ordre de grandeur.
Si u1 = v1 etun = aubn/2c + budn/2e + bnvn = avbn/2c + bvdn/2e + b′n
alors (un) et (vn) sont du même ordre de grandeur.
Dans la pratique, on remplace sans se gêner (bn) par une suite plussimple à manipuler de même ordre de grandeur.
23/30 Ivan Noyer Complexité
![Page 49: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/49.jpg)
IntroductionMaths
Récurrences d'ordre 1Diviser pour régner
Simpli�er le dernier termePreuve
Comme bn = Θ(b′n), on a λ,N positifs pour lesquels si n > N alorsbn ≤ λb′n.
Comme les suites sont positives, il existe λ1, λN positifs telsque bi ≤ λib′i (i ∈ J1,NK), et on pose µ = max(λ, λ1, . . . , λN)
On pose c = max(a, b, 1, µ). On a donc bn ≤ cb′n pour tout n.
On sait un ≥ 0. On montre que un ≤ cvn par récurrence
u1 = v1 ≤ cv1Si uk ≤ cvk pour tout k tel que n > k ≥ 1 alors
un = au bn/2c︸ ︷︷ ︸<n car n > 1
+budn/2e+bn ≤︸︷︷︸HR
cavbn/2c+cbvdn/2e+cb′n ≤ cvn︸︷︷︸=O(vn)
De même, vn = O(un).
24/30 Ivan Noyer Complexité
![Page 50: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/50.jpg)
IntroductionMaths
Récurrences d'ordre 1Diviser pour régner
Simpli�er le dernier termePreuve
Comme bn = Θ(b′n), on a λ,N positifs pour lesquels si n > N alorsbn ≤ λb′n.
Comme les suites sont positives, il existe λ1, λN positifs telsque bi ≤ λib′i (i ∈ J1,NK), et on pose µ = max(λ, λ1, . . . , λN)
On pose c = max(a, b, 1, µ). On a donc bn ≤ cb′n pour tout n.
On sait un ≥ 0. On montre que un ≤ cvn par récurrence
u1 = v1 ≤ cv1Si uk ≤ cvk pour tout k tel que n > k ≥ 1 alors
un = au bn/2c︸ ︷︷ ︸<n car n > 1
+budn/2e+bn ≤︸︷︷︸HR
cavbn/2c+cbvdn/2e+cb′n ≤ cvn︸︷︷︸=O(vn)
De même, vn = O(un).
24/30 Ivan Noyer Complexité
![Page 51: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/51.jpg)
IntroductionMaths
Récurrences d'ordre 1Diviser pour régner
Simpli�er le dernier termePreuve
Comme bn = Θ(b′n), on a λ,N positifs pour lesquels si n > N alorsbn ≤ λb′n.
Comme les suites sont positives, il existe λ1, λN positifs telsque bi ≤ λib′i (i ∈ J1,NK), et on pose µ = max(λ, λ1, . . . , λN)
On pose c = max(a, b, 1, µ). On a donc bn ≤ cb′n pour tout n.
On sait un ≥ 0. On montre que un ≤ cvn par récurrence
u1 = v1 ≤ cv1Si uk ≤ cvk pour tout k tel que n > k ≥ 1 alors
un = au bn/2c︸ ︷︷ ︸<n car n > 1
+budn/2e+bn ≤︸︷︷︸HR
cavbn/2c+cbvdn/2e+cb′n ≤ cvn︸︷︷︸=O(vn)
De même, vn = O(un).
24/30 Ivan Noyer Complexité
![Page 52: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/52.jpg)
IntroductionMaths
Récurrences d'ordre 1Diviser pour régner
Simpli�er le dernier termePreuve
Comme bn = Θ(b′n), on a λ,N positifs pour lesquels si n > N alorsbn ≤ λb′n.
Comme les suites sont positives, il existe λ1, λN positifs telsque bi ≤ λib′i (i ∈ J1,NK), et on pose µ = max(λ, λ1, . . . , λN)
On pose c = max(a, b, 1, µ). On a donc bn ≤ cb′n pour tout n.
On sait un ≥ 0. On montre que un ≤ cvn par récurrence
u1 = v1 ≤ cv1
Si uk ≤ cvk pour tout k tel que n > k ≥ 1 alors
un = au bn/2c︸ ︷︷ ︸<n car n > 1
+budn/2e+bn ≤︸︷︷︸HR
cavbn/2c+cbvdn/2e+cb′n ≤ cvn︸︷︷︸=O(vn)
De même, vn = O(un).
24/30 Ivan Noyer Complexité
![Page 53: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/53.jpg)
IntroductionMaths
Récurrences d'ordre 1Diviser pour régner
Simpli�er le dernier termePreuve
Comme bn = Θ(b′n), on a λ,N positifs pour lesquels si n > N alorsbn ≤ λb′n.
Comme les suites sont positives, il existe λ1, λN positifs telsque bi ≤ λib′i (i ∈ J1,NK), et on pose µ = max(λ, λ1, . . . , λN)
On pose c = max(a, b, 1, µ). On a donc bn ≤ cb′n pour tout n.
On sait un ≥ 0. On montre que un ≤ cvn par récurrence
u1 = v1 ≤ cv1Si uk ≤ cvk pour tout k tel que n > k ≥ 1 alors
un = au bn/2c︸ ︷︷ ︸<n car n > 1
+budn/2e+bn ≤︸︷︷︸HR
cavbn/2c+cbvdn/2e+cb′n ≤ cvn︸︷︷︸=O(vn)
De même, vn = O(un).
24/30 Ivan Noyer Complexité
![Page 54: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/54.jpg)
IntroductionMaths
Récurrences d'ordre 1Diviser pour régner
Simpli�er le dernier termePreuve
Comme bn = Θ(b′n), on a λ,N positifs pour lesquels si n > N alorsbn ≤ λb′n.
Comme les suites sont positives, il existe λ1, λN positifs telsque bi ≤ λib′i (i ∈ J1,NK), et on pose µ = max(λ, λ1, . . . , λN)
On pose c = max(a, b, 1, µ). On a donc bn ≤ cb′n pour tout n.
On sait un ≥ 0. On montre que un ≤ cvn par récurrence
u1 = v1 ≤ cv1Si uk ≤ cvk pour tout k tel que n > k ≥ 1 alors
un = au bn/2c︸ ︷︷ ︸<n car n > 1
+budn/2e+bn ≤︸︷︷︸HR
cavbn/2c+cbvdn/2e+cb′n ≤ cvn︸︷︷︸=O(vn)
De même, vn = O(un).
24/30 Ivan Noyer Complexité
![Page 55: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/55.jpg)
IntroductionMaths
Récurrences d'ordre 1Diviser pour régner
Diviser pour régnerCroissance
Proposition
Soient a, b des entiers positifs tels que a + b ≥ 1, (bn)n une suite
croissante positive et (un)n>0 une suite DPR telle que
un = aubn/2c + budn/2e + bn
La suite (un)n>0 est croissante.
25/30 Ivan Noyer Complexité
![Page 56: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/56.jpg)
IntroductionMaths
Récurrences d'ordre 1Diviser pour régner
Diviser pour régnerCroissance
On a u2 = au1 + bu1 + b2 ≥ (a + b)u1 ≥ u1 car u1 ≥ 0 eta + b ≥ 1
Pour n ≥ 2, on suppose que le termes jusqu'à n sontcroissants : si k ≤ k ′ ≤ n alors uk ≤ uk ′ .
Observons que b(n + 1)/2c ≥ bn/2c et d(n + 1)/2e ≥ dn/2e.En utilisant la remarque précédente, l’HR et la croissance de(bn) :
un+1 = aub(n+1)/2c + bud(n+1)/2e + bn+1
≥ aubn/2c + budn/2e + bn = un
26/30 Ivan Noyer Complexité
![Page 57: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/57.jpg)
IntroductionMaths
Récurrences d'ordre 1Diviser pour régner
Diviser pour régnerCroissance
On a u2 = au1 + bu1 + b2 ≥ (a + b)u1 ≥ u1 car u1 ≥ 0 eta + b ≥ 1
Pour n ≥ 2, on suppose que le termes jusqu'à n sontcroissants : si k ≤ k ′ ≤ n alors uk ≤ uk ′ .
Observons que b(n + 1)/2c ≥ bn/2c et d(n + 1)/2e ≥ dn/2e.En utilisant la remarque précédente, l’HR et la croissance de(bn) :
un+1 = aub(n+1)/2c + bud(n+1)/2e + bn+1
≥ aubn/2c + budn/2e + bn = un
26/30 Ivan Noyer Complexité
![Page 58: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/58.jpg)
IntroductionMaths
Récurrences d'ordre 1Diviser pour régner
Diviser pour régnerCroissance
On a u2 = au1 + bu1 + b2 ≥ (a + b)u1 ≥ u1 car u1 ≥ 0 eta + b ≥ 1
Pour n ≥ 2, on suppose que le termes jusqu'à n sontcroissants : si k ≤ k ′ ≤ n alors uk ≤ uk ′ .
Observons que b(n + 1)/2c ≥ bn/2c et d(n + 1)/2e ≥ dn/2e.
En utilisant la remarque précédente, l’HR et la croissance de(bn) :
un+1 = aub(n+1)/2c + bud(n+1)/2e + bn+1
≥ aubn/2c + budn/2e + bn = un
26/30 Ivan Noyer Complexité
![Page 59: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/59.jpg)
IntroductionMaths
Récurrences d'ordre 1Diviser pour régner
Diviser pour régnerCroissance
On a u2 = au1 + bu1 + b2 ≥ (a + b)u1 ≥ u1 car u1 ≥ 0 eta + b ≥ 1
Pour n ≥ 2, on suppose que le termes jusqu'à n sontcroissants : si k ≤ k ′ ≤ n alors uk ≤ uk ′ .
Observons que b(n + 1)/2c ≥ bn/2c et d(n + 1)/2e ≥ dn/2e.En utilisant la remarque précédente, l’HR et la croissance de(bn) :
un+1 = aub(n+1)/2c + bud(n+1)/2e + bn+1
≥ aubn/2c + budn/2e + bn = un
26/30 Ivan Noyer Complexité
![Page 60: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/60.jpg)
IntroductionMaths
Récurrences d'ordre 1Diviser pour régner
Théorème master
Théorème (Master)
Soient a, b deux entiers positifs tels que a + b ≥ 1, (bn)n une suite
croissante positive et une suite (un)n>0 dé�nie par
un = aubn/2c + budn/2e + bn
On pose α = log2(a + b) :
Si bn = Θ(nβ) avec β < α, alors un = Θ(nα).
Si bn = Θ(nβ) avec β > α, alors un = Θ(nβ).
Si bn = Θ(nα), alors un = Θ(nα log(n)).
27/30 Ivan Noyer Complexité
![Page 61: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/61.jpg)
IntroductionMaths
Récurrences d'ordre 1Diviser pour régner
Théorème master
Théorème (Master)
Soient a, b deux entiers positifs tels que a + b ≥ 1, (bn)n une suite
croissante positive et une suite (un)n>0 dé�nie par
un = aubn/2c + budn/2e + bn
On pose α = log2(a + b) :
Si bn = Θ(nβ) avec β < α, alors un = Θ(nα).
Si bn = Θ(nβ) avec β > α, alors un = Θ(nβ).
Si bn = Θ(nα), alors un = Θ(nα log(n)).
27/30 Ivan Noyer Complexité
![Page 62: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/62.jpg)
IntroductionMaths
Récurrences d'ordre 1Diviser pour régner
Théorème master
Théorème (Master)
Soient a, b deux entiers positifs tels que a + b ≥ 1, (bn)n une suite
croissante positive et une suite (un)n>0 dé�nie par
un = aubn/2c + budn/2e + bn
On pose α = log2(a + b) :
Si bn = Θ(nβ) avec β < α, alors un = Θ(nα).
Si bn = Θ(nβ) avec β > α, alors un = Θ(nβ).
Si bn = Θ(nα), alors un = Θ(nα log(n)).
27/30 Ivan Noyer Complexité
![Page 63: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/63.jpg)
IntroductionMaths
Récurrences d'ordre 1Diviser pour régner
Théorème MasterPreuve
On s'intéresse à la suite extraite dé�nie par vk = u2k
On a
vn = u2n = aub2n−1c + bud2n−1e + b2n
= (a + b)vn−1 + b2n︸︷︷︸=wn
: suite récurrente d'ordre 1
28/30 Ivan Noyer Complexité
![Page 64: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/64.jpg)
IntroductionMaths
Récurrences d'ordre 1Diviser pour régner
Théorème MasterPreuve
On s'intéresse à la suite extraite dé�nie par vk = u2k
On a
vn = u2n = aub2n−1c + bud2n−1e + b2n
= (a + b)vn−1 + b2n︸︷︷︸=wn
: suite récurrente d'ordre 1
28/30 Ivan Noyer Complexité
![Page 65: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/65.jpg)
IntroductionMaths
Récurrences d'ordre 1Diviser pour régner
Théorème MasterPreuve
On a vn = (a + b)vn−1 + wn = 2αvn−1 + wn.Avec bn = Θ(nβ) , on a wk = b2k = Θ((2k)β) = Θ((2β)k). Alors :
Si β < α, on a 2β < 2α.
Par propriété 2.2 vk = Θ((2α)k) = Θ((a + b)k).Pour n ∈ N∗, on a, par croissance de un :vblog
2(n)c = u
2blog2(n)c ≤ un ≤ u2blog2(n)c+1 = vblog
2(n)c+1.
Il existe λ, µ tels que pour n assez grand
λ(2α)blog2(n)c ≤ vblog2(n)c ≤ un ≤ vblog
2(n)c+1 ≤ µ(2α)blog2(n)+1c
Or, (2α)blog2(n)c = Θ((2α)log2(n)) = Θ((2α)blog2(n)c+1
)Donc un = Θ((2log2(n))α) = Θ(nα)
Si β > α, la propriété 2.1 et le même raisonnement donnentun = Θ(nβ)
29/30 Ivan Noyer Complexité
![Page 66: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/66.jpg)
IntroductionMaths
Récurrences d'ordre 1Diviser pour régner
Théorème MasterPreuve
On a vn = (a + b)vn−1 + wn = 2αvn−1 + wn.Avec bn = Θ(nβ) , on a wk = b2k = Θ((2k)β) = Θ((2β)k). Alors :
Si β < α, on a 2β < 2α.
Par propriété 2.2 vk = Θ((2α)k) = Θ((a + b)k).
Pour n ∈ N∗, on a, par croissance de un :vblog
2(n)c = u
2blog2(n)c ≤ un ≤ u2blog2(n)c+1 = vblog
2(n)c+1.
Il existe λ, µ tels que pour n assez grand
λ(2α)blog2(n)c ≤ vblog2(n)c ≤ un ≤ vblog
2(n)c+1 ≤ µ(2α)blog2(n)+1c
Or, (2α)blog2(n)c = Θ((2α)log2(n)) = Θ((2α)blog2(n)c+1
)Donc un = Θ((2log2(n))α) = Θ(nα)
Si β > α, la propriété 2.1 et le même raisonnement donnentun = Θ(nβ)
29/30 Ivan Noyer Complexité
![Page 67: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/67.jpg)
IntroductionMaths
Récurrences d'ordre 1Diviser pour régner
Théorème MasterPreuve
On a vn = (a + b)vn−1 + wn = 2αvn−1 + wn.Avec bn = Θ(nβ) , on a wk = b2k = Θ((2k)β) = Θ((2β)k). Alors :
Si β < α, on a 2β < 2α.
Par propriété 2.2 vk = Θ((2α)k) = Θ((a + b)k).Pour n ∈ N∗, on a, par croissance de un :vblog
2(n)c = u
2blog2(n)c ≤ un ≤ u2blog2(n)c+1 = vblog
2(n)c+1.
Il existe λ, µ tels que pour n assez grand
λ(2α)blog2(n)c ≤ vblog2(n)c ≤ un ≤ vblog
2(n)c+1 ≤ µ(2α)blog2(n)+1c
Or, (2α)blog2(n)c = Θ((2α)log2(n)) = Θ((2α)blog2(n)c+1
)Donc un = Θ((2log2(n))α) = Θ(nα)
Si β > α, la propriété 2.1 et le même raisonnement donnentun = Θ(nβ)
29/30 Ivan Noyer Complexité
![Page 68: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/68.jpg)
IntroductionMaths
Récurrences d'ordre 1Diviser pour régner
Théorème MasterPreuve
On a vn = (a + b)vn−1 + wn = 2αvn−1 + wn.Avec bn = Θ(nβ) , on a wk = b2k = Θ((2k)β) = Θ((2β)k). Alors :
Si β < α, on a 2β < 2α.
Par propriété 2.2 vk = Θ((2α)k) = Θ((a + b)k).Pour n ∈ N∗, on a, par croissance de un :vblog
2(n)c = u
2blog2(n)c ≤ un ≤ u2blog2(n)c+1 = vblog
2(n)c+1.
Il existe λ, µ tels que pour n assez grand
λ(2α)blog2(n)c ≤ vblog2(n)c ≤ un ≤ vblog
2(n)c+1 ≤ µ(2α)blog2(n)+1c
Or, (2α)blog2(n)c = Θ((2α)log2(n)) = Θ((2α)blog2(n)c+1
)Donc un = Θ((2log2(n))α) = Θ(nα)
Si β > α, la propriété 2.1 et le même raisonnement donnentun = Θ(nβ)
29/30 Ivan Noyer Complexité
![Page 69: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/69.jpg)
IntroductionMaths
Récurrences d'ordre 1Diviser pour régner
Théorème MasterPreuve
On a vn = (a + b)vn−1 + wn = 2αvn−1 + wn.Avec bn = Θ(nβ) , on a wk = b2k = Θ((2k)β) = Θ((2β)k). Alors :
Si β < α, on a 2β < 2α.
Par propriété 2.2 vk = Θ((2α)k) = Θ((a + b)k).Pour n ∈ N∗, on a, par croissance de un :vblog
2(n)c = u
2blog2(n)c ≤ un ≤ u2blog2(n)c+1 = vblog
2(n)c+1.
Il existe λ, µ tels que pour n assez grand
λ(2α)blog2(n)c ≤ vblog2(n)c ≤ un ≤ vblog
2(n)c+1 ≤ µ(2α)blog2(n)+1c
Or, (2α)blog2(n)c = Θ((2α)log2(n)) = Θ((2α)blog2(n)c+1
)
Donc un = Θ((2log2(n))α) = Θ(nα)
Si β > α, la propriété 2.1 et le même raisonnement donnentun = Θ(nβ)
29/30 Ivan Noyer Complexité
![Page 70: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/70.jpg)
IntroductionMaths
Récurrences d'ordre 1Diviser pour régner
Théorème MasterPreuve
On a vn = (a + b)vn−1 + wn = 2αvn−1 + wn.Avec bn = Θ(nβ) , on a wk = b2k = Θ((2k)β) = Θ((2β)k). Alors :
Si β < α, on a 2β < 2α.
Par propriété 2.2 vk = Θ((2α)k) = Θ((a + b)k).Pour n ∈ N∗, on a, par croissance de un :vblog
2(n)c = u
2blog2(n)c ≤ un ≤ u2blog2(n)c+1 = vblog
2(n)c+1.
Il existe λ, µ tels que pour n assez grand
λ(2α)blog2(n)c ≤ vblog2(n)c ≤ un ≤ vblog
2(n)c+1 ≤ µ(2α)blog2(n)+1c
Or, (2α)blog2(n)c = Θ((2α)log2(n)) = Θ((2α)blog2(n)c+1
)Donc un = Θ((2log2(n))α) = Θ(nα)
Si β > α, la propriété 2.1 et le même raisonnement donnentun = Θ(nβ)
29/30 Ivan Noyer Complexité
![Page 71: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/71.jpg)
IntroductionMaths
Récurrences d'ordre 1Diviser pour régner
Théorème MasterPreuve
On a vn = (a + b)vn−1 + wn = 2αvn−1 + wn.Avec bn = Θ(nβ) , on a wk = b2k = Θ((2k)β) = Θ((2β)k). Alors :
Si β < α, on a 2β < 2α.
Par propriété 2.2 vk = Θ((2α)k) = Θ((a + b)k).Pour n ∈ N∗, on a, par croissance de un :vblog
2(n)c = u
2blog2(n)c ≤ un ≤ u2blog2(n)c+1 = vblog
2(n)c+1.
Il existe λ, µ tels que pour n assez grand
λ(2α)blog2(n)c ≤ vblog2(n)c ≤ un ≤ vblog
2(n)c+1 ≤ µ(2α)blog2(n)+1c
Or, (2α)blog2(n)c = Θ((2α)log2(n)) = Θ((2α)blog2(n)c+1
)Donc un = Θ((2log2(n))α) = Θ(nα)
Si β > α, la propriété 2.1 et le même raisonnement donnentun = Θ(nβ)
29/30 Ivan Noyer Complexité
![Page 72: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/72.jpg)
IntroductionMaths
Récurrences d'ordre 1Diviser pour régner
Théorème MasterPreuve
On a vn = (a + b)vn−1 + b2n . Avec bn = Θ(nα) , on ab2k = Θ((2α)k). Alors :
Par propriété 2.2 vk = Θ(k(2α)k).
Pour n ∈ N∗, on a, par croissance de un :vblog2(n)c = u2blog2(n)c ≤ un ≤ u2blog2(n)c+1 = vblog2(n)c+1.
Il existe λ, µ tels que pour n assez grand
λblog2(n)c(2α)blog2(n)c ≤ vblog2(n)c
≤ un ≤ vblog2(n)c+1
≤ µ(blog2(n)c+ 1)(2α)blog2(n)c+1
Or, blog2(n)c(2α)blog2(n)c = Θ(log2(n)(2α)log2(n)
)=
Θ((blog2(n))c+ 1)(2α)blog2(n)c+1)
Donc un = Θ(log2(n)(2log2(n))α) = Θ(nα log(n))
30/30 Ivan Noyer Complexité
![Page 73: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/73.jpg)
IntroductionMaths
Récurrences d'ordre 1Diviser pour régner
Théorème MasterPreuve
On a vn = (a + b)vn−1 + b2n . Avec bn = Θ(nα) , on ab2k = Θ((2α)k). Alors :
Par propriété 2.2 vk = Θ(k(2α)k).
Pour n ∈ N∗, on a, par croissance de un :vblog2(n)c = u2blog2(n)c ≤ un ≤ u2blog2(n)c+1 = vblog2(n)c+1.
Il existe λ, µ tels que pour n assez grand
λblog2(n)c(2α)blog2(n)c ≤ vblog2(n)c
≤ un ≤ vblog2(n)c+1
≤ µ(blog2(n)c+ 1)(2α)blog2(n)c+1
Or, blog2(n)c(2α)blog2(n)c = Θ(log2(n)(2α)log2(n)
)=
Θ((blog2(n))c+ 1)(2α)blog2(n)c+1)
Donc un = Θ(log2(n)(2log2(n))α) = Θ(nα log(n))
30/30 Ivan Noyer Complexité
![Page 74: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/74.jpg)
IntroductionMaths
Récurrences d'ordre 1Diviser pour régner
Théorème MasterPreuve
On a vn = (a + b)vn−1 + b2n . Avec bn = Θ(nα) , on ab2k = Θ((2α)k). Alors :
Par propriété 2.2 vk = Θ(k(2α)k).
Pour n ∈ N∗, on a, par croissance de un :vblog2(n)c = u2blog2(n)c ≤ un ≤ u2blog2(n)c+1 = vblog2(n)c+1.
Il existe λ, µ tels que pour n assez grand
λblog2(n)c(2α)blog2(n)c ≤ vblog2(n)c
≤ un ≤ vblog2(n)c+1
≤ µ(blog2(n)c+ 1)(2α)blog2(n)c+1
Or, blog2(n)c(2α)blog2(n)c = Θ(log2(n)(2α)log2(n)
)=
Θ((blog2(n))c+ 1)(2α)blog2(n)c+1)
Donc un = Θ(log2(n)(2log2(n))α) = Θ(nα log(n))
30/30 Ivan Noyer Complexité
![Page 75: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/75.jpg)
IntroductionMaths
Récurrences d'ordre 1Diviser pour régner
Théorème MasterPreuve
On a vn = (a + b)vn−1 + b2n . Avec bn = Θ(nα) , on ab2k = Θ((2α)k). Alors :
Par propriété 2.2 vk = Θ(k(2α)k).
Pour n ∈ N∗, on a, par croissance de un :vblog2(n)c = u2blog2(n)c ≤ un ≤ u2blog2(n)c+1 = vblog2(n)c+1.
Il existe λ, µ tels que pour n assez grand
λblog2(n)c(2α)blog2(n)c ≤ vblog2(n)c
≤ un ≤ vblog2(n)c+1
≤ µ(blog2(n)c+ 1)(2α)blog2(n)c+1
Or, blog2(n)c(2α)blog2(n)c = Θ(log2(n)(2α)log2(n)
)=
Θ((blog2(n))c+ 1)(2α)blog2(n)c+1)
Donc un = Θ(log2(n)(2log2(n))α) = Θ(nα log(n))
30/30 Ivan Noyer Complexité
![Page 76: Complexité · Introduction Maths 1 Introduction 2 Maths Récurrences d'ordre 1 Diviser pour régner 2/30 Ivan Noery Complexité](https://reader033.vdocuments.mx/reader033/viewer/2022052104/603f751841faa979d8686840/html5/thumbnails/76.jpg)
IntroductionMaths
Récurrences d'ordre 1Diviser pour régner
Théorème MasterPreuve
On a vn = (a + b)vn−1 + b2n . Avec bn = Θ(nα) , on ab2k = Θ((2α)k). Alors :
Par propriété 2.2 vk = Θ(k(2α)k).
Pour n ∈ N∗, on a, par croissance de un :vblog2(n)c = u2blog2(n)c ≤ un ≤ u2blog2(n)c+1 = vblog2(n)c+1.
Il existe λ, µ tels que pour n assez grand
λblog2(n)c(2α)blog2(n)c ≤ vblog2(n)c
≤ un ≤ vblog2(n)c+1
≤ µ(blog2(n)c+ 1)(2α)blog2(n)c+1
Or, blog2(n)c(2α)blog2(n)c = Θ(log2(n)(2α)log2(n)
)=
Θ((blog2(n))c+ 1)(2α)blog2(n)c+1)
Donc un = Θ(log2(n)(2log2(n))α) = Θ(nα log(n))
30/30 Ivan Noyer Complexité