Quiz: Symbolic Math in Python


1. What are some of the SymPy Python package capabilities for symbolic math operations? Check all that apply.

A. Analytic (exact) derivatives
Correct.
B. Analytic (exact) definite integrals
Correct.
C. Analytic (exact) indefinite integrals
Correct.
D. Simplification
Correct.

2. In order to use the symbolic features of SymPy (import sympy as sp), a variable such as x must first be declared as follows (see help video):

A. x = sp.Variable('x')
Incorrect. Use sp.Symbol('x').
B. x = sp.Parameter('x')
Incorrect. Use sp.Symbol('x')
C. x = sp.Symbol('x')
Correct.

3. Analytic solutions are not exact.

A. True
Incorrect. Numerical solutions are not exact. Analytic solutions are exact.
B. False
Correct. Numerical solutions are not exact. Analytic solutions are exact.

4. Numerical solutions are typically an approximation of an exact solution.

A. True
Correct. One example is to use a finite difference to calculate a derivative such as df(x)/dx = f(x1)-f(x0) / (x1-x0). As the difference between x1 and x0 decreases, the approximation become more exact until the limits of machine precision (number of decimal places that can be stored by a computer) introduces round-off or truncation error.
B. False
Incorrect. The exact analytic solution is often not possible, but the numeric error can be approximated and reduced to a specified level.