算法分析导论(第2版)(英文版) (8) 更多

  • 3.2 Exponential Generating Functions
    Exercise 3.10 Find th EGFs for 1, 3, 5, 7, ... and 0, 2, 4, 6, ...
  • 3.2 Exponential Generating Functions
    Exercise 3.9 Find the EGFs for each of the following sequences: ExponentialGeneratingFunction[2^(k+1), k, z] ExponentialGeneratingFunction[k*2^(k+1), k, z] ExponentialGeneratingFunction[(k+2)^3, k, z]
  • 3.1 Ordinary Generating Functions
    Find [z^N] for each of the following OGFs: 由OGF求coefficient有两种方法:一种是泰勒展开;另一种是由已知OGFs进行运算。 taylor series 1/(1 - 3 z)^4 SeriesCoefficient[1/(1-3z)^4, {z, 0, n}] SeriesCoef...
  • 3.1 Ordinary Generating Functions
    Exercise 3.1 Find the OGFs for each of the following sequences: 纯手工从Sequence求OGF需要观察力(找到原始sequence)以及细心(处理下标),如果使用作者在前言中提到的符号计算系统,则可以大大简化这一过...
  • 3.1 Ordinary Generating Functions
    Exercise 3.1 Find the OGFs for each of the following sequences: 经过观察,只有求导可以产生k的平方、三次方。在计算三次方的过程中也需要使用右移。需要注意的是待求sequence的下标是从2开始,需要左移方可...
  • 3.1 Ordinary Generating Functions
    Exercise 3.1 Find the OGFs for each of the following sequences: 经过观察,上面sequence可由Table 3.1里的两个OGFs经过简单的相加和左移得到,稍微需要注意的是级数的下标,这是需要左移的原因。
  • 3.1 Ordinary Generating Functions
    Exercise 3.1 Find the OGFs for each of the following sequences: 这道题有两种解法,第一种可以利用上一题的OGF 另一种方法可以不借助上一题的OGF,直接求导、右移然后乘2即可
  • 3.1 Ordinary Generating Functions
    Exercise 3.1 Find the OGFs for each of the following sequences: 经过观察,这个sequence与下面的OGF最相似: 将c=2代入可得下面的sequence: 只需将此sequence左移(参考Table 3.2中的left shift)即可得到待...

世界上最简单的会计书 (1)

  • 第69页
    表4-9 第一周期末资产负债表 应改为“第二周期初资产负债表”

数据结构与算法分析 (2)

  • 第28页 2.12 a.求最小子序列和
    int MinSubsequenceSum(int A[], int N) { int ThisSum, MinSum, i; ThisSum = MinSum = A[0]; for (i = 1; i < N; i++) { if (ThisSum > 0) ThisSum = A[i]; else ThisSum += A[i]; if (ThisSum <= MinSum) MinS...
  • 第13页 2.3 要分析的问题 最大的子序列和问题
    如果去掉括号里的 为方便起见,如果所有整数均为负数,则最大子序列和为0 ,那么下面的代码是这个扩展问题的解: int MaxSubsequenceSum(int A[], int N) { int ThisSum, MaxSum, i; ThisSum = MaxSum = A[0]; fo...

具体数学 (4)

  • 第13页 约瑟夫问题
    还有一个方法可以计算约瑟夫问题:2($\times$)n+1-($2^{m+1}$)不过貌似计算量差不多。1.17推广递归式稍微有点跳跃。有了变动基数的解,就不怕规则改变了:每隔两个删去一个人等等。
  • 第8页 约瑟夫问题
    有一个tricky的方法可以知道J(1000000)只需要19次计算:
  • 第9页 约瑟夫问题
    如果一位数据结构老师收到“约瑟夫问题”的这样一份答案,不知会怎么想: #include <stdio.h> unsigned flp2(unsigned x) { x |= x >> 1; x |= x >> 2; x |= x >> 4; x |= x >> 8; x |= x >> 16; return x - ...
  • 第2页 河内塔
    Try Wolframalpha with input: T(n) = 2T(n-1) + 1, T(0) = 0