text:
Indian math olympiad questions are famous (infamous?) for being very analytical. There mostly do not exist any clever one line proofs. Multiple cases have to be analyzed and exhaustively eliminated before arriving upon the correct answer.

I tried solving problems from the Indian National Mathematics Olympiad, 2013 today. My solutions are different (lengthier, and hence perhaps instructive) from the official solutions given online. Hopefully they can be of help to anyone interested in mathematical problem solving.

The Indian National Mathematics Olympiad (INMO) is offered to those candidates who have cleared the Regional Mathematics Olympiad (RMO). The questions that are given are of a difficulty level comparable with P1, P4 of the International Math Olympiad.

I do plan on running a seminar on competitive math problem solving this summer. This is useful for all sorts of things, like getting better at algorithms, improving analytical skills in finance, etc. Please do let me know if you’d be interested in that sort of thing.

• Find all positive integers $m,n$ and primes $p\geq 5$, such that $m(4m^2+m+12)=3(p^n-1)$

First, we make a couple of observations. As $p^n-1$ is a multiple of $2$, $m$ will also have to be a multiple of $2$. This can be re-written as $4m^3+m^2+12m+3=3p^n$. On factorizing the left hand side, we get $(4m+1)(m^2+3)=3p^n$. Hence, as the right hand side is a multiple of $3$, either $4m+1$ is a multiple of $3$, or $m$ is a multiple of $3$.

If $4m+1$ is a multiple of $3$ and $m$ is not, then it has to be a multiple of $9$, as $m\equiv 2\pmod 3$ is the only possibility. This is impossible as $p\geq 5$. Hence, $3|m$. Note that from our previous observation, we also know that $2|m$. Hence, combining the two, we get $6|m$.

Let $m=6m'$. Then we have $(24m'+1)(12m'^2+1)=p^n$ (we obtain this after canceling out $3$ on both sides). For $m'\geq 2$, we have $24m'+1\leq 12m'^2+1$. Hence, as the right hand side is $p^n$, we have $24m'+1|12m'^2+1$. This implies that $24m'+1|12m'^2+1-(24m'+1)=12m'(m'-2)$. The right hand side is a multiple of $12m'$ while the left hand side is not. Hence, this is only possible if $m'-2=0$, or $m'=2$. As $m=6m'$, we get $m=12$.

From this, we can deduce that $(24m'+1)(12m'^2+1)=49^2$, and hence $p=7$ and $n=4$. $(12,7)$ is the only solution. QED

• Let $a,b,c,d$ be positive integers such that $a\geq b\geq c\geq d$. Prove that $x^4-ax^3-bx^2-cx-d$ has no integer solutions.

Let $x$ be a solution. Clearly $x=0$ cannot be a solution, as then we would have $d=0$, which is impossible as $d$ is a positive integer. Hence, let us assume that $x$ is a non-zero integer. Then we have $x^4-ax^3-bx^2-cx=d$. Therefore, $x|d$. Let $d'=\frac{d}{x}$. Then we have $x^3-ax^2-bx-c=d'$. Continuing like this, we get $x=a+b'+c''+d'''$, where $d'''=\frac{d}{x^3}$, $c''=\frac{c}{x^2}$, and $b'=\frac{b}{x^2}$.

In other words, we have $x=a+\frac{b+c'+d''}{a+b'+c''+d'''}$. Clearly, as $a\geq b\geq c\geq d$, we have $\frac{b+c'+d''}{a+b'+c''+d'''}\leq \frac{a+b'+c''}{a+b'+c''+d'''}<1$. Hence, $x$ is not an integer. Hence proved. QED

•  Let $n$ be a positive integer. Call a nonempty subset $S$ of $\{1,2,\dots,n\}$ good if the arithmetic mean of the elements of $S$ is also an integer. Further, let $t_n$ denote the number of good subsets of $\{1,2,\dots,n\}$. Prove that $t_n$ and $n$ are either both odd or even.

Clearly, this is equivalent to proving that $t_n-n$ is always even. Note that subsets consisting of one element have an arithmetic mean that is an integer. Hence, we can prove that the number of good subsets of $\{1,2,\dots,n\}$ containing at least two elements will be even. The way that we’ll prove this assertion is by forming a pairing between sets: if $\{a_1,\dots,a_k\}$ is one such subset, then consider the set $\{n+1-a_1,\dots,n+1-a_k\}$. Clearly this set will also have an integer average, and the map $i\to n+1-a$ is idempotent. Hence, the mapping is bijective.

Case 1: Let $n$ be even. The only cases in which bijective pairing maps a set to itself is for every $i$ in the set, $n+1-i$ is also included in it. As there is no $i\in\{1,2,\dots,n\}$ such that $i=n+1-i$, as $n+1$ is odd, a set for which bijective pairing fails will have to contain an even number of elements. Hence, $t_{2k+1}$ is even for all $k\geq 1$. For sets of the form $t_{2k}$, if $i$ and $n+1-i$ are both included, then the average will be $\frac{k(n+1)}{2k}$, which is clearly not an integer as $n+1$ is odd. Hence, every good set can be bijectively paired with a different good set, which implies that the total number of good sets is even.

Case 2: Let $n$ be odd. Let us study the good sets for which the map $i\to n+1-i$ does not produce a different set. The only different is that when $i=\frac{n+1}{2}$, $i=n+1-i$. Hence, sets of both odd and even number of elements can map to themselves through this pairing. However, if we can prove that $t_{odd}$ and $t_{even}$ are both odd, then their sum will be even. Combining this with the fact that the number of sets which map to other sets is anyway even, we get a total number of even sets.

Let us consider $t_{2k+1}$. Any set of this form will have to contain the element $\frac{n+1}{2}$. The total number of such sets is hence ${n-1\choose 1}+{n-1\choose 2}+\dots+{n-1\choose n-1}=2^{n-1}-1$, which is odd.

Let us now consider $t_{2k}$. Then the element $\frac{n+1}{2}$ cannot be contained in such a set. Hence, the total number of elements is ${n-1\choose 1}+\dots+{n-1\choose n-1}=2^{n-1}-1$, which is odd.

Adding both cases together, we get an even number of sets that map to themselves through this mapping.

Hence, the total number of sets is even, which proves our assertion. QED

•  Let $a,b,c,x,y,z$ be positive real numbers such that $a+b+c=x+y+z$ and $abc=xyz$. If $a, $x, and $a\leq x, then prove that $x=a,y=b$ and $z=c$.

This is one of my favorite problems. Without loss of generality, let $x-a\geq c-z$. Then keeping $a+b+c$ constant, bring $c\to z$ and $a\to a+(c-z)=a'$. This keeps $b$ unchanged, and hence $a'z\geq ac$ (as $(a+x)(c-x)\geq ac$), which implies $a'bz\geq abc$. Now keeping $z$ constant, bring $a'\to x$ and $b\to y$. This again implies that $xy\geq a'b$, which implies that $xyz\geq a'bz\geq abc$. Hence, $xyz\geq abc$ if any of these changes happens. Hence, as $abc=xyz$, none of these changes should happen, and $a=x,b=y$ and $c=z$. QED

### A beautiful generalization of the Nesbitt Inequality

I want to discuss a beautiful inequality, that is a generalization of the famous Nesbitt inequality:

(Romanian TST) For positive $a,b,x,y,$, prove that $\frac{x}{ay+bz}+\frac{y}{az+bx}+\frac{z}{ax+by}\geq \frac{3}{a+b}$

Clearly, if $a=b$, then we get Nesbitt’s inequality, which states that

$\frac{x}{y+z}+\frac{y}{z+x}+\frac{z}{x+y}\geq \frac{3}{2}$.

This is question 14 on Mildorf’s “Olympiad Inequalities”, and its solution comprises finding a factor to multiply this expression with, almost out of thin air, and then use Cauchy Schwarz and AM-GM inequalities to prove the assertion. My solution is the following:

On interchanging $a$ and $b$, the right hand side remains the same. However, the left hand side becomes

$\frac{x}{az+by}+\frac{y}{ax+bz}+\frac{z}{ay+bx}\geq \frac{3}{a+b}$

On adding these two inequalities, we get

$\frac{x}{ay+bz}+\frac{x}{az+by}+\frac{y}{az+bx}+\frac{y}{ax+bz}+\frac{z}{ax+by}+\frac{z}{ay+bx}\geq \frac{6}{a+b}$

Multiplying both sides by $\frac{1}{2}(a+b)$ and then adding $6$ on both sides, we get

$2(x+y+z)(\frac{1}{x+y}+\frac{1}{y+z}+\frac{1}{z+x})\geq 9$

This is obviously true by Cauchy Schwarz. We will explain below how we got this expression.

Let us see what happens to $\frac{x}{ay+bz}+\frac{x}{az+by}$ in some detail. After multiplying by $\frac{1}{2}(a+b)$ and adding $2$, we get

$\frac{\frac{1}{2}(a+b)x+ay+bz}{ay+bz}+\frac{\frac{1}{2}(a+b)x+az+by}{az+by}\geq 2\frac{(a+b)(x+y+z)}{(a+b)(y+z)}=2\frac{(x+y+z)}{y+z}$.

EDIT: I assumed that this was obviously true. However, it is slightly non-trivial that this is true. For $\frac{a}{b}+\frac{c}{d}\geq 2\frac{a+c}{b+d}$, the condition that should be true is that $(b-d)(bc-ad)\geq 0$. This is true in our case above.

After adding the other terms also, we get

$2(x+y+z)(\frac{1}{x+y}+\frac{1}{y+z}+\frac{1}{z+x})$

As pointed above, this is clearly $\geq 9$ by Cauchy-Schwarz.

Hence proved

Note: For the sticklers saying this isn’t a rigorous proof, a rigorous proof would entail us assuming that

$\frac{x}{ay+bz}+\frac{y}{az+bx}+\frac{z}{ax+by}< \frac{3}{a+b}$, and then deriving a contradiction by proving that

$2(x+y+z)(\frac{1}{x+y}+\frac{1}{y+z}+\frac{1}{z+x})< 9$, which is obviously false

### A small note on re-defining variables to prove inequalities

I just want to record my solution to the following problem, as it is different from the one given online.

For $a,b,c,d$ positive real numbers, prove that $\frac{1}{a}+\frac{1}{b}+\frac{4}{c}+\frac{16}{d}\geq \frac{64}{a+b+c+d}$

This has a fairly straight forward solution using Cauchy-Schwarz inequality, which for some reason I did not think of.

The way that I solved it is that I re-defined the variables: let $a=8a', b=8b', c=16c'$ and $d=32 d'$. Then this is equivalent to proving that $\frac{1}{8}\frac{1}{a'}+\frac{1}{8}\frac{1}{b'}+\frac{1}{4}\frac{1}{c'}+\frac{1}{2}\frac{1}{d'}\geq \frac{1}{\frac{a'}{8}+\frac{b'}{8}+\frac{c'}{4}+\frac{d'}{2}}$

This is easily seen to be a consequence of Jensen’s inequality, as $\frac{1}{x}$ is a convex function for positive $x$.

### Some solutions

I solved two math problems today. The solutions to both were uniquely disappointing.

The first problem was the first problem from IMO 1986:

Let $d$ be a number that is not $2,5$ or $13$. Prove that out of the set $\{2,5,13,d\}$, we can select two different numbers $a,b$ such that $ab-1$ is not a square.

A quick check would show that $2.5-1, 2.13-2$ and $5.13-1$ are all squares. This shows that of the two numbers that we select from $\{2,5,13,d\}$, one of them has to be $d$. We essentially need to prove that for $d\neq 2,5,13$, $2d-1, 5d-1$ and $13d-1$ are not all squares (a maximum of two of them might be. But all three cannot).

I tried figuring out some of the implications of all of them being squares, but couldn’t come up with anything concrete, as I didn’t write anything at all, and just tried to devise a strategy mentally. Ultimately, I came up with possibly the most mundane proof of all time.

Proof: Consider squares $\mod 16$ (I couldn’t come up with any contradiction up until $\mod 8$). The possible residues for squares $\mod 16$ are $0,1,4,9$. Now my strategy was to plug in all possible residues $\mod 16$ in place of $d$, and checking that in every such instance, at least one of $2d-1, 5d-1$ and $16d-1$ gave a residue that was not $0,1,4,9\mod 16$. This I could successfully verify. Hence proved.

The solution that I could find in the IMO compendium was much smarter, but involved some algebra that would obviously involve putting pen to paper.

The second question that I solved today was proving the Koszul formula, which states that

$2g(\nabla_X Y,Z)=D_Xg(Y,Z)+D_Yg(X,Z)-D_Zg(X,Y)-g([Y,X],Z)-g([X,Z],Y)+g([Z,Y],X)$

I’d seen proofs before in textbooks, that would involve writing down expansions, and then combining all of them in some clever way. The way that I came up with was pretty algorithmic, and perhaps even more elementary. It is simply the following: Take $g(\nabla_X Y,Z)$. Use the torsion free condition to write it as $g(\nabla_Y X,Z)+g([X,Y],Z)$. Now use the formula for connection acting on a tensor to write $g(\nabla_Y X,Z)$ as $D_Y g(X,Z)-g(X,\nabla_Y Z)$. Performing the two operations, we have $D_Yg(X,Z)-g(X,\nabla_Y Z)+g([X,Y],Z)$. Performing this operation of first using the torsion free condition and then the formula for a connection on a tensor three times, we get the Koszul formula.

I’ve been obsessed with Math Olympiads and other kinds of competitive math for a loong time now. Although I should be doing more serious mathematics now that can actually get me a job, I shall ignore good sense and start my series of posts on Math Olympiad problems!

The first problem that I want to write about is a relatively easy one from IMO (International Math Olympiad) 1974. I think it was a long-listed problem, and didn’t actually make it to the test. It asks to prove the fact that

$\displaystyle 343|2^{147}-1$

(that $343$ divides $2^{147}-1$)

The important thing in this problem is to figure out that $343=7^3$ and $147=3.7^2$. Hence, we’re being asked to prove that $7^3|2^{3.7^2}-1$.

We have the following theorem for reference: If $a$ and $b$ are co-prime, then $a^{\phi(b)}\equiv 1\pmod b$, where $\phi(b)$ is the number of natural numbers that are co-prime with $b$. Fermat’s Little Theorem is a special case of this.

Now on to the calculations and number crunching. We have fleshed out the main idea that we’ll use to attack the problem. We can see that $\phi(7^3)=7^3-7^3/7=6.7^2$. Hence, as $2$ is co-prime with $7^3$, $2^{6.7^2}-1\equiv 0\pmod {7^3}$. We can factorize this as $(2^{3.7^2}+1)(2^{3.7^2}-1)\equiv 0\pmod {7^3}$. Now we have to prove that $7^3$ does not have any factors in common with $2^{3.7^2}+1$. As $2^3\equiv 1\pmod 7$, $2^{3.7^2}\equiv 1\pmod 7$ too. Hence, $2^{3.7^2}+1\equiv 2\pmod 7$. This shows that $2^{3.7^2}+1$ does not have any factors in common with $7^3$, and leads us to conclude that $7^3|(2^{3.7^2}-1)$, or $343|2^{147}-1$. Hence proved.

I realize that the formatting is pretty spotty. I shall try and re-edit this in the near future to make it more readable.


text:
# Appllication of Stoke's Theorem in Functional Analysis

Let $\Omega \subset \mathbb{R}^N$ be a bounded domain with Lipschitz boundary. Let $u,v$ be function defined on $H^1(\Omega)$ such that $u=v$ on boundary of $\Omega(\partial \Omega)$. Then can we say this: $$|u-v|_{H^1(\Omega)}=0$$ My idea is like this: $$|u-v|_{H^1(\Omega)}^2=\int_{\Omega}(\triangledown (u-v))^2dx=\int_{\partial \Omega}(u-v)^2ds=0$$ where the 2nd last equality holds from Stoke's Theorem.Any suggestions are welcome.

• why is $|w|_{H^1(\Omega)} = \int_\Omega \nabla w$? So $|-x|_{H^1(0,1)} < 0$? – Calvin Khor Feb 19 '18 at 10:42
• Whats a square of a vector, and how does Stokes apply? – Calvin Khor Feb 19 '18 at 10:47
• Got my mistake! – Abhinav Jha Feb 19 '18 at 10:48
• (2nd comment is about your edit) – Calvin Khor Feb 19 '18 at 10:52

No, Let $u=0$ and $v$ be any smooth nonzero function compactly supported in $\Omega$. $|u-v|_{H^1} ≥ |v|_{L^2} > 0$.

format: plain


text:
## Section5.3Modular Source Files

For a large project, such as a book, you will likely want to split up your source into logical units, such as chapters and sections. The PreTeXt-CLI supports an inclusion mechanism automatically (see Chapter 43 for what you need to do different for xsltproc).

Let us suppose that your book on animals has a chapter on mammals with a section on monkeys. Then you need to do the following:

1. For the file containing the <chapter> tag for the chapter on mammals, place the attribute

xmlns:xi="http://www.w3.org/2001/XInclude"

on the outermost tag in the file.

2. Within the <chapter> element for the chapter on mammals, add the line <xi:include href="monkeys.xml" /> to “pull in” the section on monkeys at that location. The @href attribute can point to a file in a subdirectory, but will be interpreted relative to the location of the file containing the mammal chapter element.

• The XML specification requires that a source file only contain a single outermost element. So for example, two <chapter> elements cannot go into the same file as simultaneous outermost elements.
• Any file that uses an <xi:include> element will need the xml:ns declaration on the outermost element. So in our animal book example, the “master” file, which presumably includes several chapter files, would need this declaration on the <pretext> element.
• In practice, there is not a lot to be gained by creating a subdirectory structure mirroring your modularization—all your source files can go into one big directory and the XML hierarchy will take care of the organization. I do sometimes like to name my files accordingly, so for example chapter-mammals.xml and section-monkeys.xml.
• When you validate your source (see Section 5.4 and Chapter 6) you will always point to the main source file (the one with the <pretext> tags).
The book generated by pretext new book has modular source, so is a nice starting point to see how this works. Other examples are the sample book in examples/sample-book amply demonstrates different ways to modularize parts of a project (but in no way should be taken as best practice in this regard). This guide, in doc/author-guide is a simple example of modular source files, and might be a good template to follow for your book. See Section 4.28 for some of the finer points of this topic.


text:
# Completeness of R^m

1. Jul 13, 2012

### mateomy

I'm reading through Pugh's Real Mathematical Analysis and one of the theorems he puts down states that "R^m is complete". I assume the superscript refers to it being metric as that's what he's talking about right before this theorem. Anyway, the proof seems -to me- circular. I was hoping someone could show me why it isn't or perhaps that I'm expecting too much.

It says:

let p be a Cauchy sequence in R^m. express p in component form p={p1,p2,p3,...pmn}. Because p is Cauchy, each component sequence is Cauchy. Completeness of R implies that the component sequences converge, and therefore the vector sequence converges.

I dunno, but for some reason, and I've read it over 20+ times, that seems like circular reasoning.

(Sorry for being to lazy to post in Latex format)

2. Jul 13, 2012

### Muphrid

I think $\mathbb R^m$ refers to an m-dimensional real vector space. If so then he's proving the m-dimensional space to be complete using the fact that the 1-dimensional real line is complete.

3. Jul 13, 2012

### mateomy

Ah, you pointing that out and me re-reading the proof makes it more clear. Thank you.


text:
# HELP with Investigation

1. Oct 31, 2005

### revan

Ive been given the task of investigating what factors will affect the resonant frequency of a piece of string or wire . I believe it may have something to do with standing or stationary ways. At the moment I believe I have two ways of doing this, one by using string, vibration generator and pulley, the other by using wire, magnet and rheostat.

Both I believe involve the equation fo = ½L x (T/µ).

fo = fundamental frequency
L = length of vibrating wire
T = tension
µ = mass per unit length

Could anyone who has any experience with this formula at all, or knows how to put it into use tell me, particularly the length part, is it node to node or arbitrary lengths. Thanks

2. Oct 31, 2005

### µ³

edit - nevermind

Last edited: Oct 31, 2005
3. Oct 31, 2005

### Tide

I think you left out a square root.

4. Oct 31, 2005

### µ³

From what I know about waves and diff eq's:
The equation of a wave is
$$\frac{1}{v^2}\frac{\partial^2 y} {\partial t ^2}=\frac{\partial^2 y}{\partial x^2}$$
for which a particular solution is the standing wave with say, the fundamental frequency:
$$y(x,t) = A(x)\cos(\omega_0 t)= A\sin(kx)\cos(\omega_0 t)$$
Where A(x) is the amplitude function, $\omega_0$ is the natural angular frequency, and k is the wave number.
now since, I'm guessing, that string wave behaves like a harmonic oscilator at any given point along the strong (strictly speaking $y(t,x_0) = A(x_0)cos(\omega_0 t)$) I'm going to venture a guess that it obeys the differential equation:
$$my'' + cy = 0$$
Where c is the restoring force proportionality constant or whatever (F = -cx)
Now, let's impose an external force on it
$$my'' + cy = B(x)cos(\omega t)$$
Well, we already set the complementary solution as
$$y_c(t) = A(x)\cos(\omega_0 t)$$
so then the particular solution becomes
$$y_p(t) = B(x)\cos(\omega t)$$
so that
$$y(t) = \frac{B(x)}{c-m\omega^2} \cos(\omega t) + A(x) \cos(\omega_0 t)$$
(you can do some trig manipulation and combine this into a product of cosines making the graph look like a wave envoloped in a larger wave)
Edit -
but... what happens when $\omega_0 = \omega$ then the particular solution becomes a solution to the associated homogeneous equation.
Again, complementary solution is
$$y_c(t) = A(x)\cos(\omega t)$$
but the particular solution becomes
$$y_p(t) = \frac{B(x)t}{2\omega m} \cos(\omega t)$$
such that
$$y(t) = A(x)\cos(\omega t) + \frac{B(x)t}{2\omega m} \cos(\omega t)$$
$$=(A(x)+ \frac{B(x)t}{2\omega m})\cos(\omega t)$$
Notice that the total amplitude increases as t increases so what you have is a wave oscillating in between the lines y=+-b/2wmt +- a. However, none of this factors dampening into play but if you do, the equations become a little bit more complicated.
Disclaimer: I just applied my knowledge of springs and differential equations to my knowledge of standing waves, it may or may not be right.
Edit 3 - hurrr all that work for nothing, after googlin, the resonant frequency is just another name for natural frequency
in that case:
$$\sin(kL) = 0$$
$$kL = n\pi$$
$$\frac{2\pi L}{\lambda} = n\pi$$
$$\lambda = \frac{2L}{n}$$
$$v=f\lambda=\sqrt{T \over \mu}$$
$$f_n = \frac{n}{2L}\sqrt{T \over \mu}$$

Last edited: Oct 31, 2005
5. Nov 1, 2005

### revan

Thanks, but what does the N stand for in your version, is it just a constant?

(and yes I did miss out a square root, silly me, thanks for taking the time to do all that)

6. Feb 24, 2006

### revan

$$\sqrt{T}$$ ah so thats how it works

Last edited: Feb 24, 2006


text:
# FLUID MECHANICS : Concept regarding Ventury Tube- Bernoulli application

I was recently studying applications of Bernoulli Equation and came across the Ventury tube. This is diagram I have used to analyse the venturimeter. I understand how we obtain the first equation using bernoulli theorem which is

$$P_1 - P_2 =(1/2)ρ(v_2^2 - v_1^2) \tag{1}$$

and also the continuity equation

$$A_1 v_1 = A_2 v_2. \tag{2}$$ However, I am unable to process how to obtain the following third equation

$$P_1 - P_2 = ρgh$$

where $h$ is difference in the heights of the liquid level in the two tubes and $ρ$ is density of fluid.

Lets say the atmospheric pressure at the top of each tube is $P$. Now since the fluid in the two VERTICAL tubes are at rest and not moving, their velocities are 0. Hence, if I proceeded by applying Bernoulli equation.

$$P_1 +ρ(v_1^2)/2 = ρg(h_1) + P \tag{3}$$ and

$$P_2 + ρ(v_2^2)/2 = ρg(h_2) + P \tag{4}$$

Here $P_1$ and $P_2$ are the pressures at the points in the tube and constriction respectively and the points are at the SAME HORIZONTAL LEVEL.

Subtracting (3) and (4) and even using (1) does not yield me

$$P_1 - P_2 = ρgh$$

rather gives me $0 = ρg(h)$ which makes no sense whatsoever.

What am I missing here and how do I obtain the right result ?

• It’s been a while and I haven’t yet received a suitable answer to this question. Can someone tell me if they’re having a problem with the way the question has been posed because I would really appreciate an answer to this question as it would help my understanding of fluids significantly. Please let me know so I can edit to the right demands/interests in hope of obtaining an answer. – Hola Jun 10 '18 at 17:48

Let the atmospheric pressure be P° Therefore P¹=P°+(rho)gh¹ P²=P°+(rho)gh² Subtracting we get the required equation P¹-P²=(rho)gh 🏴🏳🏴

• That is in static condition right? Here the liquid in the horizontal tube is moving. How can you apply that? – Hola Mar 27 '18 at 14:55
• Umm nothing to do with it.The liquid is not moving in the vertical direction.We only need to see that the pressure below the first tube is P¹ which is shown by the height of liquid raised.🏴🏳🏴 – Priyam Shah Mar 28 '18 at 17:33


text:
## Eigenvalues of symmetric matrices II

[Updated 1/3/2011]
Some time ago I conjectured that for a smooth family of ${n\times n}$ symmetric real matrices ${A(x), x\in \Omega}$ (smooth here means all entries being smooth functions), there exists ${n}$ smooth families ${\lambda_1(x), \cdots, \lambda_n(x)}$ of eigenvalues of ${A(x)}$. As Raymond is asking me this question recently, I reconsider it again. Here I give an example that this is actually false. In my example, although locally we can always find ${n}$ (in fact, two) families of smooth eigenvalues, they cannot be continued in the whole domain to form even a single smooth family. (And also, my previous proof about ${n}$ continuous families of eigenvalues is also local in nature, I have corrected my post accordingly. )

The example is actually very simple: we consider a circle-family of matrices defined by

$\displaystyle A(\theta)= \begin{pmatrix} \sin \theta & 1-\cos \theta\\ 1-\cos \theta & -\sin \theta \end{pmatrix}, \theta\in [0, 2\pi).$

It is easy to see that ${A}$ can be regarded as a smooth family of symmetric matrices over the circle, and the characteristic polynomial ${\det (A-\lambda I)}$ is

$\displaystyle \lambda^2-4\sin^2(\frac{\theta}{2}).$

So we actually have two continuous families of eigenvalues: ${\pm 2 \sin(\frac{\theta}{2})}$. Also, as ${\pm 2\sin(\frac{\theta}{2})}$ are distinct if ${\theta\neq 0}$, if there are two families of smooth eigenvalues, they must be ${\pm 2 \sin(\frac{\theta}{2})}$ by continuity. However, it can be easily seen that ${2\sin(\frac{\theta}{2})}$ is not a smooth function (at ${\theta=0}$) when regarded as a function over the circle, thus there are no such families. Actually the graph of the two families look something like the (boundary of the) “Mobius band” over the circle: they cross each other at ${\theta=0}$, and actually, near ${\theta=2\pi^-}$, the family ${2\sin(\frac{\theta}{2})}$ can be extended smoothly beyond ${2\pi}$, but by taking the value ${-2 \sin(\frac{\theta}{2})}$ instead (i.e. the “second” family). Thus, we can still locally find two such smooth families of eigenvalues.

It is easy to see that the above circle family of matrices can be extended to be a family of matrices over a (annular, say) domain in ${\mathbb{R}^2}$, if you want. My new conjecture is: given a smooth (whatever reasonable sense) family of ${n\times n}$ real symmetric matrices ${A}$, we can locally find ${n}$ families of smooth eigenvalues of ${A}$.

***

Some words about the construction of the above matrix.

Although the matrix above looks very simple algebraically, I do not arrive at it very directly. I am not used to think “algebraically”, so I construct the example geometrically as follows.

The picture is simple: construct circle-family of linear maps whose eigenvalues look like the “Mobius band” as described above.

My method is: for some fixed (global) orthonormal frames ${e_1, e_2}$ over the circle, take ${v_1(\theta)=\cos (\frac{\theta}{4})e_1+\sin(\frac{\theta}{4})e_2}$ and ${v_2(\theta)=-\sin(\frac{\theta}{4})e_1+\cos(\frac{\theta}{4})e_2}$ for ${\theta\in[0, 2\pi)}$. Note that ${v_1(\theta)}$ will “become” ${v_2(0)}$ and ${v_2(\theta)}$ will “become” ${-v_1(0)}$ after traveling one loop (i.e. the limit at ${2\pi}$). I then take the map ${A: v_1\mapsto \sin (\frac{\theta}{2})v_1, v_2\mapsto -\sin (\frac{\theta}{2})v_2}$ for ${\theta\in [0, 2\pi)}$. It is easy to see that the two eigenvalues (i.e. ${\pm \sin\frac{\theta}{2}}$) crosses each other at ${\theta=0}$ and also ${A}$ is continuous also at ${\theta=0}$. It is actually not hard to see (geometrically) that ${A}$ is smooth at ${\theta=0}$. With some effort, we calculate the matrix representation of the map with respect to ${\{e_i\}}$ is the above matrix.

***

There is also a related question raised by Raymond.

Question: Suppose ${A(x)}$ is a smooth (in any reasonable sense) family of real symmetric matrices, and suppose that we now have a smooth family of eigenvalue ${\lambda(x)}$, does it follow that we can find a smooth family of eigenvectors ${v(x)}$ w.r.t. ${\lambda(x)}$? (Recall that an eigenvector can’t be zero. )

Answer: No. Similar to the above question, the global existence of such family depends heavily on the topology of the domain (rather than linear algebra).

Take a sphere (${\mathbb{S}^2}$) family of matrices

$\displaystyle A(p)= \begin{pmatrix} p_1 \vec p & p_2 \vec p & p_3 \vec p \end{pmatrix}$

where ${\vec p=(p_1, p_2, p_3)\in \mathbb{S}^2}$ (regarded as a column vector). It is easy to see that ${A}$ is symmetric and geometrically ${A}$ is the projection into the normal direction: i.e. ${A(p)\vec x=\langle x, p\rangle p,}$ noting that ${p}$ can be regarded as the normal vector of the sphere at ${p}$. Thus ${A}$ has ${1}$ as an eigenvalue (with the normal vector ${p}$ as eigenvector) and an eigenvalue ${0}$ with multiplicity ${2}$ (corresponds to the two dimensional tangent space of ${\mathbb{S}^2}$, as they have no normal component). Take ${\lambda(p)\equiv 0}$, finding ${v(p)}$ amounts to finding a global non-vanishing vector field on the sphere. But according to the Poincare-Hopf theorem (or its friendlier child, Hairy ball theorem), which states that the index of any tangent vector field on the sphere must be 2, it follows that any tangent vector field on ${\mathbb{S}^2}$ must have a zero somewhere, therefore no such ${v(p)}$ exists.

[Updated 1/3/2011]
According to Terence Tao (see here), the eigenvalues of a symmetric matrix should be smooth, locally, by Rellich’s theory. However, I don’t have the knowledge of that theory. Anyone familiar with it?


text:
## sketches

sketches for software development

An example of violation of Liskov Substitution Principle (LSP)

If Square inherits from Rectangle, the problem starts when the intention is to change the width. We expect the height of a rectangle remains the same. But that’s not the behavior of a Square.

It is a behavioral violation of LSP.

To fix it:

• Make Rectangle immutable or,
• Break the inheritance chain


text:
# Continuity at a point for function of two variables

If a function of two variables is discontinuous at a particular point, say $(x,y)$, does this mean that the graph of that function has some hole around the point $(x,y,f(x,y))$? Is there any break in the graph at this point in certain direction?

This question arises because I have one function which is discontinuous at $(0,0)$ but all of its partial derivatives and directional derivatives exist at $(0,0)$. While calculating its partial or directional derivatives, we naturally look in a certain plane with that point and specified direction and calculate the slope of the tangent line (as you would with one variable). In my example I have all directional derivatives, which seems to imply that there is no break around $(0,0,f(0,0))$ in any direction. Then why is the function discontinuous at $(0,0)$?

• Directional derivatives are one dimensional, while continuity in this case is two dimensional (as is differentiability). All the one dimensional vertical slices through the graph can be perfectly continuous and differentiable as one dimensional functions, while the two dimensional continuity condition fails because the it requires that the two-dimensional limit at (0,0) equals $f(0,0)$. The concept of a "break" isn't as simple in two dimensions as one, since you approach (0,0) along curves as well the straight lines-- a "break" in a curved path, but not in any straight line path, is possible.
– Ned
Aug 28 '18 at 21:01
• See this example too: math.stackexchange.com/q/827382/67710
– Ned
Aug 28 '18 at 21:26
• What is your function? Aug 28 '18 at 22:48
• Function is almost similar as mentioned by @zhw. Aug 29 '18 at 6:32

Example 1 (one variable): Define $f(x) = \sin (1/x),x\ne 0,$ $f(0) =0.$ Then $f$ is (badly) discontinuous at $0.$ But there is no hole or break in the graph of $f.$ In fact the graph of $f$ is a connected subset of $\mathbb R^2.$

Example 2 (two variables): Define $f(x,x^2) = 1$ for real $x\ne 0.$ Define $f(x,y)=0$ everywhere else. Then all directional derivatives of $f$ at $(0,0)$ exist and are $0.$ But $f$ is discontinuous at $(0,0),$ as $\lim_{x\to 0} f(x,x) =0,$ while $\lim_{x\to 0} f(x,x^2) =1.$

• So hard to imagine that if I take plane almost coinciding curve $y=x^{2}$,still there will be some point close to (0,0)in that direction which will take value 0 (that's why all directional derivatives are zero) and not 1 suddenly.Am I right? Aug 29 '18 at 6:44
• Right, in every direction there will be an interval of positive length centered at $(0,0)$ where $f=0.$
– zhw.
Aug 29 '18 at 14:46

Consider $f(x,y) = \frac{x^2+y^2}{x^2+y^2}$, using Cartesian coordinates. This function is undefined at $(0,0)$ so it cannot be continuous there. However, it is constantly $1$ everywhere else.

Now consider $g(x,y) = \frac{x^2-y^2}{x^2+y^2}$. What's happening at $(0,0)$?

• I don't think it's very helpful to exhibit a function that is discontinuous at a point only because it's not defined there. This is not what the OP meant at all (otherwise $f$ wouldn't have directional derivatives at $0$). Aug 28 '18 at 22:46
• @TonyK : OP asks "Is there any break in the graph at this point in certain direction?", which most clearly does not happen in the first example. Aug 29 '18 at 1:27
• But in first example, clearly we can say function is discontinuous since partial derivatives are not existing at (0,0).What spinning my head is if all directional derivatives exists,and still it is discontinuous,then there should be some break in certain direction? Aug 29 '18 at 6:23
• @omkarGirkar : What do you mean by "certain direction"? What certain direction does a point have? Aug 29 '18 at 12:30


text:
# Weak form of the $abc$-conjecture?

The $abc$-conjecture implies that the equation $a+b=c$ has only finitely many primitive solutions in the multiplicative semigroup generated by any particular finite set of primes.

I would appreciate any information about the status of this a priori weaker statement, and citations to the literature if any exist.

-
Benne de Weger surely knows... –  Luis H Gallardo Jan 14 '11 at 7:14

The fact that the S-unit equation has finitely many solutions is due to Siegel and Mahler. The statement has been generalized quite a bit (for example to the fact that $u_1+\cdots +u_n=1$ has finitely many solutions, which uses some generalization of Schmidt's subspace theorem). You can find a proof and proper references in "Diophantine Geometry: An introduction" by M. Hindri, J.H. Silverman, among other places.
Gjergji, for the equation $u_1+\cdots + u_n=1$ one needs to assume that no subsum is zero (if I recall correctly). Otherwise one has (trivially) infinitely many solutions. –  GH from MO Jan 14 '11 at 14:20


text:
💬 👋 We’re always here. Join our Discord to connect with other students 24/7, any time, night or day.Join Here!

Numerade Educator

# Show that the equation has exactly one real root.$2x + \cos x = 0$

## Let $f(x)=2 x+\cos x .$ Then $f(-\pi)=-2 \pi-1<0$ and $f(0)=1>0 .$ since $f$ is the sum of the polynomial $2 x$ and thetrignometric function $\cos x, f$ is continuous and differentiable for all $x$. By the Intermediate Value Theorem, there is a number$c$ in $(-\pi, 0)$ such that $f(c)=0 .$ Thus, the given equation has at least one real root. If the equation has distinct real roots $a$ and$b$ with $a<b,$ then $f(a)=f(b)=0 .$ since $f$ is continuous on $[a, b]$ and differentiable on $(a, b),$ Rolle's Theorem implies thatthere is a number $r$ in $(a, b)$ such that $f^{\prime}(r)=0 .$ But $f^{\prime}(r)=2-\sin r>0$ since $\sin r \leq 1 .$ This contradiction shows that thegiven equation can't have two distinct real roots, so it has exactly one root

Derivatives

Differentiation

Volume

### Discussion

You must be signed in to discuss.

Lectures

Join Bootcamp

### Video Transcript

Okay. Uh We want to solve this equation. Two X plus co sign X equals zero. So a solution to this equation is a root of the equation. When you have an equation equals zero. The solution is called a route of the equation. Now. Uh We're actually going to look at this graphically but first um I want to show you that uh if we subtracted two X from both sides of the equation we would have co signed X equals two X. No co sign the co sign function alternates between one and negative one. It takes on all the values between one and negative one. But if you remember the graph of a co sign function, it oscillates up and down. It never goes above one and it never goes below negative one. So two X would actually be bounded um between one and negative one. The reason for this is if two X is equal to cosign effects. Actually uh if I subtracted, if I saw it for co sign next, I would have to subtract two X from both sides. So Co sign X equals negative two X. No big difference. Um If I subtracted two X from both sides, I get cosign X equals negative two X. Because co sign X is bounded between one and negative one, -2 X would be bounded between one and negative one. And if we solve for X in this little inequality dividing everything by negative two we would get X itself has to be between one half and negative one half. We're still gonna solve ah this equation graphically but I just wanted to show you um that we really only need to look at the values of X between negative one half and one half. Uh For example, suppose we let X be out of this range. For example, X was three Effects was three negative two times X would be negative two times three, which is negative six. Co sign of X is never going to equal negative six. Co sign does not go above one, does not go below a negative one. It's not going to equal negative six. And that's why X would be restricted to this interval. So now let's use the dez most graphing calculator. And let's look at this function two X plus Co sign effects. Uh in the interval where X is between negative one half and one half. And see if we can find a solution to this equation. Now, a solution to this equation, a root of this equation will be a value of X. Uh Where this function equal zero. If we can find a value of X that makes this function zero dysfunction will be equal to zero when the graph crosses the X axis. Okay, because the function value is the y coordinate. And if you want the function value or the y coordinate to equal zero. We're looking for the X intercept. Let's look at the graph of two X plus cosign X. Two X plus co sign of X. Here is the graph of two X plus co sign X. You can see that it has an X intercept right here at this point. So when x is negative 0.45, the function two X plus co sign of X equals zero. So X equals negative 0.5 is a solution to this equation equaling zero when X is negative 0.45. This equation equals zero. Now you can see remember how I said, we only want to look at excess between one half and negative one half. We don't really have to worry about what the graph does as it moves on to the right or as it moves on to the left between X equals negative one half and positive one half. You can see that this graph across the D X. Axis only once. So there is only one route Or one solution to the equation. So two X plus co sign of X equals zero. When X equals -0.45. When x equals negative 0.45 we have a solution to this equation. Two X plus co sign of X equals zero. Uh this was the only solution. And so this equation has only one solution or one real numbered route and that is when x equals negative 0.45

Temple University

Derivatives

Differentiation

Volume

Lectures

Join Bootcamp


text:
# Double Inequalities

• March 5th 2010, 12:46 AM
anonymous_maths
Double Inequalities
Need help to solve this:

0 < √1-x^2 < 1

< x < 1

How does that work?

Thanks.

• March 5th 2010, 01:27 AM
Prove It
Quote:

Originally Posted by anonymous_maths
Need help to solve this:

0 < √1-x^2 < 1

< x < 1

How does that work?

Thanks.

I take it that this is

$0 \leq \sqrt{1 - x^2} \leq 1$.

Squaring everything maintains the inequality...

$0 \leq 1 - x^2 \leq 1$

$-1 \leq -x^2 \leq 0$

$1 \geq x^2 \geq 0$

$0 \leq x^2 \leq 1$

Now look at each inequality separately.

$x^2 \leq 1$

$|x| \leq 1$

$-1 \leq x \leq 1$.

But since $0\leq x^2$

$0 \leq x$.

Putting it together, that means

$0 \leq x \leq 1$.
• March 5th 2010, 01:32 AM
Haven
Quote:

Originally Posted by Prove It
But since $0\leq x^2$

$0 \leq x$.

That is false. I.e., $x = \frac{-1}{2}$. $x < 0$ yet $x^2 > 0$.

$0 \leq x^2 \leq 1$
All you have to do from here is square root everything
$0 \leq x \leq 1$
• March 5th 2010, 02:01 AM
anonymous_maths
yes, but that's different to the answer supplied of -1< x < 1
• March 5th 2010, 02:18 AM
Prove It
Quote:

Originally Posted by Haven
That is false. I.e., $x = \frac{-1}{2}$. $x < 0$ yet $x^2 > 0$.

$0 \leq x^2 \leq 1$
All you have to do from here is square root everything
$0 \leq x \leq 1$

Correct in finding the mistake in my logic.

However, since all square numbers are nonnegative, that means if

$0 \leq x^2$

Then $-\infty \leq x \leq \infty$.

So NOW putting the inequalities together you find that

$-1 \leq x \leq 1$.
• March 5th 2010, 03:34 AM
HallsofIvy
Quote:

Originally Posted by anonymous_maths
Need help to solve this:

0 < √1-x^2 < 1

< x < 1

How does that work?

Thanks.

The crucial point with double inequalities is that you must have $0\le \sqrt{1- x^2}$ and $\sqrt{1- x^2}\ge 1$.

Personally, I think the simplest way to solve complicated inequalities is to solve the associated equation first.

If [/tex]0= \sqrt{1- x^2}[/tex] then $0= 1- x^2$, $x= \pm 1$.

If $\sqrt{1- x^2}= 1$ then $1- x^2= 1$, x= 0.

The whole point of that is that the three points, -1, 0, and 1 separate intervals where $\sqrt{1- x^2}$ is less than 0, greater than 0, or does not exist. Try one value of x in each of the intervals x< -1, -1< x< 0, 0< x< 1, and x> 1.

For example, if x= -2< -1, then $\sqrt{1- x^2}= \sqrt{-3}$ which is not a real number so does not satisfy the inequality. No value of x less than -1 satisfies the inequality.

If x= -1/2, between -1 and 0, then [tex]\sqrt{1- x^2}= \sqrt{1- 1/4}= \sqrt{3}{2}. which is positive and less than 1. Every value of x between -1 and 0 satisfies the inequality.

If x= 1/2, between 0 and 1, then [tex]\sqrt{1- x^2}= \sqrt{1- 1/4}= \sqrt{3}{2}. which is positive and less than 1. Every value of x between 0 and 1 satisfies the inequality.

Finally, if x= 2, between 0 and 1, then $\sqrt{1- x^2}= \sqrt{-3}$ which is not a real number so does not satisfy the inequality. No value of x larger than 1 satisfies the inequality.

Since the numbers -1, 0, and 1 make the two sides equal, the solution set is $-1\le x\le 1$.
• March 5th 2010, 07:22 AM
Krizalid
$\sqrt{1-x^2}\ge0$ it's true as long as $|x|\le1.$

as for $\sqrt{1-x^2}\le1,$ (1) fix $|x|\le1$ and by squaring we get $x^2\ge0$ which holds for any $x,$ thus the solution set for (1) is again $|x|\le1,$ and the final solution set it's just $|x|\le1.$


text:
## On fuzzifications of discrete dynamical systems.(English)Zbl 1229.93107

Summary: Let $$X$$ denote a locally compact metric space and $$\varphi:X \rightarrow X$$ be a continuous map. In the 1970s, Zadeh presented an extension principle helping us to fuzzify the dynamical system $$(X,\varphi)$$, i.e., to obtain a map $$\Phi$$ for the space of fuzzy sets on $$X$$. We extend an idea mentioned in [P. Diamond and A. Pokrovskii, Fuzzy Sets Syst. 61, No. 3, 277–283 (1994; Zbl 0827.58037)] to generalize Zadeh’s original extension principle.
In this paper, we study basic properties of so-called $$g$$-fuzzifications, such as their continuity properties. We also show that, for any $$g$$-fuzzification: (i) a uniformly convergent sequence of uniformly continuous maps on $$X$$ induces a uniformly convergent sequence of fuzzifications on the space of fuzzy sets and (ii) a conjugacy (resp., a semi-conjugacy) between two discrete dynamical systems can be extended to a conjugacy (resp., a semi-conjugacy) between fuzzified dynamical systems.
Throughout this paper we consider different topological structures in the space of fuzzy sets, namely, the sendograph, the endograph and levelwise topologies.

### MSC:

 93C42 Fuzzy control/observation systems 93C25 Control/observation systems in abstract spaces

Zbl 0827.58037
Full Text:


text:
# Stephen Hawking wins special physics prize

Special Fundamental Physics Prizes have been awarded to a team of seven scientists who led the efforts at CERN’s Large Hadron Collider (LHC) and, separately, to Stephen Hawking for his discovery that black holes radiate.

These two awards highlight how strong a role British physicists play on the world stage. From the three British-based physicists leading efforts at LHC – Lyn Evans, Michel Della Negra and Tejinder Singh Virdee – to Stephen Hawking, we should rightly cherish our nation’s strength in physics.

Professor Sir Peter Knight, President of the Institute of Physics.

Black holes are not black!
In 1975 Hawking published a paper with a rather surprising result: if one takes into account quantum theory black holes are not quite black. Rather, a black hole glows slightly due to “Hawking radiation”, which consists largely of photons and to a lesser extent other particles.

The corresponding temperature is

$$T \approx \frac{1.227 \times 10^{23} }{M}$$ Kelvin, and here the mass is in KG.

Because of this, the temperature would only be significant for very light black holes. For example, a 30 solar mass black hole has a temperature of about $$2\times 10^{{-}9}$$ Kelvin and the corresponding luminosity is about $$10^{{-}31}$$ Watts. Bigger black holes would hardly radiate at all. This would be completely swamped by other sources of radiation including the CMBR.

Evaporation of a micro black hole
Black holes get the energy for the Hawking radiation from their rest mass. So, assuming nothing is falling into the black hole, a radiating black hole will be loosing mass. For astrophysical black holes this loss will be miniscule. The evaporation time for a black hole of 30 solar masses is about $$10^{60}$$ times the age of the Universe!

For much much smaller black holes Hawking radiation could lead to compete evaporation. For example, a black hole with the mass of about a mountain could evaporate in a time scale that is less than the age of the Universe.

However, no-one is really sure what happens to a black hole near the end of its evaporation.

The black hole information paradox
Classically, there are only three things we can know about a black hole; its mass, its angular momentum and its electric charge. These are the only parameters that describe a classical black hole. I paraphrase this as “black holes do not care what they eat”.

No matter what properties the matter that falls into a black hole has, say baryon number or lepton number, the black hole classically only cares about the mass, angular momentum and electric charge. All the other information is hidden inside the black hole away from the rest of the Universe.

So now suppose our black hole evaporates and disappears. An important property of Hawking radiation is that it is thermal: that is completely random. The information content of a black hole (what it has eaten!) appears to be lost when it dissipates.

What happens to this information is a far from understood question in physics.

Hawking’s work on black hole radiation has posed more questions about nature than it has really answered. That is the true sign of great work.

IOP News


text:
# Project Euler Problem 5: Smallest Multiple

Problem 5 is a lot of fun (well, “fun”) because (1) there’s a very simple program requiring no math that calculates the answer, but (2) that program would need impossible amounts of compute to actually run, and (3) you can figure the answer with pen and paper super fast if you think about the math a bit. That’s what normal people consider fun, right?

Since this problem leans much more on number theory than on programming we’ll use it as an excuse to talk about math more than usual. Our first real step into number theory was Problem 3 ( blog post) with prime factors. Here we’ll talk about least common multiples and prime factorization. This will be useful: as we get deeper into Project Euler we’ll get much deeper into number theory.

As always, spend some time with Problem 5 on your own if you haven’t already.

## Brute Force?

Each Project Euler problem has basically two parts: an example and a problem statement. In this case the example is:

2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.

These examples are crazy useful. They aren’t just there to define the problem: they let us work through the problem with simpler, smaller inputs. Testing and tinkering with small examples can yield insights, concepts, and strategies that help solve the problem with tougher inputs. They’re hints; if you look at them hard enough.

Now, as a programmer your instinct might be to throw piles of compute at this problem. The example number is pretty small (just 2,520). Maybe we can just light up a few nested loops to chew through this?

found = False
n = 1
factors = range(1, 11)
found = True
for x in factors:
if n % x != 0:
found = False
if found:
print(i)
n += 1
print(n)

That program gives 2520 with no appreciable delay. Let’s crank our range up to 20 and try it out!

Yeah so I pulled the plug after taking more than a minute to iterate all the way up to 19034074 without finding the answer. Clearly the number we’re looking for is too big to find with this brute force approach. Looks like we’re going to have to think about the math a bit.

## Break Out the Pen and Paper

If we can’t brute force our way, there must be a more direct solution. This is where Project Euler’s hints are crazy useful.

One way to calculate a number that’s divisible by a set of factors (a “common multiple") is to just multiply the factors all together. In our example case that’s:

$$1 * 2 * 3 * 4 * 5 * 6 * 7 * 8 * 9 * 10$$

That’s cumbersome to write out, so instead I’ll use $!$, which is short hand for the factorial operation.

We see that $10!$ is $3{,}628{,}800$. That’s MUCH bigger than $2{,}520$. Exactly $1{,}440$ times bigger in fact. What’s so special about $1{,}440$? And why can you evenly divide it by 2 and 3 so many times?

Now, you know that every integer is either prime or the product of prime factors. You may not know that’s called the “unique factorization theorem”, or, with more gravitas, the “ fundamental theorem of arithmetic".

Finding the prime factors of a number is called prime factorization and it can take a long time with big numbers. But you can factorize all the numbers you need to solve this problem in your head because they’re all so small.

Tinkering with a calculator and without needing to write any code, we can see that the prime factors of $1{,}440$ are:

$$[2{,\ }2{,\ }2{,\ }2{,\ }2{,\ }3{,\ }3{,\ }5]$$

You could say that each of those is an “extra” factor and that $10!$ has a bunch of extra factors of $2$ and $3$ and $5$ compared to the least common multiple. This is even clearer if we set the prime factorization of the least common multiple (“LCM”) and $10!$ next to each other:

$$LCM = 2{,}520 = 2^3 * 3^2 * 5^1 * 7^1$$ $$10! = 3{,}628{,}800 = 2^8 * 3^4 * 5^2 * 7^1$$

Progress! Is there a way we can figure out (1) which prime numbers are factors of our answer and (2) how many of each prime is “enough”?

### Which Prime Numbers?

Looking at the example we see none of the prime factors are larger than 10. And that every prime number less than 10 is represented at least once.

This makes sense. The next largest prime number, 11, isn’t a factor of any of the numbers 1-10. And every number, including each prime number, less than 10 is a factor.

So we know that our answer has every prime number less than 20 as a factor at least once, and none of the prime numbers larger than 20 as a factor.

### How many of each?

Some of the primes from 2 to 19 have to be represented more than once. We know that because that number (9,699,690) would have been found with our brute force approach if it were correct. We also know that because a number like 4, which has two factors of 2, wouldn’t evenly divide it. And 8, which has three factors of two also wouldn’t evenly divide it.

Turns out that we need “enough” of each prime to make every one of the factors (1 to 20). Looking at the answer to the example, it needs three factors of 2 because it needs to be divisible by 8. And it needs two factors of 3 because it needs to be divisible by 9. But only one factor of the larger primes.

## Coding a solution

At this point it might actually be easier to break out a pen and tally the answer. You could do that by looking at each number from 1 to 20, calculating the prime factors for each number, keeping the largest count of each prime factor, and then multiplying out everything. But instead, let’s write some code to do that!

from math import floor

# A simple function to test whether a number is prime.
def is_prime(n):
for x in range(2, floor(n ** 0.5) + 1):
if n % x == 0:
return False
return True

# The number we'll check up to. Set to 10 to test the code then change to 20.
limit = 100

# A list of primes we know show up at least once.
primes = [x for x in range(2, limit + 1) if is_prime(x)]

# A simple function to calculate the prime factors of a number.
def prime_factors(n):
result = {prime: 0 for prime in primes}
i = 0
for prime in primes:
while n % prime == 0:
result[prime] += 1
n = n / prime
return result

# Initialize factors. We know each prime below limit shows up at least once.
factors = {prime: 1 for prime in primes}

# Look at the prime counts for each number in our range and keep the highest.
for x in range(2, limit + 1):
for prime, count in prime_factors(x).items():
factors[prime] = max(count, factors[prime])

# Calculate and print the result.
result = 1
for prime, count in factors.items():
result *= prime ** count

print(result)

There are ways to further optimize this solution. For example, you could sidestep the need for a prime_factors() function altogether with witty application of some logarithms and the observation that 3 * 3 * 3 is bigger than 20. But that feels a bit silly. Even bumping up our limit to 100 and running this program it calculates the 41-digit answer without noticeable delay.

See an issue on this page? Report a typo, bug, or give general feedback on GitHub.


text:
# Universal covering space of the real projective line?

I´m thinking about universal covering spaces. I´ve seen a lot of examples and authors ever say "the sphere $$S^n$$ is the universal covering space of the $$n$$-dimensional projective space $$\mathbb{R}P^n$$ for $$n \geq 1$$.

So my question is: and what about the real projective line $$\mathbb{R}P^1$$? Has it universal covering space?

Thanks!

$$\mathbb{R}P^1$$ is homeomorphic to $$\mathbb{S}^1$$. To see this, first note that more generaly $$\mathbb{R}P^n\simeq\mathbb{S}^n/_{\pm id}$$ and in the case $$n=1$$ you have $$\mathbb{S}^1/_{\pm id}\simeq \mathbb{S}^1$$ (just factorize the map $$z\mapsto z^2$$).

From here you can conclude.

• Sure! I had the homeomorphism but I missed it! Lol. Thanks! :D – user183002 Apr 20 at 17:19

The real projective line is just a circle, so the universal covering space is the real line.

• I don´t agree. Even it´s not a circumference. It´s a quotient of a circumference, yeah? – user183002 Apr 20 at 17:10
• @user A cheap way to see it is that the unique closed one dimensional manifold is a circle. There's nothing else it can be. – Matt Samuel Apr 20 at 17:15
• Important to note is that it isn’t the universal cover. – Connor Malin Apr 20 at 18:47
• What I mean is that $S^1 \rightarrow \mathbb{R}P^1$ is a covering space, but not a universal one. – Connor Malin Apr 20 at 19:29
• @Connor I agree. Note my answer says the real line is the universal cover. – Matt Samuel Apr 20 at 19:31


text:
# Intervention analysis with multi-dimensional time-series

I would like to do an intervention analysis to quantify the results of a policy decision on the sales of alcohol over time. I am fairly new to time series analysis, however, so I have some beginners questions.

An examination of the literature reveals that other researchers have used ARIMA to model the time-series sales of alcohol, with a dummy variables as regressor to model the effect of the intervention. While this seems like a reasonable approach, my data set is slightly richer than those I have encoutnered in the literature. Firstly, my data set is disaggregated by beverage type (i.e. beer, wine, spirits), and then further disaggregated by geographical zone.

While I could create separate ARIMA analyses for each disagregated group and then compare the results, I suspect there is a better approach here. Could anyone more familiar with multi-dimensional time-series data provide some poitners or suggestions?

The ARIMA model with a dummy variable for an intervention is a special case of a linear model with ARIMA errors.

You can do the same here but with a richer linear model including factors for the beverage type and geographical zones.

In R, the model can be estimated using arima() with the regression variables included via the xreg argument. Unfortunately, you will have to code the factors using dummy variables, but otherwise it is relatively straightforward.

If you wanted to model the sales of drinks types as a vector [sales of wine at t, sales of beer at t, sales of spirits at t], you might want to look at Vector Autoregression (VAR) models. You probably want the VARX variety that have a vector of exogenous variables like region and the policy intervention dummy, alongside the wine, beer and spirits sequences. They are fairly straightforward to fit and you'd get impulse response functions to express the impact of exogenous shocks, which might also be of interest. There's comprehensive discussion in Lütkepohl's book on multivariate time series.

Finally, I'm certainly no economist but it seems to me that you might also think about ratios of these drinks types as well as levels. People probably operate under a booze budget constraint - I know I do - which would couple the levels and (anti-)correlate the errors.

Each time series should be evaluated separately with the ultimate idea of collecting i.e. grouping similar series into groups or sections as having similar/common structure. Since time series data can be intervened with by unknown deterministic structure at unspecified poins in time,one is advised to do Intervention Detection to find where the intervention actually had an effect. If you know a law went into effect at a particular point of (de jure) this may in fact (de facto) not the date when the intervention actually happened. Systems can respond in advance of a known effect date or even after the date due to non-compliance or non-response. Specifying the date of the intervention can lead to Model Specification Bias. I suggest that you google "Intervention Detection" or "Outlier Detection". A good book on this would be by Prof. Wei of Temple University published by Addison-Wessley. I believe the title is "Time Series Analysis". One further comment an Intervention Variable might appear as a Pulse or Level/Step Shift or a Seasonal Pulse or a Local Time Trend.

In response to expanding the discussion about Local Time Trends:

If you have a series that exhibits 1,2,3,4,5,7,9,11,13,15,16,17,18,19... there has been a change in trend at period 5 and at 10. For me a main question in time series is the detection of level shifts e.g. 1,2,3,4,5,8,9,10,..or another example of a level shift 1,1,1,1,2,2,2,2, AND/OR or the detection of time trend breaks. Just as a Pulse is a difference of a Step, a Step is a difference of a Trend. We have extended the theory of Intervention Detection to the 4th dimension i,e, Trend Point Change. In terms of openess, I have been able to implement such Intervention Detection schemes in conjuction with both ARIMA and Transfer Function Models. I am one of the senior time-series statisticians who have collaborated in the development of AUTOBOX which incorporates these features. I am unaware of anyone else who has programmed this exciting innovation. Perhaps someone else can comment on an R package that might do that but I don’t think so.

• Could you elaborate a little more on what a Local Time Trend intervention variable looks like? I am familiar with the other three. – fmark Apr 1 '11 at 0:05
• Also, can you point me towards an R package that might be able to do intervention detection? – fmark Apr 1 '11 at 0:12
• If you have a series that exhibits 1,2,3,4,5,7,9,11,... there has been a change in trend at period 5. The main question in time series is the detection of level shifts e.g. 1,2,3,4,5,8,9,10,..or another example of a level shift 1,1,1,1,2,2,2,2, and or the detection of time trend breaks. – IrishStat Apr 1 '11 at 0:44


text:
## 2.10 The Bloch sphere

Unitary operations on a single qubit form a group. More precisely, the set of all (2\times 2) unitary matrices forms a non-abelian group under the matrix multiplication, denoted by \mathrm{U}(2). It turns out that compositions of single qubit unitaries behave pretty much the same as compositions of rotations in three dimensions. Technically speaking, we claim that \mathrm{U}(2)/\mathrm{U}(1)\cong \mathrm{SO}(3).39 That is, (2\times 2) unitaries, up to global phase, form a group which is isomorphic to the group of rotations in three dimensions, denoted by \mathrm{SO}(3). This isomorphism helps to visualise the actions of single-qubit gates.

There are many ways to introduce this isomorphism. Here we will just show how to represent single-qubit state vectors in terms of Euclidean vectors in three dimensions; in Chapter 3 we will actually relate unitary operations on state vectors to rotations in this Euclidean space, demonstrating this isomorphism.40

Any single qubit state can be written as |\psi\rangle=\alpha|0\rangle+\beta|1\rangle, constrained by the relation |\alpha|^2+|\beta|^2=1. This suggests a more natural parametrisation as |\psi\rangle = \cos\frac{\theta}{2}e^{i\varphi_0}|0\rangle + \sin\frac{\theta}{2}e^{i\varphi_1}|1\rangle (note that there is a good reason to use \theta/2 instead of \theta, and we we will explain why later on). We can then factor out a global phase: |\psi\rangle = e^{i\varphi_0}\left( \cos\frac{\theta}{2}|0\rangle + \sin\frac{\theta}{2}e^{i\varphi}|1\rangle \right), and even remove it completely, since states that are identical up to a global phase are physically indistinguishable.

The parametrisation in terms of \theta and \varphi should remind you of spherical polar coordinates for the surface of a sphere.

We call this sphere the Bloch sphere, and the unit vector \vec{s} defined by \theta and \varphi the Bloch vector.41 This is a very useful way to visualise quantum states of a single qubit and unitary operations that we perform on it. Any unitary action on the state vector will induce a rotation of the corresponding Bloch vector. But what kind of rotation?

We give a complete answer to this question in Chapter 3, but we might as well give some specific results here first, since some are easy enough to calculate “by hand”. Note that any two orthogonal state vectors appear on the Bloch sphere as two Bloch vectors pointing in opposite directions. Now, the two eigenvectors of a single-qubit unitary U must be orthogonal, and thus define an axis running through the centre of the Bloch sphere. This is the axis about which the Bloch vector is rotated when U acts on the corresponding state vector. The rotation angle \alpha is given by the eigenvalues of U, which, up to a global phase factor, are of the form e^{\mp i\alpha/2}.

It is instructive to work out few simple cases and get a feel for the rotations corresponding to the most common unitaries. For example, it is easy to check that a phase gate P_\alpha acts by \cos\frac{\theta}{2}|0\rangle + e^{i\varphi}\sin\frac{\theta}{2}|1\rangle \longmapsto \cos\frac{\theta}{2}|0\rangle + e^{i(\varphi+\alpha)}\sin\frac{\theta}{2}|1\rangle. The azimuthal angle changes from \varphi to \varphi+\alpha, and so the Bloch sphere is rotated anticlockwise by \alpha about the z-axis. The Bloch vectors corresponding to the two eigenvectors of P_\alpha, namely |0\rangle and |1\rangle, define the axis of the rotation.

As previously mentioned, the Pauli operator Z=\sigma_z is a special case of a phase gate, and represents rotation by {180}^{\circ} (that is, \pi radians), about the z-axis. You can also verify that X=\sigma_x, with eigenvectors {(|0\rangle\pm|1\rangle)/\sqrt{2}}, represents rotation by {180}^{\circ} about the x-axis, and Y=\sigma_y, with eigenvectors {(|0\rangle\pm i|1\rangle)/\sqrt{2}}, represents rotation by {180}^{\circ} about the y-axis.

!!!TO-DO!!! points on the intersection of the axes with the Bloch sphere are exactly the eigenstates of the corresponding Pauli operator

How about the Hadamard gate? Like the Pauli operators, it squares to the identity (H^2=\mathbf{1}), which implies that its eigenvalues are \pm 1. Thus it will correspond to a rotation by {180}^{\circ}. But about which axis? This time, rather than finding eigenvectors of H, we notice that HXH=Z and HZH=X, thus H must swap x- and z-axes, turning rotations about the z-axis into rotations about the x-axis, and vice versa. The Hadamard gate must then represent rotation by {180}^{\circ} about the diagonal (x+z)-axis. You may also notice that, after this rotation, the y-axis points in the opposite direction, which seems to be related to another identity: HYH=-Y. This is not a coincidence.

One can show42 that the effect of the rotation represented by unitary U on the Bloch vector with components s_x, s_y, s_z is summarised in the formula U (s_x X + s_y Y + s_z Z) U^\dagger = s'_x X+ s'_y Y + s'_z Z, where s'_x, s'_y, and s'_z are the components of the rotated Bloch vector.

### 2.10.1 Drawing points on the Bloch sphere

We know that the state |0\rangle corresponds to the north pole of the Bloch sphere, and the state |1\rangle to the south, but what about an arbitrary state |\psi\rangle=\alpha|0\rangle+\beta|1\rangle? By definition, we can find the parametrisation in terms of \theta and \varphi, but there is also a neat “trick” for finding the point on the Bloch sphere that corresponds to |\psi\rangle, which goes as follows.

1. Calculate \lambda=\beta/\alpha (assuming that \alpha\neq0, since otherwise |\psi\rangle=|1\rangle).
2. Write \lambda=\lambda_x+i\lambda_y and mark the point p=(\lambda_x,\lambda_y) in the xy-plane (i.e. the plane \{z=0\}).
3. Draw the line going through the south-pole and the point p. This will intersect the Bloch sphere in exactly one other point, and this is exactly the point corresponding to |\psi\rangle.

Note that this lets you draw the point on the sphere, but doesn’t (immediately) give you the coordinates for it. That is, this method is nice for geometric visualisation, but the parametrisation method is much better when it comes to actually doing calculations.

1. Note that \mathrm{U}(1)\cong\mathbb{C}^\times, where \mathbb{C}^\times is the multiplicative group of unit elements of the complex numbers, i.e. the set \mathbb{C}\setminus\{0\} with the group operation given by multiplication.↩

2. That is, we have the group \mathrm{U}(2) acting on the space of single-qubit state vectors, and we have the group \mathrm{SO}(3) acting on the unit sphere S^2\subset\mathbb{R}^3. In this chapter we will discuss how to go from one space (i.e. the thing being acted upon by the group) to the other; in Chapter 3 we will discuss how to go from one group (i.e. the thing acting on the space) to the other.↩

3. We will revisit this construction again in more detail, and from a slightly different point of view, in Chapter 3.↩

4. Again, see Chapter 3.↩


text:
Related Tags

c++
communitycreator

# How to use the ratio_not_equal() function in C++

Harsh Jain

In this shot, we learn how to use the ratio_not_equal() function.

This template alias is used to check the equality between two ratios and give the boolean value as a result. It returns true if the two ratios are not equal, or false if the two ratios are equal.

The ration_not_equal() method does this comparison between the simplest form of the two ratios.

The ratio_not_equal() function is available in the <ratio> header file in C++.

### What is a ratio?

A ratio is a representation of a fraction in which the numerator and denominator are differentiated by the colon (:) symbol.

The numerator and denominator can be of float data type.

Let’s understand with the help of some examples. Suppose we have the following ratios:

• 2 : 3
• 3 : 6

The result of the ratio_not_equal() function on comparison for equality of these two ratios gives the result as true.

Let’s explore how the equality check took place.

• The ratios 2 : 3 and 3 : 6 can be represented as $\frac{2}{3}$ and $\frac{3}{6}$ in fractional form respectively.

• The ratio $\frac{2}{3}$ is itself a simplified form. The ratio $\frac{3}{6}$ on simplification gives $\frac{1}{2}$.

• Now, the simplified fractions $\frac{2}{3}$ and $\frac{1}{2}$  are compared for equality. Since the two fractions are not equal, the final result is true.

### Parameters

The ratio_not_equal() method takes the parameters below:

• Ratio 1: A ratio object which is compared for equality with the other ratio object.
• Ratio 2: Another ratio object which is compared for equality with the previous ratio object.

### Return value

It returns a boolean result after comparison for equality.

If the ratio objects are not equal then it returns true.

If the ratio objects are equal then it returns false.

### Code

Let’s take a look at the code.

#include <iostream>
#include <ratio>
using namespace std;

int main()
{
typedef ratio<2, 3> ratio_one;
typedef ratio<3, 6> ratio_two;

if (ratio_not_equal<ratio_one, ratio_two>::value)
cout<<"The ratio_one and ratio_two are not equal";
else
cout<<"The ratio_one and ratio_two are equal";

return 0;
}

Use ratio_not_equal() function in C++

### Explanation

• In lines 1 and 2, we import the required header files.
• In line 5, we make a main() function.
• In lines 7 and 8, we declare two ratios.
• In line 10, we perform the comparison between the two declared ratios by using the ratio_not_equal() function as a condition inside the if statement. If the two ratio objects are not equal, then the if statement gets executed and displays the message regarding the result.
• In line 12, if the condition doesn’t satisfy (i.e., the two ratio objects are equal) then the statement gets executed and displays the message regarding the result.

In this way, we can use the ratio_not_equal() function to check whether the two ratios are equal.

RELATED TAGS

c++
communitycreator

CONTRIBUTOR

Harsh Jain
RELATED COURSES

View all Courses

Keep Exploring

Learn in-demand tech skills in half the time