【具体数学--读书笔记】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)的读书 ...
随机推荐
- Eclipse servlet和jsp编写
servlet: 在你新建的Application myapp/WEB-INF/classes/test目录下新建HelloWorld.java package test; import java.i ...
- mvc 解决StyleBundle中 图片绝对路径 装换成相对路径的问题 CssRewriteUrlTransform
问题 解决办法
- Google map v3 using simple tool file google.map.util.js v 1.0
/** * GOOGLE地图开发使用工具 * @author BOONYACHENGDU@GMAIL.COM * @date 2013-08-23 * @notice 地图容器的(div)z-inde ...
- tomcat,tomcat7配置https
<一,>,tomcat7配置https 1,生成keystore文件及导出证书
- lowerCaseTableNames
数据库表,数据库名大小写铭感问题 mysql lower-case-table-names参数 线上有业务用到开源的产品,其中SQL语句是大小写混合的,而建表语句都是小写的,mysql默认设置导致这些 ...
- Java根据年份算出所属的生肖。
一个小程序~ public String getYear(Integer year){ if(year<1900){ return "未知"; } Integer start ...
- 【Android开发经验】LayoutInflater—— 你可能对它并不了解甚至错误使用
今天,看到了一篇文章讲LayoutInflater的使用方法.瞬间感觉自己对这个类确实不够了解,于是简单的看了下LayoutInflater类的源码.对这个类有了新的认识. 首先.LayoutInfl ...
- Hacker(五)----黑客专用通道--->端口
计算机中,端口是计算机与外部进行通信交流的出口.计算机本身携带的物理端口(键盘.鼠标.显示器等输入/输出接口)已经无法满足网络通信的要求,因此TCP/IP协议就引入了一种称为Socket的应用程序接口 ...
- 【二分答案】 【POJ3497】 【Northwestern Europe 2007】 Assemble 组装电脑
Assemble Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 3171 Accepted: 1013 Descript ...
- SqlBulkCopy使用介绍以及注意事项
SqlBulkCopy,微软提供的快速插入类,针对大批量数据操作,此类效果明显有所提升,以下是微软官方解释: Microsoft SQL Server 提供一个称为 bcp 的流行的命令提示符实用工具 ...