【具体数学--读书笔记】1.1 The Power of Hanoi
这一节借助汉诺塔问题引入了"Reccurent Problems"。
(Reccurence, 在这里解释为“the solution to each problem depends on the solutions to smaller instances of the same problem”. 即由相同的规模更小的问题的到原问题的解)
Hanoi问题描述:
"given a tower of eight disks, initially stacked in decreasing size on peg A.
Our task: transfer the entire tower to tower C, moving only one disk at a time and never mobing a larger one onto a smaller.
Question: How many moves are necessary and sufficient to perform the task?"
作者按照如下步骤分析求出n层汉诺塔的最少移动次数的通项公式:
1. generalize:最初是法国数学家Edouard Lucas提出的8层汉诺塔玩具,后来Lucas又创造了一个64层汉诺塔的故事。这里我们把汉诺塔的层数泛化为n
2. introduce appropriate notation, name and conquer:引入记号Tn表示n层的汉诺塔问题的最少移动次数
3. look at small cases:易知T1=1, T2=3, T3 = 7
4. find and prove a reccurence relation:找到并证明递推关系
(1) find a sufficient solution: 找到一个充分(可行)的解;
具体地,将求解small cases的方法推广,把除最底层以外的前n-1层看成一个整体,得到一个可行的方案Tn-1 + 1 + Tn-1,由此可得Tn <= 2*Tn-1 + 1
(2) prove it necessary: 证明它的必要性;
具体地,分析移动过程,移动最底层盘子之前,至少已花费Tn-1步将前n-1层移至辅助桩;最底层盘子就位后,同样至少要花费Tn-1将前n-1层从辅助桩移到目标桩,由此可得Tn >= 2*Tn-1 + 1
(3) yeild recurrence relation:v由(1)(2)得到等式,加上对平凡(trivial)情况的约定,构成如下递推关系
T0 = 0
Tn = 2*Tn-1 + 1
注:递推关系给出的是"indirect, local information",已知局部的一个值可以方便地求出邻近的值,好比链表
5. find and prove a closed form expression: 找到并证明通项式
(1) 方法一:列出small cases观察 -> 猜一个式子 -> 用数学归纳法(mathematical induction)验证
(2) 方法二:直接从递推式推导:
1) add 1 to both sides of the equations:把右侧化成和左侧类似的形式
T0 + 1= 1
Tn + 1= 2*Tn-1 + 2 = 2*(Tn-1 + 1)
2) let Un = Tn + 1, we have 引入另一个记号,换元
U0 = 1
Un = 2*Un
由此构造出等比数列Un, 首项为1,公比为2,所以通项Un = U0*2^n = 2^n
3) 带回T, 得到通项公式Tn = Un - 1 = 2^n - 1
作者说这本书主要关注讨论的就是类似第5步方法二的方法,通过推导,而不是“猜测+验证”的方式来由递推式得到通项式
"to explain how a person can solve recurrences without being clairvoyant."
【具体数学--读书笔记】1.1 The Power of Hanoi的更多相关文章
- 3D数学读书笔记——3D中的方位与角位移
本系列文章由birdlove1987编写,转载请注明出处. 文章链接: http://blog.csdn.net/zhurui_idea/article/details/25339595 方位和角位移 ...
- 3D数学读书笔记——矩阵基础
本系列文章由birdlove1987编写,转载请注明出处. 文章链接:http://blog.csdn.net/zhurui_idea/article/details/24975031 矩 ...
- 3D数学读书笔记——四元数
本系列文章由birdlove1987编写,转载请注明出处. 文章链接: http://blog.csdn.net/zhurui_idea/article/details/25400659 什么是四元数 ...
- 3D数学读书笔记——矩阵基础番外篇之线性变换
本系列文章由birdlove1987编写.转载请注明出处. 文章链接:http://blog.csdn.net/zhurui_idea/article/details/25102425 前面有一篇文章 ...
- 3D数学读书笔记——向量运算及在c++上的实现
本系列文章由birdlove1987编写.转载请注明出处. 文章链接: http://blog.csdn.net/zhurui_idea/article/details/24782661 ...
- 3D数学读书笔记——多坐标系和向量基础
本系列文章由birdlove1987编写,转载请注明出处. 文章链接: http://blog.csdn.net/zhurui_idea/article/details/24662453 第一个知识点 ...
- 【具体数学 读书笔记】1.2 Lines in the Plane
本节介绍平面划分问题,即n条直线最多把一个平面划分为几个区域(region). 问题描述: "What is the maximum number Ln of regions defined ...
- 3D数学读书笔记——矩阵进阶
本系列文章由birdlove1987编写,转载请注明出处. 文章链接:http://blog.csdn.net/zhurui_idea/article/details/25242725 最终要学习矩阵 ...
- Modern Algebra 读书笔记
Modern Algebra 读书笔记 Introduction 本文是Introduction to Modern Algebra(David Joyce, Clark University)的读书 ...
随机推荐
- Linux系统编程(9)—— 进程之进程控制函数exec系列函数
在Linux中,并不存在exec()函数,exec指的是一组函数,一共有6个,分别是: #include <unistd.h> extern char **environ; int exe ...
- 杭电1010(dfs + 奇偶剪枝)
题目: The doggie found a bone in an ancient maze, which fascinated him a lot. However, when he picked ...
- django项目环境搭建备忘
由于使用python3,所以尽量为每个项目配置虚拟环境来管理各个项目的=. 新建一个项目文件夹,进入该路径 python3 -m venv ll_env 然后激活虚拟环境 source ll_env/ ...
- Jconsole: JAVA 监视和管理控制台简介
Jconsole: JAVA 监视和管理控制台简介 JDK中除了提供大量的命令行之外,还提供两个功能强大的可视化工具:JConsole和VisualVM. 之前对java的调试一直停留在 右键-> ...
- iOS 7 改变Status Bar 颜色
Set the UIViewControllerBasedStatusBarAppearance to NO in the Info.plist. In ViewDidLoad method or a ...
- Spring-Junit4
Spring整合Junit4测试Service 1. 加入依赖包 使用Spring的测试框架需要加入以下依赖包: JUnit 4 (官方下载:https://github.com/KentBeck ...
- 点滴记录——Centos 6.5 yum安装Ganglia
转载请说明出处:http://blog.csdn.net/cywosp/article/details/39701141 注:下面操作都仅仅是在一台机器上操作 1. 安装php支持 yum inst ...
- android 更改USB显示名称
能力 kernel\drivers\usb\gadget\Android.c 在这个例子中,下列的变化 #define PRODUCT_STRING "Sergeycao" 版权声 ...
- NPOI新建和读取EXCEL
//基本NPOI 1.2.5.0 static void Main(string[] args) { string path = string.Format("E:\\export{0}.x ...
- SQL创建登陆用户和赋予权限
主要针对Sql server 2005及以上,创建简单用户名和密码所引起的密码简单的问题.解决方案 CHECK_POLICY = OFF; --强制密码策略 use MusicStore --创建登陆 ...