Thursday, October 17, 2019

Sequence and series

sequence is a function defined on the set of positive integers. This means that if you give me a positive integer $5$, I should be able to give you some object $a_{5}$, labeled with the number you gave me, which is $5$ in this case.

For example, we can think about the "identity sequence" given by $a_{n} = n$. That is, this sequence gives you back the number your give it as an input. Another example can be $a_{n} = n^{2}$. Sometimes, you may not be able to write down the formula for $a_{n}$ explicitly. For instance, define $a_{n}$ to be the $n$-th digit of $\pi = 3.141592 \dots$ after the dot. We have $a_{1} = 1, a_{2} = 4, a_{3} = 1, a_{4} = 5, \dots.$ However, because $\pi$ is an irrational number, so there is no way you can write down a general formula for $a_{n},$ which we call the $n$-th term of the sequence $(a_{i})_{i \geq 1}.$

Remark. Note that most of the time, it is perfectly fine to extend the domain of the sequence from positive integersA sequence is a function defined on the set of positive integers. This means that if you give me a positive integer $5$, I should be able to give you some object $a_{5}$, labeled with the number you gave me, which is $5$ in this case.

For example, we can think about the "identity sequence" given by $a_{n} = n$. That is, this sequence gives you back the number your give it as an input. Another example can be $a_{n} = n^{2}$. Sometimes, you may not be able to write down the formula for $a_{n}$ explicitly. For instance, define $a_{n}$ to be the $n$-th digit of $\pi = 3.141592 \dots$ after the dot. We have $a_{1} = 1, a_{2} = 4, a_{3} = 1, a_{4} = 5, \dots.$ However, because $\pi$ is an irrational number, so there is no way you can write down a general formula for $a_{n},$ which we call the $n$-th term of the sequence $(a_{i})_{i \geq 1}.$

Remark. Note that most of the time, it is perfectly fine to extend the domain of the sequence from positive integers to non-negative integers. For example, the sequence given by the formula $a_{n} = n$ can be thought over all the non-negative integers or even negative integers. It is of course okay to extend this formula for all real numbers, but we usually don't call it a sequence if it is over all real numbers. There is a reason for this, but discussing this digresses too much from our main discussion, so we won't discuss this.

We can take the limit of sequence, when ever the limit exists. For example, we have
\[\lim_{n \rightarrow \infty}\frac{1}{n} = 0.\]
One important property of real numbers is the following. The name of this property is "completeness", although your book (p.477, Theorem 9.1) does not mention this terminology.

Completeness proeprty. Any increasing sequence bounded above is convergent.

Exercise. Determine whether the sequence given by the following formula is increasing:
\[a_{n} = \left(1 + \frac{1}{n}\right)^{n}.\]

For the problem above, you might find the following hint useful:

Consider $f(x) = (1 + 1/x)^{x},$ for $x > 0.$ Let $g(x) := \ln(f(x)) = x \ln(1 + 1/x)$ so that $$g'(x) = \ln\left(1 + \frac{1}{x}\right) + \frac{x}{1 + 1/x}\left(-\frac{1}{x^{2}}\right) = \ln\left(1 + \frac{1}{x}\right) - \frac{1}{x + 1}.$$
Hence $g'(x) > 0$ for $x \geq 1.$ This shows that $g(x) = \ln(f(x))$ is increasing for $x \geq 1,$ so $f(x)$ is increasing for $x \geq 1.$ This implies that $f(n) = a_{n}$ is increasing for $n = 1, 2, 3, \dots.$

Remark. How do we know that $g'(x) > 0$ for $x \geq 1$? First, note that $g'(1) = \ln(2) - 1/2 > 0$ because $2 > e^{1/2}$, because $4 > e.$ Now, take the derivative of $g'(x)$ to have $$(g'(x))' = g''(x) = \frac{1}{1 + 1/x}\left(- \frac{1}{x^{2}}\right) + \frac{1}{(x + 1)^{2}} = -\frac{1}{x(x + 1)} + \frac{1}{(x+1)^{2}} > 0,$$ for $x \geq 1.$ Thus, we must have $g'(x) \geq \ln(2) - 1/2 > 0$ for all $x \geq 1.$

We have checked that the sequence $a_{n} = (1 + 1/n)^{n}$ is increasing. The sequence is also bounded above by $3$. Checking this is same as checking $1 + 1/n \leq 3^{1/n},$ which can be checked by checking $1 + x \leq 3^{x}$ for $0 \leq x \leq 1,$ which can be checked by differentiation trick we have introduced above. Therefore, by the completeness property, the limit of $a_{n}$ exists, and we call this limit $e.$ That is, we define $$e := \lim_{n \rightarrow \infty}\left(1 + \frac{1}{n}\right)^{n}.$$

geometric sequence is a sequence such that that each pair of the consecutive terms have the same ratio. If such a common ratio $r$ is non-zero, then we can consider this sequence to be given by $a_{n+1}/a_{n} = r$ for all $n \geq 1.$ More explicitly, you may deduce that
\[a_{n} = a_{1}r^{n-1}.\] 
series is a sum of the terms of a sequence. You can have finite series or infinite series. There is a version of $p$-test in the series world. 

$p$-series. Given any real number $p,$ the series
\[\sum_{n=1}^{\infty}\frac{1}{n^{p}}\]
converges if and only if $p > 1.$ We refer to this as "$p$-series", although this is not a standard math terminology outside Math 116.

Question. Is there a more general phenomenon?

Answer. Yes! This is what we call the integral test. Please read the link, and at least get comfortable with the statement. Alternatively, you may read p.492 of your book.

Exercise. Solve #4 of Exam 3, Fall 2016.

Optional reading. You may consider $p$-series as a function in $p$, and it turned out that this is one of the most important functions in mathematics, called "zeta function". I like thinking about it, since it often breaks data about integers into atomic pieces about prime numbers.

geometric series is a sum of a geometric sequence. Say $a_{1}, a_{2}, a_{3}, \dots$ is the geometric sequence of ratio $r$. Then we may consider their partial sums $$s_{n} := a_{1} + \cdots + a_{n}.$$

Exercise. Show that $s_{n} - s_{n-1} = a_{n}$ for $n \geq 1.$ Note that this holds for any sequence, not just for geometric sequences. This proves that if $s_{n}$ converges, then $a_{n}$ converges to $0$, which is called the general term test. (You might have to call it "$n$-th term test" for your exam, but this terminology is misleading.) A more useful way of thinking about this test is the following.

Term test for divergence. If $a_{n}$ does not go to $0,$ then $\sum_{n=1}^{\infty}a_{n}$ diverges.

Exercise. Using the fact that $a_{n} = a_{1}r^{n-1}$, show that if $r \neq 1,$ then
\[s_{n} = \frac{a_{1}(r^{n} - 1)}{r - 1} = \frac{a_{1}(1 - r^{n})}{1 - r}.\]
In particular, if $-1 < r < 1,$ then
 $$a_{1} + a_{2} + a_{3} + \cdots = \lim_{n \rightarrow \infty}s_{n} = \frac{a_{1}}{r - 1},$$ and you must remember this fact about geometric series!

Exercise. Show that $0.99999 \dots = 1.$

Friday, October 11, 2019

Probability

Introduction to probability distributions. The discussion here might be too advanced for Math 116 students, so I highly recommend you read through Section 8.7 and 8.8 of your book. Nevertheless, I think the book needs a bit more explanations, so I am just writing some here. Don't worry. I won't give proofs in class!

A continuous real-valued function $p(x)$ is called a probability density function (pdf) if the following two conditions are satisfied:
  1. $p(x) \geq 0$ for all $x.$
  2. $\int_{-\infty}^{\infty}p(x)dx = 1.$
Thus, given such a function $p(x),$ you can model some notion of probability. For example, your model can design (if chosen at random) "the probability that a person's height $x$ is between $5$ feet and $6$ feet" as the quantity $$\int_{x=5}^{x=6} p(x) dx.$$ Of course, you might want to pick $p(x)$ well enough that your probability is not too far from reality. (This is very nontrivial in practice.)

The cumulative distribution function (cdf) of a pdf $p(x)$ is $$P(t) := \int_{x= - \infty}^{x=t}p(x)dx.$$

Exercise. If $P(t)$ is the cdf of a pdf $p(x),$ then show that $P'(t) = p(t).$

Exercise. If $P(t)$ is the cdf of a pdf $p(x),$ then show that
  1. $P(t)$ is non-decreasing,
  2. $\lim_{t \rightarrow -\infty}P(t) = 0$,
  3. $\lim_{t \rightarrow \infty}P(t) = 1$, and
  4. $\int_{a}^{b}p(x)dx = P(b) - P(a).$
Exercise. Book 8.7: #1, #5, #14, #24.

Given any p.d.f. $p,$ its mean is $$\mu(p) := \int_{-\infty}^{\infty}x p(x) dx,$$ and we will only consider the case when this is a convergent integral.

Remark. For this, we need to ensure that $p(x)$ decays fast enough. For instance, if we let $c = \int_{1}^{\infty}x^{-2} dx$ and define $p(x) = c^{-1}x^{-2}$ for $x \geq 1$ and $0$ elsewhere, then $p(x)$ is a legitimate p.d.f, while we have $$\mu(p) = c^{-1}\int_{1}^{\infty} \frac{1}{x} dx = \infty,$$ which we cannot use in practice.

The standard deviation of $p$ is defined by $$\sigma(p) := \left(\int_{-\infty}^{\infty}(x - \mu(p))^{2}f(x)dx\right)^{1/2}.$$ Again we need to assume that $p(x)$ decays quite fast as it goes away from $0$ to $\infty$ or $-\infty.$

Theorem 1. If $p$ is a p.d.f that decays fast enough, we have
$$\sigma(p)^{2} = \int_{-\infty}^{\infty}x^{2}p(x)dx - \mu(p)^{2}.$$ Proof. For convenience, write $\mu = \mu(p).$ By definitions of the standard deviation and the mean of $p$, we have
\begin{align*} \sigma(p)^{2} &= \int_{-\infty}^{\infty}(x - \mu(p))^{2}p(x)dx \\ &= \int_{-\infty}^{\infty}(x^{2} - 2\mu x + \mu^{2})p(x)dx \\ &= \int_{-\infty}^{\infty}x^{2}p(x) dx - 2\mu\int_{-\infty}^{\infty}xp(x)dx + \mu^{2}\int_{-\infty}^{\infty}p(x)dx \\ &= \int_{-\infty}^{\infty}x^{2}p(x) dx - 2\mu\mu + \mu^{2} \cdot 1 \\ &= \int_{-\infty}^{\infty}x^{2}p(x) dx - \mu^{2}. \end{align*}
Note that for the second to the last equality, we have used the condition $$\int_{-\infty}^{\infty}p(x)dx = 1,$$ which follows from the assumption that $p$ is a p.d.f. This finishes the proof.

We will compute the mean and the standard deviation of the following probability distribution function (p.d.f.): $$f_{m,s}(x) = \frac{e^{-(x - m)^{2}/(2s^{2})}}{s\sqrt{2 \pi}},$$ where $m, s$ are constants and $s > 0.$ It is evident that $f_{m,s}(x) \geq 0$ for all $x$ because the exponentiation always gives us a positive value. However, to show $f_{m,s}(x)$ is a p.d.f., we also need to check that $$\int_{-\infty}^{\infty}f_{m,s}(x)dx = 1,$$ and this is not so obvious.

How to check this in your future. The easiest case is when $s = 1/\sqrt{2}$ and $m = 0$ (which can be done in Math 215 using the change of variables in polar coordinates). Then the substitution method to manipulate the integral will do the job.

Theorem 2. We have $\mu(f_{m,s}) = m.$

Proof. By definition of the mean, we have
\[\mu(f_{m,s}) = \int_{-\infty}^{\infty}xf_{m,s}(x) dx = \int_{-\infty}^{\infty} \frac{xe^{-(x - m)^{2}/(2s^{2})}}{s\sqrt{2\pi}}dx.\]
Consider the substitution
\[u = \frac{x - m}{s\sqrt{2}},\]
which comes with
\[du = \frac{dx}{s\sqrt{2}}.\]
Moreover, note that $x = s\sqrt{2} \cdot u + m.$ Hence, following the computation we have made above, we get
\begin{align*}\mu(f_{m,s}) &= \frac{1}{\sqrt{\pi}}\int_{-\infty}^{\infty}(s\sqrt{2} \cdot u + m)e^{-u^{2}}du \\ &= \frac{m}{\sqrt{\pi}}\int_{-\infty}^{\infty}e^{-u^{2}}du \\ &= m.\end{align*}
Note that the second to the last equality uses that
\[\int_{-\infty}^{\infty}ue^{-u^{2}}du = 0,\]
which is a property for any odd function. The last equality uses the fact that $f_{0,1/\sqrt{2}}$ is a p.d.f.

The following turned out to be more difficult that I thought:

Theorem 3. We have $\sigma(f_{m,s}) = s.$

Proof. By definition of the standard deviation and using Theorem 2 which says $\mu(f_{m,s}) = m$, we have
\[\sigma(f_{m,s})^{2} = \int_{-\infty}^{\infty}(x - m)^{2}f_{m,s}(x)dx = \int_{-\infty}^{\infty} \frac{(x - m)^{2}e^{-(x - m)^{2}/(2s^{2})}}{s\sqrt{2\pi}}dx.\]
Consider the substitution
\[t = \frac{x - m}{s\sqrt{2}},\]
which comes with
\[dt = \frac{dx}{s\sqrt{2}}.\]
Moreover, note that $x - m = st\sqrt{2}.$ Hence, following the computation we have made above, we get
\[\sigma(f_{m,s})^{2} = \frac{1}{\sqrt{\pi}}\int_{-\infty}^{\infty}2s^{2}t^{2}e^{-t^{2}}dt = \frac{4s^{2}}{\sqrt{\pi}}\int_{0}^{\infty}t^{2}e^{-t^{2}}dt,\]
where the last integral uses a property of even functions. Hence, we can just focus on computing the last integral. Since we only need to think about $t \geq 0,$ we can use the substitution
\[u = t^{2},\]
which comes with $du = 2tdt.$ Continuing the computation above, we have
\begin{align*}\sigma(f_{m,s})^{2} &= \frac{4s^{2}}{\sqrt{\pi}}\int_{0}^{\infty}t^{2}e^{-t^{2}}dt \\ &= \frac{2s^{2}}{\sqrt{\pi}}\int_{0}^{\infty}u^{1/2}e^{-u}du \\ &= \frac{2s^{2}}{\sqrt{\pi}}\Gamma(3/2), \end{align*}
where
\[\Gamma(z) = \int_{0}^{\infty}u^{z-1}e^{-u}du.\]
This is called the Gamma function, which you can read about here. One of the properties in the link says that we have the duplication formula:
\[\Gamma(z)\Gamma(z + 1/2) = 2^{1 - 2z} \sqrt{\pi}\Gamma(2z).\]
It is also not difficult to figure out $\Gamma(n) = (n-1)!$ for all integer $n \geq 1.$ Hence taking $z = 1$ in the duplication formula, we get $$\Gamma(3/2) = 2^{-1}\sqrt{\pi}\Gamma(2) = 2^{-1}\sqrt{\pi}.$$ Combining with the previous computation, we have $$\sigma(f_{m,s})^{2} = \frac{2s^{2}}{\sqrt{\pi}}\Gamma(3/2) = \frac{2s^{2}}{\sqrt{\pi}}2^{-1}\sqrt{\pi} = s^{2}.$$
This implies that $\sigma(f_{m,s}) = s,$ as desired.

Upshot: The distribution given by the p.d.f $f_{m,s}$ is called the normal distribution with mean $m$ and standard deviation $s.$

Median. Given a pdf $p(x),$ the median of the distribution given by $p(x)$ is the value $T$ such that $$\int_{-\infty}^{T}p(x) dx  = 1/2.$$ Roughly, the median estimates what's in the middle, while the mean means the average.

Exercise. Suppose that $p(x)$ is a pdf that is symmetric to the vertical line $x = a,$ where $a$ is a fixed real number.

  1. What is the median given by the distribution?
  2. What is the mean given by the distribution?

Tuesday, October 8, 2019

Work

In this posting, we study the concept of work. You may find more detailed exposition with various examples in Section 8.5 of your book.

Slogan: Work is "energy".

Linear fashion (local/micro work). Work = Force $\times$ Distance

Nonlinear fashion (global/total work). When $x$ is a position that moves from $a$ to $b$ and $F(x)$ is the force acting at $x$, then
\[\text{Work} = \int_{a}^{b}F(x) dx.\]

Gravitational acceleration from physics. It is quite a remarkable observation that on Earth, if you drop any two objects from the same height when there is no air at presence, both objects will hit the ground at the same time. This means that any object has a constant acceleration, not depending on the object, when we do not count air resistance. In the unit (meter/second)/second = $m/s^{2}$, this constant is denoted as $g$, and it is known that it is approximately equal to $9.8$, so when the problem does not give you any information about gravitation, you should start by write something like "Let $g$ be the gravitational acceleration in $m/s^{2}$" or "Let $g = 9.8 m/s^{2}$ be the estimated gravitational constant."

Force is mass times acceleration when the quantities are constant. In classical mechanics, it is assumed that the force is equal to mass times acceleration (a.k.a., the "law" $F = ma$). This is something we assume in this course as well, if the mass and acceleration are assumed to be constant. However, this will rarely happen. This formula will usually make sense when we compute micro-force.

Exercise. Suppose that the mass of your book is $2$kg. If you have lifted your book $1.5$ meters off the floor, then how much work have you done?

Exercise. Say you are pushing a ball whose mass is $1$kg along the graph $y = x$ from point $(0, 0)$ to $(1, 1)$. When you are done, how much work would you have done? (Suppose that the unit for distance on our $xy$-plane is in meters.)

Exercise (Hard). Say you are pushing a ball whose mass is $1$kg along the graph $y = x^{2}$ from point $(0, 0)$ to $(1, 1)$. When you are done, how much work would you have done? (Suppose that the unit for distance on our $xy$-plane is in meters.)

(Hint: This is a very hard exercise for any student who is taking Math 116 from my past experience. Writing $g$ for the constant gravitational acceleration, if you compute correctly the instantaneous force for the particle with $x$-coordinate $x$ is equal to $g \sin(\theta(x))$ and the instantaneous distance would be $\Delta x / \cos(\theta(x))$. Here, note that $\theta(x)$ is the angle between the tangent line of the point $(x, y)$ on the graph $y = x^{2}$ and the $x$-axis. Note that by taking derivative, you see $\tan(\theta(x)) = 2x,$ and this would let you compute the integral.)

Remark. The unit for the work in the last exercise is in joules (i.e., $kg \cdot m^{2}/s^{2}$, which is often denoted as $J$).

Exercise. Solve 3a and 3b of Exam 1, Winter 2017.

Exercise. Solve 9a, b, and c of Exam 1, Winter 2017.

Exercise. Solve 9 of Exam 1, Winter 2016.

Exercise. Solve 9 of Exam 1, Fall 2015.