Problem_Set_05_Solutions_Code

Problem_Set_05_Solutions_Code - (* r r-product) (dec n)...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
;;; permutation (define (p n r) (define (helper product n r) (if (< r 1) product (helper (* n product) (dec n) (dec r)))) (helper 1 n r)) (define (c n r) (define (helper p-product r-product n r) (if (< r 1) (/ p-product r-product) (helper (* n p-product)
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: (* r r-product) (dec n) (dec r)))) (helper 1 1 n r)) (define (fact n) (define (helper product counter max-count) (if (&amp;gt; counter max-count) product (helper (* counter product) (+ counter 1) max-count))) (helper 1 1 n))...
View Full Document

Ask a homework question - tutors are online