...
- 11.2.4
- Copy the definition of
deep-list
from the text. Be sure to provide your own function template fordeep-list
and to write template instantiation instantiations fordepth
andmake-deep
.
- Copy the definition of
- 11.4.7
Include a data definition \ (following the text\) of {{natural\[>=1\]}} . In addition to the constructors, accessor, recognizers, and {{equal?}} , you may use the library functions {{remainder}} and {{*}} . Hint: define an auxiliary function {{ofWiki Markup natural>=
. In addition to the constructors, accessor, recognizers, andequal?
, you may use the library functionsremainder
and*
. Hint: define an auxiliary functionis-divisible-by
}} of two inputs {{p
}} and {{q
}} \ (using the {{remainder
}} library function\) that determines if {{p
}} is divisible by {{q
}} (p/q is a whole number).- Note that the problem as stated in the book has TWO parts; the second, writing
prime?
is easy after doing the first.
- 12.2.2
- 12.4.2
- Do this problem followed by developing the function
arrangements
that returns a list containing all of the arrangements (permutations) of the input word. This function is described in detail in the text and the code for it is given to you in problem 12.4.1, but present this answer in your program file as if you developed it, including supporting test data. - Notes: the function
arrangements
computes all of the permutations of the input word. Permutation is an important concept in basic probability theory. For some reason, the authors of the book chose to avoid using the relevant mathematical terminology. This problem includes writing thearrangements
function because it is cool and developing insert-everywhere/in-all-words is contains the bulk of the work involved in developingarrangements
.
- Do this problem followed by developing the function
- 13.0.5 (part 4 only)
- 13.0.8 (part 2 only)