Daniel-Nikpayuk_SICP-Solutions/Chapter 1/1.2/exercise-1.10/exercise.lsp
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Copyright 2015 Daniel Nikpayuk
;;
;; This file is part of SICP Solutions.
;;
;; SICP Solutions is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License
;; as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
;;
;; SICP Solutions is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
;; of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License along with SICP Solutions. If not, see
;; <http://www.gnu.org/licenses/>.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(define (A x y)
  (cond ((= y 0) 0)
        ((= x 0) (* 2 y))
        ((= y 1) 2)
        (else (A (- x 1)
                 (A x (- y 1))))))

;(A 1 10)
;1024
;(A 2 4)
;65536
;(A 3 3)
;65536

(define (f n) (A 0 n))
;2n

(define (g n) (A 1 n))
;(A 0 (A 1 (n-1)))
;2(A 1 (n-1))
;2(A 1 (n-1))
;2^2(A 1 (n-2))
;2^(n-1)(A 1 (n-(n-1)))
;2^n

(define (h n) (A 2 n))
;(A 1 (A 2 (n-1)))
;2^(A 2 (n-1))
;2^(2^(A 2 (n-2)))
;2^(2^(2^(...(2^2)))) <--n times.

(define (k n) (* 5 n n))
;5n^2
