## Linear Algebra and Its Applications, Exercise 1.5.19

Exercise 1.5.19. For the following two matrices, specify the values of $a$, $b$, and $c$ for which elimination requires row exchanges, and the values for which the matrices in question are singular.

$A = \begin{bmatrix} 1&2&0 \\ a&8&3 \\ 0&b&5 \end{bmatrix} \quad A = \begin{bmatrix} c&2 \\ 6&4 \end{bmatrix}$

Answer: For the first matrix a row exchange would be necessary if the first step of elimination caused the second entry of the second row, i.e., in the (2,2) position, to become 0. This would occur if we multiplied the first row by 4 and subtracted it from the second row, as we would then have $8 - 4 \cdot 2 = 0$ in the (2,2) position. Since the entry in the (1,1) position is 1, multiplying the first row by 4 would be necessary if $a$ were 4:

$\begin{bmatrix} 1&2&0 \\ 4&8&3 \\ 0&b&5 \end{bmatrix} \rightarrow \begin{bmatrix} 1&2&0 \\ 0&0&3 \\ 0&b&5 \end{bmatrix} \rightarrow \begin{bmatrix} 1&2&0 \\ 0&b&5 \\ 0&0&3 \end{bmatrix}$

If we had both $a = 4$ and $b = 0$ then the matrix would be singular:

$\begin{bmatrix} 1&2&0 \\ 4&8&3 \\ 0&0&5 \end{bmatrix} \rightarrow \begin{bmatrix} 1&2&0 \\ 0&0&3 \\ 0&0&5 \end{bmatrix}$

However, these are not the only values of $a$ and $b$ for which the matrix is singular. Suppose we proceed with elimination. The first step would be to multiply the first row by $l_1 = a$ and subtract the result from the second row:

$\begin{bmatrix} 1&2&0 \\ a&8&3 \\ 0&b&5 \end{bmatrix} \rightarrow \begin{bmatrix} 1&2&0 \\ 0&8-2a&3 \\ 0&b&5 \end{bmatrix}$

Assuming that $a \ne 4$ then the next step of elimination would multiply the second row of the matrix by $l_2 = b/(8-2a)$ and subtract the result from the third row:

$\begin{bmatrix} 1&2&0 \\ 0&8-2a&3 \\ 0&b&5 \end{bmatrix} \rightarrow \begin{bmatrix} 1&2&0 \\ 0&8-2a&3 \\ 0&0&5-3b/(8-2a) \end{bmatrix}$

If the (3,3) entry of the resulting matrix above is zero then the original matrix is singular. In this case we have $3b/(8-2a) = 5$. Multiplying both sides by $(8-2a)$ we have $3b = 5 \cdot (8-2a) = 40 - 10a$ or $10a + 3b = 40$.

So the first matrix is singular for all values of $a$ and $b$ for which $10a+3b=40$. This includes the case $a = 4, b=0$ mentioned above, the case $a=0, b = 40/3$, the case $a=5, b=-10/3$, and an infinity of others on the line $b=-\frac{10}{3}a + \frac{40}{3}$.

For the second matrix a row exchange would be necessary if $c = 0$:

$\begin{bmatrix} 0&2 \\ 6&4 \end{bmatrix} \rightarrow \begin{bmatrix} 6&4 \\ 0&2 \end{bmatrix}$

On the other hand, if c = 3 then the first elimination produces zeroes in both entries of the second row, and the matrix is singular:

$\begin{bmatrix} 3&2 \\ 6&4 \end{bmatrix} \rightarrow \begin{bmatrix} 3&2 \\ 0&0 \end{bmatrix}$

UPDATE: Prompted by Theodore’s comment, added a section deriving the complete set of $a$ and $b$ for which the first matrix is singular.

NOTE: This continues a series of posts containing worked out exercises from the (out of print) book Linear Algebra and Its Applications, Third Edition by Gilbert Strang.

If you find these posts useful I encourage you to also check out the more current Linear Algebra and Its Applications, Fourth Edition, Dr Strang’s introductory textbook Introduction to Linear Algebra, Fourth Edition and the accompanying free online course, and Dr Strang’s other books.

This entry was posted in linear algebra. Bookmark the permalink.

### 2 Responses to Linear Algebra and Its Applications, Exercise 1.5.19

1. Theodore says:

I also found a = 5 and b = -10/3 to also cause a singular matrix. My question is how do we find all values that can cause singularity

• hecker says:

Thank you for finding this problem. You are correct that there are multiple (actually, an infinity) of values of a and b for which the first matrix is singular. I added a new section to derive the correct answer.


Accelerating the pace of engineering and science

# istril

Determine if matrix is lower triangular

## Description

example

tf = istril(A) returns logical 1 (true) if A is a lower triangular matrix; otherwise, it returns logical 0 (false).

## Examples

expand all

### Test Lower Triangular Matrix

Create a 5-by-5 matrix.

`D = tril(magic(5))`
```D =

17     0     0     0     0
23     5     0     0     0
4     6    13     0     0
10    12    19    21     0
11    18    25     2     9```

Test D to see if it is lower triangular.

`istril(D)`
```ans =

1```

The result is logical 1 (true) because all elements above the main diagonal are zero.

### Test Matrix of Zeros

Create a 5-by-5 matrix of zeros.

`Z = zeros(5);`

Test Z to see if it is lower triangular.

`istril(Z)`
```ans =

1```

The result is logical 1 (true) because a lower triangular matrix can have any number of zeros on its main diagonal.

## Input Arguments

expand all

### A — Input arraynumeric array

Input array, specified as a numeric array. istril returns logical 0 (false) if A has more than two dimensions.

Data Types: single | double
Complex Number Support: Yes

expand all

### Lower Triangular Matrix

A matrix is lower triangular if all elements above the main diagonal are zero. Any number of the elements on the main diagonal can also be zero.

For example, the matrix

$A=\left(\begin{array}{cccc}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}1& \text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}0& \text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}0& 0\\ -1& \text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}1& \text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}0& 0\\ -2& -2& \text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}1& 0\\ -3& -3& -3& 1\end{array}\right)$

is lower triangular. A diagonal matrix is both upper and lower triangular.

### Tips

• Use the tril function to produce lower triangular matrices for which istril returns logical 1 (true).

• The functions isdiag, istriu, and istril are special cases of the function isbanded, which can perform all of the same tests with suitably defined upper and lower bandwidths. For example, istril(A) == isbanded(A,size(A,1),0).


# Solve the equation $\cos^2x+\cos^22x+\cos^23x=1$

Solve the equation: $$\cos^2x+\cos^22x+\cos^23x=1$$ IMO 1962/4

My first attempt in solving the problem is to simplify the equation and express all terms in terms of $\cos x$. Even without an extensive knowledge about trigonometric identities, the problem is solvable.

\begin{align} \cos^22x&=(\cos^2x-\sin^2x)^2\\ &=\cos^4x+\sin^4x-2\sin^2\cos^2x\\ &=\cos^4+(1-\cos^2x)^2-2(1-\cos^2)\cos^2x\\ &=\cos^4+1-2\cos^2x+\cos^4x-2\cos^2x+2\cos^4x\\ &=4\cos^4x-4\cos^2x+1 \end{align}

Without knowledge of other trigonometric identities, $\cos3x$ can be derived using only Ptolemy's identities. However for the sake of brevity, let $\cos 3x=4\cos^3x-3\cos x$: \begin{align} \cos^23x&=(4\cos^3x-3\cos x)^2\\ &=16\cos^6x+4\cos^2x-24\cos^4x \end{align}

Therefore, the original equation can be written as: $$\cos^2x+4\cos^4x-4\cos^2x+1+16\cos^6x+4\cos^2x-24\cos^4x-1=0$$ $$-20\cos^4x+6\cos^2x+16\cos^6x=0$$ Letting $y=\cos x$, we now have a polynomial equation: $$-20y^4+6y^2+16y^6=0$$ $$y^2(-20y^2+6y+16y^4)=0\Rightarrow y^2=0 \Rightarrow x=\cos^{-1}0=\bbox[yellow,10px]{90^\circ}$$ From one of the factors above, we let $z=y^2$, and we have the quadratic equation: $$16z^2-20z+6=0\Rightarrow 8z^2-10z+3=0$$ $$(8z-6)(z-\frac12)=0\Rightarrow z=\frac34 \& \ z=\frac12$$ Since $z=y^2$ and $y=\cos x$ we have: $$\biggl( y\rightarrow\pm\frac{\sqrt{3}}{2}, y\rightarrow\pm\frac{\sqrt{2}}2 \biggr)\Rightarrow \biggl(x\rightarrow\cos^{-1}\pm\frac{\sqrt{3}}{2},x\rightarrow\cos^{-1}\pm\frac{\sqrt{2}}2\biggr)$$ And thus the complete set of solution is: $$\bbox[yellow, 5px]{90^\circ, 30^\circ, 150^\circ, 45^\circ, 135^\circ}$$

As I do not have the copy of the answers, I still hope you can verify the accuracy of my solution.

## But more importantly...

Seeing the values of $x$, is there a more intuitive and simpler way of finding $x$ that does away with the lengthy computation?

• This post doesn't have the squares, but it could give some insight as to how one may think about this problem. – Arthur Mar 12 '18 at 13:12
• This link gives you the solutions. – Jose Arnaldo Bebita-Dris Mar 12 '18 at 13:15
• I expect there to be a much more elegant solution to this as it is an IMO problem. Now only someone has to find it... – vrugtehagel Mar 12 '18 at 13:15
• @vrugtehagel I believe the link to the solution is already an elegant answer! – John Glenn Mar 12 '18 at 13:17
• Yup, I think so too! It was shortly posted before my comment, so I hadn't seen it. I advise @JoseArnaldoBebitaDris to summarize that solution and post it as answer, to avoid this question lingering in the unanswered section of this website – vrugtehagel Mar 12 '18 at 13:21

This is a summary of the solution found in this hyperlink.

We can write the LHS as a cubic function of $\cos^2 x$. This means that there are at most three values of $x$ that satisfy the equation.

Hence, we look for three values of $x$ that satisfy the equation and produce three distinct $\cos^2 x$. Indeed, we find that $$\frac{\pi}{2}, \frac{\pi}{4}, \frac{\pi}{6}$$ all satisfy the equation, and produce three different values for $\cos^2 x$, namely $0, \frac{1}{2}, \frac{3}{4}$.

Lastly, we solve the resulting equations $$\cos^2 x = 0$$ $$\cos^2 x = \frac{1}{2}$$ $$\cos^2 x = \frac{3}{4}$$ separately. We conclude that our solutions are: $$x=\frac{(2k+1)\pi}{2}, \frac{(2k+1)\pi}{4}, \frac{(6k+1)\pi}{6}, \frac{(6k+5)\pi}{6}, \forall k \in \mathbb{Z}.$$

You can shorten the argument by noting at the outset that $$\cos3x=4\cos^3x-3\cos x=(4\cos^2x-3)\cos x$$ so if we set $y=\cos^2x$ we get the equation $$y+(2y-1)^2+y(4y-3)^2=1$$ When we do the simplifications, we get $$2y(8y^2-10y+3)=0$$ The roots of the quadratic factor are $3/4$ and $1/2$.

A different strategy is to note that $\cos x=(e^{ix}+e^{-ix})/2$, so the equation can be rewritten $$e^{2ix}+2+e^{-2ix}+e^{4ix}+2+e^{-4ix}+e^{6ix}+2+e^{-6ix}=4$$ Setting $z=e^{2ix}$ we get $$2+z+z^2+z^3+\frac{1}{z}+\frac{1}{z^2}+\frac{1}{z^3}=0$$ or as well $$z^6+z^5+z^4+2z^3+z^2+z+1=0$$ that can be rewritten (noting that $z\ne1$), $$\frac{z^7-1}{z-1}+z^3=0$$ or $z^7+z^4-z^3-1=0$ that can be factored as $$(z^3+1)(z^4-1)=0$$ Hence we get (discarding the spurious root $z=1$) $$2x=\begin{cases} \dfrac{\pi}{3}+2k\pi \\[6px] \pi+2k\pi \\[6px] \dfrac{5\pi}{3}+2k\pi \\[12px] \dfrac{\pi}{2}+2k\pi \\[6px] \pi+2k\pi \\[6px] \dfrac{3\pi}{2}+2k\pi \end{cases} \qquad\text{that is}\qquad x=\begin{cases} \dfrac{\pi}{6}+k\pi \\[6px] \dfrac{\pi}{2}+k\pi \\[6px] \dfrac{5\pi}{6}+k\pi \\[6px] \dfrac{\pi}{4}+k\pi \\[6px] \dfrac{3\pi}{4}+k\pi \end{cases}$$

• Great! An elegant solution too! – John Glenn Mar 12 '18 at 14:42

Hint:

$$0=\cos^2x+\cos^22x+\cos^23x-1$$

$$=\cos(3x+x)\cos(3x-x)+\cos^22x$$

$$=\cos2x(\cos4x+\cos2x)$$


# Calculation of modular multiplicative inverse of A mod B when A > B

I'm trying to understand a Montgomery reduction algorithm, for which I need to calculate a multiplicative inverse. However, euclidean algorithm only helps if A < B.

Example is 11 mod 3. Multiplicative inverse of 11 is 2,but ext_gcd gives you Bezout numbers such as -1 and 4.

https://en.wikipedia.org/wiki/Extended_Euclidean_algorithm

Wikipedia says so: The extended Euclidean algorithm is particularly useful when a and b are coprime, since x is the modular multiplicative inverse of a modulo b, and y is the modular multiplicative inverse of b modulo a.

But as far as I see this can't be true, either X is multiplicative inverse of A modulo B or Y is multiplicative inverse of B modulo A, but not both at the same time, because one of them (A or B) is going to be bigger than another. We have X=4, Y=-1 for A=3,B=11, and X=4 is valid inverse, while -1 is indeed not.

A lot of online calculators that I tried are also said that a has to be bigger than be, but they (some of them) are still able to calculate inverse of 11 mod 3.

The only workaround I found so far is perform A = A mod B first, so A is now a remainder of divisios and therefore is less than modulus, so we can perform ext_gcd(2, 3) now and get our 2 as answer.

Probably I'm missing something, this thing is pretty new for me.

Thanks.

• "We have X=4, Y=-1 for A=3,B=11, and X=4 is valid inverse, while -1 is indeed not. " Huh. $X \equiv A^{-1}\mod B$ because $X*A = 4*3 \equiv 1 \mod 11$. An $Y\equiv B^{-1} \mod A$ because $Y*B=(-1)*11 \equiv 1 \mod 3$. They are both valid inverses. What is your issue? – fleablood Jun 15 at 18:48
• $-1\equiv 2 \mod 3$. So $-1$ is equivalent to $2$. It doesn't make the slightest difference which one you use. (We don't call these things "equivalences" for nothing, you know...) – fleablood Jun 15 at 19:16
• "A lot of online calculators that I tried are also said that a has to be bigger than be," Calculators don't do mathematics. Calculators do calculations. – fleablood Jun 15 at 19:24

It is inevitable that a Bézout's identity equation will give you modular multiplicative inverses, since given:

$$am+bn = 1$$

we can take $\bmod m$ for

$$bn\equiv 1 \bmod m$$

or $\bmod n$ for

$$am \equiv 1 \bmod n$$

To get $a$ and $b$ in your preferred range, you can simply add or subtract a suitable multiple of the modulus.

So in this case $$-1\cdot 11 + 4\cdot 3 = 1$$

and thus $$-1\cdot 11\equiv 1 \bmod 3$$

($-11$ being one more than $-12$), so $-1$ is a valid inverse of $11$ modulo $3$. Then of course $$-1\equiv 2 \bmod 3$$

so this is consistent with your observation that $2$ is the inverse of $11 \bmod 3$ also.

• I now understand why this is correct from algorithmical point of view, but I don't understand why −1 ≡ 2 mod 3. I miss some math-related thing. – Danetta Jun 18 at 9:12
• Presumably you have no problem with $11 \equiv 8\equiv 5 \equiv 2 \bmod 3$. In each case, add one and you arrive at a multiple of $3$. The same applies to $-1$. Also, the difference between $-1$ and $2$ is a multiple of $3$ (as is true for any pair of the equivalent values above). – Joffan Jun 18 at 12:52

$-1 \equiv 2 \mod 3$ so they are considered to be the same thing.

That's we we call these equivalence classes.

However, euclidean algorithm only helps if A < B

I simply do not understand why you say that.

either X is multiplicative inverse of A modulo B or Y is multiplicative inverse of B modulo A, but not both at the same time, because one of them (A or B) is going to be bigger than another. We have X=4, Y=-1 for A=3,B=11, and X=4 is valid inverse, while -1 is indeed not.

Except, of course, it indeed is. $-1*11 = -11 \equiv 1 \mod 3$. That is the valid inverse. Why do you think it is not?

It doesn't matter if $A > B$ or $B> A$ as $\gcd(A,B) = 1$ Euclid's algorithm will give us:

$mA + kB = 1$ so $k \equiv A^{-1} \mod B$ and $m \equiv B^{-1} \mod A$ simultaneously.

Is your concern that one is represented with a positive number and the other negative?

That's irrelevent.

It doesn't matter which representative we use to represent a class. We could have used $50\equiv -1 \mod 3$ so $50 \equiv 11^{-1}\mod 3$ for all we care. (Indeed $50*11 = 550 = 3*183 + 1 \equiv 1\mod 3$).

Note: if $mA + kB = 1$ and $m > 0$ but $-A < k < 0$ then

$mA + (k+A)B = 1 + BA\equiv 1 \mod A,B,AB$ and $m$ and $(k+A)$ are still the proper inverses. ANd $m > 0; k+A > 0$.

Indeed $(m + vB)A + (k + uA)B = 1 + (v+u)AB$ so $m + vB\equiv A^{-1} \mod B$ for any integer $v$ and $k + uA \equiv B^{-1} \mod A$ for any integer $u$.

• "Is your concern that one is represented with a positive number and the other negative?" — Yes, I haven't even considered negative numbers. I'm still not exactly sure how −11 ≡ 1 mod 3. For me logically it looks like quotient of -11/3 is -3, so remainder is either 2 or -2, but how is it 1? – Danetta Jun 18 at 8:56
• It looks like a rule to "just take a remainder from division" stops working there. Do I need positive inverse for Montgomery or it doesn't matter? – Danetta Jun 18 at 9:17
• $-11 = 3*(-4)+ 1$ so $-11 \equiv 1 \mod 3$ and $-11 = 3*(-3) -2$ so $-11 \equiv -2 \mod 3$. And $1 \equiv -2 \mod 3$. As well $-11 = 3*(-7)+12$ so $-11 \equiv 10 \mod 3$. But $-11 \ne 3*k + 2$ for any integer $k$ so $-11 \not\equiv 2 \mod 3$. A remainder means any $p = d*n + r$ and $d$ can be any value positive or a negative and $r$ can be any value that works. But THE remainder would mean $p=d*n+r;0\le r< n$ would mean the remainder is unique, positive and less than the divisor. If $p < 0$ this means $d < 0$ and $r \ge 0$. – fleablood Jun 18 at 15:01
• I dont know how to do the Montgomery method. It seems as though you must already now then inverse to use it and that it is just an computational efficient method to do multiplication. – fleablood Jun 18 at 15:18


# Is the Trace of the Transposed Matrix the Same as the Trace of the Matrix?

## Problem 633

Let $A$ be an $n \times n$ matrix.

Is it true that $\tr ( A^\trans ) = \tr(A)$? If it is true, prove it. If not, give a counterexample.

## Solution.

The answer is true. Recall that the transpose of a matrix is the sum of its diagonal entries. Also, note that the diagonal entries of the transposed matrix are the same as the original matrix.

Putting together these observations yields the equality $\tr ( A^\trans ) = \tr(A)$.

Here is the more formal proof.

For $A = (a_{i j})_{1 \leq i, j \leq n}$, the transpose $A^{\trans}= (b_{i j})_{1 \leq i, j \leq n}$ is defined by $b_{i j} = a_{j i}$.

In particular, notice that $b_{i i} = a_{i i}$ for $1 \leq i \leq n$. And so,
$\tr(A^{\trans}) = \sum_{i=1}^n b_{i i} = \sum_{i=1}^n a_{i i} = \tr(A) .$

### More from my site

#### You may also like...

##### The Vector $S^{-1}\mathbf{v}$ is the Coordinate Vector of $\mathbf{v}$

Suppose that $B=\{\mathbf{v}_1, \mathbf{v}_2\}$ is a basis for $\R^2$. Let $S:=[\mathbf{v}_1, \mathbf{v}_2]$. Note that as the column vectors of $S$...

Close


# Find volume of solid generated (Calc 2)

#### lovex25

##### New member
[solved]Find volume of solid generated (Calc 2)

Find the volume of the solid generated by revolving the region in the first quadrant bounded by the coordinate axes, the curve y=e^x, and the line x = ln 2 about the line x= ln 2.

So I tried graphing it to see visually, and the expression I got for calculating the volume was ∫π(ln2-lny)^2dy, evaluating from 0 to 2 using disk method, and the answer I got was 4π, but apparently that doesn't match the answer in the back of the book. I'd really appreciate if someone can help me out!!

Off topic: First time posting a thread here, may I ask how do you type the mathematical symbols such as the integral sign and whatnot, or do I have to manually copy and paste from other website?

Last edited:

#### MarkFL

Staff member
Hello lovex25,

As you did, a good first step for these problems is to sketch a graph of the region to be revolved, and the axis of rotation:

Using the shell method, the volume of an arbitrary shell is:

$$\displaystyle dV=2\pi rh\,dx$$

where:

$$\displaystyle r=\ln(2)-x$$

$$\displaystyle h=e^x$$

and so we find:

$$\displaystyle dV=2\pi \left(\ln(2)-x \right)e^x\,dx$$

Now, you want to sum up the shells by integrating:

$$\displaystyle V=2\pi\int_0^{\ln(2)}\left(\ln(2)-x \right)e^x\,dx$$

To make things a bit simpler, I would use the substitution:

$$\displaystyle u=e^x\,\therefore\,du=e^x\,dx$$

and we now may state:

$$\displaystyle V=2\pi\int_1^2\ln(2)-\ln(u)\,du$$

Can you proceed?

Now, as far as posting mathematical expressions, this site supports $\LaTeX$, and a good tutorial written by our own Sudharaka can be found here:

http://mathhelpboards.com/latex-tips-tutorials-56/math-help-boards-latex-guide-pdf-1142.html

#### lovex25

##### New member
Hello lovex25,

As you did, a good first step for these problems is to sketch a graph of the region to be revolved, and the axis of rotation:

View attachment 1349

Using the shell method, the volume of an arbitrary shell is:

$$\displaystyle dV=2\pi rh\,dx$$

where:

$$\displaystyle r=\ln(2)-x$$

$$\displaystyle h=e^x$$

and so we find:

$$\displaystyle dV=2\pi \left(\ln(2)-x \right)e^x\,dx$$

Now, you want to sum up the shells by integrating:

$$\displaystyle V=2\pi\int_0^{\ln(2)}\left(\ln(2)-x \right)e^x\,dx$$

To make things a bit simpler, I would use the substitution:

$$\displaystyle u=e^x\,\therefore\,du=e^x\,dx$$

and we now may state:

$$\displaystyle V=2\pi\int_1^2\ln(2)-\ln(u)\,du$$

Can you proceed?

Now, as far as posting mathematical expressions, this site supports $\LaTeX$, and a good tutorial written by our own Sudharaka can be found here:

http://mathhelpboards.com/latex-tips-tutorials-56/math-help-boards-latex-guide-pdf-1142.html
thanks so much!!! finally i was able to match the answer to the back of the book, and I realized what went wrong with my attempt: I didn't separate the integrals to 2 different functions. As for the LaTeX software I'll look in to it soon, thanks again!

#### Prove It

##### Well-known member
MHB Math Helper
I personally prefer the discs method. Here you would need to split up your region of integration into two regions, the first being the rectangle below the point (0,1), and the second being the remaining region above it.

As for the volume of the region below (0,1) generated when rotating, that's easy, it's simply a cylinder of radius \displaystyle \begin{align*} \ln{(2)} \end{align*} units and height 1 unit, so its volume is \displaystyle \begin{align*} \pi \left[ \ln{(2)} \right] ^2 \end{align*}.

As for the volume of the region above (0,1), if we consider horizontal discs, they will each have radius \displaystyle \begin{align*} \ln{(2)} - \ln{(y)} \end{align*} and a height \displaystyle \begin{align*} \Delta y \end{align*}, where \displaystyle \begin{align*} \Delta y \end{align*} is some small change in y. So their total volume can be approximated by

\displaystyle \begin{align*} V &\approx \sum \pi \left[ \ln{(2)} - \ln{(y)} \right] ^2 \Delta y \\ &= \pi \sum \left[ \ln{(2)} - \ln{(y)} \right] ^2 \Delta y \\ &= \pi \sum \left\{ \left[ \ln{(2)} \right] ^2 - 2\ln{(2)}\ln{(y)} + \left[ \ln{(y)} \right] ^2 \right\} \Delta y \end{align*}

And then as we increase the number of discs, making \displaystyle \begin{align*} \Delta y \end{align*} smaller, the sum converges on an integral and the approximation becomes exact, so the total volume is

\displaystyle \begin{align*} V &= \pi \int_1^2{ \left[ \ln{(2)} \right] ^2 - 2\ln{(2)}\ln{(y)} + \left[ \ln{(y)} \right] ^2 \, dy }\end{align*}

which is possible to be integrated


# The tip of a colorful triangle

Original source: Problem 1 of British Informatics Olympiad 2017, Round 1

You're given a bunch of red (R), green (G), and blue (B) balls. I arrange some balls on a line. Then I ask you to complete the triangle of balls under the following simple rules, and tell me the color of the ball at the last row:

• Below two balls of the same color, place a ball of that color. (For example, a G must be placed under two G's.)
• Below two balls of different colors, place a ball of the third color. (For example, a B must be placed under a R and a G.)

If I gave you the balls "R R G B R G B B", you would place the balls like the following, and tell me "it's green":

R R G B R G B B
R B R G B R B
G G B R G G
G R G B G
B B R R
B G R
R B
G

Now, I'll give you a sequence of 60,000 balls. I won't even show you all the balls' colors; the only information available to you is that it starts with 999 balls of the pattern RGB RGB RGB ... RGB, and ends with 999 balls of the pattern BGR BGR BGR ... BGR.

Using the same rules, can you guess the color of the ball on the last row? The answer is unique, and an answer with mathematical explanation is preferred.

This game is a modified Pascal triangle.

First,

let's look at size 4. If you were to permute all the possible inputs and look at the first ball given, last ball given, and the color of the ball on the last row, you can see they are also conforming to the rules given.

We then

try 10. We can look at this like so, since size 4 works:

(R)* * B * * B * *(G)
* * * * * * * * *
* * * * * * * *
G * * B * * R
* * * * * *
* * * * *
R * * G
* * *
* *
(B)

In fact,

this works if the number is $$3^n + 1$$.

Alright,

let's say the colors red, green, and blue are numbers 0, 1, and 2 respectively.

We then visualize a Pascal mod 3 and the game flipped of size 10, with the top portion being one:

Pascal mod 3    |       The game
1          |          1
1 1         |         2 2
1 2 1        |        1 2 1
1 0 0 1       |       2 0 0 2
1 1 0 1 1      |      1 1 0 1 1
1 2 1 1 2 1     |     2 1 2 2 1 2
1 0 0 2 0 0 1    |    1 0 0 2 0 0 1
1 1 0 2 2 0 1 1   |   2 2 0 1 1 0 2 2
1 2 1 2 1 2 1 2 1  |  1 2 1 2 1 2 1 2 1
1 0 0 0 0 0 0 0 0 1 | 2 0 0 0 0 0 0 0 0 2

This result looks similar - as Pascal's formula (mod 3) is

$${{n}\choose{k}} \equiv {{n - 1}\choose{k - 1}} + {{n - 1}\choose{k}} \pmod 3$$ denoting the nth row and kth column. But what about the game?

As $$1 + 0 \equiv 2 \pmod 3$$ and $$2 + 0 \equiv 1 \pmod 3$$ for the game,
while $$1 + 0 \equiv 1 \pmod 3$$ and $$2 + 0 \equiv 2 \pmod 3$$, we want to switch the terms, and that's simple. We negate this equation. The formula for the game is then:
$${{n}\choose{k}} \equiv -\left[{{{n - 1}\choose{k - 1}} + {{n - 1}\choose{k}}}\right] \pmod 3$$
then:
$${{n}\choose{k}} \equiv -{{n - 1}\choose{k - 1}} - {{n - 1}\choose{k}} \pmod 3$$

Alright, now let's show why size 4 works. We assign each column in the first row $$a, b, c, d$$, and we will use the above formula.

a         b        c         d
-a-b       -b-c     -c-d
a+2b+c      b+2c+d
-a-3b-3c-d

We modulo by 3 the expression in the last row and we get $$-a-d \pmod 3$$, and that also conforms to the provided equation above.

Because the question is modified,

and 60,000 is not $$3^n + 1$$, we must find the highest power of 3 plus 1 that's smaller than this, which is 59050 ($$3^{10} + 1$$).

Subtracting 60000 to 59050 gives us 950, the (n+1)th-to-last element (starting from the first ball). We use $$\bmod 3$$ because of the pattern, giving us $$2$$.

Now, starting from the first ball which is R, and looking at the 3rd to last, which is B gives us G.
Looking at the second ball which is G, and looking at the 2nd to last, which is G gives us G.
The third ball is B, and looking at the 1st-to-last, which is R gives us G.
Since the next balls are repeating, it will be always periodic, but notice how it's always a G? That must mean the next colors, and the last row is Green!

• Yes, it is correct! – Bubbler Nov 16 '20 at 6:15


Math Help - Probability

1. Probability

I'm having a lot of trouble with permutations and combinations, so I was hoping someone here could help me out with a few questions. Please make sure that you explain your working; I really want to understand this topic... The first question asks;

A queue has 4 boys and 4 girls standing in line. Find how mant different arrangements are possible if;

a) The boys and girls alternate.

b) 2 particular girls wish to stand together.

c) All the boys stand together.

d) Also find the probability that 3 particular people will be in the queue together if the queue forms randomly.

EDIT: If it's any help, here are the answers...

a) 1152
b) 10080
c) 2880
d) 3/28

EDIT: I've got a new problem now;

A table has 4 boys and 4 girls sitting around it.

a) Find the number of ways of sitting possible if the boys and girls can sit anywhere around the table.

b) If the seating is arranged at random, find the probability that;
i) 2 particular girls will sit together.
ii) All the boys will sit together.

2. Hello, Flay!

We have to "talk" our way through these problems . . .

A queue has 4 boys and 4 girls standing in line.
Find how mant different arrangements are possible if;

a) The boys and girls alternate.
There are 2 possible arrangements: . $BGBGBGBG\,\text{ and }\,GBGBGBGB.$

The four boys can be placed in 4! ways.
The four girls can be placed in 4! ways.

Therefore, there are: . $2 \times 4! \times 4! \;=\;\boxed{1152}$ ways.

b) 2 particular girls wish to stand together.
Suppose the two girls are $X$ and $Y.$

Duct-tape them together.
Note that there are 2 possible orders: . $XY\,\text{ or }\,YX.$

Now we have seven "people" to arrange: . $\boxed{XY}\,,G,G,B,B,B,B$
. . and they can be arranged in ${\color{blue}7!}$ ways.

Therefore, there are: . $2 \times 71\;=\;\boxed{10,080}$ ways.

c) All the boys stand together.
Duct-tape the four boys together.
. . Note that there are 4! possible orders.

Now we have five "people" to arrange.
. . There are $5!$ ways.

Therefore, there are: . $4! \times 5! \:=\:\boxed{2880}$ ways.

d) Find the probability that 3 particular people will be together
if the queue forms randomly.
First of all, there are 8! possible arrangements.

Suppose the three people are $X, Y\text{ and }Z.$
Duct-tape them together: . $\boxed{XYZ}$
. . Note that there are 3! orderings.

Now we have six "people" to arrange,
. . and there are 6! ways.

Hence, there are: . ${\color{red}3!\times6!}$ ways for $X,Y,Z$ to be together.

Therefore, the probability is: . $\frac{3!\cdot6!}{8!} \;=\;\boxed{\frac{3}{28}}$

3. Thanks very much. Now I have another problem;

A school committee is to be made up of 5 teachers, 4 students and 3 parents.

a) If 12 teachers, 25 students and 7 parents apply to be on the committee, which is chosen at random, how many possible committees could be formed?

This part I've figured out. The answer is $350 658 000$.

b) If Jan and her mother both apply, find the probability that both will be chosen for the committee.

This part I'm not sure how to do. The answer is apparently $\frac{3036}{44275}$.

4. I figured out the last question. As it turns out, $\frac{3036}{44275}$ simplifies to $\frac{12}{175}$, which was the answer I was getting.

Now I have a new problem;

A sample of 3 coins is taken at random from a bag containing 8 ten cent coins and 8 twenty cent coins. Find the probability that a particular ten cent coin will be chosen, if 1 twenty cent and 2 ten cent coins are chosen.


# If $\rho_{n+1}\leq\rho_{n} +\sigma_n,\;\;\forall\;\;n\geq N_0,$ then prove that $\lim\rho_n=0.$

Good day, all!

Suppose $\{\rho_n\}$ and $\{\sigma_n\}$ are two sequences of non-negative real numbers such that for some real number $N_0\geq 1,$ the following recursion inequality holds:

$$\rho_{n+1}\leq\rho_{n} +\sigma_n,\;\;\forall\;\;n\geq N_0.$$

Prove that,

1. if $\sum_{n=1}^{\infty}\sigma_n<\infty,$ then $\lim\rho_n$ exists.
2. If $\sum_{n=1}^{\infty}\sigma_n<\infty,$ and $\rho_n$ has a subsequence converging to zero, then $\lim\rho_n=0.$

The first question was asked in my exam but I skipped it. I am stating the truth! Hence, I'll like to get it solved before the final exam. So please, can anyone help me? Thanks in advance.

• if the series of $\rho_n$ converges, then the limit of $\rho_n$ has to be zero, there is nothing to prove in 1 and 2. Please double-check the formulation (perhaps you need $\sigma_n$ instead ?) – Hayk May 20 '18 at 5:40
• @Hayk: Sorry, my mistake! It has been corrected! Matt A Pelto: Thanks for the edit! – Omojola Micheal May 20 '18 at 6:11
• Please give more context. Providing context not only assures that this is not simply copied from a homework assignment, but also allows answers to be better directed at where the problem lies and to be within the proper scope. Please avoid "I have no clue" questions. Defining keywords and trying a simpler, similar problem often helps. – robjohn May 20 '18 at 7:07
• a real pity about people on this forum that go straight to down voting :) ... such a community. – Matt A Pelto May 20 '18 at 7:47
• @ robjohn: This is not an assignment question. We had the third exam yesterday and the first question, .i.e. question 1, was given to us. However, I'll correct some of my words! – Omojola Micheal May 20 '18 at 7:48

Observe that once we prove assertion $1$, then the claim of $2$ follows readily. This is due to the fact, that if $\rho_n$ is convergent, than all its subsequences must be convergent, all with the same limit. Now, if we prove claim N$1$ and assume in addition that a subsequence of $\rho_n$ converges to $0$, then $\rho_n$, having the same limit as its subsequence, must converge to $0$.

We now prove claim $1$. Observe that for any $k\in \mathbb{N}$ and any $n\geq N_0$ we have $$(1) \qquad \rho_{n+k} - \rho_n = \rho_{ n + k } - \rho_{ n + k -1} + \rho_{ n + k - 1 } - \rho_{ n + k -2} +...+\rho_{n+1} - \rho_n \leq \\ \sigma_{n+k-1} +...+\sigma_n,$$ where we apply the given inequality on each term $\rho_{n+k -i} - \rho_{n+k-i-1}$, for $i=0,....,k-1$.

From the above inequality, and the fact that $\rho_n \geq 0$, we have that $\rho_n$ is a bounded sequence. Now assume, for contradiction, that it does not converge. Hence, $\rho_n$, converges to different limits along two different subseqeunces. Namely there exists $n_{k}$ and $m_k$, and non negative numbers $a_1$ and $a_2$ such that $$\rho_{n_k} \to a_1 \qquad \text{ and } \qquad \rho_{m_k} \to a_2,$$ where $a_1 \neq a_2$. From $(1)$, let us fix $n\geq N_0$, and choose $k$ such that $n+k = n_k$. Then, taking limit with respect to $k$ and using the fact that the series $\sigma_n$ converges, we get $$(2) \qquad a_1 - \rho_n \leq \sum_{i = n}^\infty \sigma_i.$$ Now take $n\to \infty$ along the second subsequence $m_k$, we obtain $a_1 - a_2 \leq 0$, since convergence of $\sum_i \sigma_i$ implies that the right hand side of $(2)$ converges to $0$.

Since the process is symmetric (we could have started with $m_k$ and not $n_k$) we obtain also that $a_2 \leq a_1$ and hence they must be equal.

This contradicts our assumption that $a_1 \neq a_2$ and hence the limit of $\rho_n$ exists.

• What is wrong with Hayk's solution? Can anyone please, explain? – Omojola Micheal May 20 '18 at 7:49
• @Mike, let's see if the voter will be able to justify it. BTW, the only place you need non-negativity of $\rho_n$ is to get a lower bound on the sequence, as otherwise without bounding $\rho_n$ from below, it can escape to $-\infty$. So, instead of requiring $\rho_n \geq 0$ the claim stays valid also for the case $\rho_n \geq -M$, for any fixed $M\geq 0$ (the same proof works). – Hayk May 20 '18 at 8:49
• I neutralized it for you! – Omojola Micheal May 20 '18 at 15:56
• Can you please, expand this line $\leq \sigma_{n+k-1} +...+\sigma_{n-1}$? Kindly explain why it is so! – Omojola Micheal May 20 '18 at 16:09
• I was thinking it should be $\leq \sigma_{n+k-1} +...+\sigma_{n-1}+\sigma_{n}$ instead! – Omojola Micheal May 20 '18 at 16:19

Put $T_n=\sum_{k=1}^n \sigma_k$. Then $T_n$ is a convergent sequence. Now put $u_n=T_{n-1}-\rho_n$. From the inequality given, we see that $u_n$ is increasing for $n$ large, and of course (as $\rho_n \geq 0$) $\leq T_{n-1}$, hence bounded, hence convergent. It is easy to finish.

From $\rho_{n+1}-\rho_n\leq \sigma_n$ we obtain $\rho_{n}- \rho_m \leq \sum_{i=m}^{n-1}\sigma _i \Longrightarrow \rho_{n} \leq \rho_m+\sum_{i=m}^{n-1}\sigma _i$.

Taking $\limsup$ in respect of $n$ we obtain $\limsup \rho _n \leq \sum_{i=m}^\infty \sigma _i +\rho _m$.

Taking now $\liminf$, we obtain $$\limsup \rho _n \leq \liminf\rho _m$$ So, $\rho_n\longrightarrow x$ where $x \in [-\infty,\infty]$. Since $\rho _n$ is non-negative and upper bounded by $\rho_0 +\sum_{i=1}^\infty \sigma _i$, we conclude that $x\in \mathbb{R}$.


# Is there a closed form expression for $\int_{- \infty}^\infty \int_{-\infty}^y \frac{1}{2 \pi} e^{-(1/2) ( x^2+y^2 )} \mathrm{d}x\,\mathrm{d}y$?

I have been trying to evaluate the integral:

$$\int_{- \infty}^\infty \int_{-\infty}^y \frac{1}{2 \pi} e^{-(1/2) ( x^2+y^2 )}\mathrm {d}x\,\mathrm{d}y$$

I know of course that the integral equals $1$ over $[-\infty,\infty] \times [-\infty,\infty]$ but I do not quite know how to handle the present case. Are there any tricks here?

Thank you.

• I think you can exploit the simmetry of the integrand by noting that the line $y=x$ divides the plane in half. – Gennaro Marco Devincenzis Sep 6 '14 at 15:22

Your integral is the probability: $$\mathbb{P}[X\leq Y]$$ where $X$ and $Y$ are two independent normal variables $N(0,1)$,

hence the value of the integral is just $\frac{1}{2}$, since: $$\mathbb{P}[X\leq Y]=\mathbb{P}[Y\leq X],\qquad \mathbb{P}[X\leq Y]+\mathbb{P}[Y\leq X]=1.$$

• That makes sense intuitively but could you please explain a little more why that is? There is no closed form then, right? – JohnK Sep 6 '14 at 15:26
• $f(x)=\frac{1}{\sqrt{2\pi}}e^{-x^2/2}$ is the pdf of a $N(0,1)$ random variable, and $\frac{1}{2}$ looks as a very closed form to me. – Jack D'Aurizio Sep 6 '14 at 15:29
• Yes but what allows us to say that the value of that probability is 1/2? – JohnK Sep 6 '14 at 15:31
• Symmetry: $$\mathbb{P}[Y\leq X]=\mathbb{P}[X\leq Y],\quad \mathbb{P}[Y\leq X]+\mathbb{P}[X\leq Y] = 1.$$ – Jack D'Aurizio Sep 6 '14 at 15:32
• Simple yet elegant! Intuitively, it can also be seen by plotting the region $0<x<y<\infty$ since the integrand is even function (i.e. symmetry). +1 – Tunk-Fey Sep 6 '14 at 15:44

Jack D'Aurizio's answer is good, but since you said in comments under it that you wanted a different point of view, let's try this: \begin{align} u & = (\cos45^\circ)x-(\sin45^\circ)y = \tfrac{\sqrt{2}}2 x - \tfrac{\sqrt{2}}2 y \\ v & = (\sin45^\circ)x+(\cos45^\circ)y = \tfrac{\sqrt{2}}2 x + \tfrac{\sqrt{2}}2 y \end{align} This is just a $45^\circ$ rotation of the coordinate system, suggested by the fact that your boundary line $y=x$ is just a $45^\circ$ rotation of one of the coordinate axes.

Then simplify $u^2+v^2$ and find that it comes down to $x^2+y^2$.

Solving the system of two equations above for $x$ and $y$, one gets \begin{align} x & = \phantom{-}\tfrac{\sqrt{2}}2 u + \tfrac{\sqrt{2}}2 v \\ y & = -\tfrac{\sqrt{2}}2 u + \tfrac{\sqrt{2}}2 v \end{align} By trivial algebra, the condition that $x\le y$ now becomes $u\le0$.

If you know about Jacobians, you get $$du\,dv = \left|\frac{\partial(u,v)}{\partial(x,y)}\right|\,dx\,dy = \left|\frac{\partial u}{\partial x}\cdot\frac{\partial v}{\partial y} - \frac{\partial u}{\partial y}\cdot\frac{\partial v}{\partial x}\right|\,dx\,dy = 1\,dx\,dy.$$ Hence your iterated integral becomes $$\int_{-\infty}^\infty\int_{-\infty}^0 \frac 1{2\pi} e^{-(u^2+v^2)/2}\,du\,dv = \int_{-\infty}^\infty \int_{-\infty}^0 \left\{\frac 1{2\pi} e^{-v^2/2}\right\} e^{-u^2/2}\,du\,dv$$ The part in $\{\text{braces}\}$ does not depend on $u$, so this is $$\int_{-\infty}^\infty\left( \frac 1{2\pi} e^{-v^2/2} \int_{-\infty}^0 e^{-u^2/2}\,du \right)\,dv.$$ Now the inside integral does not depend on $v$, so it pulls out: $$\int_{-\infty}^\infty e^{-v^2/2}\,dv \cdot \frac1{2\pi} \int_{-\infty}^0 e^{-u^2/2}\,du$$ and this is of course $$\int_{-\infty}^\infty \frac1{\sqrt{2\pi}} e^{-v^2/2}\,dv \cdot \int_{-\infty}^0 \frac1{\sqrt{2\pi}} e^{-u^2/2}\,du.$$ The first integral comes to $1$ and the second, by a simple symmetry argument, is $1/2$.

• Thank you very much. I'll just have to understand how come that substitution rotates the coordinate system. – JohnK Sep 6 '14 at 16:48
• nice result! you may simplify your answer by showing that $\int_{-\infty}^0 e^{-u^2}\,du=(1/2)\int_{-\infty}^{\infty} e^{-u^2}\,du$ as early in your answer as possible. – mike Sep 6 '14 at 16:52
• Think of what that substitution does to $(x,y)=(1,0)$ and to $(x,y)=(0,1)$ and then you'll be well on your way to understanding why it's a rotation. But even if you didn't know it's a rotation, you should still be able to follow the argument. – Michael Hardy Sep 6 '14 at 16:52
• . . . however, it is also the case that if you know nothing of Jacobians, you can understand that $du\,dv=dx\,dy$ by using the fact that the transformation is a rotation. Rotations multiply volumes by $1$, so the thing to multiply $dx\,dy$ by to get $du\,dv$ is $1$. ${}\qquad{}$ – Michael Hardy Sep 6 '14 at 16:54
• The intuition behind Jacobians is often not made explicit in second-year calculus courses where the concept is introduced. But if the value of the Jacobian $|\partial(u,v)/\partial(x,y)|$ at a particular point is, for example $6$, that means that at that point an infinitesimal area in the $x,y$ plane is transformed to an infinitesimal area $6$ times as big in the $u,v$ plane. Determinants generally area what you multiply by a volume to get the volume it is transformed to. And the determinant is negative if the orientation gets reversed. – Michael Hardy Sep 6 '14 at 17:03

Set $x=r\cos \theta,y=r\sin \theta$, then we have

$$\int_{- \infty}^\infty \int_{-\infty}^y e^{-(1/2) ( x^2+y^2 )}\mathrm {d}x\,\mathrm{d}y=\int_{0}^\infty \left(\int_{-3\pi/4}^{\pi/4} e^{-r^2/2}\mathrm {d}\theta\,\right)r\,\mathrm{d}r=\pi \int_{0}^\infty e^{-r^2/2}r\,\mathrm{d}r=\pi$$

So the original integral is equal to $(1/2)$.

This method as well as @MichaelHardy's method also works for the integrals like:

$$\int_{- \infty}^\infty \int_{-\infty}^{a y} e^{-(1/2) ( x^2+y^2 )}\mathrm {d}x\,\mathrm{d}y, \text{ }a \in \mathbb{R}$$

The results are the same. This is because the function to be integrated ($e^{-r^2/2}$) is rotational invariant (independent of $\theta$) and $x=a y$ is a straight line going through the origin and divides the plane into 2 halfs of equal size.

• Glad to see polar coordinates work too, thank you. – JohnK Sep 6 '14 at 18:27

Ah, I realise just now I'd misread to start with. Algebraically, we can solve it by noting that the value of the integral is the same under the change of variables $u=-x$, and since summing the two resulting integrals results in the $[-\infty,\infty] \times [-\infty,\infty]$ case, the answer is $1/2$.

i.e.:

$$\int_{- \infty}^\infty \int_{-\infty}^y \frac{1}{2 \pi} e^{-1/2 (x^2+y^2)} \,\mathrm{d}x\,\mathrm{d}y = \int_{- \infty}^\infty \int_{-y}^\infty \frac{1}{2 \pi} e^{-1/2 \left( x^2+y^2 \right)}\,\mathrm{d}x\,\mathrm{d}y.$$

$LHS+RHS=\int_{- \infty}^\infty \int_{-\infty}^\infty \frac{1}{2 \pi} e^{-1/2 (x^2+y^2)}\,\mathrm{d}x\,\mathrm{d}y=1$, and $LHS=RHS$, so your integral is $1/2$.

EDIT: I guess I was a little bit short. There are several ways of showing $LHS+RHS$ is what I quote, but here is a simple, uninformative one.

$LHS+RHS=\int_{- \infty}^\infty \int_{-\infty}^\infty \frac{1}{2 \pi} e^{-1/2 (x^2+y^2)}\,\mathrm{d}x\,\mathrm{d}y-\int_{- \infty}^\infty \int_{-y}^y\frac{1}{2 \pi} e^{-1/2 (x^2+y^2)}\,\mathrm{d}x\,\mathrm{d}y$.

Now, Let $I=\int_{- \infty}^\infty \int_{-y}^y\frac{1}{2 \pi} e^{-1/2 (x^2+y^2)}\,\mathrm{d}x\,\mathrm{d}y$. Use substitution $u=-y$. Then

$I=-\int_{\infty}^{-\infty} \int_{u}^{-u}\frac{1}{2 \pi} e^{-1/2 (x^2+u^2)}\,\mathrm{d}x\,\mathrm{d}u=\int_{-\infty}^{\infty} \int_{u}^{-u}\frac{1}{2 \pi} e^{-1/2 (x^2+u^2)}\,\mathrm{d}x\,\mathrm{d}u=-I$, hence as $I=-I$, $I=0$.

I think it could also be done by splitting the integration range up. (e.g. looking at the integrals on $(-\infty,0]$ and $[0,\infty)$)

• If you do not mind how is that LHS+RHS equal that integral? – JohnK Sep 6 '14 at 16:09
• @JohnK there you go :) – ShakesBeer Sep 7 '14 at 7:49


# Math Help - How to prove logical equivalence using Theorems and substitution?

1. ## How to prove logical equivalence using Theorems and substitution?

So, I have the statement

(p ^ q) \/ (p ^ ¬ q) ≡ p

I have to prove the given logical equivalence using Theorems and not constructing a truth table. If anyone has as idea how I prove this I would appreciate an explanation and solution.

cheers
-ipatch

2. Originally Posted by ipatch
So, I have the statement

(p ^ q) \/ (p ^ ¬ q) ≡ p

I have to prove the given logical equivalence using Theorems and not constructing a truth table. If anyone has as idea how I prove this I would appreciate an explanation and solution.

cheers
-ipatch
Just read it as a sentence:

"p and q" or "p and not q".

It's saying you have to have p but you may or may not have q.

So what it's the same as having? p.

3. I have to prove the given logical equivalence using Theorems and not constructing a truth table
The solution depends on what theorems you have in mind. Every course may have a different set of those.

4. Hello, ipatch!

I don't know the names of the theorems you know.
I hope you can follow my proof.

Prove: . $(p \;\wedge\; q) \;\vee\; (p\; \wedge \sim q) \;\;\equiv \;\; p$

. . . . . . . . . $(p \;\wedge\; q) \;\vee\; (p\; \wedge\; \sim q)$

. . $(p \;\vee\; p) \;\wedge\; (p \;\vee\; \sim q) \;\wedge\; (q \;\vee\; p) \;\wedge\; (q \;\vee\; \sim q)$ . . Distributive

. . . . . . $p\;\wedge\;(p\;\vee\;\sim q)\;\wedge\;(p\;\vee\; q) \;\wedge\; T$

. . . . . . . . . $(p\;\vee\;\sim q)\;\wedge\; (p\;\vee q)$

. . . . . . . . . . . $p\;\vee(\sim q\;\wedge\; q)$ . . . . . . . . . . . . Distributive

. . . . . . . . . . . . . $p\;\vee\;F$

. . . . . . . . . . . . . . . $p$

5. Hello ipatch
Originally Posted by ipatch
So, I have the statement

(p ^ q) \/ (p ^ ¬ q) ≡ p

I have to prove the given logical equivalence using Theorems and not constructing a truth table. If anyone has as idea how I prove this I would appreciate an explanation and solution.

cheers
-ipatch
Using the standard Laws of Boolean Algebra (for instance, just here) we get:
$(p \land q)\lor(p\land\neg q) \equiv p\land(q\lor\neg q)$ (Distributive Law)
$\equiv p\land T$ (Complement Law)

$\equiv p$ (Identity Law)

6. (p ^ q) \/ (p ^ ¬ q) ≡ p

1. (p ^ q) \/ (p ^ ¬ q)-----------------hypotesis
2. (p ^ q)-----------------assume
3. p-----------------2, ^-elim 2
4. (p ^ ¬ q)-----------------assume
5. p-----------------4, ^-elim 2
6. p-----------------1, 2-3 , 4-5, \/-elim

7. Hello again, ipatch!

My first proof was long and clumsy.
(Don't know where my brain was at the time.)

There are two theorems we need. .(I don't know their names.)

. . $\begin{array}{cccc}P \;\vee \sim \!P &\equiv& t & \text{Theorem 1} \\ \\[-3mm] P \wedge \:t &\equiv& P & \text{Theorem 2} \end{array}$

. . . . $\begin{array}{ccc}(p \;\wedge\; q) \;\vee\; (p\; \wedge\; \sim q) & \text{Given} \\ \\ p \;\wedge\; (q \;\vee \sim \!q) & \text{Distr.} \\ \\ p \;\wedge \;t & \text{Theorem 1} \\ \\ p & \text{Theorem 2} \end{array}$

8. Originally Posted by cgafa
(p ^ q) \/ (p ^ ¬ q) ≡ p

1. (p ^ q) \/ (p ^ ¬ q)-----------------hypotesis
2. (p ^ q)-----------------assume
3. p-----------------2, ^-elim 2
4. (p ^ ¬ q)-----------------assume
5. p-----------------4, ^-elim 2
6. p-----------------1, 2-3 , 4-5, \/-elim

Rules used:
conjunctive elimination ( ^-elim ) if you have A and B the you have A (or B)... simple
disjuntive elimination (\/-elim)... a little more complex... if you have A or B and from A you can deduce C; and from B you can deduce C; then from A or B we can deduce C.....

9. Originally Posted by ipatch
So, I have the statement

(p ^ q) \/ (p ^ ¬ q) ≡ p

I have to prove the given logical equivalence using Theorems and not constructing a truth table. If anyone has as idea how I prove this I would appreciate an explanation and solution.

cheers
-ipatch
ipatch:
There two kind of proofs,one in Boolean Algebra and one in propositional calculus.

The proof in Boolean Algebra was shown by other people in the forum.

The proof in propositional calculus is as follows:

First we prove : $(p\wedge q)\vee (p\wedge\neg q)\Longrightarrow p$ and then:

$p\Longrightarrow (p\wedge q)\vee (p\wedge\neg q)$.

Proof:

1) $(p\wedge q)\vee (p\wedge\neg q)$.................................................. ............................given

2) $(p\wedge q)$.................................................. ..............................................assu mption to start a conditional proof

3) p................................................. .................................................. .....from (2) and using Conjunction Elimination (=C.E)

4) $(p\wedge q)\Longrightarrow p$.................................................. ....................................from (2) to (3) and using the rule of conditional proof

5) In the same way we prove: $(p\wedge\neg q)\Longrightarrow p$

6) $(p\wedge q)\vee (p\wedge\neg q)\Longrightarrow p\vee p$.................................................. ...........................from (4)and(5) and using the rule called proof by cases: $[((A\Longrightarrow B)\wedge (C\Longrightarrow D))\Longrightarrow ((A\vee C)\Longrightarrow (B\vee D))]$.

7) $p\vee p$.................................................. .......................................from (1) and (6) and using M.Ponens

8) $p\vee p\Longleftrightarrow p$.................................................. .......................................tautology

9) $p\vee p\Longrightarrow p$.................................................. ........................................from (8) and using biconditional elimination

10) p................................................. .................................................. ....from (7) and (9) and using M.Ponens

Now to prove the converse.

Proof:

1)p............................................... .................................................. given

2) $\neg(p\wedge q)$.................................................. ........................................assumption to start a conditional proof

3) $\neg p\vee\neg q$.................................................. ..........................................from (2) and using De Morgan

4) $p\Longrightarrow\neg q$.................................................. .....................from (3) and using material implication

5) $\neg q$.................................................. .....................................from (1) and (4) and using M.Ponens

6) $p\wedge\neg q$.................................................. ...........................from (1) and (5) and using Conjunction Introduction

7) $\neg(p\wedge q)\Longrightarrow(p\wedge\neg q)$.................................................. .......................from (2) to(6) and using the rule of conditional proof

8) $(p\wedge q)\vee (p\wedge\neg q)$.................................................. ........................from (7) and using material implication $(A\Longrightarrow B)\Longleftrightarrow (\neg A\vee B)$


# Vector whose inner product is positive with every vector in given basis of $\mathbb{R}^n$

I am trying to solve the following question which I came across when studying root system in euclidean spaces, with positive definite symmetric bilinear form.

Statement: Given a basis $\{v_1,\cdots, v_n\}$ of $\mathbb{R}^n$, $\exists$ $v\in\mathbb{R}^n$ such that $(v,v_i)>0$ for all $i$

My answer: Let $v=a_1v_1 + \cdots + a_nv_n$. Then $$(v,v_i)=a_1(v_1,v_i) + a_2(v_2,v_i) + \cdots + a_n(v_n,v_i), \hskip5mm i=1,2,\cdots,n.$$ Writing this in matrix form we get $$\begin{bmatrix} (v,v_1) \\ \vdots \\ (v,v_n)\end{bmatrix} = \begin{bmatrix} (v_1,v_1) & \cdots & (v_n,v_1)\\ \vdots & & \vdots \\ (v_1,v_n) & \cdots & (v_n,v_n) \end{bmatrix} \begin{bmatrix} a_1 \\ \vdots \\ a_n\end{bmatrix}.$$ We want to find $a_1,\cdots,a_n$ such that the left column vector contains positive entries only. Let $A$ be the square matrix appearing above; it is matrix of positive definite (symmetric) inner product w.r.t given basis, so it is invertible over $\mathbb{R}$. Take $$\begin{bmatrix} a_1 \\ \vdots \\ a_n\end{bmatrix} := A^{-1}\begin{bmatrix} 1 \\ \vdots \\ 1\end{bmatrix}.$$ This is non-zero vector, and for this choice of $a_i$'s we get the vector $v=a_1v_1+\cdots + a_nv_n$ with desired properties.

Q.1 Is the above statement and proof correct?

Q.2 Is there geometric way to prove the statement?

• How do you know that $A$ is invertible? – 5xum Apr 10 '18 at 12:43
• it is matrix of non-degenerate bilinear form (positive definite inner product should be non-degenerate, isn't it?) – Beginner Apr 10 '18 at 12:44
• That's one way of showing it, sure. – 5xum Apr 10 '18 at 12:45

For a geometric proof, just do something akin to Gram-Schmidt orthogonalisation. Take $v=v_1$, so that $(v,v_1)>0$. Let $u_2=v_2-\frac{(v_1,v_2)}{(v_1,v_1)}v_1$ be the component of $v_2$ that is orthogonal to $v_1$. Then $u_2\ne0$, or else $v_1$ and $v_2$ are linearly dependent. Add $c_2u_2$ to $v$ for a sufficiently large $c_2>0$. Then $(v,v_i)>0$ for $i=1,2$. Continue in this manner, you get a desired $v$.


# Math Help - Problem 5

1. ## Problem FIVE

Problem 5

TRIPOLLO

TRIPOLLO is a strategy game in which numbered marbles are placed in a rectangular array of holes on a board. As shown, there are three rows of holes. A player wins if the marbles are placed so that in each column, the sum of the numbers in the first two rows is three times the number in the third row.

(a) John has a 5-column board and marbles numbered 1 to 15.
So far he has placed them as shown in the diagram.

Show how he could successfully place the remaining marbles.

(b) With the same board and marbles. John made the following start:

Can he successfully complete this game? Give reasons.

(c) You have an 8-column board and marbles numbered 1 to 24. Show how you can win by placing all the marbles on the board.

(d) Show that with an 11-column board and marbles numbered 1 to 33 it is not possible to find a winning placement.

Explain the problem in as much detail as you can.

2. Originally Posted by MrFantasy
Problem 5

TRIPOLLO

TRIPOLLO is a strategy game in which numbered marbles are placed in a rectangular array of holes on a board. As shown, there are three rows of holes. A player wins if the marbles are placed so that in each column, the sum of the numbers in the first two rows is three times the number in the third row.

(a) John has a 5-column board and marbles numbered 1 to 15.
So far he has placed them as shown in the diagram.

Show how he could successfully place the remaining marbles.

(b) With the same board and marbles. John made the following start:

Can he successfully complete this game? Give reasons.

(c) You have an 8-column board and marbles numbered 1 to 24. Show how you can win by placing all the marbles on the board.

(d) Show that with an 11-column board and marbles numbered 1 to 33 it is not possible to find a winning placement.

Explain the problem in as much detail as you can.
Is this a Mathematics Challenge question? If so, it is not approporiate to ask this question until the competition is ended.

3. Hello Mr.Fantastic
No, this is not a question from a maths competition. it's 1 of the 6 questions I picked out from the monthly issued maths challenge. My previous posts will explain the purpose of these 6 questions. It is to provide maths lovers some challenging questions to do. Please refer to my previous post for more information.

http://www.mathhelpforum.com/math-he...intrested.html

MrFantasy

4. Originally Posted by MrFantasy
Hello Mr.Fantastic
No, this is not a question from a maths competition. it's 1 of the 6 questions I picked out from the monthly issued maths challenge. My previous posts will explain the purpose of these 6 questions. It is to provide maths lovers some challenging questions to do. Please refer to my previous post for more information.

http://www.mathhelpforum.com/math-he...intrested.html

MrFantasy
Yes, I've seen that thread. I just find it odd that the same questions are being posted by other members too.

5. It may very well be that this question/problem is quiet wide known and is used in different occasions, whoever posted the same problem as I have posted here, could be another occasion. And please, if you dont mind. We're taking too much space talking in here, it would be difficult for members to read the answer replies. If there is any questions or replies or issues you want to make please contact me through PM. As it is more easier that way.

Thank You,
Mr`Fantasy

6. Originally Posted by mr fantastic
Is this a Mathematics Challenge question? If so, it is not approporiate to ask this question until the competition is ended.
This question is NOT from the Australian Maths Challenge Competition. The member has posted it in good faith. Please feel free to reply.

Apologies for any embarassment caused - I hope you understand that all members need to be vigilant for the sort of cheating that does sometimes occur.


# Plotting contours plot for f(x,y,z)=c

I have the following question: I have a file that has structure:

x1 y1 z1 f1
x2 y2 z2 f2
...
xn yn zn fn

I can easily visualize it with Mathematica using ListContourPlot3D. But could you please tell me how I can plot contour plot for this surface? I mean with these data I have a set of surfaces corresponding to different isovalues (f) and I want to plot intersection between all these surfaces and some certain plane. I tried to Google but didn't get any results. Any help and suggestions are really appreciated. Thanks in advance!

-
Would you please include a sample of your data, or provide a function that generates data that can serve as an example? –  Mr.Wizard Aug 10 '12 at 21:47
Also, do you want a 2D contour plot, or a 3D curve through space? –  Mr.Wizard Aug 10 '12 at 22:00
The answers to this question might be useful to you. –  Ｊ. Ｍ. Aug 11 '12 at 3:53
Thanks for all your replies! Sorry for the delay, I had problems with an internet acces. But the problem is when I'm trying to use suggestions by halirutan I get empty box (and I need exactly this plot). I'd love to provide the sample of my data but it's big, it has 2744 lines and I don't know how to upload this file here (any suggestions?). Thanks! PS Original questions was asked by me. I do not know how to comment other answers (I don't see button add commment) –  Nikita Aug 13 '12 at 20:50
After merging your accounts you should now be able to comment. –  Sjoerd C. de Vries Aug 13 '12 at 22:45
show 1 more comment

Ok, lets give this a try. @Mr.Wizard already showed you, how you can use Interpolate to make a function from your discrete data and since you didn't provide some test-data, I just assume we are speaking of an isosurface of a function $f(x,y,z)=c$ which is defined in some box in $\mathbb{R}^3$.

For testing we use $$f(x,y,z) = x^3+y^2-z^2\;\;\mathrm{and}\;\; -2\leq x,y,z \leq 2$$ which accidently happens to be the first example of ContourPlot3D.

The idea behind the following is pretty easy: As you may know from school, there is a simple representation of a plane in 3d which uses a point vector $p_0$ and two direction vectors $v_1$ and $v_2$. Every point on this plane can be reached through the $(s,t)$ parametrization

$$p(s,t)=p_0+s\cdot v_1+t\cdot v_2$$

Please note that $p_0, p, v_1, v_2$ are vectors in 3d and $s,t$ are scalars. The other form which we will use only for illustration is called the normal form of a plane. It is give by

$$n\cdot (p-p_0)=0$$

where $n$ is the vector normal to the plane, which can easily be calculated with the cross-product by $v_1\times v_2$. Lets start by looking at our example. To draw the plane inside ContourPlot3D we use the normal form which is plane2:

f[{x_, y_, z_}] := x^3 + y^2 - z^2;
v1 = {1, 1, 0};
v2 = {0, 0, 1};
p0 = {0, 0, 0};
plane1 = p0 + s*v1 + t*v2;
plane2 = Cross[v1, v2].({x, y, z} - p0);
gr3d = ContourPlot3D[{f[{x, y, z}], plane2}, {x, -2, 2}, {y, -2, 2}, {z, -2, 2},
Contours -> {0},
ContourStyle -> {ColorData[22, 3], Directive[Opacity[0.5], ColorData[22, 4]]}]

What we do now is, that we try to find the contour value (which is 0 here) of $f(x,y,z)$ for all points, that lie on our plane. This is like doing a normal ContourPlot because our plane is 2d (although placed in 3d space). Therefore, we use the 2d to 3d mapping of plane1

gr2d = ContourPlot[f[plane1], {s, -2, 2}, {t, -2, 2}, Contours -> {0},
ContourShading -> None, ContourStyle -> {ColorData[22, 1], Thick}]

Look at the intersection. It is exactly the loop we would have expected from the 3d illustration. Now you could object something like "ew.. but I really like a curve in 3d..". Again, the mapping from this 2d curve to 3d is given in the plane equation. You can simply extract the Line[..] directives from the above plot and transfer it back to 3d:

Show[{gr3d,
Graphics3D[{Red, Cases[Normal[gr2d], Line[__], Infinity] /.
Line[pts_] :> Tube[p0 + #1*v1 + #2*v2 & @@@ pts, .05]}]
}]

I extract the Lines with Cases and then use the exact same definition of plane1 as pure function to transform the pts.

When I'm not completely wasted at 5:41 in the morning, than this approach should work for your interpolated data too.

## Apply method on test-data

I uploaded your test-data to our Git-repository and therefore, the code below should work without downloading anything. The approach is the same as above but some small things have changed, since we work on interpolated data now. I'll explain only the differences.

First we import the data and since we have a long list of {x,y,z,f} values, we transform them to {{x,y,z},f} as required by the Interpolation function. I'm not using the interpolation-function directly. I wrap a kind of protection around it which tests whether a given {x,y,z} is numeric and lies inside the interpolation box. Otherwise I just return 0.

data = {Most[#], Last[#]} & /@
Import["https://raw.github.com/stackmma/Attachments/master/data_9304_187.m"];
ip = Interpolation[data];
fip[{x_?NumericQ, y_?NumericQ, z_?NumericQ}] :=
If[Apply[And, #2[[1]] < #1 < #2[[2]] & @@@
Transpose[{{x, y, z}, First[ip]}]],
ip[x, y, z], 0.0]

The code below is almost the same. I only adapted the plane that it goes through your interpolation box. Furthermore, if you inspect your data you see that the value run from 0 to 1.2. Therefore I'm plotting the 0.5 contour by subtracting 0.5 from the function value and using Contours -> {0}. Remember that when I would simply plot the 0.5 contour, it would draw me a different plane, since we use one combined ContourPlot3D call.

Furthermore, notice that I normalized the direction vectors of the plane. This makes it easier to adjust the 2d plot of the contour. The rest should be the same.

v1 = Normalize[{30, 30, 0}];
v2 = Normalize[{0, 0, 21}];
p0 = {26, 26, 17};
plane1 = p0 + s*v1 + t*v2;
plane2 = Cross[v1, v2].({x, y, z} - p0);
gr3d = ContourPlot3D[{fip[{x, y, z}] - 0.5, plane2}, {x, 27, 30}, {y,
27, 30}, {z, 17.3, 21}, Contours -> {0},
ContourStyle -> {Directive[Opacity[.5], ColorData[22, 3]],
Directive[Opacity[.8], ColorData[22, 5]]}]

gr2d = ContourPlot[fip[plane1] - 0.5, {s, 2, 5}, {t, 1, 4},
Contours -> {0}, ContourShading -> None,
ContourStyle -> {ColorData[22, 1], Thick}];
Show[{gr3d,
Graphics3D[{Red,
Cases[Normal[gr2d], Line[__], Infinity] /.
Line[pts_] :> Tube[p0 + #1*v1 + #2*v2 & @@@ pts, .05]}]}]

As you can see, your sphere has a whole inside.

-
Thanks for all your replies! Sorry for the delay, I had problems with an internet acces. But the problem is when I'm trying to use suggestions by halirutan I get empty box (and I need exactly this plot). I'd love to provide the sample of my data but it's big, it has 2744 lines and I don't know how to upload this file here (any suggestions?). Thanks! PS Original questions was asked by me. I do not know how to comment other answers (I don't see button add commment) –  Nikita Aug 13 '12 at 20:50
thanks for solving account issue! So my question if it is possible to load file on this forum or how I can upload my data which are quite big (app. 3000 lines) –  Nikita Aug 13 '12 at 22:51
@Nikita I asked in the chat and there seems to be no standard-upload place. Oleksandr suggested ge.tt. Before uploading a very large file, please read the FAQ and remember that the questions on this site should be helpful for everyone and should not be too localized! –  halirutan Aug 14 '12 at 1:14
here is a link (depositfiles.com/files/r0pckyaiu) to zip file that contains 2 absolutely identical data (one is in format: x y z f, and the other is in the same format but can be directly load to mathematica). Yes, I understand that questions shouldn't be too localized, but the data I'm working on are cube files and it can be useful for many people. Thanks! –  Nikita Aug 14 '12 at 14:31
@Nikita Here we go. See my update. –  halirutan Aug 14 '12 at 15:56
show 1 more comment

You can use the options MeshFunctions in combination with Mesh for this.

I'm borrowing Mr.Wizard's data here for a moment:

data = Flatten[Table[{x, y, z, x^2 + y^2 - z^2}, {x, -2, 2, 0.2},
{y, -2, 2, 0.2}, {z, -2, 2, 0.2}], 2];

Suppose you want to plot the intersection of the contours of data with the plane x - y == 0, then you could do something like

ListContourPlot3D[data, Contours -> {0.5, 2},
ContourStyle -> Opacity[0.3],
BoundaryStyle -> Opacity[0.3],
MeshFunctions -> {(#1 - #2) &}, Mesh -> {{0}},
MeshStyle -> {Thick, Orange}]

-
You removed my glorious infix! +1 for the method however. (It's nice to see you posting again.) –  Mr.Wizard Aug 11 '12 at 7:00
thanks for your reply! These tricks with meshfunctions are brilliant, but when I use ListContourPlot3D on my data (which are exactly in the same format) I have empty box. But when I apply ListContourPlot3D on data that have only f values (without x,y,z) Mathematica plots correct figures but I cannot use MeshFunction in this case (because there is no information about x,y,z values). Do you know what can solve this problem? –  Nikita Aug 13 '12 at 22:58

I'm not claiming this is a good method, I'm just getting some ink the page:

data = Table[{x, y, z, x^2 + y^2 - z^2}, {x, -2, 2, 0.2}, {y, -2, 2, 0.2}, {z, -2, 2, 0.2}] ~Flatten~ 2;

ListContourPlot3D[data, Contours -> {0.5, 2}, Mesh -> None]

int = Interpolation[data];

ContourPlot3D[int[x, y, z], {x, -2, 2}, {y, -2, 2}, {z, -2, 2},
Contours -> {0.5, 2}, RegionFunction -> (-0.02 < #2 - # < 0.02 &)]

-
The second piece of codes using RegionFunction doesn't creat a pretty plot,which contains two outer curves with small intervals, and neither PlotPoints nor MaxRecursion could help to improve it. –  withparadox2 Aug 11 '12 at 7:12
@paradox2 hence: "I'm not claiming this is a good method ..." –  Mr.Wizard Aug 11 '12 at 7:13


# Are random circulant matrices almost orthonormal?

Let $(X_1, X_2, \dots, X_n)$ be i.i.d. ${\cal N}(0,1)$. We construct a random circulant matrix $M$:

$$M = \frac{1}{\sqrt n}\begin{pmatrix}X_1 &X_2 &X_3 \dots &X_n\\ X_n &X_1 & X_2 \dots &X_{n-1}\\ \vdots &\vdots &\vdots &\vdots\\X_2 &X_3 &X_4 \dots &X_1\end{pmatrix}.$$

My questions are the following:

1. Is $M$ "almost orthonormal" in a precise probabilistic sense?

2. Related to above, is it possible to upper-bound the largest possible dot product between any two rows of $M$ by a suitably small $\epsilon_n$?

Note that this says that $MM^T$ is close to the identity matrix $I_{n \times n}$, as we are bounding the off-diagonal entries of $MM^T$ by $\epsilon_n$, while the diagonal entries are close to $1$.

• What do you mean by "upper-bound the largest possible dot product"? All of the $X_i$ could be equal to $10^{10^{10}}.$ You can upper bound it with high probability, but that's the best you can do. – Igor Rivin Oct 14 '17 at 0:05
• If $D$ is the absolute value of the largest dot product, one could seek a bound of the sort $\mathbb P(D > \epsilon_n) < \epsilon_n$ for a suitable choice of $\epsilon_n \to 0$. – VSJ Oct 14 '17 at 2:25
• Yes, that follows from Marcel's answer, using, e.g., Markoff's inequality. – Igor Rivin Oct 14 '17 at 3:24

The diagonal elements of $P=\frac{1}{N}MM^T$, like $$P_{11}=\frac{1}{N}\sum_{i=1}^NX_i^2,$$ satisfy $\langle P_{11}\rangle=1$ and $\langle P_{11}^2\rangle=1+2/N$ (variance decreases like $N^{-1}$).

On the other hand, off-diagonal elements like $$P_{12}=\frac{1}{N}\sum_{i=1}^{N}X_iX_{i+1}$$ satisfy $\langle P_{12}\rangle=0$ and $\langle P_{12}^2\rangle=1/N$ (variance also decreases like $N^{-1}$).

In this sense I would say $P$ is close to the identity.

Marcel's solution provides a good approach for understanding the marginal statistics. Here are a few supplementary comments that might give a little insight into the joint distribution.

Let $D$ be the discrete Fourier transform matrix, i.e. the $j,k$-th entry is: $$D_{j,k}=e^{-2\pi i jk/N}/\sqrt{N}$$ Consider the discrete Fourier transform of the first row of $M$, i.e. $$(G_1,...,G_N)=(1/\sqrt{N})(X_1,...,X_N)D$$ Let $G$ be a diagonal matrix with diagonal entries $G_1,...,G_N$. Then $D$ diagonalizes $M$ (see, e.g., this description), that is: $$M = D G D^{-1}$$

If we took the $X_i$ to be complex-valued Gaussian variables, then we would be essentially done at this point: since $D$ is unitary, and the Gaussian is spherically symmetric, then the $G_i$ would be i.i.d. (complex) Gaussian random variables with mean 0 and variance $1/n$. (That is, if we sampled the $G_i$ as i.i.d complex $\mathcal{N}(0,1/n)$, then $DGD^{-1}$ has the same distribution as samples from the original circulant matrix.) It follows that $$MM^*=(DGD^{-1})(DG^*D^{-1})=DGG^{-1}D^*$$ It then follows that the eigenvalues of $MM^{*}$ (or, if you prefer, the squared singular values of $M$) are distributed like $n$ i.i.d draws from a rescaled $\chi^2$ distribution with 2 degrees of freedom (which happens to simplify to an exponential distribution), where we rescale by dividing by $n$. From an eigenvalue perspective, this is a complete characterization of the "orthonormality" of $M$.

However, your $X_i$ are probably real-valued. This causes a small book-keeping headache, but doesn't really change much. In brief: since the $X_i$ are real-valued, the $G_i$ will be symmetric. We can convert our $n\times n$ complex-valued matrices into corresponding $2n \times 2n$ real-valued matrices (say, $D'$ and $G'$). Then observe that there are only $n$ of the $2n$ diagonal elements in $G$ are free, and only $n$ of the $2n$ inputs to $D'$ are non-zero (namely, the ones corresponding to the real values of the inputs in $D$). Noting that the resulting decimated matrices are still unitary, we then reduce to the previous case, except with $\chi^2/n$ distributions with only 1 degree of freedom.

• I'm confused about one part: Marcel's answer indicates that $MM^*$ is close to identity. Thus it should have eigenvalues close to 1? But your argument says eigenvalues are iid from a chi square distribution so they aren't all close to 1. How to reconcile these? – VSJ Nov 2 '17 at 4:04
• Ah, @VSJ , that is my mistake: I forgot to pass through the prefactor of $1/\sqrt(n)$ in the original definition of $M$. I will fix that now, at which point I think Marcel's answer is consistent with mine. – Bill Bradley Nov 3 '17 at 13:31
• Hi Bill, I'm not sure that is a mistake. Because even then, the eigenvalues will converge to 0 and not 1. Perhaps it is the case that the matrix is tending "pointwise" to identity, but it is not tending fast enough, and therefore the eigenvalues don't converge? – VSJ Nov 3 '17 at 17:52


# Another way of counting probability

A set $S = \{1, 2, \cdots, k\}$ is given. Two persons independently choose some numbers from this set. I want to count the probability that the cardinality of intersection of the chosen sets by both persons is exactly one.

Each person has to choose at least one number. A person can choose a number which is already chosen by another person. A number is being chosen independently and uniformly at random from the set.

My approach: Fix one number from $1$ to $k$. Probability of both persons choosing that number is $\frac{1}{k^2}$. Remaining $k-1$ numbers can be chosen by either of both or by none of both. So, probability for that is $\left(1 - \frac{1}{k^2}\right)^{k-1}$. And that fixed number can be selected in ${k \choose 1}$ ways.

So, probability of required event is:

\begin{align} P(E) = {k \choose 1} \frac{1}{k^2} \left(1 - \frac{1}{k^2}\right)^{k-1} \end{align}

My questions:

1. Is this reasoning correct?

2. Initially I started with counting all the possible ways of choosing numbers by each person. Can we count the required probability by counting ways technique? Is there any other way of counting the probability?

• Why do you say that the probability of both people picking the fixed number is $\frac{1}{k^2}$? – paw88789 Oct 25 '15 at 12:57
• I think you need to say something about the number of elements each player selects. There are $2^k-1$ non-empty subsets of $\{1,....,k\}$. Do you mean to say that each player can select any one of these with equal probability? – lulu Oct 25 '15 at 12:57
• @lulu Yes. That is what I mean. – Nimit Oct 25 '15 at 13:07
• Ok, but then the situation is more complex than your method suggests. You have to take into account the fact that it is more likely that a randomly chosen subset has about $\frac k2$ elements than, say, $1$ or $k$. – lulu Oct 25 '15 at 13:09
• @paw88789 I got your point. I smell something wrong with my reasoning now. I had assumed that each person is choosing that fixed number very first. But that is not the case. It can be chosen later also. – Nimit Oct 25 '15 at 13:16

Let us at first ignore the condition that at least one number has to be chosen (that will get fixed afterwards). Under that condition, as each choice of each possible subset is equally likely (as you say in the comments), and for any given element there are exactly the same number of subsets containing and not containing that element (think of a subset and its complement!), the probability that a person chooses a given number is exactly $1/2$. Thus it's the same problem as if both people throw a coin for each number, and the question is what's the probability that they throw both head for exactly one of the numbers.

This is a fairly standard problem which I guess you can solve. Let's call the obtained probability $p_0$.

Now we have to fix this up for the condition that the empty set is not a valid choice. Fortunately this is easy, since when any party chose the empty set, we know for sure there was no number that was chosen by both (because at least one of them didn't chose a number to begin with).

Since the probability calculated in the previous step is $$\frac{\text{Number of choices with exactly one shared number}} {\text{Total number of choices when allowing empty sets}}$$ we have to just fix up the denominator, which we can do by multiplying with $$\frac{\text{Total number of choices when allowing empty sets}} {\text{Total number of choices when not allowing empty sets}}.$$ Now the total number of choices when allowing empty sets is $2^{2k}$ since there are $2^k$ subsets, and each person chooses one. When excluding the empty set, each player has one choice less (namely he cannot choose the empty set), and therefore without the empty set, the number of possible choices is $(2^k-1)^2$.

Therefore we have for the requested probability: $$p = \frac{2^{2k}}{(2^k-1)^2}p_0$$

• To get an exact answer, the requirement of nonempty set choice by each person complicates the problem. For instance, players can't select/not select items by tossing a coin because that would allow for the empty set being chosen. And then consequently we can't simply say that for any given item that the probability of both selecting it is $\frac14$. I think you need to know more about how numbers are chosen. – paw88789 Oct 25 '15 at 13:45
• @paw88789: Ah right, I overlooked that condition. But the claim that all possible sets are chosen with equal probability should still be sufficient. I'll rework the answer. – celtschk Oct 25 '15 at 13:50
• @paw88789: See edited answer. – celtschk Oct 25 '15 at 14:05