• Home
  • Textbooks
  • Computer science with Mathematica: theory and practice for science, mathematics, and engineering
  • Structure of Programs

Computer science with Mathematica: theory and practice for science, mathematics, and engineering

Roman Maeder

Chapter 4

Structure of Programs - all with Video Answers

Educators


Chapter Questions

08:08

Problem 1

Collect the functions that we developed for the Collatz sequence (Section 3.2) in a package Collatz.m. They are:
$$
\begin{aligned}
& \text { CollatzLength }[n] \\
& \text { CollatzSequence }[n] \\
& \text { CollatzMaximum }[a, b] \quad \text { (FindMax in Exercise 3.3) }
\end{aligned}
$$
Auxiliary functions should be defined in the implementation part. Add documentation and the necessary context declarations.

Chris Trentman
Chris Trentman
Numerade Educator

Problem 2

A Möbius transform is a complex-valued function of the form
$$
f(z)=\frac{a z+b}{c z+d}
$$
(a, $b, c$, and $d$ are complex numbers).
1. Find $a, b, c$, and $d$, such that
$$
\begin{array}{ll}
f(0) & =1, \\
f(1) & =1+i, \\
f(1+i) & =\infty
\end{array}
$$
2. Illustrate $f$ using ComplexParametricMap [] by choosing suitable sets of lines that show the essential features of $f$. Identify the values $f(0)$ and $f(\infty)$ in the diagrams.

Check back soon!