<jupyter_start><jupyter_text>**Exercise 1.11**A function $f$ is defined by the rule that ${f(n)=n}$ if ${n<3}$ and${f(n)}={f(n-1)}+{2f(n-2)}+{3f(n-3)}$ if ${n\geq3}$.Write a procedure that computes f by means of a recursive process. Write a procedure that computes f by means of an iterative process.<jupyter_code>(define (f-r n) ; recursive, branched
  (if (< n 3)
      n
      (+ (f-r (- n 1))
         (f-r (- n 2))
         (f-r (- n 3)))))<jupyter_output><empty_output><jupyter_text>```scheme(f-r 6)(+ (f-r 5) (f-r 4) (f-r 3))(+ (+ (f-r 4) (f-r 3) (f-r 2)) (+ (f-r 3) (f-r 2) (f-r 1)) (+ (f-r 2) (f-r 1) (f-r 0)))(+ (+ (f-r 4) (f-r 3) 2) (+ (f-r 3) 2 1) (+ 2 1 0))...```위 함수는 이런 식으로 풀린다. (솔직히 풀어서 쓸 자신이 없다.)<jupyter_code>(define (f-i n) ; iterative
  (define (iter a b c count)
    (if (= count 3)
        (+ a b c)
        (iter (+ a b c) a b (- count 1))))
  (iter 2 1 0 n))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.23903508771929824, 'fraction_numerical': 0.044956140350877194, 'mean_word_length': 2.788381742738589, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '626925', 'license': 'Unlicense', 'n_tokens_mistral': 482, 'n_tokens_neox': 438, 'n_words': 130, 'path': '1/11.ipynb', 'repo_name': 'BasixKOR/SICP', 'size': '912'}