【Algorithm】数学归纳法
1、简介
数学归纳法(Mathematical Induction, MI)是一种数学证明方法,通常被用于证明某个给定命题在整个(或者局部)自然数范围内成立。
除了自然数以外,广义上的数学归纳法也可以用于证明一般良基结构,例如:集合论中的树。这种广义的数学归纳法应用于数学逻辑和计算机科学领域,称作结构归纳法。
在数论中,数学归纳法是以一种不同的方式来证明任意一个给定的情形都是正确的(第一个,第二个,第三个,一直下去概不例外)的数学定理。
虽然数学归纳法名字中有“归纳”,但是数学归纳法并非不严谨的归纳推理法,它属于完全严谨的演绎推理法。事实上,所有数学证明都是演绎法。
2、原理定义
最简单和常见的数学归纳法是证明当n等于任意一个自然数时某命题成立。证明分下面两步:
- 1、证明 “当n = 1时命题成立。” (选择数字1因其作为自然数集合中中最小值)
- 2、证明 “若假设在n = m时命题成立,可推导出在n = m+1时命题成立。(m代表任意自然数)”
这种方法的原理在于:首先证明在某个起点值时命题成立,然后证明从一个值到下一个值的过程有效。当这两点都已经证明,那么任意值都可以通过反复使用这个方法推导出来。
把这个方法想成多米诺骨牌效应也许更容易理解一些。例如:你有一列很长的直立着的多米诺骨牌,如果你可以:
- 1、证明 “第一张骨牌会倒。”
- 2、证明 “只要任意一张骨牌倒了,其下一张骨牌也会因为前面的骨牌倒而跟着倒。”
- 3、则可下结论:所有的骨牌都会倒下。
Principle of Mathematical Induction Solution and Proof
Consider a statement P(n), where n is a natural number. Then to determine the validity of P(n) for every n, use the following principle:
Step 1: Check whether the given statement is true for n = 1.
Step 2: Assume that given statement P(n) is also true for n = k, where k is any positive integer.
Step 3: Prove that the result is true for P(k+1) for any positive integer k.
If the above-mentioned conditions are satisfied, then it can be concluded that P(n) is true for all n natural numbers.
Proof:
The first step of the principle is a factual statement and the second step is a conditional one. According to this if the given statement is true for some positive integer k only then it can be concluded that the statement P(n) is valid for n = k + 1.
This is also known as the inductive step and the assumption that P(n) is true for n=k is known as the inductive hypothesis.
Solved problems
Example 1: Prove that the sum of cubes of n natural numbers is equal to ( n(n+1) 2)2 for all n natural numbers.
Solution:
In the given statement we are asked to prove:
13+23+33+⋯+n300 = (n(n+1)2)2
Step 1: Now with the help of the principle of induction in math let us check the validity of the given statement P(n) for n=1.
P(1)=(1(1+1)2)2 = 1 This is true.
Step 2: Now as the given statement is true for n=1 we shall move forward and try proving this for n=k, i.e.,13+23+33+⋯+k3= (k(k+1)2)2 .
Step 3: Let us now try to establish that P(k+1) is also true.
Example 2: Show that 1 + 3 + 5 + … + (2n−1) = n2
Solution:
Step 1: Result is true for n = 1
That is 1 = (1)2 (True)
Step 2: Assume that result is true for n = k
1 + 3 + 5 + … + (2k−1) = k2
Step 3: Check for n = k + 1
i.e. 1 + 3 + 5 + … + (2(k+1)−1) = (k+1)2
We can write the above equation as,
1 + 3 + 5 + … + (2k−1) + (2(k+1)−1) = (k+1)2
Using step 2 result, we get
k2 + (2(k+1)−1) = (k+1)2
k2 + 2k + 2 −1 = (k+1)2
k2 + 2k + 1 = (k+1)2
(k+1)2 = (k+1)2
L.H.S. and R.H.S. are same.
So the result is true for n = k+1
By mathematical induction, the statement is true.
We see that the given statement is also true for n=k+1. Hence we can say that by the principle of mathematical induction this statement is valid for all natural numbers n.
Example 3:
Show that 22n-1 is divisible by 3 using the principles of mathematical induction.
To prove: 22n-1 is divisible by 3
Assume that the given statement be P(k)
Thus, the statement can be written as P(k) = 22n-1 is divisible by 3, for every natural number
Step 1: In step 1, assume n= 1, so that the given statement can be written as
P(1) = 22(1)-1 = 4-1 = 3. So 3 is divisible by 3. (i.e.3/3 = 1)
Step 2: Now, assume that P(n) is true for all the natural number, say k
Hence, the given statement can be written as
P(k) = 22k-1 is divisible by 3.
It means that 22k-1 = 3a (where a belongs to natural number)
Now, we need to prove the statement is true for n= k+1
Hence,
P(k+1) = 22(k+1)-1
P(k+1)= 22k+2-1
P(k+1)= 22k. 22 – 1
P(k+1)= (22k. 4)-1
P(k+1) =3.2k +(22k-1)
The above expression can be written as
P(k+1) =3.22k + 3a
Now, take 3 outside, we get
P(k+1) = 3(22k + a)= 3b, where “b” belongs to natural number
It is proved that p(k+1) holds true, whenever the statement P(k) is true.
Thus, 22n-1 is divisible by 3 is proved using the principles of mathematical induction
【Algorithm】数学归纳法相关推荐
- [数据结构与算法 DSA 林轩田] 1. Introduction to Data Structure and Algorithm
目录 算法 1.什么是算法 2.Five Criteria of Algorithm(算法的五大原则) 3. Correctness Proof of Algorithm(算法正确性) 4. Effi ...
- 《Data Structures and Algorithm Analysis in C》学习与刷题笔记
<Data Structures and Algorithm Analysis in C>学习与刷题笔记 为什么要学习DSAAC? 某个月黑风高的夜晚,下班的我走在黯淡无光.冷清无人的冲之 ...
- 如何高效进行模乘、模幂运算?——蒙哥马利算法(Montgomery Algorithm)从入门到精通
蒙哥马利算法(Montgomery Algorithm)从入门到精通 加密算法中,模运算(包括模乘.模幂运算)是难以避免的,如何高效地进行模运算,是提高算法效率的一个关键. 直观的想法 在数学 ...
- 【论文笔记之 APA】an adaptive filtering algorithm using an orthogonal projection to an affine subspace ...
本文对 Kazuhiko Ozeki 等人于 1984 年在 Electronics and Communications in Japan (Part I: Communications) 上发表的 ...
- HMM——维特比算法(Viterbi algorithm)
1. 前言 维特比算法针对HMM第三个问题,即解码或者预测问题,寻找最可能的隐藏状态序列: 对于一个特殊的隐马尔可夫模型(HMM)及一个相应的观察序列,找到生成此序列最可能的隐藏状态序列. 也就是说给 ...
- 《OpenCV3编程入门》学习笔记8 图像轮廓与图像分割修复(五)分水岭算法(watershed algorithm)
8.5 分水岭算法(watershed algorithm) 1.基于拓扑理论的数学形态学的分割方法. 2.基本思想:把图像看作测地学上的拓扑地貌,图像中每一点像素的灰度值表示该点的海拔高度,每一个局 ...
- C++ algorithm的sort函数总结
sort函数 sort对给定区间进行排序,支持各种数据类型,迭代器,结构体,自定义排序规则 stable_sort 对给定区间进行稳定排序,且可保证相等元素的原本相对次序在排序后保持不变 partia ...
- SLAM之特征匹配(三)————RANSAC------LO-RANSAC Algorithm
matlab 编译loransac,lapack mex ranH.c时一直链接错误. 原来mex在编译多个文件时要把所有的C文件都列出来.命令如下: mex loransacH.mex.c ranH ...
- C++/C++11中头文件algorithm的使用
<algorithm>是C++标准程序库中的一个头文件,定义了C++ STL标准中的基础性的算法(均为函数模板).<algorithm>定义了设计用于元素范围的函数集合.任何对 ...
- 2018/8/27 A Modified PSO Algorithm with Exponential Decay Weight
信息: 2017年 会议 题目: A Modified PSO Algorithm with Exponential Decay Weight 总 ...
最新文章
- Target runtime Apache Tomcat v7.0 is not defined.
- Servlet监听器Listener
- 7系列高速收发器总结 GTP IP核使用篇
- luogu4365 秘密袭击 (生成函数+线段树合并+拉格朗日插值)
- js 操作获取和设置cookie
- python爬虫实例100例-Python爬虫 实例
- static、const、static const、const static成员的初始化问题
- android定义颜色数组,Colours——一套漂亮的预定义颜色库和方法
- linux 安装mantis,在Ubuntu 18.04系统上安装Mantis Bug Tracker[MantisBT]
- Python文本特征提取 DictVectorizer CountVectorizer TfidfVectorizer 附代码详解
- 简单了解实体框架EF(Entity Framework)
- Undefined control sequence. 解决
- Python GPU加速
- 重磅 | 完备的 AI 学习路线
- JAVA从入门到进阶(九)——集合类框架基础一
- 自动化测试——多窗口切换和切换frame
- 酷狗账号登陆服务器繁忙,酷狗音乐账号无法登陆如何解决?账号无法登陆原因及解决方法介绍...
- chattr命令被篡改
- mycat Mycat监控工具
- redis geo 性能分析及对问题的思考