这一节借助汉诺塔问题引入了"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的更多相关文章

  1. 3D数学读书笔记——3D中的方位与角位移

    本系列文章由birdlove1987编写,转载请注明出处. 文章链接: http://blog.csdn.net/zhurui_idea/article/details/25339595 方位和角位移 ...

  2. 3D数学读书笔记——矩阵基础

     本系列文章由birdlove1987编写,转载请注明出处.    文章链接:http://blog.csdn.net/zhurui_idea/article/details/24975031   矩 ...

  3. 3D数学读书笔记——四元数

    本系列文章由birdlove1987编写,转载请注明出处. 文章链接: http://blog.csdn.net/zhurui_idea/article/details/25400659 什么是四元数 ...

  4. 3D数学读书笔记——矩阵基础番外篇之线性变换

    本系列文章由birdlove1987编写.转载请注明出处. 文章链接:http://blog.csdn.net/zhurui_idea/article/details/25102425 前面有一篇文章 ...

  5. 3D数学读书笔记——向量运算及在c++上的实现

     本系列文章由birdlove1987编写.转载请注明出处.     文章链接: http://blog.csdn.net/zhurui_idea/article/details/24782661   ...

  6. 3D数学读书笔记——多坐标系和向量基础

    本系列文章由birdlove1987编写,转载请注明出处. 文章链接: http://blog.csdn.net/zhurui_idea/article/details/24662453 第一个知识点 ...

  7. 【具体数学 读书笔记】1.2 Lines in the Plane

    本节介绍平面划分问题,即n条直线最多把一个平面划分为几个区域(region). 问题描述: "What is the maximum number Ln of regions defined ...

  8. 3D数学读书笔记——矩阵进阶

    本系列文章由birdlove1987编写,转载请注明出处. 文章链接:http://blog.csdn.net/zhurui_idea/article/details/25242725 最终要学习矩阵 ...

  9. Modern Algebra 读书笔记

    Modern Algebra 读书笔记 Introduction 本文是Introduction to Modern Algebra(David Joyce, Clark University)的读书 ...

随机推荐

  1. setTimeout()使用

    Basic setTimeout() Example setTimeout(function() {       // Do something after 5 seconds }, ); Tip:  ...

  2. mvc 解决StyleBundle中 图片绝对路径 装换成相对路径的问题 CssRewriteUrlTransform

    问题 解决办法

  3. 中国版 Ubuntu Kylin 14.04 LTS 麒麟操作系统中文版发布下载 (Ubuntu天朝定制版)

    中国版 Ubuntu Kylin 14.04 LTS 麒麟操作系统中文版发布下载 (Ubuntu天朝定制版) http://www.iplaysoft.com/ubuntukylin.html

  4. LeeCode-Delete Node in a Linked List

    Write a function to delete a node (except the tail) in a singly linked list, given only access to th ...

  5. HDOJ-1012 u Calculate e(水)

    http://acm.hdu.edu.cn/showproblem.php?pid=1012 简单套公式 # include <stdio.h> double Factorial(doub ...

  6. JAVA JNI

    jni非常好的一篇文章 http://m.blog.csdn.net/article/details?id=22827307 JAVA JNI介绍 http://blog.csdn.net/cyg08 ...

  7. Java 获取Linux 的IP地址

    import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import ...

  8. svn之——linux下清除svn的用户名和密码

    问题:之前用的svn账号权限不够,需要使用别的账号,所以提出需求——怎么使用新的svn账号进行操作 方法一: linux下删除~/.subversion/auth即可清除之前的用户名和密码:rm -r ...

  9. magento后台登陆后,没任何提示,又跳转到登陆页面

    这个问题通常是cookie配置的问题.需要去将core_config_data中web/cookie/cookie_path.web/cookie/cookie_domain设为null

  10. UGUI Toggle控件

    今天我们来看看Toogle控件, 它由Toogle + 背景 + 打勾图片 + 标签组成的. 它主要用于单选和多选 属性讲解: Is On: 代表是否选中. Toogle Transition: 在状 ...