# How to show some function is constant?

Suppose $f:(a,b) \to \mathbb{R}$ satisfy $|f(x) - f(y) | \le M |x-y|^\alpha$ for some $\alpha >1$ and all $x,y \in (a,b)$. Prove that $f$ is constant on $(a,b)$.

I'm not sure which theorem should I look to prove this question. Can you guys give me a bit of hint? First of all how to prove some function $f(x)$ is constant on $(a,b)$? Just show $f'(x) = 0$?

-
yes, indeed! (to your last question) –  Avitus Dec 11 '13 at 20:41
What does the value $M$ mean? –  John Dec 11 '13 at 20:41
the condition should be $\alpha>1$ otherwise it just an holder function and they are everything but constant (in general). In case $\alpha>1$ you just show $f$ is differentiable with $0$ has a derivative. (like the answer below). Can you correct the question ? –  user42070 Dec 11 '13 at 21:08

divide by $|x-y|$ both members. you get

$$\frac{|f(x) - f(y)|}{|x-y|} \le M |x-y|^{\alpha - 1} \ \ (1)$$

now, since $(1)$ has to hold $\forall \ x, y$ then set $y = x + h$, with $h \to 0$

it becomes

$$|f'(x)| \le M \ |h|^{\alpha-1} = 0$$ ($\alpha - 1 > 0$ so there's no problem there)

So $|f'(x)| \le 0$, but of course also $|f'(x)| \ge 0$, it implies $|f'(x)| = 0$. Hence $f'(x) = 0$

EDIT:

We can formalize it more. Let's do it.

$$\frac{|f(x) - f(y)|}{|x-y|} \le M |x-y|^{\alpha - 1} \ \ (1)$$

We can always set $x = y + h, h > 0$ since $(1)$ has to hold $\forall x, y$

Then

$$\frac{|f(y+h) - f(y)|}{h} \le M h^{\alpha - 1} \ \ (1)$$

(note $|h| = h$)

Now, let's suppose $f(y+h) - f(y) \ge 0 \ \ \ \ \ (2a)$

It implies that $f'(y) \ge 0$ (it suffice to divide $(2a)$ by $h$ and then taking the limit for $h \to 0$ to show it)

But it also implies, recalling (1) that

$$\frac{f(y+h) - f(y)}{h} \le 0 \Rightarrow f'(y) \le 0$$

(Again by taking the limit of both parts.)

But these last two results imply that $f'(y) = 0$

We can do the exact same reasoning in the case that $f(y+h) - f(y) \le 0$

So again, in this case we find $f'(y) = 0$

Thus we have demonstrated that in both cases ($f(y+h) > f(y)$ and $f(y+h) < f(y)$) we have $f'(y) = 0$, so this has to hold $\forall y$

This implies $f = const$

-
this is good one –  james Miler Dec 11 '13 at 20:47
Are you using this for your second equation? $\lim_{x \rightarrow a}{|f(x)|}=|\lim_{x \rightarrow a}{f(x)}|$, I thought this equality does not hold? –  Idonknow Dec 11 '13 at 21:06
edited.. it should be better now :-) –  Ant Dec 11 '13 at 23:56

Hint: Show that $f'(y)$ exists and is equal to $0$ for all $y$. Then as usual by the Mean Value Theorem our function is constant.

-
+1 for speed :-) –  Avitus Dec 11 '13 at 20:41
so what is first conditio refer to? –  james Miler Dec 11 '13 at 20:42
Divide by $|x-y|$. We are left on the right with $\le M|x-y|^{\alpha-1}$, which approaches $0$ as $x\to y$. –  André Nicolas Dec 11 '13 at 20:43

Without any derivative...

Choose $y\gt x$ in the interval $(a,b)$. For every $n\geqslant1$, divide the interval $(x,y)$ into $n$ subintervals $(x_i,x_{i+1})$ of length $x_{i+1}-x_i=(y-x)/n$. By hypothesis, for every $i$, $$|f(x_i)-f(x_{i+1})|\leqslant M(x_{i+1}-x_i)^\alpha=M(y-x)^\alpha n^{-\alpha},$$ hence, by the triangular inequality, $$|f(x)-f(y)|\leqslant \sum\limits_{i=1}^n|f(x_i)-f(x_{i+1})|\leqslant M(y-x)^\alpha n^{1-\alpha}.$$ If $\alpha\gt1$, the RHS goes to zero when $n\to\infty$ because $n^{1-\alpha}\to0$, hence $f(x)=f(y)$, QED.

-
Interesting answer. Do you think we can adapt it in order to prove this: math.stackexchange.com/questions/578487/… –  Tomás Dec 11 '13 at 21:42
Hadn't seen this way before--I appreciate it. –  nayrb Dec 12 '13 at 0:00
Nicely done! (+1) –  leo Dec 12 '13 at 3:58

HINT: Your idea is a good one. What happens when you divide the inequality by $|x-y|$?

-

It suffices to show that $f$ is differentiable and its derivative vanishes everywhere.

The hypothesis implies that, for every $x\in(a,b)$ and $h$, such that $x+h\in(a,b)$, we have that

$$\frac{|f(x+h)-f(x)-0\cdot h|}{|h|} \le M\,|h|^{\alpha-1}.$$

The right hand side of the above tends to zero, as $h\to 0$, and therefore $f'(x)=0$!

-


# complex conjugate eigenvalues

The characteristic polynomial of $$A$$ is $$\lambda^2 - 2 \lambda + 5$$ and so the eigenvalues are complex conjugates, $$\lambda = 1 + 2i$$ and $$\overline{\lambda} = 1 - 2i\text{. Note that not only do eigenvalues come in complex conjugate pairs, eigenvectors will be complex conjugates of each other as well. Thus you only need to compute one eigenvector, the other eigenvector must be the complex conjugate. If the eigenvalues are a complex conjugate pair, then the trace is twice the real part of the eigenvalues. The Characteristic Equation always features polynomials which can have complex as well as real roots, then so can the eigenvalues & eigenvectors of matrices be complex as well as real. eigenvalues of a real symmetric or complex Hermitian (conjugate symmetric) array. Example 13.1. Also, they will be characterized by the same frequency of rotation; however, the direction s of rotation will be o pposing. Value. A complex number is an eigenvalue of corresponding to the eigenvector if and only if its complex conjugate is an eigenvalue corresponding to the conjugate vector. It is possible that Ahas complex eigenvalues, which must occur in complex-conjugate pairs, meaning that if a+ ibis an eigenvalue, where aand bare real, then so is a ib. 1.2. When the eigenvalues of a system are complex with a real part the trajectories will spiral into or out of the origin. 4. These pairs will always have the same norm and thus the same rate of growth or decay in a dynamical system. If A has complex conjugate eigenvalues λ 1,2 = α ± βi, β ≠ 0, with corresponding eigenvectors v 1,2 = a ± bi, respectively, two linearly independent solutions of X′ = AX are X 1 (t) = e αt (a cos βt − b sin βt) and X 2 (t) = e αt (b cos βt + a sin βt). Then a) if = a+ ibis an eigenvalue of A, then so is the complex conjugate = a−ib. values. eigvalsh. Most of this materi… For example, the command will result in the assignment of a matrix to the variable A: We can enter a column vector by thinking of it as an m×1 matrix, so the command will result in a 2×1 column vector: There are many properties of matrices that MATLAB will calculate through simple commands. To enter a matrix into MATLAB, we use square brackets to begin and end the contents of the matrix, and we use semicolons to separate the rows. The Eigenvalue Problem: The Hessenberg and Real Schur Forms The Unsymmetric Eigenvalue Problem Let Abe a real n nmatrix. eigenvalues are themselves complex conjugate and the calculations involve working in complex n-dimensional space. complex eigenvalues always come in complex conjugate pairs. eigh. There is nothing wrong with this in principle, however the manipulations may be a bit messy. A similar discussion verifies that the origin is a source when the trace of is positive. Here is a summary: If a linear system’s coefﬁcient matrix has complex conjugate eigenvalues, the system’s state is rotating around the origin in its phase space. eigenvalues of a self-adjoint matrix Eigenvalues of self-adjoint matrices are easy to calculate. Note that the complex conjugate of a function is represented with a star (*) above it. An interesting fact is that complex eigenvalues of real matrices always come in conjugate pairs. On this site one can calculate the Characteristic Polynomial, the Eigenvalues, and the Eigenvectors for a given matrix. The eigenvectors associated with these complex eigenvalues are also complex and also appear in complex conjugate pairs. Example: Diagonalize the matrix . Solve the system. →Below is a calculator to determine matrices for given Eigensystems. In equation 1 we can appreciate that because the eigenvalue is real, the complex conjugate of the real eigenvalue is just the real eigenvalue (no imaginary term to take the complex conjugate of). Proposition Let be a matrix having real entries. complex eigenvalues. Once you have found the eigenvalues of a matrix you can ﬁnd all the eigenvectors associated with each eigenvalue by ﬁnding a … If A is a 2 2-matrix with complex-conjugate eigenvalues l = a bi, with associated eigenvectors w = u iv, then any solution to the system dx dt = Ax(t) can be written x(t) = C1eat(ucosbt vsinbt)+C2eat(usinbt+vcosbt) (7) where C1,C2 are (real) constants. Find the complex conjugate eigenvalues and corresponding complex eigenvectors of the following matrices. Similar function in SciPy that also solves the generalized eigenvalue problem. Finding Eigenvectors. 3. Since the real portion will end up being the exponent of an exponential function (as we saw in the solution to this system) if the real part is positive the solution will grow very large as \(t$$ increases. eigenvalues of a non-symmetric array. This occurs in the region above the parabola. NOTE 4: When there are complex eigenvalues, there's always an even number of them, and they always appear as a complex conjugate pair, e.g.


# Session 10: Fast Fourier Transform¶

Date: 11/27/2017, Monday

In [1]:

format compact

## Generate input signal¶

Fourier transform is widely used in signal processing. Let’s looks at the simplest cosine signal first.

Define

$y_1(t) = 0.3 + 0.7\cos(2\pi f_1t)$

It has a magnitude of 0.7, with a constant bias term 0.3. We choose the frequency $$f_1=0.5$$.

In [2]:

t = -5:0.1:4.9; % time axis
N = length(t) % size of the signal

f1 = 0.5; % signal frequency
y1 = 0.3 + 0.7*cos(2*pi*f1*t); % the signal

N =
100

In [3]:

%plot -s 800,200
hold on
plot(t, y1)
plot(t, 0.3*ones(N,1), '--k')
title('simple signal')
xlabel('t [s]')
legend('signal', 'mean')

## Perform Fourier transform on the signal¶

You can hand code the Fourier matrix as in the class, but here we use the built-in function for convenience.

In [4]:

F1 = fft(y1);
length(F1) % same as the length of the signal

ans =
100

There are two different conventions for the normalization factor in the Fourier matrix. One is having the normalization factor $$\frac{1}{\sqrt{N}}$$ in the both the Fourier matrix $$A$$ and the inverse transform matrix $$B$$

$\begin{split}A = \frac{1}{\sqrt{N}} \begin{bmatrix} 1&1&1&\cdots &1 \\ 1&\omega&\omega^2&\cdots&\omega^{N-1} \\ 1&\omega^2&\omega^4&\cdots&\omega^{2(N-1)}\\ \vdots&\vdots&\vdots&\ddots&\vdots\\ 1&\omega^{N-1}&\omega^{2(N-1)}&\cdots&\omega^{(N-1)(N-1)}\\ \end{bmatrix}\end{split}$
$\begin{split}B = \frac{1}{\sqrt{N}} \begin{bmatrix} 1&1&1&\cdots &1 \\ 1&\omega^{-1}&\omega^{-2}&\cdots&\omega^{-(N-1)} \\ 1&\omega^{-2}&\omega^{-4}&\cdots&\omega^{-2(N-1)}\\ \vdots&\vdots&\vdots&\ddots&\vdots\\ 1&\omega^{-(N-1)}&\omega^{-2(N-1)}&\cdots&\omega^{-(N-1)(N-1)}\\ \end{bmatrix}\end{split}$

MATLAB uses a different convention that

$\begin{split}A = \begin{bmatrix} 1&1&1&\cdots &1 \\ 1&\omega&\omega^2&\cdots&\omega^{N-1} \\ 1&\omega^2&\omega^4&\cdots&\omega^{2(N-1)}\\ \vdots&\vdots&\vdots&\ddots&\vdots\\ 1&\omega^{N-1}&\omega^{2(N-1)}&\cdots&\omega^{(N-1)(N-1)}\\ \end{bmatrix}\end{split}$
$\begin{split}B = \frac{1}{N} \begin{bmatrix} 1&1&1&\cdots &1 \\ 1&\omega^{-1}&\omega^{-2}&\cdots&\omega^{-(N-1)} \\ 1&\omega^{-2}&\omega^{-4}&\cdots&\omega^{-2(N-1)}\\ \vdots&\vdots&\vdots&\ddots&\vdots\\ 1&\omega^{-(N-1)}&\omega^{-2(N-1)}&\cdots&\omega^{-(N-1)(N-1)}\\ \end{bmatrix}\end{split}$

The difference doesn’t matter too much as long as you use one of them consistently. In both cases there is

\begin{align} F &= AY \text{ (Discrete Fourier transfrom)} \\ Y &= BF \text{ (Inverse transfrom)} \end{align}

### Full spectrum¶

The spectrum F1 (the result of the Fourier transfrom) is typically an array of complex numbers. To plot it we need to use absolute magnitude.

In [5]:

%plot -s 800,200
plot(abs(F1),'- .')
title('unnormalized full spectrum')

The first term in F1 indicates the magnitude of the constant term (zero frequency). Diving by N gives us the actual value.

In [6]:

F1(1)/N % equal to the constant bias term specified at the beginning

ans =
0.3000

Besides the constant bias F1(1), there are two non-zero pointings in F1, indicating the cosine signal itself. The magnitude 0.7 is evenly distributed to two points.

In [7]:

F1(2+4)/N, F1(end-4)/N % adding up to 0.7

ans =
-0.3500 - 0.0000i
ans =
-0.3500 + 0.0000i

Plotting F1/N shows more clearly the magnitude of signals at different frequencies:

In [8]:

%plot -s 800,200
plot(abs(F1)/N,'- .')
title('(normalized) full spectrum')
ylabel('signal amplitude')

### Half-sided spectrum¶

From the matrix $$A$$ it is easy to show that, the first element F(1) in the resulting spectrum is always a real number indicating the constant bias term, while the rest of the array F(2:end) is symmetric, i.e. F(2) == F(end), F(3) == F(end-1). ( F(2) is actually the conjugate of F(end), but we only care about magnitude here. )

Due to such symmetricity, we can simply plot half of the array (scaled by 2) without loss of information.

In [9]:

M = N/2 % need to cast to integer if N is an odd number

M =
50

In [10]:

%plot -s 800,200
plot(abs(F1(1:M+1))/N*2, '- .')
title('(normalized) half-sided spectrum')
ylabel('signal amplitude')

## Understanding units!¶

The Discrete Fourier Transform, by defintion, is simply a matrix multiplication which acts on pure numbers. But real physical signals have units. You cannot just treat the resulting array F1 as some unitless frequency. If the signal is a time series then you need to deal with seconds and hertz; if it is a wave in the space then you need to deal with the wave length in meters.

In order to understand the unit of the resulting spectrum F1, let’s look at the original time series y1 first.

The “time step” of the signal is

In [11]:

dt = t(2)-t(1) % [s]

dt =
0.1000

This is the finest temporal resolution the signal can have. It corresponds the highest frequency:

In [12]:

f_max = 1/dt % [Hz]

f_max =
10.0000

On the contrary, the longest time range (dt*N, the time span of the entire signal) corresponds to the lowest frequency:

In [13]:

df = f_max/N % [Hz]

df =
0.1000

With the lowest frequency df being the “step size” in the frequency axis, the value of the frequency axis is simply the array [0, df, 2*df, …]. Now we can use correct values and units for the x-axis of the spectrum plot.

In [14]:

%plot -s 800,200
plot(df*(0:M), abs(F1(1:M+1))/N*2,'- .')
title('half-sided spectrum with correct unit of x-axis')
ylabel('signal amplitude')
xlabel('frequency [Hz]')

The peak is at 0.5 Hz, consistent with our original signal which has a period of 2 s, since 0.5 Hz = 1/(2s). Thus our unit specification is correct.

## Deal with negative frequency¶

The right half of the spectrum array (F1(M+2:end), not plotted in the above figure) corresponds to negative frequency [-M*df, …, -2*df, -df]. Thus each element in the entire F1 array corresponds to each element in the frequency array [0, df, 2*df, …, M*df, -M*df, …, -2*df, -df].

You can perform fftshift on the resulting spectrum F1 to swap its left and right parts, so it will align with the motonically increasing axis [-M*df, …, -2*df, -df, 0, df, 2*df, …, M*df]. That feels more natural from a mathematical point of view.

In [15]:

F_shifted = fftshift(F1);
plot(abs(F_shifted),'- .')

## Perform inverse transform¶

Performing inverse transform is simply ifft(F1). Recall that MATLAB performs the $$\frac{1}{N}$$ scaling during the inverse transform step.

We use norm to check if ifft(F1) is close enough to y1.

In [16]:

norm(ifft(F1) - y1) % almost zero

ans =
1.2269e-15

## Mix two signals¶

Fourier transform and inverse transform are very useful in signal filering. Let’s first add a high-frequency noise to our original signal.

In [17]:

f2 = 5; % higher frequency
y2 = 0.2*sin(f2*pi*t); % noise
y = y1 + y2; % add up original signal and noise

In [18]:

%plot -s 800,400
subplot(311);plot(t, y2, 'r');
ylim([-1,1]);title('noise')

subplot(312);plot(t, y1);
ylim([-0.6,1.2]);title('original signal')

subplot(313);plot(t, y, 'k');
ylim([-0.6,1.2]);title('signal + noise')

After the Fourier transform, we see two new peaks at a relatively higher frequency.

In [19]:

F = fft(y);

In [20]:

%plot -s 800,200
plot(abs(F), '- .')
title('spectrum with high-frequency noise')

Again, the noise magnitude 0.2 is evenly distributed to positive and negative frequencies. Here we got complex conjugates:

In [21]:

F(2+24)/N, F(end-24)/N % magnitude of noises

ans =
-0.0000 + 0.1000i
ans =
-0.0000 - 0.1000i

## Filter out high-frequency noise¶

Let’s wipe out this annoying noise. It’s very difficult to do so in the original signal, but very easy to do in the spectrum.

In [22]:

F_filtered = F; % make a copy
F_filtered(26) = 0; % remove the high-frequency noise
F_filtered(76) = 0; % same for negative frequency

In [23]:

plot(abs(F_filtered), '- .')
title('filtered spectrum')

Then we can transform the spectrum back to the signal.

In [24]:

y_filtered = ifft(F_filtered);

If the filtering is done symmetrically (i.e. do the same thing for positive and negative frequencies), the recovered signal will only contain real numbers.

In [35]:

%plot -s 800,200
plot(t, y_filtered)
title('de-noised signal')

The de-noised signal is almost the same as the original noise-free signal:

In [36]:

norm(y_filtered - y1) % almost zero

ans =
5.6847e-15

## Filter has to be symmetric¶

What happens if the filtering done asymmetrically?

In [37]:

F_wrong_filtered = F; % make another copy
F_wrong_filtered(76) = 0; % only do negative frequency

In [39]:

plot(abs(F_wrong_filtered), '- .')
title('asymmetrically-filtered spectrum')

The recovered signal now contains imaginary parts. That’s unphysical!

In [40]:

y_wrong_filtered = ifft(F_wrong_filtered);

In [42]:

y_wrong_filtered(1:5)' % print the first several elements

ans =
-0.4000 - 0.1000i
-0.4657 + 0.0000i
-0.2663 + 0.1000i
-0.0114 - 0.0000i
0.0837 - 0.1000i

In [43]:

norm(imag(y_wrong_filtered)) % not zero

ans =
0.7071

You can plot the real part only. It is something between the unfiltered and filtered signals, i.e. the filtering here is incomplete.

In [45]:

hold on
plot(t, y, 'k')
plot(t, real(y_wrong_filtered), 'b')
plot(t, y1, 'r')
legend('signal with noise', 'incomplete fliltering', 'signal without noise')


# Why can't a neighborhood be a finite set?

Rudin defines a neighborhood as follows:

Let $X$ be a metric space endowed with a distance function $d$. A neighborhood of a point $p \in X$ is a set $N_r(p)$ consisting of all $q \in X$ such that $d(p,q) < r$ for some $r > 0$.

He later proves two facts: every neighborhood is an open set, and every finite set is closed.

But it would seem to me that a neighborhood as defined above could be finite. For example, let $X = \{1,2,3\}$ with $d(x,y) = |x-y|$ be a metric space . Consider the neighborhood around $p = 2$ of radius $0.5$, i.e.: the set of all points $q$ in $X$ such that $d(q,p)<0.5$. But the neighborhood is simply $\{2\}$. Therefore, the neighborhood is a finite set, and therefore closed. But every neighborhood is open. This is a contradiction.

So my understanding of a neighborhood is broken somehow. It has further implications: if we define $E = \{2\}$, then the $0.5$-radius neighborhood is $\{2\}$, which is a subset of $E$, which means that $2$ is an interior point of $E$. Since $2$ is the only point in $E$, all points in $E$ are interior points, and $E$ is open. But $E$ is finite, and therefore closed.

I'm probably missing something obvious. Can anyone spot my mistake?

-
Nothing about the definition of a set being open or closed precludes a set being both -- merely your intuition. :) – Eugene Shvarts Sep 5 '12 at 16:45
It is possible for are set to be open and closed, as $\{2\}$ in your example. Being open and closed isn't mutually exclusive. – martini Sep 5 '12 at 16:45
"not closed" is not necessarily "open" and "not open" is not necessarily "closed": "not open" and "not closed" can both be "ajar"! – rschwieb Sep 5 '12 at 16:55
Obligatory quote: ''…an answer to the mathematician’s riddle: “How is a set different from a door?” should be: “A door must be either open or closed, and cannot be both, while a set can be open, or closed, or both, or neither!”'' - Munkres – Michael Greinecker Sep 5 '12 at 16:58
Well, in that case, Rudin 2.21 is incorrect, unless there's another hypothesis. – Cameron Buie Sep 5 '12 at 17:02

"Every finite set is closed" does not imply "every open neighbourhood is infinite".

Let $(X,d)$ be any metric space, and let $F \subseteq X$ be a non-empty finite subset; say $F = \{ x_1, \cdots, x_n \}$ for some $n \in \mathbb{N}$. To prove that $F$ is closed it suffices to prove that $X - F$ is open. So let $p \in X-F$. Then the set $\{ d(p,x_1), \cdots, d(p,x_n) \}$ has a minimum value, say $\delta$, and we know that $\delta > 0$ since $p \not \in F$, and so whenever $d(p,q) < \delta$ we have $q \in X-F$. But this tells you that the (open) ball of radius $\delta$ about $p$ lies in $X-F$, and hence $X-F$ is open.

In your examples, yes, the sets are open and finite, but they are also closed!

The key fact to take home is that sets are allowed to be both open and closed.

However, there is a partial converse: in a dense metric space, every open neighbourhood is infinite.

A metric space $(X,d)$ is dense if for any $x \in X$ and $r > 0$ there exists $y \in X$ with $x \ne y$ and $d(x,y) < r$ $-$ that is, given any point in the space, there are other points which lie arbitrarily close to that point. $\mathbb{R}$ is a dense space, so is $\mathbb{Q}$, so is $(0,1)$, and indeed so is any other non-empty open subset of $\mathbb{R}$.

The fact that open neighbourhoods in dense metric spaces are necessarily infinite is clear from the definition. [It's also clear that a metric space in which every open neighbourhood is infinite is dense, and so the two conditions are equivalent.]

-
This makes sense, thanks! – jme Sep 5 '12 at 17:11

For an interesting example, let $X$ be any non-empty set, and define $d:X\times X\to\Bbb R$ by $$d(x,y)=\begin{cases}0 & x=y\\1 & x\neq y.\end{cases}$$ This can be shown to be a metric on $X$ (called the discrete metric). One interesting property is that in the metric space $(X,d)$, every subset of $X$ is both open and closed. Even in general metric spaces, there will always be at least two subsets that are both open and closed--namely, the empty set and the whole set.

-


# Is the set $A = [0,1]\setminus\mathbb{Q}$ countable or not?

Is the set $$A = [0,1]\setminus\mathbb{Q}$$ countable or not?

What I am thinking is $$A$$ consist of irrational numbers in the interval $$[0,1]$$ hence it is subset of irrational numbers. As set of irrational numbers is uncountable so I think set $$A$$ is also uncountable.

• not every subset of irrational numbers is uncountable, but if $A$ and $\mathbb Q$ were both countable then so would be $A\cup \mathbb Q$ and therefore $[0,1]\subset A\cup \mathbb Q$ – J. W. Tanner Jan 10 at 15:55
• $\varnothing$ is also a subset of the irrational numbers. – Asaf Karagila Jan 10 at 16:24

Yes, it is uncountable, but not for that reason. For instance, $$\left\{\sqrt2+n\,\middle|\, n\in\Bbb N\right\}$$ is also a set of irrational numbers, but it is countable.

However, if $$[0,1]\setminus\Bbb Q$$ was countable, then, since $$\Bbb Q\cap[0,1]$$ is countable, $$[0,1]$$ would be countable too, since it's the union of them.

• technically, $[0,1]$ is contained in the union of $A$ and $\mathbb Q$ – J. W. Tanner Jan 10 at 16:08
• @J.W.Tanner I've edited my answer. Thank you. – José Carlos Santos Jan 10 at 16:23

All countable set of $$R$$ have Lebesgue measure equal to $$0$$. So Lebesgue measure of $$[0, 1] - \mathbb{Q}$$ is $$1$$. Eventually by contraposition, $$[0, 1] - \mathbb{Q}$$ is uncoutable.

What you are thinking does not work.

For example, $$\{n\pi\mid n\in\mathbb N\setminus\{0\}\}$$ is a subset of irrational numbers but countable.

Here's an argument that works. If $$A$$ were countable, then, since $$\mathbb Q$$ is countable,

$$A\cup \mathbb Q$$ would be countable,

and therefore $$[0,1]$$, which is a subset of $$A\cup \mathbb Q$$, would be countable,


# Can one compute series expansions or complex residues at essential singularities?

Title says it all.

I'm noticing a trend of failure on Mathematica/WolframAlpha's parts when trying to compute either the Laurent expansions or the residues of functions like $\sin\dfrac{1}{z}$ about $z=0$. (Specifying $z=0$ for the residue query returns nothing.)

Is there something about essential singularities $z_0$ that prevents one from computing a series expansion about or residue at $z_0$? Is this "something" explicitly mentioned in the usual definitions of series/residues that I'm missing? Admittedly, my complex analysis knowledge has started to rust.

• Just plug $u=1/z$ into $\sin u = u -u^3/3! + \cdots$ for the Larent expansion; the residue is $1.$ – zhw. Oct 28 '15 at 19:46
• @zhw. Okay, that approach works fine for $\sin\dfrac{1}{z}$, but what if I made a slight adjustment? Say, $\sin\dfrac{z}{z-1}$. Does the same process still work? – user170231 Oct 28 '15 at 19:51

Recall the definition of an essential singularity. If a function $f$ has an essential singularity at $z=z_0$, then

$$\lim_{z \to z_0} (z-z_0)^m f(z) = \infty$$

That is, an essential singularity is "more singular" than any order pole.

That all said, the definition of a residue still applies as the coefficient of $(z-z_0)^{-1}$ in the Laurent expansion of $f$.

In your example of $f(z) = \sin{\left ( \frac{z}{z-1} \right )}$, there is an essential singularity at $z=1$. The Laurent expansion of $f$ about $z=1$ may be easily determined by expressing $f$ as follows:

\begin{align}f(z) &= \sin{\left (1+\frac1{z-1} \right )} = \sin{1} \cos{\left ( \frac{1}{z-1} \right )}+ \cos{1} \sin{\left ( \frac{1}{z-1} \right )}\\ &= \sin{1}\sum_{n=0}^{\infty} \frac{(-1)^n}{(2 n)!(z-1)^{2 n}} + \cos{1}\sum_{n=0}^{\infty} \frac{(-1)^n}{(2 n+1)!(z-1)^{2 n+1}}\end{align}

Hopefully it is clear that the residue of $f$ at $z=1$ is $\cos{1}$.

• Are there any functions with essential singularities for which identities and "tricks" like these don't help? I'm just trying to wrap my mind around why WA and Mma are having trouble with these computations. – user170231 Oct 28 '15 at 21:00
• @user170231: plenty. What I would do is make use of Mathematica's expansion about Infinity, i.e., Series[f[z],{z,Infinity,n}] for an n-term expansion in $1/z$. – Ron Gordon Oct 28 '15 at 21:08


Linear Optimization - Lecture Notes and Videos

Math 464 (Spring 2018)  - Lecture Notes and Videos on Linear Optimization

Scribes from all lectures so far (as a single big file)

Lec # Date Topic(s) Scribe Panopto
1 Jan  9 syllabus, optimization in calculus, solving $$A\mathbf{x} = \mathbf{b}$$ using EROs, linear program example: Dude's Thursday problem scribe video
2 Jan 11 no class
3 Jan 16 general form of a linear program (LP), feasible and optimal solutions, standard form, conversion to std form, excess/slack variables scribe video
4 Jan 18 LP formulations, diet problem, solution in AMPL, road lighting problem, exceeding illumination limits, currency exchange LP scribe video
5 Jan 23 convex function, piecewise linear (PL) convex (PLC) functions, max of convex functions is convex, PLC functions in LP scribe video
6 Jan 25 $$|x_i| \to x_i^+, x_i^-$$, lighting problem: get "close to" $$I_i^*$$, inventory planning LP, graphical solution in 2D, feasible region, slide $$\mathbf{c}^T\mathbf{x}$$ line scribe video
7 Jan 30 cases of LP, unique and alternative optimal solutions, unbounded LP, infeasible LP, subspace, affine spaces, polyhedron, halfspace scribe video
8 Feb   1 polyhedron is convex, bounded set, convex hull, active constraint, extreme point, vertex, basic and basic feasible solution (bfs) scribe video
9 Feb   6 proof of extreme point $$\Leftrightarrow$$ vertex $$\Leftrightarrow$$ bfs, adjacent basic solutions and bfs's, polyhedron $$P$$ in standard form, basic solutions of $$P$$ scribe video
10 Feb   8 finding basic solutions in Octave, correspondence of corner points and bfs's, degenrate basic bfs, degeneracy and representation scribe video
11 Feb 13 degeneracy in standard form, $$P$$ has no line $$\Leftrightarrow P$$ has vertex, existence of optimal vertex, shape of standard form polyhedron scribe video
12 Feb 15 simplex method, feasible direction at $$\mathbf{x}$$: $$\mathbf{x}+\theta\mathbf{d} \in P \mbox{ for } \theta > 0, j$$th basic direction at bfs $$\mathbf{x}$$, reduced cost $$\mathbf{c}'^T = \mathbf{c}^T - \mathbf{c}_B B^{-1} A$$ scribe video
13 Feb 20 hints for problems from Hw6, LP optimality conditions in standard form: basis $$B$$ optimal if $$B^{-1}\mathbf{b} \geq \mathbf{0}$$ and $$\mathbf{c}^T - \mathbf{c}_B B^{-1} A \geq \mathbf{0}^T$$ scribe video
14 Feb 22 entering/leaving variable, min-ratio test: $$\theta^* = \min_{\{i \in \scr{B}|d_{B(i)} < 0\}} \,(-x_{B(i)}/d_{B(i)})$$, an iteration of the simplex method, Octave session scribe video


# How does the Taylor Series converge at all points for certain functions

The way my professor defined Taylor polynomials is: the $$n^{th}$$ degree Taylor polynomial $$p(x)$$ of $$f(x)$$ is a polynomial that satisfies $$\lim_{x\to 0}{f(x)-p(x) \over x^n} = 0$$. This is actually the little-o notation $$o(x^n)$$, which means $$(f(x)-p(x)) \ll x^n$$ as $$x$$ approaches $$0$$. From this I have got the intuition that Taylor Polynomials work only for $$|x| < 1$$ because $$x^n$$ gets smaller as $$n$$ gets bigger only when $$|x| < 1$$. And the textbook seemed to agree with my intuition, because the textbook says “Taylor polynomial near the origin” (probably implying $$|x| < 1$$).

Since Taylor Series is basically Taylor polynomial with $$n\to\infty$$, I intuitively thought that the Taylor Series would also only converge to the function it represents in the interval $$(-1, 1)$$.

For example, in the case of $$1\over1-x$$, it is well known that the Taylor series only converges at $$|x| < 1$$.

However, all of a sudden, the textbook says that the Taylor series of $$\cos x$$ converges for all real $$x$$. It confused me because previously I thought the Taylor series would only work for $$|x|<1$$. Now, I know that the Taylor Series is defined like this: $$f(x) = Tf(x) \Leftrightarrow \lim_{n\to\infty}R_{n}f(x) = 0$$

And I know how to get the maximum of Taylor Remainder for $$\cos x$$ using Taylor's Theorem, and I know that the limit of that Taylor Remainder is $$0$$ for all real $$x$$, which makes the Taylor Series of $$cosx$$ converge to $$\cos x$$, pointwise. However, I just can't get why my initial intuition is wrong (why taylor series converges for all $$x$$ for certain functions, like $$\cos x$$, also $$\sin x$$ and $$e^x$$, etc.)

• For the specific example $e^x$, the terms in its series are $x^n/n!$. Note that $n!$ grows much faster than $x^n$ as $n$ grows. That's one reason to believe the Taylor series of $e^x$ converges. Apr 24 '20 at 18:10
• In my mind, the key idea of calculus is the local linear approximation $f(x) \approx f(a) + f'(a)(x - a)$, which is a good approximation when $x$ is near $a$. It is natural to ask, what if we approximate $f$ locally by a quadratic or cubic function rather than by a linear function. This leads to the idea of Taylor polynomial approximation, which is indeed initially intended to be a local approximation to $f$. But when we look at the remainder term in Taylor's theorem, there's something kind of amazing, surprising that happens which is that often it's small even when $x$ is far from $a$. Apr 24 '20 at 18:11
• @trisct Yes that is true indeed. The limit of Taylor remainder for $e^x$ is also zero for all x, which further explains why the Taylor Series converges. But I still I can't see why my initial intuition is wrong.
– the
Apr 24 '20 at 18:12
• @littleO So it just happened to be that the Taylor remainder's limit is zero even for x far away?
– the
Apr 24 '20 at 18:14
• @linearAlg In my mind, yes. It is just one of the miracles of math, which makes us wonder why things have worked out more nicely than we deserved. Apr 24 '20 at 18:16

Actually, things may go wrong in $$(-1,1)$$. For instance, the Taylor series centered at $$0$$ of $$f(x)=\frac1{1-nx}$$ only converges to $$f(x)$$ on $$\left(-\frac1n,\frac1n\right)$$. And if$$f(x)=\begin{cases}e^{-1/x^2}&\text{ if }x\ne0\\0&\text{ if }x=0,\end{cases}$$then the Taylor series of $$f$$ only converges to $$f(x)$$ if $$x=0$$.
On the other hand, yes, Taylor series centered at $$0$$ are made to converge to $$f(x)$$ near $$0$$. But that's no reason to expect that they don't converge to $$f(x)$$ when $$x$$ is way from $$0$$. That would be like expecting that a non-constant power series $$a_0+a_1x+a_2x^2+\cdots$$ takes larger and larger values as the distance from $$x$$ to $$0$$. That happens often, but $$1-\frac1{2!}x^2+\frac1{4!}x^4-\cdots=\cos(x)$$, which is bounded.
In other words, you have gone from $$a\implies b$$ to $$\tilde a\implies \tilde b,$$ which you can see to be clearly false, identically. That is, it is not necessarily true for all $$a,\,b.$$
Since you already know why the series for entire functions like $$\cos x$$ converges everywhere (as you explain towards the end of your post), you should now see where your original intuition (I would say erroneous belief) misled you.


# Helen and Joe play guitar together every day at lunchtime.

Helen and Joe play guitar together every day at lunchtime. The number of songs that they play on a given day has a Poisson distribution, with an average of 5 songs per day. Regardless of how many songs they will play that day, Helen and Joe always flip a coin at the start of each song, to decide who will play the solo on that song. If we know that Joe plays exactly 4 solos on a given day, then how many solos do we expect that Helen will play on that same day?

My attempt: If the average is $$5$$ songs a day and Joe performs $$4$$ solos on one day. I thought we should expect Helen to perform $$1$$ solo on the same day $$(5-4=1)$$

But The answer given to me is: $$2.5$$ solos we expect Helen to play

My question is why? What is the way of thinking that gives me $$2.5$$? Is it cause of the coin flip? so $$5 \cdot .5 = 2.5$$? What does Joe's $$4$$ solos have to do with anything then?

Thank You for any help.

• Helen and Joe must have played $4$ or more solos on that day. In other words, you should be thinking about a conditional probability. – Toby Mak May 15 at 2:42

Let $$X$$ denote the total number of games played, and let $$J$$ denote the number of games Joe played. The conditional distribution of $$X$$ given $$J=4$$, namely $$X|J=4$$, is supported on $$\{4,5,\ldots\}$$ and has pmf $$P(X=k|J=4)=\frac{P(J=4|X=k)P(X=k)}{\sum_{k=4}^{\infty}P(J=4|X=k)P(X=k)}$$ which is non zero whenever $$k\geq 4$$. Using the facts that $$X\sim \text{Poisson}(5)$$ and $$J|X\sim \text{Binomial}(X,1/2)$$ we get $$P(X=k|J=4)=e^{-5/2}\frac{1}{(k-4)!}\bigg(\frac{5}{2}\bigg)^{k-4}$$ This means $$X-4|J=4\sim \text{Poisson}(5/2)$$ and so $$\mathbb{E}(X-4|J=4)=\mathbb{E}(X|J=4)-4=5/2$$ Hence $$13/2=E(X|J=4)$$ so expected number of times Helen plays is $$5/2$$

While Matthew Pilling and tommik provide answers that show the mathematics of getting the answer, I will provide the intuition involved.

1. We know that, on this specific day, Joe played 4 solos. This provides a minimum number of songs - specifically, there must have been at least 4 songs. Note that it is very possible for the Poisson distribution to produce 0 songs or 1 song. However, we have been given information that constrains the set of possible numbers of songs - it must be at least 4.

2. We know that Joe played exactly 4 solos - this is a lot more likely if there are 8 songs (~27%) than if there are 4 songs (~6%). This changes the likelihoods of each of the possibilities, compared with the basic Poisson distribution, given this information.

3. How many solos we expect Helen to have played can then be worked out from the new probabilities, which have incorporated the additional information (that Joe played 4 solos).

To see why the 50% information can't be directly used to conclude that Helen is expected to have played 4 solos as well, consider a slightly modified version of the problem. Rather than the number of songs following a Poisson distribution, we will assume that they follow a uniform distribution of between 1 and 7 songs.

Now, we know that Joe played 4 solos. How many solos do we expect Helen to have played? Well, it can't be 4, because that would mean they may have played 8 songs, which can't have happened - the maximum is 7 songs.

To work out the correct answer, we turn to Bayes' Theorem, which is explicitly used in Matthew's answer, and is hidden by proportionality in tommik's answer. Think of the fact that Joe played 4 solos as a "new piece of information". Bayes' Theorem (at least by Bayesian thinking) lets you update your probabilities given the new information.

The answer of @Matthew Pilling is perfect (+1). A Bayesian approach will lead to the same solution avoiding a lot of calculations: (constants are not considered until the end of the process)

$$\mathbb{P}[X|J=4]\propto \mathbb{P}[X]\cdot \mathbb{P}[J=4|X]\propto\frac{5^x}{x!}\cdot \binom{x}{4}\left(\frac{1}{2}\right)^x\propto\frac{\left(\frac{5}{2}\right)^{x}}{(x-4)!}\propto\frac{\left(\frac{5}{2}\right)^{(x-4)}}{(x-4)!}$$

Setting $$Y=X-4$$ we immediately recognize the kernel of a Poisson distribution with mean 2.5

Here $$Y$$ is the distribution of the solos played by Helen

$$\mathbb{P}[Y=y|\text{Joe }=4]=\frac{e^{-2.5}\cdot 2.5^y}{y!}$$

Here's some intuition:

The Poisson distribution is the limiting case for a binomial distribution where the number of trials goes to infinity while the success probability shrinks proportionally to keep the total expectation constant. So we can imagine Helen and Joe spending their lunch break making a very large number of Bernoulli trials, with each giving a small probability of "play a song now".

When the number of trials grows large we can fold the coin flip into that process, deciding that when "play a song now" comes out at trial number $$n$$, Helen plays the solo if $$n$$ is odd, and Joe plays the solo if $$n$$ is even.

But this effectively means that each of Helen and Joe might as well be making their own separate series of trials, with half as many trials but the same probability, and therefore half the expected value. The number of solos played by each is independent of the other, and still Poisson distributed.

The number of solos Helen plays is independent of the number of solos Joe plays, so his $$4$$ solos is not actually relevant information.

An alternative (and perhaps slightly more rigorous) phrasing of the same reinterpretation:

In each step, instead of first asking "should we play a song now?" and then "who should play the solo if we do play?", in each step we can ask "should Joe play now?" and "should Helen play now?" each independently with half the probability. That's almost the same, except that there's a finite chance the answer would be that both should play. But when we go to the limit of infinity many steps, the risk of that happening in any given step goes to zero as $$1/N^2$$, and so the probability of it ever happening during the entire lunch break goes to zero as $$1/N$$. Therefore the risk becomes irrelevant in the limit where the distributions become Poisson.


The Stacks Project

Tag: 036M

This tag has label descent-section-fppf-local-source, it is called Properties of morphisms local in the fppf topology on the source in the Stacks project and it points to

The corresponding content:

31.24. Properties of morphisms local in the fppf topology on the source

Here are some properties of morphisms that are fppf local on the source.

Lemma 31.24.1. The property $\mathcal{P}(f)=$''$f$ is locally of finite presentation'' is fppf local on the source.

Proof. Being locally of finite presentation is Zariski local on the source and the target, see Morphisms, Lemma 25.22.2. It is a property which is preserved under composition, see Morphisms, Lemma 25.22.3. This proves (1), (2) and (3) of Lemma 31.22.3. The final condition (4) is Lemma 31.10.1. Hence we win. $\square$

Lemma 31.24.2. The property $\mathcal{P}(f)=$''$f$ is locally of finite type'' is fppf local on the source.

Proof. Being locally of finite type is Zariski local on the source and the target, see Morphisms, Lemma 25.16.2. It is a property which is preserved under composition, see Morphisms, Lemma 25.16.3, and a flat morphism locally of finite presentation is locally of finite type, see Morphisms, Lemma 25.22.8. This proves (1), (2) and (3) of Lemma 31.22.3. The final condition (4) is Lemma 31.10.2. Hence we win. $\square$

Lemma 31.24.3. The property $\mathcal{P}(f)=$''$f$ is open'' is fppf local on the source.

Proof. Being an open morphism is clearly Zariski local on the source and the target. It is a property which is preserved under composition, see Morphisms, Lemma 25.24.3, and a flat morphism of finite presentation is open, see Morphisms, Lemma 25.26.9 This proves (1), (2) and (3) of Lemma 31.22.3. The final condition (4) follows from Morphisms, Lemma 25.26.10. Hence we win. $\square$

Lemma 31.24.4. The property $\mathcal{P}(f)=$''$f$ is universally open'' is fppf local on the source.

Proof. Let $f : X \to Y$ be a morphism of schemes. Let $\{X_i \to X\}_{i \in I}$ be an fppf covering. Denote $f_i : X_i \to X$ the compositions. We have to show that $f$ is universally open if and only if each $f_i$ is universally open. If $f$ is universally open, then also each $f_i$ is universally open since the maps $X_i \to X$ are universally open and compositions of universally open morphisms are universally open (Morphisms, Lemmas 25.26.9 and 25.24.3). Conversely, assume each $f_i$ is universally open. Let $Y' \to Y$ be a morphism of schemes. Denote $X' = Y' \times_Y X$ and $X'_i = Y' \times_Y X_i$. Note that $\{X_i' \to X'\}_{i \in I}$ is an fppf covering also. The morphisms $f'_i : X_i' \to Y'$ are open by assumption. Hence by the Lemma 31.24.3 above we conclude that $f' : X' \to Y'$ is open as desired. $\square$

\section{Properties of morphisms local in the fppf topology on the source}
\label{section-fppf-local-source}

\noindent
Here are some properties of morphisms that are fppf local on the source.

\begin{lemma}
\label{lemma-locally-finite-presentation-fppf-local-source}
The property $\mathcal{P}(f)=$$f$ is locally of finite presentation''
is fppf local on the source.
\end{lemma}

\begin{proof}
Being locally of finite presentation is Zariski local on the source
and the target, see Morphisms,
Lemma \ref{morphisms-lemma-locally-finite-presentation-characterize}.
It is a property which is preserved under composition, see
Morphisms, Lemma \ref{morphisms-lemma-composition-finite-presentation}.
This proves
(1), (2) and (3) of Lemma \ref{lemma-properties-morphisms-local-source}.
The final condition (4) is
Lemma \ref{lemma-flat-finitely-presented-permanence-algebra}. Hence we win.
\end{proof}

\begin{lemma}
\label{lemma-locally-finite-type-fppf-local-source}
The property $\mathcal{P}(f)=$$f$ is locally of finite type''
is fppf local on the source.
\end{lemma}

\begin{proof}
Being locally of finite type is Zariski local on the source
and the target, see Morphisms,
Lemma \ref{morphisms-lemma-locally-finite-type-characterize}.
It is a property which is preserved under composition, see
Morphisms, Lemma \ref{morphisms-lemma-composition-finite-type}, and
a flat morphism locally of finite presentation is locally of finite type, see
Morphisms, Lemma \ref{morphisms-lemma-finite-presentation-finite-type}.
This proves
(1), (2) and (3) of Lemma \ref{lemma-properties-morphisms-local-source}.
The final condition (4) is
Lemma \ref{lemma-finite-type-local-source-fppf-algebra}. Hence we win.
\end{proof}

\begin{lemma}
\label{lemma-open-fppf-local-source}
The property $\mathcal{P}(f)=$$f$ is open''
is fppf local on the source.
\end{lemma}

\begin{proof}
Being an open morphism is clearly Zariski local on the source and the target.
It is a property which is preserved under composition, see
Morphisms, Lemma \ref{morphisms-lemma-composition-open}, and
a flat morphism of finite presentation is open, see
Morphisms, Lemma \ref{morphisms-lemma-fppf-open}
This proves
(1), (2) and (3) of Lemma \ref{lemma-properties-morphisms-local-source}.
The final condition (4) follows from
Morphisms, Lemma \ref{morphisms-lemma-fpqc-quotient-topology}.
Hence we win.
\end{proof}

\begin{lemma}
\label{lemma-universally-open-fppf-local-source}
The property $\mathcal{P}(f)=$$f$ is universally open''
is fppf local on the source.
\end{lemma}

\begin{proof}
Let $f : X \to Y$ be a morphism of schemes.
Let $\{X_i \to X\}_{i \in I}$ be an fppf covering.
Denote $f_i : X_i \to X$ the compositions.
We have to show that $f$ is universally open if and only if
each $f_i$ is universally open. If $f$ is universally open,
then also each $f_i$ is universally open since the maps
$X_i \to X$ are universally open and compositions
of universally open morphisms are universally open
(Morphisms, Lemmas \ref{morphisms-lemma-fppf-open}
and \ref{morphisms-lemma-composition-open}).
Conversely, assume each $f_i$ is universally open.
Let $Y' \to Y$ be a morphism of schemes.
Denote $X' = Y' \times_Y X$ and $X'_i = Y' \times_Y X_i$.
Note that $\{X_i' \to X'\}_{i \in I}$ is an fppf covering also.
The morphisms $f'_i : X_i' \to Y'$ are open by assumption.
Hence by the Lemma \ref{lemma-open-fppf-local-source}
above we conclude that $f' : X' \to Y'$ is open as desired.
\end{proof}

To cite this tag (see How to reference tags), use:

\cite[\href{http://stacks.math.columbia.edu/tag/036M}{Tag 036M}]{stacks-project}

In your comment you can use Markdown and LaTeX style mathematics (enclose it like $\pi$). A preview option is available if you wish to see how it works out (just click on the eye in the lower-right corner).


# Equation of the line that lies tangent to both circles

Consider the two circles determined by $$(x-1)^2 + y^2 = 1$$ and $$(x-2.5)^2 + y^2 = (1/2)^2$$. Find the (explicit) equation of the line that lies tangent to both circles.

I have never seen a clean or clever solution to this problem. This problem came up once at a staff meeting for a tutoring center I worked at during undergrad. I recall my roommate and I - after a good amount of time symbol pushing - were able to visibly see a solution by inspection, then verify it by plugging in. I have never seen a solid derivation of a solution to this though, so I would like to see what MSE can come up with for this!

I took a short stab at it today before posting, and got that it would be determined by the solution to the equation $$\left( \frac{\cos(\theta)}{\sin(\theta)} + 2\cos(\theta) + 3 \right)^2 -4\left( \frac{\cos(\theta)^2}{\sin(\theta)^2}+1 \right)\left(\frac{-\cos(\theta)^3}{\sin(\theta)^2}+\frac{\cos(\theta)^4}{\sin(\theta)^2}+3 \right).$$

The solution $$\theta$$ would then determine the line $$y(x) = \frac{-\cos(\theta)}{\sin(\theta)}(x) + \frac{\cos(\theta)^2}{\sin(\theta)} + \sin(\theta).$$

Not only do I not want to try and solve that, I don't even want to try expanding it out :/

• not $x=2$ :-) ? – J. W. Tanner May 9 at 0:32
• "the line"? I see 3 common tangents after plotting the circles. – peterwhy May 9 at 0:32
• math.stackexchange.com/questions/211538/… – lab bhattacharjee May 9 at 0:44
• @peterwhy Hi Peter. One of those 3 solutions is so trivial, I am offended you would even bring it up. For the remaining 2, one is clearly the other ones mirror image. So I am going to stick to my wording of 'find the line' since there is clearly one difficult one to find, which is what I am interested in seeing solutions for. Let me know when you have one, you can post answers below. – Prince M May 9 at 4:47

As peterwhy points out in the comments, there are three tangent lines. By inspection, one is $$x = 2$$, as pointed out by J.W. Tanner in the comments.

The other two can be identified by similar triangles. Suppose that we have a line tangent to both circles, and let the points of tangency be $$T_1$$ and $$T_2$$. Let the circle centers be $$O_1$$ and $$O_2$$. Finally, let the point where this line intersects the $$x$$-axis be called $$P$$. Then $$\triangle PO_1T_1$$ and $$\triangle PO_2T_2$$ are similar (do you see why?). Since $$O_1T_1 = 2O_2T_2$$, we must have $$PO_1 = 2PO_2$$, and therefore $$P$$ must be at $$(4, 0)$$. Note that $$PT_1 = \sqrt{3^2-1^2} = \sqrt{8}$$, and therefore our tangent line must have slope $$\pm \frac{1}{\sqrt{8}}$$.

(For simplicity, I only show one of the tangent lines; the other is its mirror image across the $$x$$-axis.) From this, we get the equation of the two remaining tangent lines

$$y = \pm \frac{x-4}{\sqrt{8}}$$

• This is a clean solution. Nice – Prince M May 9 at 4:52

The equation of the second circle can be written as $$x^2+y^2-5x+6=0$$.

Let $$P(h,k)$$ be a point on the second circle.

Then the equation of the tangent to the second circle at $$P$$ is $$hx+ky-\dfrac52(x+h)+6=0$$.

If it is also a tangent to the first circle, the distance from $$(1,0)$$ to this line is $$1$$.

\begin{align*} \frac{|h-\frac52(1+h)+6|}{\sqrt{(h-\frac52)^2+k^2}}&=1\\ \frac{|-\frac32h+\frac72|}{\sqrt{(\frac12)^2}}&=1\\ -3h+7&=\pm1 \end{align*} So, we have $$h=2$$ or $$h=\frac83$$.

If $$h=2$$, $$k=\pm\sqrt{(\frac12)^2-(2-\frac52)^2}=0$$ and the common tangent is $$x-2=0$$.

If $$h=\frac83$$, $$k=\pm\sqrt{(\frac12)^2-(\frac83-\frac52)^2}=\pm\frac{\sqrt{2}}{3}$$ and the common tangents are $$x\pm2\sqrt{2}y-4=0$$.

Use dual conics: If we represent a circle (in fact, any nondegenerate conic) with the homogeneous matrix $$C$$ so that its equation is $$(x,y,1)C(x,y,1)^T=0$$, lines $$\lambda x+\mu y+\tau=0$$ tangent to the circle satisfy the dual conic equation $$(\lambda,\mu,\tau)\,C^{-1}(\lambda,\mu,\tau)^T=0$$. (This equation captures the fact that the pole of a tangent line lies on the line.)

The matrix that corresponds to the circle $$(x-h)^2+(y-k)^2=r^2$$ is $$C=\begin{bmatrix}1&0&-h\\0&1&-k\\-h&-k&h^2+k^2-r^2\end{bmatrix}$$ with inverse $$C^{-1}=\frac1{r^2}\begin{bmatrix}r^2-h^2&-hk&-h\\-hk&r^2-k^2&-k\\-h&-k&-1\end{bmatrix}.$$ For the circles in this problem, the resulting dual equations are $$\mu^2-\tau^2-2\lambda\tau = 0 \\ -24\lambda^2+\mu^2-4\tau^2-20\lambda\tau = 0.$$ Both circles’ centers lie on the $$x$$-axis but their radii differ, so no common tangent is horizontal. Thus, we can set $$\lambda=1$$ and solve the slightly simpler system to obtain the solutions $$\mu=0$$, $$\tau=-2$$ and $$\mu=\pm2\sqrt2$$, $$\tau=-4$$, i.e., the three common tangent lines are $$x=2 \\ x\pm2\sqrt2 y=4.$$

This general method works for any pair of nondegenerate conics: it finds their common tangents by solving a dual problem of the intersection of two (possibly imaginary) conics. For a pair of circles, however, there’s a simple way to find common tangents via similar triangles, as demonstrated in Brian Tung’s answer.

To find a common tangent to two arbitrary circles, you can use the following trick: "deflate" the smaller circle (let $$1$$) so that it shrinks to a point, while the second shrinks to the radius $$r_2-r_1$$. Doing this, the direction of the tangent doesn't change and the tangency point forms a right triangle with the two centers.

By elementary trigonometry, the angle $$\phi$$ between the axis through the centers and the tangent is drawn from

$$d\sin\phi=r_2-r_1,$$ where $$d$$ is the distance between the centers. The direction of the axis is such that

$$\tan\theta=\frac{y_2-y_1}{x_2-x_1}.$$

So the equation of the tangent is given by

$$(x-x_1)\sin(\theta+\phi)-(y-y_1)\cos(\theta+\phi)=0.$$

The original tangent is a parallel at distance $$r_1$$, hence

$$(x-x_1)\sin(\theta+\phi)-(y-y_1)\cos(\theta+\phi)=r_1.$$

• Caution: quadrant discussion is missing. – Yves Daoust May 9 at 20:30

As already stated, there are three lines that can be drawn that are tangent to both circles. One is the trivial line $$x = 2,$$ which is tangent at the point $$(2,0)$$, which is also the common point of tangency of the two circles.

The other two lines are reflections of each other in the $$x$$-axis; these can be found by noting that a homothety that takes the point $$(0,0)$$ to $$(2,0)$$ and $$(2,0)$$ to $$(3,0)$$ will map the first circle to the second, and the center of this homothety will be a fixed point of this map.

To this end, let $$(x',y') = (a x + b, a y + d)$$, so we now solve the system $$(b, d) = (2,0) \\ (2a + b, d) = (3,0).$$ That is to say, $$b = 2$$, $$d = 0$$, $$a = 1/2$$, and the desired homothety is $$(x',y') = (x/2 + 2, y/2).$$ The unique fixed point is found by setting $$(x',y') = (x,y)$$ from which we obtain $$(x,y) = (4,0)$$. Thus the tangent lines pass through this point and have the form $$y = m(x - 4)$$ where $$m$$ is the slope. Such a line will be tangent if the system of equations $$(x-1)^2 + y^2 = 1, \\ y = m(x-4)$$ has exactly one solution. Eliminating $$y$$ gives the quadratic $$(m^2+1)x^2 - 2(4m^2+1)x + 16m^2 = 0,$$ for which the solution has a unique root if the discriminant is zero; i.e., $$0 = 4(4m^2+1)^2 - 4(m^2+1)(16m^2) = 4 - 32m^2.$$ Therefore, $$m = \pm 1/\sqrt{2}$$ and the desired lines are $$y = \pm \frac{x-4}{2 \sqrt{2}},$$ in addition to the previous line $$x = 2$$ described.

Beside the obvious solution of $$x=2$$ you also have two more common tangent lines, namely $$y= \pm \frac {\sqrt {2}}{4} (x-4)$$

The two non-obvious tangent lines pass through $$(4,0)$$ and their y-intercepts are respectively $$(0,\pm \sqrt {2})$$


Thread: AP calculus exam question on Absolute max

1. $\text{22. Let f be the function defined by$f(x)=\dfrac{\ln x}{x}$What is the absolute maximum value of f ? }$
$$(A)\, 1\quad (B)\, \dfrac{1}{e} (C)\, 0 \quad (D) -e \quad (E) f\textit{ does not have an absolute maximum value}.$$

I only guessed this by graphing it and it appears to $\dfrac{1}{e}$ which is (B)

2.

3. Originally Posted by karush
$\text{22. Let f be the function defined by$f(x)=\dfrac{\ln x}{x}$What is the absolute maximum value of f ? }$
$$(A)\, 1\quad (B)\, \dfrac{1}{e} (C)\, 0 \quad (D) -e \quad (E) f\textit{ does not have an absolute maximum value}.$$

I only guessed this by graphing it and it appears to $\dfrac{1}{e}$ which is (B)
Why would graphing be a guess? It's a valid Mathematical tool!

You could do this by taking the derivative of f(x) and finding the critical points, etc. But if you have this question on an exam the simplest (and probably fastest) way is to take a look at each answer and see what you get. D) is out because f(x) takes on positive values, and A), C), and E) are out by looking at the graph. That leaves B).

-Dan

4. $f’(x)=\dfrac{x \cdot \frac{1}{x} - \ln{x} \cdot 1}{x^2} = \dfrac{1-\ln{x}}{x^2}$

$f’(x)=0$ at $x=e$

first derivative test ...

$x < e \implies f’(x) > 0 \implies f(x) \text{ increasing over the interval } (0,e)$

$x > e \implies f’(x) < 0 \implies f(x) \text{ decreasing over the interval } (e, \infty)$

conclusion ... $f(e) = \dfrac{1}{e}$ is an absolute maximum.

second derivative test ...

$f’’(x) = \dfrac{x^2 \cdot \left(-\frac{1}{x} \right) - (1-\ln{x}) \cdot 2x}{x^4} = \dfrac{2\ln{x} - 3}{x^3}$

$f’’(e) = -\dfrac{1}{e^3} < 0 \implies f(e) = \dfrac{1}{e}$ is a maximum.

wow that was a lot of help..

yes the real negative about these assessment tests is how fast you can eliminate possible answers
not so much what math steps are you really need to take

actually Im learning a lot here at MHB
Mahalo


# To find the smallest integer greater than $23$ with certain modular residues

The question asks to find the smallest integer greater than $23$ that leaves the remainders $2,3,2$ when divided by $3,5,7$ respectively. The answer is given as $128$.

I used C.R.T. to solve this. $$x\equiv2\pmod 3\\ x\equiv3\pmod 5\\ x\equiv2\pmod 7$$ where $M=m_1·m_2·m_3=3×5×7=105$.

From here I get solutions, $$x\equiv2\pmod 3\\ x\equiv1\pmod 5\\ x\equiv1\pmod 7$$
After that I find\begin{align*} x &\equiv 2×2×5×7+1×3×3×7+1×2×3×5\\ &\equiv 140+63+30\\ &\equiv 233 \pmod{105}, \end{align*} where I again find that $x=23$.

But one thing I have noticed that $233=105×1+128$. I cannot continue from here. I need help and any help is highly appreciated.

• The "From here I get solutions..." is incomprehensible for me: how applying the CRT gives you those "solutions" and not the final one, which is unique modulo $\;3\cdot5\cdot7=105\;$ ? Mar 12 '18 at 8:34
• @thevbm The solutions are actually given by $23+105n$. Since substituting in $n=0$ gives $23$, you can substitute the next $n$ which is $n=1$. Mar 12 '18 at 8:35
• You could just observe that $23$ itself has the correct remainders modulo $3,5$ and $7$. By CRT the solutions form a single residue class modulo $3\cdot5\cdot7=105$, and you already know which class it is! So....? Mar 12 '18 at 8:35

Applying directly the following proof of CRT, for example:

$$\begin{cases}y_1=\frac{105}3=35\;\implies y_1=2\pmod3\implies y_1^{-1}=2\pmod3\\{}\\y_2=\frac{105}5=21\implies y_2=1\pmod5\implies y_2^{-1}=1\pmod5\;\\{}\\y_3=\frac{105}7=15\implies y_3=1\pmod7\implies y_3^{-1}=1\pmod7\end{cases}$$

so that

$$2\cdot35\cdot2+3\cdot21\cdot1+2\cdot15\cdot1=233\;\;\text{ is a solution, and}$$

$$233=128\pmod{105}\;\;\text{is another solution, and}$$

$$128=23\pmod105\;\;\text{ is the unique solution modulo}\;105$$

Observe that unless you consider things modulo $\;3\cdot5\cdot7=105\;$ at the end , there is not "the" solution, but only one out of infinitely many

• Yes, now I understand and thank you for providing the link.
– vbm
Mar 12 '18 at 9:03
• Following the link you provided, one question I have (from an example given there) to make my doubt clear. suppose system of congruences is given as $x\equiv 5 \mod 6$ $x\equiv 3 \mod 8$. Here g..c.d of the moduli is $2$. The first congruence implies $x\equiv 1\mod 2$, also the second congruence implies $x\equiv 1\mod 2$Now to reduce the system of congruency to a simpler form if we divide the g.c.d of the moduli from the modulud of the first congruence, then how is it $x\equiv2 \mod3$? rather it should be $x\equiv 1 \mod 3$. If I'm wrong, please correct me. Thank you
– vbm
Mar 12 '18 at 9:38
• @thevbm I'm not sure what your doubt exactly is, but remember the CRT applies for coprime moduli, so reducing your moduli as you did can help...but then you should be careful when going back to the original ones. Mar 12 '18 at 11:53

Let $x\equiv y \equiv 2 \mod 3,$ and $x\equiv y \equiv 3 \mod 5,$ and $x\equiv y \equiv 2 \mod 7.$ Then $x-y \equiv 0$ modulo $3,5,$ and $7.$

So $x-y$ is divisible by $3,5,$ and $7,$ so $x-y$ is divisible by $(3)(5)(7)=105.$ So if $y=23$ and $x>y$ then $x=23+105n$ for some $n\in \Bbb N.$

And if $x=23+105n$ for some $n\in \Bbb N$ then $x\equiv 23$ modulo $3,5,$ and $7.$


# Sum of unique elements in all sub-arrays of an array

Given an array $$A$$, sum the number of unique elements for each sub-array of $$A$$. If $$A = \{1, 2, 1, 3\}$$ the desired sum is $$18$$.

Subarrays:

{1} - 1 unique element
{2} - 1
{1} - 1
{3} - 1
{1, 2} - 2
{2, 1} - 2
{1, 3} - 2
{1, 2, 1} - 2
{2, 1, 3} - 3
{1, 2, 1, 3} - 3

I have a working solution which sums the unique elements for all sub-arrays starting at index $$0$$, then repeats that process at index $$1$$, etc. I have noticed that for an array of size $$n$$ consisting of only unique elements, the sum I desire can be found by summing $$i(i + 1) / 2$$ from $$i = 1$$ to $$n$$, but I haven't been able to extend that to cases where there are non-unique elements. I thought I could use that fact on each sub-array, but my control logic becomes unwieldy. I've spent considerable time trying to devise a solution better than $$O(n^2)$$ to no avail. Is there one?

Secondary question: if there is no better solution, are there any general guidelines or hints to recognize that fact?

• An incremental algorithm is supposedly easier to come up with in this case, I think so. – Thinh D. Nguyen Oct 18 '18 at 7:16
• I don't understand the line {1, 2, 1} - 2. The multiset {1, 2, 1} only contains one unique element: 2. – Peter Taylor Oct 18 '18 at 10:28
• Peter, yes number of distinct elements might be better phrasing. If all elements of each sub-array are added to a set, the set size is the desired metric. In either case, the behavior in my example is what I'm looking for. – User12345654321 Oct 18 '18 at 17:34

Hint: Use an extra $$O(n)$$-spaced array of pointer to the last (biggest) index of each distinct value. Then, this array is very helpful when you do your above algorithm.

Lastly, we should have an $$O(n)$$ algorithm.

• This was a good hint. Assume zero-indexed arrays. Starting with sum = maxPossibleSum, iterate through the array adding elements to a set. If the added element is a duplicate, sum = sum - (indexPreviousOccurrence + 1) * (totalElements - currentIndex). This requires just one pass leading to O(n) like you said. Thanks for a quality nudge in the right direction. – User12345654321 Oct 18 '18 at 20:31

If the maximum number $$k$$ is not too high, a Counting Sort based solution can be used;

In the first step, we count the number of elements into the array $$C$$ by

for j = 1 to length(A)
C[A[j]] = C[A[j]]+1

now the array contains all the information we need to sum;

sum = 0;
for j = 1 to k
if C[i] > 1
sum =  C[i] * i

Complexity:

$$\mathcal{O}(n)$$ additions (increment) for the counting step

$$\mathcal{O}(n)$$ additions for the summation step

$$\mathcal{O}(n)$$ multiplications for the summation step

result $$\mathcal{O}(n)$$.

Note: indeed the multiplications are not necessary since we will have at most $$n-1$$ addition.

Let $$a_1,\ldots,a_m$$ be the distinct values. Now consider the positions of $$a_i$$'s in $$A$$. Assume the number of $$a_i$$'s is $$b_i$$ and the positions are as follows:

(x_{i0} non-a_i's) a_i (x_{i1} non-a_i's) a_i ... a_i (x_{ib_i} non-a_i's)

In your example $$A=\{1,2,1,3\}$$, when considering the value $$a_1=1$$, we have $$x_{10}=0,x_{11}=1,x_{12}=1$$ because the positions of $$1$$s are like 1 * 1 *: there is $$0$$ element before the first $$1$$, $$1$$ element between the first $$1$$ and the second $$1$$, and $$1$$ element after the second $$1$$.

Then there are \begin{align} &\sum_{j=0}^{b_i} \frac{x_{ij}(x_{ij}+1)}{2}\\ =\ &\frac{1}{2}\sum_{j=0}^{b_i}x_{ij}^2+\frac{1}{2}\sum_{j=0}^{b_i}x_{ij}\\ =\ &\frac{1}{2}\sum_{j=0}^{b_i}x_{ij}^2+\frac{1}{2}(n-b_i) \end{align} subarrays that do not contain $$a_i$$. Note there are $$n(n+1)/2$$ subarrays in total, so the final result we want is \begin{align} &\sum_{i=1}^m\left(\frac{n(n+1)}{2}-\frac{1}{2}\sum_{j=0}^{b_i}x_{ij}^2-\frac{1}{2}(n-b_i)\right)\\ =\ &\frac{1}{2}\left(mn^2+n-\sum_{i=1}^m\sum_{j=0}^{b_i}x_{ij}^2\right). \end{align}

To calculate $$\sum_{i=1}^m\sum_{j=0}^{b_i}x_{ij}^2$$, you can scan the array and maintain a lookup table that, for each distinct value, keeps the position of the last element with this value. With this table, when the $$(j+1)$$-th $$a_i$$ is scanned, you can compute $$x_{ij}$$ easily. This leads us to an $$O(n\log n)$$ solution (or $$O(n)$$ in average if you use a good hash table to implement the lookup table).

• could you clarify what X represents? It looks like a 2D array. This is the part I'm not understanding "(x_{i0} non-a_i's) a_i ..." – User12345654321 Oct 18 '18 at 17:17
• @User12345654321 In your example $A=\{1,2,1,3\}$, when considering the value $a_1=1$, we have $x_{10}=0,x_{11}=1,x_{12}=1$ because the positions of 1s are like 1 * 1 *: there is 0 element before the first 1, 1 element between the first 1 and the second 1, and 1 element after the second 1. – xskxzr Oct 19 '18 at 3:18


# Why must $r$ be put in modulus for $\int^{\infty}_0\frac{1-\cos(rx)}{x^2}dx=\frac{\pi}{2}|r|$?

Here's the question: Prove that $$\int^{\infty}_0\frac{1-\cos(rx)}{x^2}~\mathrm dx=\frac{\pi}{2}|r|·$$

When I finished my working, I got $$\frac{\pi}{2}r$$

Why is the $$r$$ put in modulus? Is it because the graph lies entirely above the x axis?

• Did you assume $r\geq 0$ in your working? Nov 10 '18 at 3:18
• The integral expression is visibly even in $r$. As for where the absolute value comes up in your derivation, that depends on your method, I suppose. Nov 10 '18 at 3:21
• Nope I didn't assume r greater than 0 as I thought there wasn't any need to do so Nov 10 '18 at 3:24
• Notice that for any real number $a$, $\cos(a) = \cos(-a)$. In particular, it suffices to solve the problem in the case $r \geq 0$. Nov 10 '18 at 3:49
• Note: the integrand is positive, so you could you get a negative answer? Nov 10 '18 at 13:55

Integrating by part: $$\int_0^{+\infty} \frac {1-\cos(rx)}{x^2}\, \mathrm dx = \int_{+\infty}^0 (1 - \cos(rx)) \mathrm d \frac 1 x =\left. \frac {1-\cos(rx)}x \right\vert_{+\infty}^0 - r\int_{+\infty}^0 \frac {\sin(rx)}x\, \mathrm dx = r \int_0^{+\infty} \frac {\sin(rx)}x \,\mathrm dx.$$ Now $$\DeclareMathOperator\sgn{sgn} \int_0^{+\infty} \frac {\sin(rx)}x \,\mathrm dx =\int_0^{+\infty} \frac {\sin(rx)}{rx}\,\mathrm d(rx)= \begin{cases}\displaystyle \int_0^{+\infty} \frac {\sin u}u\, \mathrm du, & r > 0,\\ 0, & r=0,\\ \displaystyle \int_{-\infty}^0 \frac {\sin u}u\, \mathrm du, & r < 0, \end{cases} = \sgn r \cdot \int_0^{+\infty} \frac {\sin u}u\, \mathrm du = \sgn r \cdot \frac \pi 2,$$ hence the integral equals $$r \sgn r \cdot \frac \pi 2 = \frac \pi 2 \vert r \vert.$$
The implicit assumption could be $$r>0$$ when dealing the integral $$\int_0^{+\infty} \sin(rx)\,\mathrm dx /x$$.
The other answers explain how you get $$|r|$$ in your answer, but here’s why it should happen:
Notice that $$1-\cos(rx) \geq 0$$ for all $$x$$, regardless of what $$r$$ is. Integrating a nonnegative function over any interval should give you a nonnegative value.


# Spivak's Calculus: Finding the formula for the sum of a series. [duplicate]

This question already has an answer here:

In Spivak's Calculus, Chapter 2, the second problem of the set asks you to find a formula for the following series:

$$\sum_{i=1}^n(2i-1)$$ and $$\sum_{i=1}^n(2i-1)^2$$ Now, for the former, this was fairly straightforward: it sums to $i^2$ and I have a proof that I'm happy with. However, for the latter, I cannot identify a pattern in terms of $n$ to begin building a proof. The series proceeds $1^2 + 3^2 + 5^2 + 7^2 + \cdots + (2n-1)^2$, so the sum for the first few indices would be $1, 10, 35,$ and $84.$ Not only have I failed to come up with an expression of this in terms of $n$, but I'm not even sure what I should be considering to lead me to such a formula.

## marked as duplicate by Hans Lundmark, Claude Leibovici, ccorn, cansomeonehelpmeout, ChristopherJun 8 '18 at 12:16

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

• Are you also supposed to give a direct proof by induction, or can you use other known formulæ like the sum of the first $2n$ squares? – Bernard Jun 6 '18 at 20:33

## 5 Answers

Hint : Expand the summand & use \begin{eqnarray*} \sum_{i=1}^{n} i^2 =\frac{n(n+1)(2n+1)}{6}. \end{eqnarray*} You should get to \begin{eqnarray*} \sum_{i=1}^{n} (2i-1)^2 =\frac{n(4n^2-1)}{3}. \end{eqnarray*}

• Thanks to a combination of your hint and dezdichado's below, I managed to figure it out. Thank you very much! – user242007 Jun 6 '18 at 21:44

If you know what $1^2+2^2+...+n^2=f(n)$ sums up to, then your desired sum is simply: $$1^2+3^2+...+(2n-1)^2 = f(2n) - (2^2+4^2+...+(2n)^2) = f(2n) - 4f(n).$$

• Your comment helped me become more aware of incorporating existing known formulae in these exercises. Between that and Donald's comment above, I was able to solve the problem. Thank you. – user242007 Jun 6 '18 at 21:44

$$\sum_{i=1}^n (2i-1)^2$$

$$=\sum_{i=1}^n 4i^2-4i+1$$

$$=4\sum_{i=1}^n i^2-4\sum_{i=1}^n i+\sum_{i=1}^n1$$

• Could you elaborate on this? In trying to implement it with an example value of i = 4, I end up with 81, when the actual value in the series appears to be 84. – user242007 Jun 6 '18 at 21:26

$\sum_\limits{k=1}^n (2k - 1)^2 = \sum_\limits{k=1}^n 4k^2 - \sum_\limits{k=1}^n 4k + \sum_\limits{k=1}^n 1 = 4\left(\sum_\limits{k=1}^n k^2\right) - 2n(n+1) + n$

You need a way to find $\sum_\limits{k=1}^n k^2$

There are lots of other ways to derive this... but this one is nice.

Write the numbers in a triangle

$\begin {array}{} &&&1\\&&2&&2\\&3&&3&&3\\&&&\vdots&&\ddots\\n&&n&\cdots\end{array}$

The sum of each row is $k^2.$ And, the sum of the whole trianglular array is $\sum_\limits{k=1}^n k^2$

Take this triangle and rotate it 60 degrees clockwise and 60 degrees counter clockwise and sum the 3 triangles together.

$\begin {array}{} &&&1\\&&2&&2\\&3&&3&&3\end{array}+\begin {array}{} &&&n\\&&n-1&&n\\&n-2&&n-1&&n\\\end{array}+\begin {array}{} &&&n\\&&n&&n-1\\&n&&n-1&&n-2\end{array}$

And we get:

$\begin {array}{} &&&2n+1\\&&2n+1&&2n+1\\&2n+1&&2n+1&&2n+1\\&&&\vdots&&\ddots\end{array}$

What remains how many elements are in the triangular array? $\sum_\limits{k=1}^n k$

$3\sum_\limits{k=1}^n k^2 = (2n+1)\sum_\limits{k=1}^n k\\ \sum_\limits{k=1}^n k^2 = \frac {n(n+1)(2n+1)}{6}$

Another way to do it is:

$\sum_\limits{k=1}^n (k+1)^3 - k^3 = (n+1)^3-1\\ \sum_\limits{k=1}^n (3k^2 + 3k + 1)\\ \sum_\limits{k=1}^n 3k^2 + \sum_\limits{k=1}^n 3k + \sum_\limits{k=1}^n 1\\ \sum_\limits{k=1}^n 3k^2 + 3\frac {n(n+1)}{2} + n = n^3 + 3n^2 + 3n \\ 3\sum_\limits{k=1}^n k^2 = n^3 + \frac 32 n^2 + \frac 12 n\\ \sum_\limits{k=1}^n k^2 = \frac 16 (n)(n+1)(2n+1)$

• I like the rotation method, that works out very nicely! – abiessu Jun 6 '18 at 20:59
• It is nice in that it is intuitive, but the other method can be generalized. – Doug M Jun 6 '18 at 21:01

You can do it by telescoping. Given a sequence $f(n)$ define the sequence $\Delta f(n)=f(n+1)-f(n)$ and put $(n)_m=n(n-1)\dotsb(n-m+1)$. One can check that $\Delta (n)_m=m(n)_{m-1}$ for $m\geq 1$. Now note that $$(2i-1)^2=4i^2-4i+1=4[(i)_2+i] -4i+1=4(i)_2+1$$ whence $$\Delta\left(\frac{4}{3}(i)_3+i\right)=(2i-1)^2.$$ In particular $$\sum_{i=1}^n (2i-1)^2=\sum_{i=1}^n \Delta\left(\frac{4}{3}(i)_3+i\right)=\left[\frac{4}{3}(i)_3+i\right]_{i=1}^{n+1}$$ with the notation $[g(i)]_{i=a}^b=g(b)-g(a)$.


# Probability of a 500 year flood occuring in the next 100 years - comparison of approaches

I'm looking at this problem

A $$500$$-year flood is one that occurs once in every $$500$$ years.

a) What is the probability of having at least $$3$$ such floods in $$500$$ years?

b) What is the probability that a flood will occur within the next $$100$$ years?

c) What is the expected number of years until the next flood?

Attempt:

a) The window size is $$500$$ years, $$\lambda=1$$ and the number of floods is a Poisson variable $$X$$. So the answer would be $$1-P(X=0)-P(X=1)-P(X=2)$$, where $$P(X=n)$$ is the Poisson pmf.

c) I can consider a window size of $$1$$ year, $$\lambda=\frac{1}{500}$$ and consider the time to next flood as the exponential random variable $$T$$, so that $$E[T]=1/\lambda=500$$.

Are the above two correct?

Finally for part b), one approach is to decide on a window size, let's say $$1$$ year, set $$\lambda$$ appropriately (in this case $$\frac{1}{500}$$), let $$T$$ be the time to next flood (exponential RV), and find $$P(T=1)+P(T=2)+P(T=3)+\ldots+P(T=100)$$

The other approach is to set the window to $$100$$ years, set $$\lambda=\frac{100}{500}=0.2$$, model number of floods as a Poisson RV $$X$$ and find $$1-P(X=0)$$.

Numerically, these approaches give slightly different answers ($$0.1811$$ vs $$0.1813$$). Which of the two approaches is better for this purpose (i.e. which gives a more accurate answer)?

Also, in the first approach to part b), instead of a one-year window, I could've taken a half-year window and set $$\lambda=\frac{1}{1000}$$ and summed from $$P(T=1)$$ to $$P(T=200)$$. And of course there's no limit to how small I can set that window. What is the recommended granularity of time windows for problems like these?

• I would write > in the first two questions, and < in the final one - given that climate change means that all estimates based on historical rates will underestimate future rates. In other words, what we consider a 500 year flood today, will not be a 500 year flood tomorrow. Oct 18, 2019 at 12:14

Your treatment of (a) and (c) are correct. In (b), the second approach is the correct one because in your first approach, you treat exponential RVs as if they're discrete. You should've done the following ($$\lambda=1/500$$): $$P(T\leq100)=\int_0^{100}\lambda e^{-\lambda t}dt=1-e^{-100\lambda}=1-e^{-0.2}$$ which gives the same answer as your Poisson approach. By the way, for (b), if you discretize at infinitely small steps, you get this integral.


# Find $f$ if $f'(x)=\dfrac{x^2-1}{x}$ knowing that $f(1) = \dfrac{1}{2}$ and $f(-1) = 0$

I am asked the following problem:

Find $f$ if $$f'(x)=\frac{x^2-1}{x}$$

I am not sure about my solution, which I will describe below:

My solution:

The first thing that I've done is separate the terms of $f'(x)$

\begin{align*} f'(x)&=\frac{x^2-1}{x}\\ &=x-\frac{1}{x}\\ \therefore \quad f(x)&=\frac{x^2}{2}-\ln|x|+c \end{align*}

For ( x > 0 ):

\begin{align*} f(x)&=\frac{x^2}{2}-\ln x+c\\ f(1)&=\frac{1^2}{2}-\ln 1+c=\frac{1}{2} \quad \Rightarrow \quad c=0\\ f(x)&=\frac{x^2}{2}-\ln |x| \end{align*}

For ( x < 0 )

\begin{align*} f(x)&=\frac{x^2}{2}-\ln (-x)+c\\ f(-1)&=\frac{(-1)^2}{2}-\ln [-(-1)]+c=0 \quad \Rightarrow \quad c=-\frac{1}{2}\\ f(x)&=\frac{x^2}{2}-\ln |x|-\frac{1}{2} \end{align*}

Is my solution correct? Should I really find two different answers, one for $x > 0$ and another for $x < 0$?

Thank you.

• yes your solution is fine. As the domain has two connected components there can indeed be different constants of integration on each of them. – H. H. Rugh Sep 25 '16 at 17:03
• It looks fine to me. +1 – DonAntonio Sep 25 '16 at 17:03
• Related: math.stackexchange.com/questions/234624/… (see the accepted answer) – Winther Sep 26 '16 at 1:18

Looks fine! However a little typo when calculate $f(-1)=0$ not $-1$


# Vandermonde determinant by induction

For $$n$$ variables $$x_1,\ldots,x_n$$, the determinant $$\det\left((x_i^{j-1})_{i,j=1}^n\right) = \left|\begin{matrix} 1&x_1&x_1^2&\cdots & x_1^{n-1}\\ 1&x_2&x_2^2&\cdots & x_2^{n-1} \\ \vdots&\vdots&\vdots&\ddots&\vdots\\ 1&x_{n-1}&x_{n-1}^2&\cdots&x_{n-1}^{n-1}\\ 1 &x_n&x_n^2&\cdots&x_n^{n-1} \end{matrix}\right|$$ can be computed by induction; the image below says it shows that. I have done this before, if I submit this will I get marks?

MORE IMPORTANTLY how do I do it by induction? The "hint" is to get the first row to $$(1,0,0,...,0)$$.

I think there are the grounds of induction in there, but I'm not sure how (I'm not very confident with induction when the structure isn't shown for $$n=k$$, assume for $$n=r$$, show if $$n=r$$ then $$n=r+1$$ is true.

By the way the question is to show the determinant at the start equals the product $$\prod_{1\leq i (but again, explicitly by induction)

• There's a nice non-inductive proof. Would that work for you? – Bruno Joyal Oct 14 '13 at 2:38
• Actually, my memory tricked me. There is an induction. I'm posting it below. – Bruno Joyal Oct 14 '13 at 2:52
• ProofWiki has two proofs using mathematical induction. – user1551 Oct 14 '13 at 6:42

You're facing the matrix

\begin{pmatrix} 1&1&\cdots & 1 &1\\a_1&a_2&\cdots &a_n&a_{n+1}\\\vdots&\vdots&\ddots&\vdots&\vdots\\a_1^{n-1}&a_2^{n-1}&\cdots&a_n^{n-1}& a_{n+1}^{n-1}\\a_1^{n}&a_2^{n}&\cdots&a_n^{n}&a_{n+1}^{n}\end{pmatrix}

By subtracting $a_1$ times the $i$-th row to the $i+1$-th row, you get

\begin{pmatrix} 1&1&\cdots & 1 &1\\ 0&a_2-a_1&\cdots &a_n-a_1&a_{n+1}-a_1\\ \vdots&\vdots&\ddots&\vdots&\vdots\\ 0&a_2^{n}-a_1a_{2}^{n-1}&\cdots&a_n^n-a_1a_{n}^{n-1}& a_{n+1}^{n}-a_1a_{n+1}^{n-1}\end{pmatrix}

Expanding by the first column and factoring $a_i-a_1$ from the $i$-th column for $i=2,\ldots,n+1$, you get the determinant is

$$=\prod_{j=2}^{n+1}(a_j-a_1) \det\begin{pmatrix} 1& 1&\cdots&1\\a_2&a_3&\cdots&a_{n+1}\\ \vdots&\vdots&\ddots&\vdots\\a_2^{n-1}&a_3^{n-1}&\cdots&a_{n+1}^{n-1}\end{pmatrix}$$

You may apply your inductive hypothesis, to get this is $$=\prod_{j=2}^{n+1}(a_j-a_1) \prod_{2\leqslant i<j\leqslant n+1}(a_j-a_i)=\prod_{1\leqslant i<j\leqslant n+1}(a_j-a_i)$$ and the inductive step is complete.

• Can you please explain how it is possible to factor out $a_i - a_1$? – john.abraham Sep 2 '15 at 10:05
• $a_j^{i} - a_1 a_j^{i-1} = a_j^{i-1}(a_j - a_1)$ – D_S Oct 1 '15 at 4:59
• Even though it is clearly stated, gratuitous change of notation with respect to the question (transposing the matrix and renaming the $x_i$ to $a_i$) is not really helpful, especially in the presence of another answer that does keep the original notation (but uses $a_i$ for a different purpose). – Marc van Leeuwen Dec 3 '18 at 10:17

Let $f(T) = T^{n-1} + a_1 T^{n-2} + \dots + a_{n-1}$ be the polynomial $(T-x_2)(T-x_3)\dots (T-x_n)$. By adding to the rightmost column an appropriate linear combination of the other columns (namely the combination with coefficients $a_1, \dots, a_{n-1}$), we can make sure that the last column is replaced by the vector $(f(x_1), 0, 0, \dots, 0)$, since by construction $f(x_2) = \dots = f(x_n) =0$. Of course this doesn't change the determinant. The determinant is therefore equal to $f(x_1)$ times $D$, where $D$ is the determinant of the $(n-1) \times (n-1)$ matrix which is obtained from the original one by deleting the first row and the last column. Then, we apply the induction hypothesis, using the fact that $f(x_1) = (x_1 - x_2)(x_1-x_3) \dots (x_1-x_n)$. And we are done!

By the way, this matrix is known as a Vandermonde matrix.

I learned this trick many years ago in Marcus' Number fields.

• Sexy! I should read this book if it has more fancy tricks like that. – Patrick Da Silva Dec 24 '13 at 15:06
• You get the wrong product (it should have factors $x_j-x_i$ when $i<j$, rather than factors $x_i-x_j$, or else you should throw in a sign $(-1)^{\binom n2}$ for the Vandermonde determinant). The explanation is that you produce a factor $f(x_1)$ that is not on the main diagonal, and this means in the induction step you get a sign $(-1)^{n-1}$ in the development of the determinant. This sign could have been avoided by producing a nonzero coefficient in the last entry of the final column instead, using a monic polynomial of degree $n-1$ with roots at $x_1,\ldots,x_{n-1}$ but not at $x_n$. – Marc van Leeuwen Dec 3 '18 at 10:10

Although this does not really answer the question (in particular, I cannot tell whether you whether submitting the image will give you any marks), it does explain the evaluation of the determinant (and one can get an inductive proof from it if one really insists, though it would be rather similar to the answer by Bruno Joyal).

The most natural setting in which the Vandermonde matrix $$V_n$$ arises is the followig. Evaluating a polynomial over$$~K$$ in each of the points $$x_1,\ldots,x_n$$ of $$K$$ gives rise to a linear map $$K[X]\to K^n$$ i.e., the map $$f:P\mapsto (P[x_1],P[x_2],\ldots,P[x_n])$$ (here $$P[a]$$ denotes the result of substituting $$X:=a$$ into$$~P$$). Then $$V_n$$ is the matrix of the restriction of $$f$$ to the subspace $$\def\Kxn{K[X]_{ of polynomials of degree less than$$~n$$, relative to the basis $$[1,X,X^2,\ldots,X^{n-1}]$$ of that subspace. Any family $$[P_0,P_1,\ldots,P_{n-1}]$$ of polynomials in which $$P_i$$ is monic of degree$$~i$$ for $$i=0,1,\ldots,n-1$$ is also a basis of$$~\Kxn$$, and moreover the change of basis matrix$$~U$$ from the basis $$[1,X,X^2,\ldots,X^{n-1}]$$ to $$[P_0,P_1,\ldots,P_{n-1}]$$ will be upper triangular with diagonal entries all$$~1$$, by the definition of being monic of degree$$~i$$. So $$\det(U)=1$$, which means that the determinant of$$~V_n$$ is the same as that of the matrix$$~M$$ expressing our linear map on the basis $$[P_0,P_1,\ldots,P_{n-1}]$$ (which matrix equals $$V_n\cdot U$$).

By choosing the new basis $$[P_0,P_1,\ldots,P_{n-1}]$$ carefully, one can arrange that the basis-changed matrix is lower triangular. Concretely column$$~j$$ of$$~M$$, which describes $$f(P_{j-1})$$ (since we number columns from$$~1$$), has as entries $$(P_{j-1}[x_1],P_{j-1}[x_2],\ldots,P_{j-1}[x_n])$$, so lower-triangularity means that $$x_i$$ is a root of $$P_{j-1}$$ whenever $$i. This can be achieved by taking for $$P_k$$ the product $$(X-x_1)\ldots(X-x_k)$$, which is monic of degree $$k$$. Now the diagonal entry in column$$~j$$ of$$~M$$ is $$P_{j-1}[x_j]=(x_j-x_1)\ldots(x_j-x_{j-1})$$, and $$\det(V_n)$$ is the product of these expressions for $$j=1,\ldots,n$$, which is $$\prod_{j=1}^n\prod_{i=1}^{j-1}(x_j-x_i)=\prod_{1\leq i.


# Sum of log squared terms?

1. Aug 10, 2012

### yogo

Hi all,

I have a summation series which goes like this,

S = [log(1)]^2 + [log(2)]^2 + [log(3)]^2 + ....... + [log(n)]^2

Since each term is square of the logarithm of a value, I think there are no general tricks which can be used to solve this.

But is there any way to approximate the value of this summation?

The problem I am facing here is that n is very very large and it is not possible (time-wise and memory-wise) for my program to evaluate every term. So I was hoping for some approximate solution in terms of 'n'.

Thanks,
yogo

2. Aug 10, 2012

### micromass

Well, we know that since $f(x)=(log(x))^2$ is increasing (if x>1)

$$\int_2^{n+1} \log(x-1)^2dx \leq \sum_{n=1}^n \log(n)^2 \leq \int_1^{n+1} \log(x)^2 dx$$

So, if you calculate the integral, then you got a sweet upper and lower bound for the sum.

3. Aug 11, 2012

### coolul007

can't this be a manipulated into a product of n? log(2)+log(3) = log((2)(3)), I'm uncertain what to do with the squared.

4. Aug 11, 2012

### micromass

Not really. But the integral

$$\int \log(x)^2dx$$

has a nice elementary solution. Just integrate by parts twice.

5. Aug 11, 2012

### Mute

In a similar vein, there is also the Euler-Maclaurin formula for asymptotic expansions of sums.

$$\sum_{k=a}^{k=n} f(k) \sim \int_a^n dx~f(x) + \frac{f(a)+f(n)}{2} + \mbox{corrections}.$$

(The full form of the expansion is given on the wikipedia page I linked to). This looks like it would be useful in this case.

6. Aug 11, 2012

### yogo

Thanks for your help guys. Appreciate it.

@micromass: I am not so good at Math. I was wondering how tight these bounds are?

Thanks,
yogo

7. Aug 15, 2012

### chingel

You would have to calculate the integral to find out. Or you can let an online calculator do it. To find the tightness of the bonds, calculate the difference between the integrals, or in other words the integral from n to n+1.

http://www.wolframalpha.com/widgets/view.jsp?id=8ab70731b1553f17c11a3bbc87e0b605

Using Wolfram Alpha the integral from 10 to 11 for example is ~5.5, so if you take the average of them you get a maximal error of ~2.75, actual error would probably be much less, since the function doesn't jump too much, and is rather straight for intervals of width 1. Lower bound is ~25, and using Wolfram Alpha to calculate the sum directly gives ~27.65. If you want more accuracy, you could calculate a few terms of the sum directly, and then get the upper and lower bounds for the rest, for the upper bound it is the sum from 1 to m-1 plus the integral from m to n+1, and for the lower bound the sum from 1 to m-1 plus the integral from m-1 to n. The difference of the upper and lower bounds now turns out to be the integral from n to n+1 minus the integral from m-1 to m, which is better than just the integral from n to n+1.

So for example if you want the sum of the first 1000 terms and you know the first 100 terms exactly, you could do something like this. Sum of first 100 terms is 1408.33. Lower bound is 1408.33+34501.8=35910.13, higher bound is 1408.33+34528.3=35936.63, average is 35923.38. Letting Wolfram Alpha calculate the sum itself, it gets the answer 35923.4, I don't know how it calculates the sum itself and how much it rounded that answer, but at least it shows that taking the average of the bounds is not too bad. So now you have an approximation of the sum of the first 1000 terms, you can now use that to calculate the sum of the first 10000 terms etc.

8. Aug 16, 2012

### chingel

I also tried the Euler-Maclaurin formula. Adding only first two terms from the sum with the Bernoulli numbers in it, it got the sum of the first 1000 terms of log(x)^2 accurate to within 0.0015, so it seems a lot better than just taking the average of integral bounds, especially if you would include more of the correction terms. You could probably get very accurate with more correction terms.

9. Aug 16, 2012

### yogo

@chingel, @mute: Thanks for all the help. I am using Euler-Maclaurin formula now, seems to work really well for me. I actually have an upcoming deadline, and now I am good! :)

Thanks all.


# Minimizing a symmetric sum of fractions without calculus

Calculus tools render the minimization of $$\frac{(1-p)^2}{p} + \frac{p^2}{1-p}$$ on the interval $(0,1/2]$ to be a trivial task. But given how much symmetry there is in this expression, I was curious if one could use olympiad-style manipulations (AM-GM, Cauchy Schwarz, et al) to minimize this, show it is decreasing, or to show that it is bounded below by 1.

• The squares alone tell me to use Cauchy-Schwarz, but I can't see how exactly without screwing it up. – Sean Roberson May 23 '18 at 6:11
• I applied AM-GM directly on the expression to bound it below by $2 \sqrt{p(1-p)}$, but that is a pretty bad bound for $p$ smaller than $1/2$. – user369210 May 23 '18 at 6:13
• There is no minimum of the function on (0, 1/2). There is a minimum on (0, 1/2] which occurs at the boundary 1/2. What am I missing? – Andreas May 23 '18 at 6:21
• Infimum, fine, same thing – user369210 May 23 '18 at 6:27

This is elementary:

$$\frac{(1-p)^2}p+\frac{p^2}{1-p}=\frac{1-3p+3p^2-p^3+p^3}{p(1-p)}=\frac1{p(1-p)}-3.$$

The minimum is achieved by the vertex of the parabola $p(1-p)$, i.e. $p=\dfrac12\to\dfrac1{\frac14}-3$, as can be shown by completing the square.

By Rearrangement inequality assuming wlog $p\ge(1-p)$

$$\frac{(1-p)^2}{p} + \frac{p^2}{1-p}=(1-p)\frac{1-p}{p} + p\frac{p}{1-p}\ge (1-p)\frac{p}{1-p} + p\frac{1-p}{p}=p+1-p=1$$

with equality for

$$p=1-p \implies p=\frac12$$

• The problem statement actually implies that $p \leq 1 - p.$ But of course this method still works, just swap $p$ and $1 - p.$ – David K May 24 '18 at 1:23

** I modified this to give a proof with elementary methods only, no inequality theorems needed**

Simple transformations lead to $$\frac{(1-p)^2}{p} + \frac{p^2}{1-p} = - 3 + \frac{4}{1 - 4 (p-1/2)^2}$$ Now it is easy to see that the global minimum of $f(p)$ for $p \in (0 , \; 1/2]$ occurs at $p = 1/2$.

• You've only shown that it is a local minimum. – Kenny Lau May 23 '18 at 6:30
• The "small $x$" part invokes calculus, which I am trying to avoid – user369210 May 23 '18 at 6:33

$$\begin{array}{rcll} \dfrac{(1-p)^2}{p} + \dfrac{p^2}{1-p} &=& \dfrac {(1-p)^3 + p^3} {p (1-p)} \\ &=& \dfrac {[(1-p) + p] [(1-p)^2 - p(1-p) + p^2]} {p (1-p)} \\ &=& \dfrac {(1-p)^2 + p^2} {p (1-p)} - 1 \\ &\ge& \dfrac {\left[ \frac1{\sqrt2} (1-p) + \frac1{\sqrt2} p \right]^2} {p (1-p)} - 1 &\text{Cauchy-Schwarz} \\ &=& \dfrac 1 {2 p (1-p)} - 1 \\ &=& \dfrac 1 {0.5 - 2 (p-0.5)^2} - 1 \\ &\ge& \dfrac 1 {0.5} - 1 \\ &=& 1 \end{array}$$

Both $\ge$ has equality at $p = 0.5$.

$$\dfrac{(1-p)^2}p+\dfrac{p^2}{1-p}=\dfrac{1-3p+3p^2}{p(1-p)}=K\text{(say)}$$

$$\implies p^2(3+K)-p(3+K)+1=0$$

As $p$ is real, the discriminant must be $\ge0$

$$0\le(K+3)^2-4(K+3)=(K+3)(K-1)\implies$$

either $K\ge$max$(1,-3)$

or $K\le$min$(1,-3)$

But observe that $K+3\ne0$

Make the change: $a=1-p, b=p, p\in \left(0,\frac12\right]$.

Then: $a+b=1, ab\le \frac14,$ the equality occurs when $a=b=\frac12$.

Hence: $$\frac{(1-p)^2}{p} + \frac{p^2}{1-p}=\frac{a^2}{b} + \frac{b^2}{a}=\frac{a^3+b^3}{ab}=\frac{(a+b)((a+b)^3-3ab)}{ab}\ge \frac{1\cdot \left(1^3-\frac34\right)}{\frac14}=1.$$

Let's utilize the symmetry:

$$p\equiv\frac 1 2 -q$$

$$1-p\equiv\frac 1 2 +q$$

Then

$$p \in (0,1/2] \iff q \in [0,1/2)$$

$$\frac{(1-p)^2}{p} + \frac{p^2}{1-p} \equiv \frac{(\frac 1 2 +q)^2}{\frac 1 2 -q} + \frac{(\frac 1 2 -q)^2}{\frac 1 2 +q} \equiv \dots$$

(here be magic, try it)

$$\dots \equiv \frac{\frac 1 4 + 3q^2}{\frac 1 4 -q^2} \equiv - 3 + \frac{4}{1 - 4q^2}$$

Note this is the result already obtained in another answer, however manipulations with $p$ (there) are not as elegant as manipulations with $q$ (here).

It's now easy to tell $q=0$ maximizes the denominator which is always positive (in the domain), so the last fraction is minimized.

$$q=0 \iff p=\frac 1 2$$


# How is the relation “the smallest element is the same” reflexive?

Let $$\mathcal{X}$$ be the set of all nonempty subsets of the set $$\{1,2,3,...,10\}$$. Define the relation $$\mathcal{R}$$ on $$\mathcal{X}$$ by: $$\forall A, B \in \mathcal{X}, A \mathcal{R} B$$ iff the smallest element of $$A$$ is equal to the smallest element of $$B$$. For example, $$\{1,2,3\} \mathcal{R} \{1,3,5,8\}$$ because the smallest element of $$\{1,2,3\}$$ is $$1$$ which is also the smallest element of $$\{1,3,5,8\}$$.

Prove that $$\mathcal{R}$$ is an equivalence relation on $$\mathcal{X}$$.

From my understanding, the definition of reflexive is:

$$\mathcal{R} \text{ is reflexive iff } \forall x \in \mathcal{X}, x \mathcal{R} x$$

However, for this problem, you can have the relation with these two sets:

$$\{1\}$$ and $$\{1,2\}$$

Then wouldn't this not be reflexive since $$2$$ is not in the first set, but is in the second set?

I'm having trouble seeing how this is reflexive. Getting confused by the definition here.

• Reflexive means that every element is related to itself. Thus, for reflexivity you have to consider one set only. Ok, we have that $\{ 1 \} \mathcal R \{ 1,2 \}$ but we have also $\{ 1 \} \mathcal R \{ 1 \}$ and $\{ 1,2 \} \mathcal R \{ 1,2 \}$ – Mauro ALLEGRANZA Apr 7 at 17:34
• Note: “reflexive” does not mean that if $x$ is related to $y$, then $x=y$. It means that if $x=y$, then $x$ is related to $y$. – Arturo Magidin Apr 7 at 17:44
• So it must be reflexive because both $A$ and $B$ belong to the same set $\mathcal{X}$? – qbuffer Apr 7 at 18:00
• @qbuffer Have a look at the updated version of my answer. – Haris Gusic Apr 7 at 18:49

Why are you testing reflexivity by looking at two different elements of $$\mathcal{X}$$? The definition of reflexivity says that a relation is reflexive iff each element of $$\mathcal X$$ is in relation with itself.
To check whether $$\mathcal R$$ is reflexive, just take one element of $$\mathcal X$$, let's call it $$x$$. Then check whether $$x$$ is in relation with $$x$$. Because $$x=x$$, the smallest element of $$x$$ is equal to the smallest element of $$x$$. Thus, by definition of $$\mathcal R$$, $$x$$ is in relation with $$x$$. Now, prove that this is true for all $$x \in \mathcal X$$. Of course, this is true because $$\min(x) = \min(x)$$ is always true, which is intuitive. In other words, $$x \mathcal{R} x$$ for all $$x \in \mathcal X$$, which is exactly what you needed to prove that $$\mathcal R$$ is reflexive.
You must understand that the definition of reflexivity says nothing about whether different elements (say $$x,y$$, $$x\neq y$$) can be in the relation $$\mathcal R$$. The fact that $$\{1\}\mathcal R \{1,2\}$$ does not contradict the fact that $$\{1,2\}\mathcal R \{1,2\}$$ as well.
A binary relation $$R$$ over a set $$\mathcal{X}$$ is reflexive if every element of $$\mathcal{X}$$ is related to itself. The more formal definition has already been given by you, i.e. $$\mathcal{R} \text{ is reflexive iff } \forall x \in \mathcal{X}, x \mathcal{R} x$$