# The Mathematica GuideBook for Programming

###### Michael Trott
Publisher:
Springer
Publication Date:
2004
Number of Pages:
904
Format:
Hardcover
Price:
79.95
ISBN:
0387942823
Category:
Manual
[Reviewed by
Marvin Schaefer
, on
08/1/2006
]

By way of explanation: It is uncommon for MAA Reviews to post reviews on software; rarer yet on programming manuals or guides. In the past, because of its pedagogical value for younger people, I wrote a review of Stan Wagon’s Mathematical Explorer, an interactive survey of various mathematical concepts that was built on a “stripped-down” version of Mathematica.

I have been a light-weight user of Mathematica for some years now. I primarily used it as a very powerful “calculator”: a tool for simplifying, solving or manipulating equations encountered in reading, for evaluating integrals, for testing the equivalence of expressions, or for graphing real or complex functions to help gain insights. Only rarely did I need to write programs in Mathematica, and those I wrote generally only required writing a dozen or so short function definitions. Usually, I quickly got what I needed; occasionally I’d receive a strange series of error messages (often about something not being a “machine precision number”) and have to consult on-line documentation or books written about using Mathematica. The latter generally focused on “toy” problems and offered a quick, but superficial, explanation of the principles of the system or its true power. All too frequently, their longer programs would be difficult to understand, as they used efficient, but cryptic, constructs like Plus @@ (NIntegrate[#1, {x, #2[[1]], #2[[-1]]}]& @@@ %[[1]])

The Mathematica GuideBooks are a significant exception to this paradigm. Constructs like the above do appear, but the first volume explains these notations as needed that builds a basis of familiarity and understanding. While the four volumes explain how to use Mathematica’s many functions, they go well beyond this and are indeed books on solving vast classes of real problems in mathematics and physics. As emphasis for Trott’s understanding that Mathematica cannot be learnt only by reading, he concludes each chapter with a generous set of graded exercises and programming problems and, in a separate section he presents detailed analyses, author’s insights, and illustrative solutions to the problems. The following is the first part of a progressing 8-part exercise from the first volume:

18a) For an arbitrary 3 x 3 matrix A,

A3 – tr(A) A2 + ½ (tr(A)2 – tr( A2)) A – det(A) 1 = 0,

where tr is the trace, det is the determinant, and 1 is the 3D identity matrix. (This identity follows from the Theorem of Cayley–Hamilton together with the Newton relations.) [Using Mathematica,] prove this identity.

In all, I have taken over two years to read the four volumes cover-to-cover. They are far more than an encyclopedic treatment or reference manual to Mathematica . This review is the first of a series on the four GuideBooks; it looks specifically at the first volume. Although the publisher claims that each volume is self-contained, the first volume’s content is very much a prerequisite to the other volumes in the set. As noted below, each volume’s DVD provides the complete text of the full four-volume set.

Series Background. PhD solid-state physicist Michael Trott began using version 1.2 of Mathematica in his native Germany in mid-1990. In 1991-2, he developed a 1600-page set of lecture notes from which he began teaching an Introductory Course in Mathematica 2 and an advanced course on the Efficient Use of the Mathematica Programming System , given in 1991/1992 at the Technical University of Ilmenau, Germany. Because of this course, he was invited to join Wolfram Research in 1994 where he is now a senior developer. Over the years, he continued evolving the growing set of lecture to accommodate new Mathematica versions and features and their applications.

Springer-Verlag began publishing the 5,027 densely-printed pages of Michael Trott’s Mathematica GuideBooks in 2004. All four volumes have now been published. The individual books, largely self-contained, address Programming, Graphics, Numerics and Symbolics. Each volume comes with a multiplatform DVD-ROM that contains the complete text, executable programs and evaluated visualizations of the specific volume it accompanies. In addition, the DVD contains the complete text and executable programs of the other three volumes. The printed volumes are actually black-and-white printouts of the 16 notebooks on the DVD which also has a complete hyperlinked table of contents and index the full set. Additionally, the chapter-by-chapter notebooks contain internal hyperlinks to other sections and to hundreds of bibliographic references. Many references are linked to abstracts or papers available on the Internet. Because of the space limitations and cost of printed books, there is far more information in the DVD and its cross-referencing tools than could fit in the bound volumes. The notebooks are compatible with Mathematica versions 4 and 5.

Over the years, many mathematicians and physicists have become familiar with Michael Trott’s functions web site (http://functions.wolfram.com). It contains references to over 87000 formulas with nearly 11000 striking visualizations of elementary functions and pi. His mathematical artwork has become well-known, appearing on posters, T-shirts, and other Mathematica -related materials and logos.

Volume 1: Programming. This book has six chapters: “Introduction to Mathematica”; “Structure of Mathematica Expressions”; “Definitions and Properties of Functions”; “Meta-Mathematica”; “Restricted Patterns and Replacement Rules”; and “Operations on Lists, and Linear Algebra”. The book’s structure follows the general outline of Wolfram’s Mathematica Book . The similarity ends there.

The first chapter provides an extensive overview of Mathematica’s capabilities. The pace is terse and considerably more sophisticated than that of any introduction to Mathematica I’ve seen elsewhere. It includes detailed approaches to solving actual problems including the system of ordinary differential equations for the Burridge–Knopoff model for earthquakes, set of partial differential equations. The author states: “Some of the inputs shown and executed in this chapter represent an intermediate to advanced use of Mathematica. Readers new to Mathematica will probably not understand how they work, neither should they. These inputs and code pieces represent a cross section of the type of problems treated in this book. After reading the GuideBooks , the reader will have no problem understanding these programs.” As the volume progresses, Trott generously shows pedagogical examples but occasionally reverts to the phrase that some of the more obscure constructions “will become intelligible to the reader” later in the book in order that a specific point can be presented in a real (rather than a toy) context. Remarkably, Trott keeps this promise! In the exercises, Trott invites the reader to pick a problem to work on while reading through the series. He suggests over 100 such problems, mostly mathematical with about 30 requiring a sound theoretical background in physics. Examples include: How does one calculate the shape of the two pieces used to cover a baseball? Which point of a hypercube in n dimensions maximizes the product of the distances to its vertices? How does one model the shape of a cracking whip? How does one analytically map a polygon with a hole to an annulus? How does one model the sand flow in a hourglass? Each problem is accompanied by a list of bibliographical references.

The second chapter is a thorough examination of Mathematica expressions and numbers. It presents elementary and transcendental functions, simple and nested expressions, rational, symbolic, real and complex numbers. Structures of expressions and numbers are explored fully, from user- and internal-perspectives, with tree structures shown for nested expressions. This chapter begins to show how the list is the fundamental structure on which Mathematica is based.

The third chapter begins the development of programming Mathematica. In its first section, the third chapter, “Definitions and Properties of Functions,” quickly covers the basics shown in every users’ manual. The six remaining sections systematically develop the concept of functions and their definitions as lists with attributes. This chapter also explores how Mathematica makes extensive use of pattern-representation and interpretation. Somewhat arcane topics are treated at length, including the important notions of immediate and delayed interpretation, up-values and down-values. Finally, pure functions are discussed in the context of Church’s λ-Calculus. The chapter concludes with sections on mapping, iterating and composing Mathematica functions.

The fourth chapter, “Meta-Mathematica” deals with the semantics of Mathematica as a programming system. As in any programming system, users are likely to write programs that fail for obscure reasons and that require debugging. Currently, Mathematica has nearly 2000 commands, and their misuse can produce confusing system messages or baffling results. In this chapter, the very structures of Mathematica are treated as Mathematica objects, and evaluation semantics are treated in excruciating detail, making this possibly the most demanding chapter in the volume. Naming and scoping are treated along with a short treatise on various forms of iteration. Linguistic tools are introduced that can show the full semantic representation and internal bindings of any Mathematica expression. Additionally, Trott shows the use of Mathematica’s execution tracing and trapping tools.

The fifth chapter fully examines patterns and rule-based programming. Mathematica’s pattern notation and interpretation capabilities enable the writing of short and elegant programs that eliminate much of the procedural bookkeeping required in most programming languages. Patterns make it possible to write short program expressions that allow for treating special cases in the context of the special case. But, without deep understanding of the problem and its computational complexity, these tools can also produce very inefficient programs. After developing the variations on Boolean functions and patterns, Trott gives several interesting examples, including development of a short(!) program for evaluating certain complete elliptic integrals from basic principles, complete with definitions, rules and recursive relationships.

The final chapter treats lists and their manipulation in full generality and explores their application to linear and matrix algebra. Mathematica has an extensive set of linear algebra commands that allow one to use lists (vectors, generalized n-dimensional matrices and arrays) as primitive structures. The chapter develops several interesting program applications, including a crossword-puzzle generator, construction and solution of magic squares, and powers and exponents of matrices. The chapter concludes with an illustration of the Cayley-Hamilton Theorem and a wealth of challenging exercises. As a coda, a program is developed that goes through the Standard Mathematica Packages to identify the “Top 10 Built-in Commands”used in producing the distributed Mathematica system. It should come as little surprise to the reader of this review that these are, in order: List, Pattern, Blank, Set, Times, Power, Plus, Null, CompoundExpression, and SetDelayed.This list explains the emphasis Trott has placed on lists, patters and execution semantics in this volume.

Trott maintains a web site for the GuideBooks where additional examples, graphics galleries, and errata and can be found and downloaded. The graphics gallery is well worth the visit!

The Mathematica GuideBook for Programming provided this reviewer with insights into solving and visualizing problems by using Mathematica rather than the other way around. Its wealth of exercises, annotated solutions and integrated bibliographic references should make this set a valuable part of the library of any Mathematica user. I highly recommend it.

Marvin Schaefer (bwapast@erols.com) is a computer security expert and was chief scientist at the National Computer Security Center at the NSA, and at Arca Systems. He has been a member of the MAA for 39 years and now operates an antiquarian book store called Books With a Past.

## CHAPTER 1 Introduction to Mathematica

### 1.1 Basics of Mathematica as a Programming Language

#### 1.1.1 General Background

• In and Out Numbering
• General Naming, Spelling, and Capitalization Conventions for Symbols
• Options and Option Settings
• Messages

#### 1.1.2 Elementary Syntax

• Common Shortcuts
• Parentheses, Braces, and Brackets
• Font Usage
• Referring to Outputs
• Functional Programming Style
• "Ideal" Formatting

### 1.2 Introductory Examples

#### 1.2.1 Numerical Computations

• Periodic Continued Fractions
• Pisot Numbers
• Fast Integer Arithmetic
• Digit Sums
• Numerical Integration
• Numerical ODE Solving
• Burridge-Knopoff Earthquake Model
• Trajectories in a Random Two-Dimensional Potential
• Numerical PDE Solving
• Benney PDE
• Sierpinski Triangle-Generating PDE
• Monitoring Numerical Algorithms
• Hilbert Matrices
• Distances between Matrix Eigenvalues
• Special Functions of Mathematical Physics
• Sums and Products
• Computing a High-Precision Value for Euler's Constant γ
• Numerical Root-Finding
• Roots of Polynomials
• Jensen Disks
• De Rham's Function
• Logistic Map
• Built-in Pseudo-Compiler
• Forest Fire Model
• Iterated Digit Sums
• Modeling a Sinai Billiard

#### 1.2.2 Graphics

• Gibbs Phenomena
• Fourier Series of Products of Discontinuous Functions
• Dirichlet Function
• Counting Digits
• Apollonius Circles
• Generalized Weierstrass Function
• 3D Plots
• Plotting Parametrized Surfaces
• Plotting Implicitly Defined Surfaces
• Graphics-Objects as Mathematica Expressions
• Kepler Tiling
• Fractal Post Sign
• Polyhedral Flowers
• Gauss Map Animation
• Random Polyehdra

#### 1.2.3 Symbolic Calculations

• Differentiation
• Integration
• Symbolic Solutions of ODEs
• Vandermonde Matrix
• LU Decomposition of a Vandermonde Matrix
• Redheffer Matrix
• Symbolic Representations of Polynomial Roots
• Solving Systems of Polynomials
• Eliminating Variables from Polynomial Systems
• Series Expansions
• L'Ho^spital's Rule
• Radical Expressions of Trigonometric Function Values
• Prime Factorizations
• Symbolic Summation
• Proving Legendre's Elliptic Integral Identity
• Geometric Theorem Proofs Using Gröbner Bases
• Medial Parallelograms
• Inequality Solving
• Symbolic Description of a Thickened Lissajous Curve
• Simplifications under Assumptions
• Numbers with Identical Digits in the Decimal and Continued Fraction Expansions
• Conformal Map of a Square to the Unit Disk
• Vortex Motion in a Rectangle
• Magnetic Field of a Magnet with Air Gap
• Localized Propagating Solution of the Maxwell Equation
• Customized Notations
• Schmidt Decomposition of a Two-Particle State

#### 1.2.4 Programming

• Large Calculations
• Partitioning Integers
• Binary Splitting-Based Fast Factorial
• Bolyai Expansion in Nested Radicals
• Defining Pfaffians
• Structure of Larger Programs
• Making Platonic Solids from Tori
• Equipotential Surfaces of a Charged Icosahedral Wireframe
• Tube along a 3D Hilbert Curve

### 1.3 What Computer Algebra and Mathematica 5.1 Can and Cannot Do

• What Mathematica Does Well
• What Mathematica Does Reasonably Well
• What Mathematica Cannot Do
• Package Proposals
• What Mathematica Is and What Mathematica Not Is
• Impacts of Computer Algebra
• Relevant Quotes
• Computer Algebra and Human Creativity
• New Opportunities Opened by Computer Algebra
• Computer Mathematics--The Joy Now and the Joy to Come

### Exercises

• Computing Wishes and Proposals
• Computer Algebra Systems

### Solutions

• 100 Proposals for Problems to Tackle
• Sources of Interesting and Challenging Problems
• ISSAC Challenge Problems

#### 4.3.1 System-Related Commands

• Mathematica Versions
• The Date Function
• Smallest and Largest Machine Real Numbers

#### 4.3.2 Session-Related Commands

• In and Out Numbering
• Input History
• Collecting Messages
• Display of Graphics
• Controlling Recursions and Iterations
• Deep Recursions
• Ackermann Function

### 4.4 Communication and Interaction with the Outside

#### 4.4.1 Writing to Files

• Extracting Function Definitions
• Writing Data and Definitions to Files
• Reading Data and Definitions from Files
• File Manipulations

#### 4.4.2 Simple String Manipulations

• Concatenating Strings
• Replacing Substrings
• General String Manipulations
• Case Sensitivity and Metacharacters
• A Program that Prints Itself

#### 4.4.3 Importing and Exporting Data and Graphics

• Importing and Exporting Files
• Importing Web Pages
• Importing From and To Strings
• Making Low-Resolution JPEGs

### 4.5 Debugging

• Displaying Steps of Calculations
• Evaluation Histories as Expressions
• Recursion versus Iteration
• Interactive Inputs

### 4.6 Localization of Variable Names

#### 4.6.1 Localization of Variables in Iterator Constructions

• Sums and Products
• Scoping of Iterator Variables

#### 4.6.2 Localization of Variables in Subprograms

• Scoping Constructs
• Lexical Scoping
• Dynamic Scoping
• Local Constants
• Temporary Variables
• Variable Scoping in Pure Functions
• Creating Unique Variables
• Nonlocal Program Flow

#### 4.6.3 Comparison of Scoping Constructs

• Delayed Assignments in Scoping Constructs
• Temporarily Changing Built-in Functions
• Variable Localization in Iterators
• Scoping in Nested Pure Functions
• Nesting Various Scoping Constructs
• Timing Comparisons of Scoping Constructs

#### 4.6.4 Localization of Variables in Contexts

• Contexts
• Variables in Contexts
• Searching through Contexts
• Manipulating Contexts
• Beginning and Ending Contexts

#### 4.6.5 Contexts and Packages

• General Structure of Packages
• Private Contexts
• Analyzing Context Changes

#### 4.6.6 Special Contexts and Packages

• Developer Functions
• Special Simplifiers
• Bit Operations
• Experimental Functions
• Standard Packages

### 4.7 The Process of Evaluation

• Details of Evaluating an Expression
• Analyzing Evaluation Examples
• Standard Evaluation Order
• Nonstandard Evaluations
• Held Arguments

### Exercises

• Frequently Seen Messages
• Unevaluated Arguments
• Predicting Results of Inputs
• Analyzing Context Changes
• Evaluated versus Unevaluated Expressions

### Solutions

• Shortcuts for Functions
• Functions with Zero Arguments
• Small Expressions that Are Large
• Localization of Iterator Variables
• Dynamical Context Changes
• Local Values

## CHAPTER 5 Restricted Patterns and Replacement Rules

### 5.1 Boolean and Related Functions

#### 5.1.1 Boolean Functions for Numbers

• Truth Values
• Predicates
• Functions Ending with Q
• Numbers and Numeric Quantities
• Integer and Real Numbers
• Compound Numeric Quantities
• Exact and Inexact Numbers
• Primality
• Gaussian Primes
• Stating Symbolic and Verifying Numeric Inequalities
• Comparisons of Numbers
• Ordering Relations
• Positivity

#### 5.1.2 Boolean Functions for General Expressions

• Testing Expressions for Being a Polynomial
• Vectors and Matrices
• Mathematical Equality
• Equality and Equations
• Structural Equality
• Identity of Expressions
• Equality versus Identity
• Canonical Order
• Membership Tests

#### 5.1.3 Logical Operations

• Boolean Operations
• And, Or, Not, and Xor
• Rewriting Logical Expressions
• Precedences of Logical Operators

#### 5.1.4 Control Structures

• Branching Constructs
• The If Statement
• Undecidable Conditions
• While and For Loops
• Prime Numbers in Arithmetic Progression

#### 5.1.5 Piecewise Functions

• Piecewise Defined Functions
• Canonicalization of Piecewise Functions
• Composition of Piecewise Functions
• Interpreting Functions as Piecewise Functions
• Specifying Geometric Regions
• Endpoint Distance Distribution of Random Flights

### 5.2 Patterns

#### 5.2.1 Patterns for Arbitrary Variable Sequences

• Simple Patterns
• Patterns for Multiple Arguments
• Testing Patterns
• Named Patterns
• Trace of Products of Gamma Matrices
• Shortcuts for Patterns
• Avoiding Evaluation in Patterns
• Literal Patterns

#### 5.2.2 Patterns with Special Properties

• Optional Arguments
• Default Values for Optional Arguments
• Repeated Arguments
• Excluding Certain Patterns
• Alternative Arguments
• Restricted Patterns
• Pattern Tests
• Conditional Patterns
• Recursive Definitions
• Pattern-Based Evaluation of Elliptic Integrals
• Generating Tables
• Selecting Elements from Lists
• All Syntactically Correct Shortcuts

#### 5.2.3 Attributes of Functions and Pattern Matching

• Pattern Matching in Commutative and Associative Functions
• Arguments in Any Order
• Nested Functions
• Automatic Use of Defaults
• Analyzing Matchings and Recursions in Pattern and Attribute Combinations

### 5.3 Replacement Rules

#### 5.3.1 Replacement Rules for Patterns

• Immediate and Delayed Rules
• One-Time and Repeated Replacements
• Unevaluated Replacements
• Common Pattern Matching Pitfalls
• Finding All Possible Replacements
• Scoping in Rules
• Replacements and Attributes
• Modeling Function Definitions
• Options and Rules
• Replacing Position-Specified Parts of Expressions

#### 5.3.2 Large Numbers of Replacement Rules

• Optimized Rule Application
• Complexity of Optimized Rule Application

#### 5.3.3 Programming with Rules

• Examples of Rule-Based Programs
• Splitting Lists
• Cycles of Permutations
• Sorting of Complex Numbers
• Cumulative Maxima
• Dividing Lists
• House of the Nikolaus
• Polypaths
• Rule-Based versus Other Programming Styles

### 5.4 String Patterns

• Strings with Pattern Elements
• Patterns for Character Sequences
• String-Membership Tests
• Shortest and Longest Possible Matches
• Overlapping Matches
• Counting Characters
• Replacing Characters
• All Possible Replacements
• Analyzing the Online Documentation
• Cumulative Letter Frequencies

### Exercises

• Rule-Based Expansion of Polynomials
• All Possible Patterns from a Given Set of Shortcuts
• Extending Built-in Functions
• General Finite Difference Weights
• Zeta Function Derivatives
• Operator Products
• q-Binomial Theorem
• q-Derivative
• Ordered Derivatives
• Differentiating Parametrized Matrices
• Ferrer Conjugates
• Hermite Polynomial Recursions
• Peakons
• Puzzles
• Catching Arguments and Their Head in Calculations
• Nested Scoping

### Solutions

• Modeling Noncommutative Operations
• Campbell-Baker-Hausdorff Formula
• Counting Function Calls Using Side Effects
• q-Deformed Pascal Triangle
• Ordered Derivative
• Avoiding Infinite Recursions in Pattern Matchings
• Dynamically Generated Definitions

## CHAPTER 6 Operations on Lists, and Linear Algebra

### 6.0 Remarks

• Prevalence of List Manipulations
• Building Polyhedra by Reflecting Polygons Iteratively
• Animating the Folding Process Based on Iterated Reflections

### 6.1 Creating Lists

#### 6.1.1 Creating General Lists

• Lists and Nested Lists as Arrays, Tables, Vectors, and Matrices
• Timings of Creating Nested Lists
• Summing Elements of Lists

#### 6.1.2 Creating Special Lists

• Kronecker Symbol and Identity Matrix
• Levi-Civita Symbol and Antisymmetric Tensors
• Creating Multiple Iterators
• Stirling Numbers
• Subsets and Tuples

### 6.2 Representation of Lists

• 2D Formatting of Tables and Matrices
• Aligning Rows and Columns
• Formatting Higher-Dimensional Tensors
• Tensors and Arrays

### 6.3 Manipulations on Single Lists

#### 6.3.1 Shortening Lists

• Extracting Elements from Lists
• Deleting Elements by Specifying Position, Pattern, or Property
• Prime Sieving

#### 6.3.2 Extending Lists

• Prepending, Appending, and Inserting List Elements
• Working with Named Lists

#### 6.3.3 Sorting and Manipulating Elements

• Rotating Lists Cyclically
• Sorting Lists
• Sorting Criteria
• Analyzing the Built-in Sorting Algorithm
• Splitting Lists
• Mapping Functions over Lists
• Listable Functions
• Mapping Functions to Expressions and Parts of Expressions
• Extracting Common Subexpressions
• Optimized Expressions

#### 6.3.4 Arithmetical Properties of Lists

• Average Value of a List
• Sum of a List
• Variance of a List
• Quantiles of a List

### 6.4 Operations with Several Lists or with Nested Lists

#### 6.4.1 Simple Operations

• Transposing Tensors
• Permutations
• Using Side Effects for Monitoring List Algorithms
• Joining Lists
• Intersections and Complements of Lists
• Finding Approximately Identical Elements

#### 6.4.2 List of All System Commands

• Working with Unevaluated Expressions
• Options and Attributes of All Built-in Functions
• Analyzing All Built-in Function Names
• Dependencies of Definitions

#### 6.4.3 More General Operations

• Contractions and Kronecker Products--Inner and Outer Products
• Rotations in 3D
• Cross Products

#### 6.4.4 Constructing a Crossword Puzzle

• A Large, List-Based Calculation
• Example Construction
• Manipulating Function Definitions through Downvalues
• Crossword Array of All Built-in Functions
• Crossword Array of All Package Functions
• Crossword Array of All Named Characters

### 6.5 Mathematical Operations with Matrices

#### 6.5.1 Linear Algebra

• Inverse Matrices
• Determinants
• Timing Comparisons for Various Element Types
• Traces of Matrices
• Modeling Trace Calculations
• Eigenvalues and Eigenvectors
• Pauli Matrices
• Properties of Eigenprojectors
• Power Method for Finding the Largest Eigenvalue
• Generalized Eigenvalue Problem
• Solving Systems of Linear Equations
• Siamese Sisters
• Lorentz Transformations in Matrix Form
• Moore-Penrose Inverse
• Best Solutions to Overdetermined Linear Systems
• Algorithms of Linear Algebra
• Quantum Cellular Automata
• Extending Linear Algebra Functions

#### 6.5.2 Constructing and Solving Magic Squares

• Underdetermined Linear Systems
• Integer Solutions of Linear Systems
• Decoding and Encoding Magic Squares
• Finding All Solutions of a Magic Square

#### 6.5.3 Powers and Exponents of Matrices

• Integer and Fractional Powers of Matrices
• Exponential Function of a Matrix
• Trigonometric Functions of Matrices
• Fractional Powers and Matrix Spectral Decompositions
• Matrix Evolution Equations
• Time-Development of a Linear Chain
• Cayley-Hamilton Theorem
• Characteristic Polynomials

### 6.6 The Top Ten Built-in Commands

• Finding Filenames
• Working with Unevaluated Expressions
• Counting Function Uses
• Zipf's Law
• Analyzing Notebooks, Cell Types, References, Typeset Structures, and Text

### Exercises

• Benford's Rule
• Timing Comparisons for List Operations
• Sum-Free Sets
• Generating an Index for This Book
• Consistency of References
• Line Length Distribution
• Spacing Check
• Moessner's Process
• Ducci's Iterations
• Stieltjes Iterations
• Pseudorandom trees
• Levi-Civita Tensor Contractions
• Dirac Matrices Products
• Determinants of Multidimensional Arrays
• Mediants
• d'Hondt Voting
• Identifying Approximate Vectors Efficiently
• Unsorted Complements
• All Arithmetic Expressions
• Ideal Formatting
• Functions with Method Options
• Functions with Level Specifications
• Changing Formatting by Programs
• Pattern Instances
• Matrix Identities
• Amitsur-Levitzky Identity
• Frobenius Formula for Block Matrices
• Iterative Matrix Square Root
• Differential Matrix Identities
• Matrix Derivatives
• Precedences of All Operators
• One-Liners
• Changing \$1
• Meissel Formula
• Binary Bracketing
• Kolakoski Sequence
• Puzzles
• Cloning Functions
• Hash Values
• Permutation Digit Sets

### Solutions

• Chemical Element Data
• Population Data of US Cities and Villages
• Caching versus List-Lookup
• Electronic Publication Growth
• Statistics of Author Initials
• Analyzing Bracket Frequencies
• Word Neighbor Statistics
• Weakly Decreasing Sequences
• Finding All Built-in Symbols with Values
• Automated Custom Code Formatting
• Making Dynamically Formatted Inputs
• Working with Symbolic Matrices