Search problems

2 problems match “function iteration”. Clear

Visitors search a sample. Sign in for free to search every problem. Sign in

  1. Iterated piecewise function value ●○○○○ 10 ptsFor integers nn, let f(n)={n2+1if n is odd,n2−3n+1if n is even.f(n) = \begin{cases} n^2 + 1 & \text{if } n \text{ is odd}, \\ n^2 - 3n + 1 & \text{if } n \text{ is even}. \end{cases} Find f(f(f(f(f(f(2))))))f(f(f(f(f(f(2)))))).
  2. Evaluating the Ackermann function ●●○○○ 20 ptsDefine a function A(m,n)A(m, n) by A(m,n)={n+1if m=0,A(m−1,1)if m>0 and n=0,A(m−1,A(m,n−1))if m>0 and n>0.A(m,n) = \begin{cases} n+1 & \text{if } m = 0, \\ A(m-1, 1) & \text{if } m > 0 \text{ and } n = 0, \\ A(m-1, A(m, n-1)) & \text{if } m > 0 \text{ and } n > 0. \end{cases} Compute A(2,1)A(2, 1).