Merge pull request #140 from fangliu-tju/main

some typos
This commit is contained in:
john verzani 2025-04-23 11:36:48 -04:00 committed by GitHub
commit 8df336b595
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 20 additions and 20 deletions

View File

@ -1305,7 +1305,7 @@ With this we can answer agequestions, such as:
> How many stars can we see in the sky?
Star [magnitude](https://en.wikipedia.org/wiki/Magnitude_(astronomy)) measures the brightness of celestial objects, with the sun on a log scale so that a magnitude $1$ star is $100$ times brighter than a magnitude $6$ star. The sun has a value around $-27$, Sirius (the brightest visible star) around $-1.46), Venus around $-5$. We will take a magnitude of $6$ or brighter for visibility. (magnitudes less than $6$). The value of $N(6)$ is then
Star [magnitude](https://en.wikipedia.org/wiki/Magnitude_(astronomy)) measures the brightness of celestial objects, with the sun on a log scale so that a magnitude $1$ star is $100$ times brighter than a magnitude $6$ star. The sun has a value around $-27$, Sirius (the brightest visible star) around $-1.46$), Venus around $-5$. We will take a magnitude of $6$ or brighter for visibility. (magnitudes less than $6$). The value of $N(6)$ is then
```{julia}
q(m) = -0.0003*m^3 + 0.0019*m^2 + 0.484*m - 3.82
@ -1355,7 +1355,7 @@ If a star of magnitude $5$ difference is $100$ times brighter, what is the scale
```{julia}
#| echo: false
explanation = raw"""
The base $a$ solve $\log_a(x + 5) / \log_a(x) = 100$. The logs can be combined and then $a$ can be solved for.
The base $a$ solve $\log_a(100x) - \log_a(x) = 5$. The logs can be combined and then $a$ can be solved for.
"""
choices = [raw"$5$",raw"$\sqrt[5]{100}$", raw"$\sqrt{100}$"]
answer = 2

View File

@ -182,7 +182,7 @@ x &= \sqrt{(1-y)/y}, \quad 0 < y \leq 1.
\end{align*}
$$
Then $f^{-1}(x) = \sqrt{(1-x)/x}$ where $0 < x \leq 1$. The somewhat complicated restriction for the the domain coincides with the range of $f(x)$. We shall see next that this is no coincidence.
Then $f^{-1}(x) = \sqrt{(1-x)/x}$ where $0 < x \leq 1$. The somewhat complicated restriction for the domain coincides with the range of $f(x)$. We shall see next that this is no coincidence.
## Formal properties of the inverse function
@ -198,7 +198,7 @@ plot(f, 0, 4, legend=false)
plot!([2,2,0], [0,f(2),f(2)])
```
The graph is shown over the interval $(0,4)$, but the *domain* of $f(x)$ is all $x \geq 0$. The *range* of $f(x)$ is clearly $2 \leq x \leq \infty$.
The graph is shown over the interval $(0,4)$, but the *domain* of $f(x)$ is all $x \geq 0$. The *range* of $f(x)$ is clearly $2 \leq y \leq \infty$.
The lines layered on the plot show how to associate an $x$ value to a $y$ value or vice versa (as $f(x)$ is one-to-one). The domain then of the inverse function is all the $y$ values for which a corresponding $x$ value exists: this is clearly all values bigger or equal to $2$. The *range* of the inverse function can be seen to be all the images for the values of $y$, which would be all $x \geq 0$. This gives the relationship:
@ -283,7 +283,7 @@ The slope of $f(x) = 9/5 \cdot x + 32$ is clearly $9/5$ and the slope of the inv
Now consider the graph of the *tangent line* to a function. This concept will be better defined later, for now, it is a line "tangent" to the graph of $f(x)$ at a point $x=c$.
For concreteness, we consider $f(x) = \sqrt{x}$ at $c=2$. The tangent line will have slope $1/(2\sqrt{2})$ and will go through the point $(2, f(2)$. We graph the function, its tangent line, and their inverses:
For concreteness, we consider $f(x) = \sqrt{x}$ at $c=2$. The tangent line will have slope $1/(2\sqrt{2})$ and will go through the point $(2, f(2))$. We graph the function, its tangent line, and their inverses:
```{julia}

View File

@ -94,7 +94,7 @@ Well, almost... When `Inf` or `NaN` are involved, this may not hold, for example
So adding or subtracting most any finite value from an inequality will preserve the inequality, just as it does for equations.
What about addition and multiplication?
What about multiplication?
Consider the case $a < b$ and $c > 0$. Then $ca < cb$. Here we investigate using $3$ random values (which will be positive):
@ -231,7 +231,7 @@ Read aloud this would be "minus $7$ is less than $x$ minus $5$ **and** $x$ minus
The "and" equations can be combined as above with a natural notation. However, an equation like $\lvert x - 5\rvert > 7$ would emphasize an **or** and be "$x$ minus $5$ less than minus $7$ **or** $x$ minus $5$ greater than $7$". Expressing this requires some new notation.
The *boolean shortcut operators* `&&` and `||` implement "and" and "or." (There are also *bitwise* boolean operators `&` and `|`, but we only describe the former.)
The *boolean shortcut operators* `&&` and `||` implement "and" and "or". (There are also *bitwise* boolean operators `&` and `|`, but we only describe the former.)
Thus we could write $-7 < x-5 < 7$ as

View File

@ -88,7 +88,7 @@ These values are *very* small numbers, but not exactly $0$, as they are mathemat
---
The only common issue is with powers. We saw this previously when discussing a distinction between `2^64` and `2.0^64. `Julia` tries to keep a predictable output from the input types (not their values). Here are the two main cases that arise where this can cause unexpected results:
The only common issue is with powers. We saw this previously when discussing a distinction between `2^64` and `2.0^64`. `Julia` tries to keep a predictable output from the input types (not their values). Here are the two main cases that arise where this can cause unexpected results:
* integer bases and integer exponents can *easily* overflow. Not only `m^n` is always an integer, it is always an integer with a fixed storage size computed from the sizes of `m` and `n`. So the powers can quickly get too big. This can be especially noticeable on older $32$-bit machines, where too big is $2^{32} = 4,294,967,296$. On $64$-bit machines, this limit is present but much bigger.
@ -643,7 +643,7 @@ Finding the value through division introduces a floating point deviation. Which
```{julia}
#| echo: false
as = [`1/10^21`, `1e-21`]
as = ["1/10^21", "1e-21"]
explanation = "The scientific notation is correct. Due to integer overflow `10^21` is not the same number as `10.0^21`."
buttonq(as, 2; explanation)
```

View File

@ -899,7 +899,7 @@ buttonq(["Yes", "No"], 1; explanation)
###### Question
Make this parametric plot for the specific values of the parameters `k` and `l`. What shape best describes it?
Make this parametric plot for the specific values of the parameters `R`, `r`, and `rho`. What shape best describes it?
```{julia}

View File

@ -749,7 +749,7 @@ If this sum has a remainder of 0 when dividing by 10, the credit card number is
iszero(rem(z,10))
```
Darn. A typo. is `4137 8947 1175 5804` a possible credit card number?
Darn. A typo. is `4137 8047 1175 5804` a possible credit card number?
```{julia}
#| hold: true

View File

@ -280,7 +280,7 @@ plot!(h, label="h")
A model for the length of a day in New York City must take into account periodic seasonal effects. A simple model might be a sine curve. However, there would need to be many modifications: Obvious ones would be that the period would need to be about $365$ days, the oscillation around $12$ and the amplitude of the oscillations no more than $12$.
We can be more precise. According to [dateandtime.info](http://dateandtime.info/citysunrisesunset.php?id=5128581) in $2015$ the longest day will be June $21$st when there will be $15$h $5$m $46$s of sunlight, the shortest day will be December $21$st when there will be $9$h $15$m $19$s of sunlight. On January $1$, there will be $9$h $19$m $44$s of sunlight.
We can be more precise. According to [dateandtime.info](http://dateandtime.info/citysunrisesunset.php?id=5128581) in $2015$ the longest day will be June $21$st when there will be $15$h $8$m $55$s of sunlight, the shortest day will be December $21$st when there will be $9$h $18$m $23$s of sunlight. On March $21$st, there will be $12$h $13$m $42$s of sunlight.
A model for a transformed sine curve is
@ -294,12 +294,12 @@ Where $b$ is related to the amplitude, $c$ the shift and the period is $T=2\pi/d
```{julia}
a = 12
b = ((15 + 5/60 + 46/60/60) - (9 + 19/60 + 44/60/60)) / 2
a = 12 + 13/60 + 42/60/60
b = ((15 + 8/60 + 55/60/60) - (9 + 18/60 + 23/60/60)) / 2
d = 2pi/365
```
If we let January $1$ be $x=0$ then the first day of spring, March $21$, is day $80$ (`Date(2017, 3, 21) - Date(2017, 1, 1) + 1`). This day aligns with the shift of the sine curve. This shift is $80$:
If we let January $1$st be $x=0$ then the first day of spring, March $21$st, is day $80$ (`Date(2015, 3, 21) - Date(2015, 1, 1) + Day(1)`). This day aligns with the shift of the sine curve. This shift is $80$:
```{julia}
@ -314,15 +314,15 @@ newyork(t) = up(stretch(over(scale(sin, d), c), b), a)(t)
plot(newyork, -20, 385)
```
To test, if we match up with the model powering [dateandtime.info](http://dateandtime.info/citysunrisesunset.php?id=5128581) we note that it predicts "$15$h $0$m $4$s" on July $4$, $2015$. This is day $185$ (`Date(2015, 7, 4) - Date(2015, 1, 1) + 1`). Our model prediction has a difference of
To test, if we match up with the model powering [dateandtime.info](http://dateandtime.info/citysunrisesunset.php?id=5128581) we note that it predicts "$12$h $10$m $38$s" on September $23$th, $2015$. This is day $266$ (`Date(2015, 9, 23) - Date(2015, 1, 1) + Day(1)`). Our model prediction has a difference of
```{julia}
datetime = 15 + 0/60 + 4/60/60
delta = (newyork(185) - datetime) * 60
datetime = 12 + 10/60 + 38/60/60
delta = (newyork(266) - datetime) * 60
```
This is off by a fair amount - almost $12$ minutes. Clearly a trigonometric model, based on the assumption of circular motion of the earth around the sun, is not accurate enough for precise work, but it does help one understand how summer days are longer than winter days and how the length of a day changes fastest at the spring and fall equinoxes.
This is off by a fair amount - almost $8$ minutes. Clearly a trigonometric model, based on the assumption of circular motion of the earth around the sun, is not accurate enough for precise work, but it does help one understand how summer days are longer than winter days and how the length of a day changes fastest at the spring and fall equinoxes.
##### Example: the pipeline operator

View File

@ -264,7 +264,7 @@ plt = plot(legend=false, size=fig_size)
arrow!(p0, [2,3], color="black")
arrow!(p0, [2,0], color="orange")
arrow!(p0+[2,0], [0,3], color="orange")
annotate!(plt, collect(zip([.25, 1,1,1.75], [.25, 1.85,.25,1], [L"t",L"r", L"r \cdot \cos(t)", L"r \cdot \sin(t)"]))) #["θ","r", "r ⋅ cos(θ)", "r ⋅ sin(θ)"]
annotate!(plt, collect(zip([.25, 1,1,1.75], [.15, 1.85,.25,1], [L"\theta",L"r", L"r \cdot \cos(\theta)", L"r \cdot \sin(\theta)"]))) #["θ","r", "r ⋅ cos(θ)", "r ⋅ sin(θ)"]
imgfile = tempname() * ".png"
png(plt, imgfile)