Ackermann function derivation (m <= 3)

Examples Ackermann function (Ackermann) of the original non-recursive functions. It takes two natural numbers as an input value, the output of a natural number. Its output value grew very fast, only for the (4,3) output has been so large that can not be accurately calculated.
\ [A (m, n) = \ left \ {\ begin {array} {ll} {n + 1} & {m = 0} \\ {A (m-1,1)} & {m> 0, n = 0} \\ {A ( m-1, A (m, n-1))} & {m> 0, n> 0} \ end {array} \ right. \]

Since \ (m \) is small, so we can for \ (0 \ leq m \ leq 3 \) to be deduced to Ackermann function
for a particular derivation Ackermann function is as follows:

  • When (m = 0 \) \ time:
    \ [A (0, n-). 1 = n-+ \]
  • \(m=1\)时:
    \[ \begin{aligned} A(1, n) &=A(0, A(1, n-1))=A(1, n-1)+1 \\ &=A(0, A(1, n-2))=A(1, n-2)+2 \\ &=A(0, n-3)+3 \\ & \cdots \\ &=A(1,0)+n \\ &=A(0,1)+n \\ &=n+2 \end{aligned} \]
  • \(m=2\)时:
    \[ \begin{aligned} A(2, n) &=A(1, A(2, n-1))=A(2, n-1)+2 \\ &=A(1, A(2, n-2))+2 \\ &=A(2, n-2)+2 \times 2 \\ & \cdots \\ &=A(2,0)+2 \times n \\ &=A(1,1)+2 \times n \\ &=3+2 \times n \end{aligned} \]
  • \(m=3\)时:
    \[ \begin{aligned} A(3, n) &=A(2, A(3, n-1)) \\ &=A(3, n-1) \times 2+3 \\ &=A(2, A(3, n-2)) \times 2+3 \\ &=(A(3, n-2) \times 2+3) \times 2+3 \\ &=2 \times 2 \times A(3, n-2)+2 \times 3+3 \\ &=2 \times 2 \times A(3, n-2)+2 \times 3+3 \\ &=2 \times 2 \times(A(3, n-2)+2 \times 3+3) \\ &=2 \times 2 \times(A(3, n-3) \times 2+3)+2 \times 3+3 \\ &=2^{n} \times A(2,1)+3 \times\left(2^{n}-1\right) \\ &=2^{n} \times 5+2^{n} \times 3-3 \\ &=2^{n+3}-3 \end{aligned} \]

Guess you like

Origin www.cnblogs.com/Friends-A/p/11389837.html