Merge branch 'main' into v0.16

This commit is contained in:
jverzani 2023-04-15 07:20:57 -04:00
commit a4b670cd81

View File

@ -89,7 +89,7 @@ This variable is a `Polynomial` object, so can be manipulated as a polynomial; w
```{julia}
r = (x-2)^3 * (x-1) * (x+1)
r = (x-2)^2 * (x-1) * (x+1)
```
The product is expanded for storage by `Polynomials`, which may not be desirable for some uses. A new variable can produced by calling `variable()`; so we could have constructed `p` by:
@ -154,7 +154,7 @@ Polynomial objects have a plot recipe defined plotting from the `Plots` pack
plot(r, legend=false) # suppress the legend
```
The choice of domain is heuristically identified; it and can be manually adjusted, as with:
The choice of domain is heuristically identified; and it can be manually adjusted, as with:
```{julia}
@ -440,7 +440,7 @@ numericq(4)
###### Question
The identification of a collection of coefficients with a polynomial depends on an understood **basis**. A basis for the polynomials of degree $n$ or less, consists of a minimal collection of polynomials for which all the polynomials of degree $n$ or less can be expressed through a combination of sums of terms, each of which is just a coefficient times a basis member. The typical basis is the $n+$ polynomials $1`, `x`, `x^2, \dots, x^n$. However, though every basis must have $n+1$ members, they need not be these.
The identification of a collection of coefficients with a polynomial depends on an understood **basis**. A basis for the polynomials of degree $n$ or less, consists of a minimal collection of polynomials for which all the polynomials of degree $n$ or less can be expressed through a combination of sums of terms, each of which is just a coefficient times a basis member. The typical basis is the $n+1$ polynomials $1, x, x^2, \dots, x^n$. However, though every basis must have $n+1$ members, they need not be these.
A basis used by [Lagrange](https://en.wikipedia.org/wiki/Lagrange_polynomial) is the following. Let there be $n+1$ points distinct points $x_0, x_1, \dots, x_n$. For each $i$ in $0$ to $n$ define
@ -448,7 +448,7 @@ A basis used by [Lagrange](https://en.wikipedia.org/wiki/Lagrange_polynomial) is
$$
l_i(x) = \prod_{0 \leq j \leq n; j \ne i} \frac{x-x_j}{x_i - x_j} =
\frac{(x-x_1)\cdot(x-x_2)\cdot \cdots \cdot (x-x_{j-1}) \cdot (x-x_{j+1}) \cdot \cdots \cdot (x-x_n)}{(x_i-x_1)\cdot(x_i-x_2)\cdot \cdots \cdot (x_i-x_{j-1}) \cdot (x_i-x_{j+1}) \cdot \cdots \cdot (x_i-x_n)}.
\frac{(x-x_1)\cdot(x-x_2)\cdot \cdots \cdot (x-x_{i-1}) \cdot (x-x_{i+1}) \cdot \cdots \cdot (x-x_n)}{(x_i-x_1)\cdot(x_i-x_2)\cdot \cdots \cdot (x_i-x_{i-1}) \cdot (x_i-x_{i+1}) \cdot \cdots \cdot (x_i-x_n)}.
$$
That is $l_i(x)$ is a product of terms like $(x-x_j)/(x_i-x_j)$ *except* when $j=i$.
@ -518,7 +518,7 @@ What is the value of $l_i(x_j)$ *if* $i \ne j$?
numericq(0)
```
Suppose the $x_0, x_1, \dots, x_n$ are the $x$ coordinates of $n$ distinct points $(x_0,y_0)$, $(x_1, y_1), \dots, (x_n,y_n).$ Form the polynomial with the above basis and coefficients being the $y$ values. That is consider:
Suppose the $x_0, x_1, \dots, x_n$ are the $x$ coordinates of $n+1$ distinct points $(x_0,y_0)$, $(x_1, y_1), \dots, (x_n,y_n).$ Form the polynomial with the above basis and coefficients being the $y$ values. That is consider:
$$
@ -560,13 +560,13 @@ With these definitions what is the polynomial associated to the coefficients $[0
#| echo: false
choices = [
raw"""
It is ``0\cdot 1 + 1 \cdot x + 2 \cdots x^2 + 3\cdot x^3 = x + 2x^2 + 3x^3``
""",
It is ``0\cdot 1 + 1 \cdot x + 2 \cdot x^2 + 3\cdot x^3 = x + 2x^2 + 3x^3``
"""
raw"""
It is ``0\cdot T_1(x) + 1\cdot T_1(x) + 2\cdot T_2(x) + 3\cdot T_3(x) = 0``
""",
It is ``0\cdot T_0(x) + 1\cdot T_1(x) + 2\cdot T_2(x) + 3\cdot T_3(x) = 0``
"""
raw"""
It is ``0\cdot T_1(x) + 1\cdot T_1(x) + 2\cdot T_2(x) + 3\cdot T_3(x) = -2 - 8\cdot x + 4\cdot x^2 + 12\cdot x^3```
It is ``0\cdot T_0(x) + 1\cdot T_1(x) + 2\cdot T_2(x) + 3\cdot T_3(x) = -2 - 8\cdot x + 4\cdot x^2 + 12\cdot x^3```
"""]
radioq(choices, 3)
```