posts - 2, comments - 0, trackbacks - 0, articles - 0

          導(dǎo)航

          <2006年7月>
          2526272829301
          2345678
          9101112131415
          16171819202122
          23242526272829
          303112345

          常用鏈接

          留言簿(2)

          隨筆分類

          隨筆檔案

          搜索

          •  

          最新評(píng)論

          閱讀排行榜

          評(píng)論排行榜

          concrete mathematics(1)

          Posted on 2006-07-19 01:33 jimmyljb 閱讀(242) 評(píng)論(0)  編輯  收藏 所屬分類: Algorithms
          1.2) Lines in the plane.
          ??? What is the maximum number L, of regions defined by n lines in the plane?
          ??? L0 = 1
          ??? Ln = Ln-1 + n (n>0)
          =>>?? Ln = n(n+1)/2 +1

          Suppose that instead of straight lines we use bent lines, each containing one “zig!", such as "<"
          ??? Zn = L2n - 2n = 2n(2n+1)/2+1-2n = 2n^2-n+1 (n>=0)

          1.3) THE JOSEPHUS PROBLEM
          ??? In our variation, we start with n people numbered 1 to n around a circle,and we eliminate every second remaining person until only one survives.
          ??? J(1) = 1 ;
          ??? J(2n) = 2J(n) - 1 , for n > 1;
          ??? J(2n + 1) = 2J(n) + 1
          ==>>J(2^m+l) = 2*l+1;

          for binary number
          ??? J(ABCDEF) = 2*BCDEFA + 1 (A,B,C,D,E,F = 0,1)
          ??? J(1...1...) = 1...1... ? (A = 1)

          習(xí)題有一個(gè)是漢諾塔的題目,說是A C B中不允許A和B之間交換,即只能to or from C。
          這里得到一個(gè)簡單的遞歸就是A(n) = 3A(n-1)+2 (n >= 1),理由是把n-1個(gè)塔從A經(jīng)由C移到B,再把最底下的第n塊從A移動(dòng)C,再把n-1塊從B經(jīng)由C移到A,再把C中的第n塊從C移到B,最后把A的n-1塊從A移到B。

          只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。


          網(wǎng)站導(dǎo)航:
          博客園   IT新聞   Chat2DB   C++博客   博問  
           
          主站蜘蛛池模板: 晋宁县| 三门县| 出国| 平度市| 宁武县| 犍为县| 台安县| 博客| 深州市| 六枝特区| 武安市| 双江| 瓦房店市| 吉安县| 灌阳县| 博乐市| 左权县| 武邑县| 酉阳| 皮山县| 陇南市| 江口县| 新蔡县| 颍上县| 门头沟区| 云阳县| 北宁市| 安西县| 南宁市| 仪征市| 宜川县| 神池县| 聊城市| 教育| 苏州市| 修武县| 林周县| 图木舒克市| 岳西县| 宜春市| 隆安县|