# Spanning forests of bipartite graphs and distinct row/column sums of binary matrices

Let $$F_{m,n}$$ be the set of spanning forests on the complete bipartite graph $$K_{m,n}$$. Let $$S_{m,n} = \{(r(M), c(M)), M \in B_{m,n} \}$$ where $$B_{m,n}$$ is the set of $$m \times n$$ binary matrices and $$r(M), c(M)$$ are the vectors of row sums and column sums of $$M$$, respecitvely. That is, $$S_{m,n}$$ is the set of the distinct row-sum, column-sum pairs of binary matrices. (The term spanning forest here refers to a forest that spans all of the vertices of the given graph; it doesn't have to be a maximal acyclic subgraph.)

Q: Is it true that $$|F_{m,n}| = |S_{m,n}|$$? It is true for $$m,n \leq 4$$. For $$m=n$$ this is OEIS A297077.

There is an obvious mapping from $$F_{m,n} \rightarrow B_{m,n}$$ given by taking the reduced adjacency matrix, so if $$U = \{u_1, \ldots, u_m\}$$, $$V = \{v_1, \ldots, v_m\}$$ are the color categories we set $$M_{ij} = 1$$ if $$v_i \sim u_j$$ in a forest $$F$$, else $$M_{ij} = 0$$. However, this does not help because multiple forests may have the same row and column sums - and not every row-sum, column-sum pair is represented by a forest under this mapping.

The numbers $$|F_{m,n}|$$ are given here:

$$\begin{array}{|c|c|}\hline m\backslash n & 1 & 2 & 3 & 4 & 5 \\ \hline 1 & 2 & \\\hline 2 & 4 & 15 \\\hline 3 & 8 & 54 & 328 \\\hline 4 & 16 & 189 & 1856 & 16145 \\\hline 5 & 32 & 648 & 9984 & 129000 & 1475856 \\\hline\end{array}$$

For more see this answer (sum each row.)

• The linked MSE thread calculates $|F_{m,n}|$, but how did you calculate $|S_{m,n}|$ to verify they are the same for $m,n\le 4$? Did you just generate all $2^{mn}$ binary matrices? – antkam May 24 '19 at 19:24
• Yes, I did a brute force count. – Jair Taylor May 24 '19 at 22:32
• Just curious: what made you do the brute force count to find out they're equal? Nothing in the "obvious mapping" would suggest (to me) that they are equal, so it would never have occurred to me to even try. – antkam May 25 '19 at 22:54
• @antkam I was interested in counting forests and found that the relevant OEIS entry only mentioned row-sum / column-sums. – Jair Taylor May 26 '19 at 1:01
• In my Answer, when interpreting $F_{m,n}$, I wrote "In your definition, a spanning forest is any subset $T$ of edges of $K_{2,n}$ which is acyclic." So e.g. the empty $T=\emptyset$ qualifies, and in general nodes can be isolated/unconnected. First of all, is my interpretation correct? Second, if I'm correct, then IMHO your use of the word "spanning" is a little confusing. I understand you probably want to make sure unconnected nodes are still included, and simply saying "forest" might also be confusing in a different way... – antkam May 30 '19 at 12:49

I can prove the conjecture, although I can't give a bijection. I've left up a previous answer which does the case $$m=3$$, since it serves as an example of many of the ideas here.

Here is the key observation:

Theorem: There is a unique array $$f(m,n)$$, for $$m$$ and $$n$$ nonnegative integers, satisfying:

1. $$f(m,0) = f(0,n)=1$$

2. If we fix $$m \geq 1$$, then $$f(m,n)$$ is of the form $$(m+1)^n p_m(n)$$ where $$p_m(x)$$ is a polynomial of degree $$\leq m-1$$.

3. If we fix $$n \geq 1$$, then $$f(m,n)$$ is of the form $$(n+1)^m p_n(m)$$ where $$p_n(x)$$ is a polynomial of degree $$\leq n-1$$.

Uniqueness: Let's suppose that we have already found unique values of $$f(m,n)$$ whenever $$\min(m,n) < k$$. In particular, we know the values of $$f(k,x)$$ and $$f(x,k)$$ for $$0 \leq x \leq k-1$$. This is enough values to uniquely determine a degree $$k-1$$ polynomial, so the values we already know determine the values of $$f(k,x)$$ and $$f(x,k)$$ for all $$x$$.

Existence: The proof of uniqueness gives an algorithm to compute $$f$$. The only potential issue is that $$f(k,k)$$ is determined twice, as a polynomial in its first variable and in its second variable. However, the algorithm is symmetric in $$m$$ and $$n$$, so the two interpolating polynomials coincide. $$\square$$

For example, we have $$f(1,0) = 1 = 2^0 \cdot 1$$ so we must have $$p_1(n)=1$$ and $$f(1,n) = 2^n$$. Similarly, $$f(2,0)=1=2^0 \cdot 1$$ and $$f(2,1) = 4=3^1 \cdot (4/3)$$, so we must have $$p_2(n) = 1+n/3$$ and $$f(2,n) = 3^n(1+n/3) = 3^{n-1} (n+3)$$. Using this algorithm, I computed $$f(m,n)$$ for $$0 \leq m,n \leq 10$$. Here is the data, and some Mathematica code, if you'd like to play with it.

f[m_, n_] := f[m, n] =
If[m == 0 || n == 0, 1,
If[m <= n,
(m + 1)^n * InterpolatingPolynomial[Table[{k, f[m, k]/(m + 1)^k}, {k, 0, m - 1}], x] /. x -> n,
(n + 1)^m * InterpolatingPolynomial[Table[{k, f[k, n]/(n + 1)^k}, {k, 0, n - 1}], x] /. x -> m]]

Values of $$f(m,n)$$ for $$0 \leq m,n \leq 10$$.

1,1,1,1,1,1,1,1,1,1,1
1,2,4,8,16,32,64,128,256,512,1024
1,4,15,54,189,648,2187,7290,24057,78732,255879
1,8,54,328,1856,9984,51712,260096,1277952,6160384,29229056
1,16,189,1856,16145,129000,968125,6925000,47690625,318500000,2073828125
1,32,648,9984,129000,1475856,15450912,151201728,1403288064,12479546880,107152782336
1,64,2187,51712,968125,15450912,219682183,2862173104,34828543449,401200569280,4418300077219
1,128,7290,260096,6925000,151201728,2862173104,48658878080,760774053888,11122973573120,153936323805184
1,256,24057,1277952,47690625,1403288064,34828543449,760774053888,15047189968833,274908280855680,4707029151392121
1,512,78732,6160384,318500000,12479546880,401200569280,11122973573120,274908280855680,6199170628499200,129708290461760000
1,1024,255879,29229056,2073828125,107152782336,4418300077219,153936323805184,4707029151392121,129708290461760000,3283463201858585471

So, we can prove the conjecture by showing that both $$F_{m,n}$$ and $$S_{m,n}$$ obey conditions 1, 2 and 3. For condition 1, we can just define $$S_{m,0}$$, $$S_{0,n}$$, $$F_{m,0}$$, and $$F_{0,n}$$ to be singletons (and I claim this is actually the most natural definition); then we just need to check that our verification of polynomiality goes all the way down to the zero case.

Since conditions 2 and 3 are symmetric, and the definitions of $$F_{m,n}$$ and $$S_{m,n}$$ are symmetric, we just check condition $$2$$.

Verification of condition 2 for forests: Let $$A_{m,b}$$ be the set of isomorphism classes of bicolored forests whose white vertices are labeled $$\{1,2,\ldots,m \}$$ and which have $$b$$ black vertices, each of degree $$\geq 2$$. We claim that $$|F_{m,n}| = \sum_b |A_{m,b}| n(n-1)(n-2) \cdots (n-b+1) (m+1)^{n-b} . \qquad (1)$$

Proof: Take a forest in $$F_{m,n}$$, with the $$m$$ vertices colored white and the $$n$$ vertices colored black. Delete all black vertices of degree $$0$$ and $$1$$ and forget the numbering of the remaining black vertices. This gives a forest in $$A_{m,b}$$. To undo this process, we first must take the $$b$$ black vertices and decide which of the $$n$$ vertices of $$K_{m,n}$$ they will be; there are $$n(n-1)(n-2) \cdots (n-b+1)$$ ways to do this. (We used that trees in $$A_{m,b}$$ have no automorphisms.) Then we must take the $$n-b$$ remaining black vertices and either join them to one of the $$m$$ white vertices or leave them unconnected; there $$(m+1)^{n-b}$$ ways to do this.

Formula (1) is clearly $$(m+1)^n$$ times a polynomial, it remains to check that the polynomial has degree at most $$m-1$$. We must check that $$A_{m,b}$$ is empty if $$b \geq m$$. Indeed, since every black vertex has degree at least $$2$$, a forest in $$A_{m,b}$$ has at least $$2b$$ edges. But, since it is a forest, it also has at most $$m+b-1$$ vertices. So $$2b \leq m+b-1$$ and $$b \leq m-1$$. $$\square$$

Verification of condition 2 for margins of $$(0,1)$$ matrices: Consider a vector $$C = (C_1, \ldots, C_n) \in \{ 0,1,\ldots, m \}^n$$ of columns sums, and consider how many row sums $$(R_1, \ldots, R_m)$$ are compatible with it. Let $$c_j = \# \{ k : C_k = j \}$$, so $$c_0+c_1+\cdots + c_m=n$$.

By the Gale-Ryser theorem, $$(R_1, \ldots, R_m)$$ is compatible with $$(c_0, \cdots, c_m)$$ if and only if $$\sum R_i = \sum j c_j$$ and, for all index sets $$1 \leq i_1 < i_2 < \cdots < i_k \leq m$$, we have $$R_{i_1} + R_{i_2} + \cdots + R_{i_k} \leq \sum_j \min(j,k) c_j .$$ This is the defining list of inequalities of the permutahedron, so this condition can alternately be stated as saying that $$(R_1, \ldots, R_m)$$ is in the convex hull of the $$m!$$ permutations of $$(c_1+c_2+\cdots+c_m, c_2+\cdots + c_m, \cdots, c_{m-1}+c_m, c_m)$$.

By Theorem 11.3 of Postnikov's Permutohedra, associahedra, and beyond, the number of such $$(R_1, \ldots, R_m)$$ is a polynomial $$g_m(c_0,c_1, \ldots, c_m)$$ in the $$c_j$$, of degree $$m-1$$. So $$|S_{m,n}| = \sum_{c_0+\cdots + c_m=n} \frac{n!}{c_0! c_1! \cdots c_m!} \ g_m(c_0,c_1, \ldots, c_m). \qquad (2)$$ Let $$\partial_j$$ be $$\tfrac{\partial}{\partial x_j}$$. There is some polynomial $$h_m$$ in the $$\partial_j$$, of degree $$m-1$$, such that $$\left. h_m(\partial_0, \ldots, \partial_m) \left( x_0^{c_0} \cdots x_m^{c_m} \right) \right|_{(1,1,\ldots,1)} = g_m(c_1, \ldots, c_m). \qquad (3)$$ Combining (2), (3) and the binomial expansion of $$(x_0+x_1+\cdots+x_m)^n$$, we obtain $$|S_{m,n}| = \left. h_m(\partial_0, \ldots, \partial_m) \left( x_0+x_1+\cdots+x_m \right)^n \right|_{(1,1,\ldots,1)} . \qquad (4)$$ Let $$h_m(t,t,\ldots,t) = \sum_{k=0}^{m-1} h_{m,k} t^k$$. Then $$(4)$$ is $$\sum_{k=0}^{m-1} h_{m,k} n(n-1)(n-2) \cdots (n-k+1) (m+1)^{n-k}$$, which is a polynomial of the desired form. $$\square$$

• Very cool! I think you need another index on your coefficients $c_k$ (say $c_{m,k}$). Then you've shown $c_{m,k} = |A_{m, k}|$ which is interesting as well. I'd be curious to see if this could be generalized more - e.g., to forests with a specified number of components. But I don't know what the appropriate statistic on row-sums/column-sums would be. – Jair Taylor Jun 2 '19 at 21:16
• @JairTaylor Nice observation. Your comment made me realize I had used $c_j$ to mean two things, so I changed the second one to $h_{m,k}$; your observation then is that I have shown $h_{m,k} = |A_{m,k}|$. – David E Speyer Aug 27 '19 at 15:38

This conjectured equivalence (if true) is still amazing to me. However, here is a baby step: The conjecture is indeed true for $$m=2$$. Perhaps someone else will find this useful as a base for generalization.

Claim: $$|F_{2,n}| = |S_{2,n}|$$ for all $$n$$

First, lets consider $$F_{2,n}$$. In your definition, a spanning forest is any subset $$T$$ of edges of $$K_{2,n}$$ which is acyclic. Let $$u,v$$ be the two nodes on the $$m=2$$ side, and let $$S(u)$$ be the neighbors of $$u$$, i.e. the subset of nodes (on the $$n$$-node side) which $$u$$ is connected to in $$T$$. Similarly for $$S(v)$$.

Next, note that $$T$$ contains a cycle iff $$S = S(u) \cap S(v)$$ contains $$2$$ nodes (or more). So, $$F_{2,n}$$ can be counted by counting all cases where $$S$$ contains $$0$$ or $$1$$ node.

• $$|S|=0$$ case: Each of $$n$$ nodes can be connected to $$u$$, or to $$v$$, or to neither. Total no. $$= 3^n$$.

• $$|S|=1$$ case: There are $$n$$ ways to pick the unique $$w \in S$$. After that, each of the remaining $$n-1$$ nodes can be connected to $$u$$, or to $$v$$, or to neither. Total no. $$= n\, 3^{n-1}$$

• Summing up, $$|F_{2,n}| = 3^n + n \,3^{n-1} = 3^{n-1} (3+n),$$ which matches your table.

Second, lets consider $$S_{2,n}$$. There are $$n$$ column sums, each of which can be $$0, 1, 2$$. Let $$x,y,z$$ be the number of columns whose sum $$=0, 1, 2$$ respectively. The columns whose sum $$=0$$ or $$2$$ dictate their elements. In the $$y$$ columns whose sum $$=1$$, the number of $$1$$s in the top row can be any integer $$\in [0,y]$$, and so the top row sum can be any integer $$\in [z,z+y]$$, and in short there are $$(y+1)$$ possibilities. Obviously, once the top row sum is known that determines the bottom row sum $$= (y+2z) \,-$$ top row sum.

So $$S_{2,n}$$ can be counted by (i) summing over all possible $$y$$, and for each $$y$$: (ii) picking the $$y$$ columns whose sum $$=1$$, and (iii) for the remaining $$n-y=x+z$$ columns assign them $$0$$ or $$2$$ arbitrarily. I.e.:

$$|S_{2,n}| = \sum_{y=0}^n (y+1) {n \choose y} 2^{n-y}$$

This can be evaluated many ways but my favorite is to recognize a slightly transformed sum as an explicit formula for the expected value of a Binomial random variable:

\begin{align} |S_{2,n}| &= \sum_{y=0}^n (y+1) {n \choose y} 2^{n-y} \\ &= 3^n \times \sum_{y=0}^n (1+y) {n \choose y} (\frac13)^y (\frac23)^{n-y} \\ &= 3^n \times \mathbb{E}[1 + Bin(n, \frac13)] \\ &= 3^n (1 + {n \over 3}) = 3^{n-1} (3 + n) = |F_{2,n}| & QED \end{align}

As I said, this is a baby step only. The key step in $$F_{2,n}$$ is that $$T$$ has a cycle iff $$|S| \ge 2$$, and the key step in $$S_{2,n}$$ is that the $$y$$ ones can be all in the top row or all in the bottom row or anywhere in between, for $$(1+y)$$ possibilities. These key steps make the counting easy. However, as far as I can see, neither key step has any easy way to generalize to $$m=3$$, let alone arbitrary $$m$$. (E.g. for $$m=3$$, a cycle in $$T$$ can involve $$2$$ or $$3$$ nodes on the $$m=3$$ side, and I don't know any good way to count that.)

• Nice start. I would like to see a bijective proof. I wonder if, in general, if $m$ is fixed, $F_{m,n}$ has a rational generating function. – Jair Taylor May 30 '19 at 19:32
• I would like to see a bijective proof even just for $m=2$, instead of this algebraic mess. Also, I am no good at GFs, but in this case, I couldn't even find nice recursions for $F$ or $S$. Do you have recursions for either of them? – antkam May 30 '19 at 19:54

I have a brute force proof that, for $$m=3$$, both counts are $$4^{n - 2} (3 n^2 + 13 n + 16)$$. It would be possible to extend this method for any fixed $$m$$. I'll write it up for $$m=3$$ in the hope it gives insight. As you'll see, many steps look the same on both sides, but I can't figure out how to give a general proof.

Counting margins of $$3 \times n$$ binary matrices Consider a vector $$C \in \{ 0,1,2,3 \}^n$$ of column sums. Let $$C$$ have $$c_j$$ entries equal to $$j$$ (so $$c_0+c_1+c_2+c_3=n$$). Let's consider how many row sums $$(R_1, R_2, R_3)$$ are compatible with $$C$$. By the Gale-Ryser theorem, these are the vectors with $$R_1+R_2+R_3 = c_1+2c_2+3c_3$$, $$\min(R_1+R_2, R_1+R_3, R_2+R_3) \geq c_2+2c_3$$ and $$\min(R_1, R_2, R_3)\geq c_3$$. Geometrically, this is the lattice points in a hexagon whose vertices are the permutations of $$(c_1+c_2+c_3, c_2+c_3, c_3)$$. I computed that the number of lattice points in this hexagon is $$\binom{c_1}{2} + 2 c_1 c_2 + \binom{c_2}{2} + 2 c_1 + 2 c_2 + 1.$$

The generating function for $$\sum_C x_0^{c_0} x_1^{c_1} x_2^{c_2} x_3^{c_3}$$ is $$(x_0+x_1+x_2+x_3)^n$$. Let $$\partial_j$$ be differentiation with respect to $$x_j$$. Let $$D$$ be the differential operator $$\tfrac{1}{2} \partial_1^2 + 2 \partial_1 \partial_2+\tfrac{1}{2} \partial_2^2 + 2 \partial_1 + 2 \partial_2 + 1.$$ Then $$D$$ applied to the monomial $$x_0^{c_0} x_1^{c_1} x_2^{c_2} x_3^{c_3}$$, and evaluated at $$(1,1,1,1)$$, gives $$\binom{c_1}{2} + 2 c_1 c_2 + \binom{c_2}{2} + 2 c_1 + 2 c_2 + 1$$. So the number of pairs $$(C,R)$$ is $$D (x_0+x_1+x_2+x_3)^n$$ evaluated at $$(1,1,1,1)$$.

This gives $$3 n(n-1) 4^{n-2} + 4 n 4^{n-1} + 4^n = 4^{n - 2} (3 n^2 + 13 n + 16)$$.

Counting forests Given a forest on $$3 \times n$$, define a sequence $$(v_1, v_2, \ldots, v_n)$$ in $$\{ 0,1,2,3 \}^n$$ by saying that $$v_j$$ is $$0$$ if vertex $$j$$ has degree $$0$$, and otherwise $$v_j$$ is the least neighbor of $$j$$. Let $$c_j$$ be the number of $$v_j$$'s equal to $$j$$.

The generating function for the $$(c_0, c_1, c_2, c_3)$$ sequences is $$(x_0+x_1+x_2+x_3)^n$$ (again!). We count how many forests give rise to each $$(c_0, c_1, c_2, c_3)$$, by listing all possiblilities.

One vertex joined to $$(1,2)$$ and another joined to $$(1,3)$$ This can happen in $$c_1 (c_1-1)$$ ways.

One vertex joined to $$(1,2)$$ and another joined to $$(2,3)$$ This can happen in $$c_1 c_2$$ ways.

One vertex joined to $$(1,3)$$ and another joined to $$(2,3)$$ This can happen in $$c_1 c_2$$ ways.

One vertex joined to $$(1,2,3)$$ This can happen in $$c_1$$ ways.

One vertex joined to $$(1,2)$$ This can happen in $$c_1$$ ways.

One vertex joined to $$(1,3)$$ This can happen in $$c_1$$ ways.

One vertex joined to $$(2,3)$$ This can happen in $$c_2$$ ways.

None of the $$n$$-vertices joined to more than one neighbor This can happen in $$1$$ way.

So, this time, we want to sum up $$c_1 (c_1-1) + 2 c_1 c_2 + 3 c_1 + c_2 +1.$$ The corresponding differential operator is $$E=\partial_1^2 + 2 \partial_1 \partial_2 + 3 \partial_1 + \partial_2+1.$$

The differential operators are different, but once again I get $$3 n(n-1) 4^{n-2} + 4 n 4^{n-1} + 4^n$$ at the end of the day.

A thought for the future Why do the differential operators $$\tfrac{1}{2} \partial_1^2 + 2 \partial_1 \partial_2+\tfrac{1}{2} \partial_2^2 + 2 \partial_1 + 2 \partial_2 + 1$$ and $$\partial_1^2 + 2 \partial_1 \partial_2 + 3 \partial_1 + \partial_2+1$$ give the same thing when applied to $$(x_0+x_1+x_2+x_3)^n$$? Because $$(x_0+x_1+x_2+x_3)^n$$ is solely a function of $$z:=x_0+x_1+x_2+x_3$$, so all the $$\partial_j$$'s evaluate to $$\tfrac{d}{dz}$$. Writing $$\partial$$ for $$\tfrac{d}{dz}$$, both operators are $$3 \partial^2 + 4 \partial + 1$$. Any hope to generalize this?

• Nice. I was not aware of Gale-Ryser. If I understand correctly, this could give a method of verifying the conjecture for any fixed $m$ by counting lattice points of appropriate polytopes (to count $S_{m,n}$) and enumerating all possible families of subsets of $[m]$ sharing neighbors (to count $F_{m,n}$), both reducing to finite counting problems. Still, it seems like this problem is crying out for an explicit bijection. – Jair Taylor Jun 1 '19 at 13:43


2.2k views
A deck of $5$ cards (each carrying a distinct number from $1$ to $5$) is shuffled thoroughly. Two cards are then removed one at a time from the deck. What is the probability that the two cards are selected with the number on the first card being one higher than the number on the second card?

1. $\left(\dfrac{1}{5}\right)$

2. $\left(\dfrac{4}{25}\right)$

3. $\left(\dfrac{1}{4}\right)$

4. $\left(\dfrac{2}{5}\right)$
edited | 2.2k views

The number on the first card needs to be One higher than that on the second card, so possibilities are :

$\begin{array}{c} \begin{array}{cc} 1^{\text{st}} \text{ card} & 2^{\text{nd}} \text{ card}\\ \hline \color{red}1 & \color{red}-\\ 2 & 1\\ 3 & 2\\ 4 & 3\\ 5 & 4\\ \color{red}- & \color{red}5 \end{array}\\ \hline \text{Total$:4$possibilities} \end{array}$

Total possible ways of picking up the cards $= 5 \times 4 = 20$

Thus, the required Probability $= \dfrac{\text{favorable ways}}{\text{total possible ways}}= \dfrac{4}{20} = \dfrac 15$

Option A is correct

selected
0
How to solve the question if it would be only HIGHER and not ONE HIGHER?
+4

How to solve the question if it would be only HIGHER and not ONE HIGHER?

Possible combinations :-

 First card second card 5 4,3,2,1 4 3,2,1 3 2,1 2 1 1 none

$P(First\ card\ is\ HIGHER\ than\ second\ one\ )=\left [ \left ( \frac{1}{5} \times \frac{4}{4}\right ) + \left ( \frac{1}{5} \times \frac{3}{4}\right ) + \left ( \frac{1}{5} \times \frac{2}{4}\right ) + \left ( \frac{1}{5} \times \frac{1}{4}\right ) \right]\\ =\frac{1}{2}$

+1
Got it
Here we should consider without replacement, since "removed one at a time" means the card has been removed from the deck.

Prob of picking the first card  = 1/5

Now there are 4 cards in the deck. Prob of picking the second card = 1/4

Possible favourable combinations = 2-1, 3-2, 4-3, 5-4

Probability of each combination = (1/5)*(1/4) = 1/20

Hence answer = 4*1/20 = 1/5
with 5 cards to choose we can only fulfil the condition if we pick 2,3,4,5 in our choice else theres no way to get the same

the probability of choosing first no's is =(2,3,4,5)/(1,2,3,4,5)=4/5

the second time, we have only one option to choose out of four option=1/4

so,the total probability=(4/5)*(1/4)=1/5

1
2


Zero rows in echelon matrix

In the MIT lecture notes (pg. 1) for Linear Algebra, it states;

The third row is zero because row 3 was a linear combination of rows 1 and 2; it was eliminated.

Here, $$A = \begin{bmatrix} 1 & 2 & 2 & 2 \\ 2 & 4 & 6 & 8 \\ 3 & 6 & 8 & 10 \end{bmatrix}$$ and $$U = \begin{bmatrix} 1 & 2 & 2 & 2 \\ 0 & 0 & 2 & 4 \\ 0 & 0 & 0 & 0 \end{bmatrix}$$.

Does this mean that if the row of the echelon matrix is all zeros, the corresponding row in A can be represented as a linear combination of the other rows in A?

And if the above statements is true, does this also apply to reduced row echelon matrix?

(1) Yes, if a row of the echelon matrix is all zeros, then that row (but remember to consider possible partial pivoting) is a linear combination of other rows in the original matrix. Generally, the coefficients such that forms this linear combination can be found solving the following linear system for $$a$$ and $$b$$: $$\begin{bmatrix}1 & 2 \\ 2 & 4 \\ 2 & 6 \\ 2 & 8 \end{bmatrix}\cdot\begin{bmatrix}a \\ b \end{bmatrix}=\begin{bmatrix}3 \\ 6 \\ 8 \\ 10\end{bmatrix}$$


1. ## Question about solving eigenvector problems

I understand how to get eigenvalues, but I have a problem understanding eigenvectors.
I'll demonstrate with an example:

I am given A = $\begin{bmatrix}3 & 1.5 \\1.5 & 3 \end{bmatrix}$

Solving for lambda, I get lambda = 1.5 and 4.5

Now my matrix equations become:

$-1.5x_1+1.5x_2=0$ and $1.5x_1-1.5x_2=0$

dividing by 1.5 I get: $x_1-x_2=0$
so I get $x_1=x_2$

Now, the answer is $\begin{bmatrix}1 & 1 \end{bmatrix}$ because if you set x1=1, then x2=1

If x1=x2, then why isn't the answer [ℝ], where ℝ is the set of all real numbers?

2. ## Re: Question about solving eigenvector problems

Originally Posted by yaro99
I understand how to get eigenvalues, but I have a problem understanding eigenvectors.
I'll demonstrate with an example:

I am given A = $\begin{bmatrix}3 & 1.5 \\1.5 & 3 \end{bmatrix}$

Solving for lambda, I get lambda = 1.5 and 4.5

Now my matrix equations become:

$-1.5x_1+1.5x_2=0$ and $1.5x_1-1.5x_2=0$

dividing by 1.5 I get: $x_1-x_2=0$
so I get $x_1=x_2$

Now, the answer is $\begin{bmatrix}1 & 1 \end{bmatrix}$ because if you set x1=1, then x2=1

If x1=x2, then why isn't the answer [ℝ], where ℝ is the set of all real numbers?

There are actually two eigenvectors 1/sqrt(2) {1,1} and 1/sqrt(2) {1,-1}, corresonding to eigenvalues 1.5 and 4.5.

{1,1} doesn't span R2. It spans the line y = x. Likewise {1,-1} spans the line y = -x

together these two vectors span R2

3. ## Re: Question about solving eigenvector problems

Originally Posted by romsek

{1,1} doesn't span R2. It spans the line y = x.
In that case, my question is, why aren't there infinite values for x and y that satisfy the eigenvector?
for example, {2,2}, {5,5}, {1000,1000}, etc.

Originally Posted by romsek

There are actually two eigenvectors 1/sqrt(2) {1,1} and 1/sqrt(2) {1,-1}, corresonding to eigenvalues 1.5 and 4.5.
How did you get this? My book has this answer:
1.5, [1 1], 45°; 4.5, [1 1], 45°

Does that make sense?

4. ## Re: Question about solving eigenvector problems

Originally Posted by yaro99
so I get $x_1=x_2$

Now, the answer is $\begin{bmatrix}1 & 1 \end{bmatrix}$ because if you set x1=1, then x2=1

If x1=x2, then why isn't the answer [ℝ], where ℝ is the set of all real numbers?
First, the notation [ℝ ℝ], where the objects inside brackets are sets rather than numbers, is not universally accepted. Even if it were, [A B] would probably mean {[x y] | x ∈ A, y ∈ B}, i.e., A × B. There is no coordination between the first and second coordinate here. It is clear that you mean {[x x] | x ∈ ℝ}, but I don't see an easier way to write this. By the way, even if you delimit matrices with square brackets, I would use parentheses for vectors (i.e., 1 × n matrices): e.g., (x, x), because square brackets are also used to denote closed segments.

Second, you are right, any (x, x) is an eigenvector of A as is (x, -x). Indeed, you solve the equation det(A -λI) = 0 for λ, so if λ is an eigenvalue, the matrix A - λI is singular by definition. Therefore, the system of equations (A - λI)x = 0 has infinitely many solutions.

Edit: If x is an eigenvector with value λ, then so is (ax) for any a ∈ ℝ such that a ≠ 0. Indeed, A(ax) = a(Ax) = a(λx) = λ(ax).

5. ## Re: Question about solving eigenvector problems

Originally Posted by yaro99
In that case, my question is, why aren't there infinite values for x and y that satisfy the eigenvector?
for example, {2,2}, {5,5}, {1000,1000}, etc.

How did you get this? My book has this answer:
1.5, [1 1], 45°; 4.5, [1 1], 45°

Does that make sense?
there are infinite points. That's why you say this space, in this case the 1 dimensional line y=x, is "spanned" by the vector 1/sqrt(2) {1,1}. Multiply this vector by any real scalar and you remain in the space, but yes there are infinitely many points.

Your book is missing a minus sign somewhere. The answer I got was

1.5 [1,-1]/sqrt(2)

4.5 [1,1]/sqrt(2)

6. ## Re: Question about solving eigenvector problems

Originally Posted by romsek
there are infinite points. That's why you say this space, in this case the 1 dimensional line y=x, is "spanned" by the vector 1/sqrt(2) {1,1}. Multiply this vector by any real scalar and you remain in the space, but yes there are infinitely many points.

Your book is missing a minus sign somewhere. The answer I got was

1.5 [1,-1]/sqrt(2)

4.5 [1,1]/sqrt(2)
Whoops, that was my bad, there was a minus sign.
where do you get the 1/sqrt(2) from?
is it a scalar that you can multiply throughout the matrix?

7. ## Re: Question about solving eigenvector problems

Originally Posted by yaro99
Whoops, that was my bad, there was a minus sign.
where do you get the 1/sqrt(2) from?
is it a scalar that you can multiply throughout the matrix?
it just normalizes the vector to unit length. You tend to want the unit eigenvectors


# Singing Bird Problem

For my algorithms class, the professor has this question as extra credit:

The Phicitlius Bauber bird is believed to never sing the same song twice.
Its songs are always 10 seconds in length and consist of a series of notes that are either high or low pitched and are either 1 or 2 seconds long.
How many different songs can the Bauber bird sing?

This strikes me as a combinatorial problem, but I'm having trouble figuring out the exact formula to use to fit the included variables of 10 seconds length, 2 notes and 2 note periods.

At first, I thought that $\binom{10}{2}*\binom{10}{2}$ can be a solution, since it fits finding all combinations of both and multiplies the total.

My issue is this results in a total of 2025 possible songs, and this just seems a little on the low side.

Any assistance is appreciated.

-

I'm going to work under the assumption that two successive 1-second notes of the same pitch is distinct from a single 2-second note of that pitch.

Let $f(n)$ be the number of distinct $n$-second songs the bird can sing. The bird has four options for starting the song: 1-second low, 1-second high, 2-second low, and 2-second high. This gives the recursion $$f(n) = 2f(n-1) + 2f(n-2),$$ with $f(0) = 1$ and $f(1) = 2$.

The associated characteristic equation is $x^2 - 2x - 2 = 0$, which has roots $x = 1 \pm \sqrt{3}$. Thus, we get the general solution $$f(n) = A(1 + \sqrt{3})^n + B(1 - \sqrt{3})^n.$$

Using the initial conditions, we have the system \begin{align*} 1 &= A + B\\ 2 &= A(1 + \sqrt{3}) + B(1 - \sqrt{3}), \end{align*} which has the unique solution $A = \frac{3 + \sqrt{3}}{6}$ and $B = \frac{3 - \sqrt{3}}{6}$.

Finally, we have $$f(n) = \frac{3 + \sqrt{3}}{6}(1 + \sqrt{3})^n + \frac{3 - \sqrt{3}}{6}(1 - \sqrt{3})^n.$$

For the problem at hand, we want $$f(10) = 18,272.$$

-
That's strange, f(2)=7. But as Mark Eichenlaub says, it should be 6. I think you made a mistake somewhere. –  Lopsy Feb 13 '12 at 21:52
The roots should be $1\pm\sqrt3$, and $f(10)$ is considerably smaller; a hasty calculation made it $18272$. @Lopsy means that your formula for $f(n)$ gives $f(2)=7$. –  Brian M. Scott Feb 13 '12 at 21:55
Right, but your final equation with the radicals gives 7. I think I figured out what happened: the roots of that quadratic are 1+sqrt(3) and 1-sqrt(3), not 2+sqrt(3) and 2-sqrt(3) as you claim. –  Lopsy Feb 13 '12 at 21:56
Thanks for everyone's keen eyes. I believe I've caught all the errors now. –  Austin Mohr Feb 13 '12 at 22:16
Now it’s good. I’d add just one comment: $10$ is a small enough number that in this case it’s easier just to use the recurrence than it is to find the general solution. –  Brian M. Scott Feb 13 '12 at 22:18

Hint: use recursion.

You know that the first note in the Bauber bird's song is either $1$ or $2$ seconds long. In the first case, the remainder of the song is $9$ seconds long; in the second case, the remainder of the song is $8$ seconds long.

Therefore, the number of $10$-second songs equals twice (remember, the last note can be low or high) the number of $9$-second songs plus the number of $8$-second songs. Can you see how to solve the problem from here?

Also, note that it's generally a bad idea to encourage "looking for things to do with the numbers in the problem" like you said you did with your first try, $\binom{10}{2}*\binom{10}{2}$. Although formula-hunting does have its uses (esp. when doing dimensional analysis, where it's essential), if you're going to try to find a formula first, it's a good idea to check the answer for small cases (like $1$ second, $2$ seconds, etc) and then extrapolate off of that than trying to guess formulae blind.

-

Here is a non-recursive solution.

Suppose there are $a$ 1s songs and $b$ 2s songs, so $a + 2b = 10$. The total number of songs is $10 - b$.

We can count the number of such songs by first ignoring pitch and counting the ways the 1s and 2s songs can be ordered, then multiplying by $2^{a+b}$.

There are $a+1$ gaps between the $a$ 1s songs, so we want to know how many ways $b$ 2s songs can fit into $a+1$ gaps. This is $\binom{a+b}{b} = \binom{10-b}{b}$, as shown by Akash Kumar in this answer.

So we want

$$\sum_{b=0}^{5} 2^{10 - b}\dbinom{10 - b}{b} = 18,272$$

-
But you can’t break the ten-second interval into $2$-second chunks, because a $2$-second note can overlap chunks. –  Brian M. Scott Feb 13 '12 at 21:59
@BrianM.Scott Yes, you're right, thanks. Tried a new answer. –  Mark Eichenlaub Feb 13 '12 at 23:04


# Units and Nilpotents

If $ua = au$, where $u$ is a unit and $a$ is a nilpotent, show that $u+a$ is a unit.

I've been working on this problem for an hour that I tried to construct an element $x \in R$ such that $x(u+a) = 1 = (u+a)x$. After tried several elements and manipulated $ua = au$, I still couldn't find any clue. Can anybody give me a hint?

• Dear Shannon, Try the case $u = 1$ first. Regards, – Matt E Mar 14 '12 at 2:23
• See also here for the commutative case. – Gone Aug 6 '17 at 15:21

If $u=1$, then you could do it via the identity $$(1+a)(1-a+a^2-a^3+\cdots + (-1)^{n}a^n) = 1 + (-1)^{n}a^{n+1}$$ by selecting $n$ large enough.

If $uv=vu=1$, does $a$ commute with $v$? Is $va$ nilpotent?

• I had tried your way before I asked. But I used u+a instead of 1+a. I was stuck cause I couldnt conclude 1. Here, 1+a is a special case of u+a, do you have to prove u+a? – Shannon Mar 14 '12 at 2:51
• @Shannon: That's what my last paragraph is about. Multiply $u+a$ by $v$; then you get $1+(va)$... is $va$ nilpotent? – Arturo Magidin Mar 14 '12 at 2:56
• oh, I see. I will work on it. Thank you so much. – Shannon Mar 14 '12 at 3:10
• This identity can be heuristically arrived at, and the whole problem approached directly, by using the infinite series expansion of $1/(1-x)$ with, to start, $x = -a$. Since $a$ is nilpotent, the series reduces to a perfectly acceptable polynomial. Rewriting $1/(u+a)$ into the above form is a simple exercise in high school algebra but leads to the the need to verify the (easy) questions Arturo raises. – Derek Elkins left SE Jan 21 '16 at 4:01

Let $v$ be the inverse of $u$, and suppose $a^2=0$. Note that $$(u+a)\cdot v(1-va)=(1+va)(1-va)=1-v^2a^2=1-0=1.$$ See if you can generalize this.

• The way you constructed the element is wonderful. I've never thought about this way. Can I ask where did this idea come from? – Shannon Mar 14 '12 at 2:55

Here's a rather different argument. First, suppose that $R$ is commutative. Suppose $u+a$ is not a unit. Then it is contained in some maximal ideal $M\subset R$. Since $a$ is nilpotent, $a\in M$ (since $R/M$ is a field, and any nilpotent element of a field is $0$). Thus $u=(u+a)-a\in M$ as well. But $u$ is a unit, so it can't be in any maximal ideal, and this is a contradiction.

If you don't know that $R$ is commutative, let $S\subseteq R$ be the subring generated by $a$, $u$, and $u^{-1}$. Then $S$ is commutative: the only thing that isn't immediate is that $u^{-1}$ commutes with $a$, and this this can be proven as follows: $$u^{-1}a=u^{-1}auu^{-1}=u^{-1}uau^{-1}=au^{-1}.$$

The argument of the first paragraph now shows that $u+a$ is a unit in $S$, and hence also in $R$.

This argument may seem horribly nonconstructive, due to the use of a maximal ideal (and hence the axiom of choice) and proof by contradiction. However, it can be made to be constructive and gives an explicit inverse for $u+a$ in terms of an inverse for $u$ and and an $n$ such that $a^n=0$.

First, we observe that all that is actually required of the ideal $M$ is that it is a proper ideal which contains $u+a$ and all nilpotent elements of $R$. So we may replace $M$ with the ideal $(u+a)+N$ where $N$ is the nilradical of $R$, and use the fact that if $I=(u+a)$ is a proper ideal in a commutative ring then $I+N$ is still a proper ideal. This is because $R/(I+N)$ is the quotient of $R/I$ by the image of $N$, which is contained in the nilradical of $R/I$. If $I$ is a proper ideal, then $R/I$ is a nonzero ring, so its nilradical is a proper ideal, so $R/(I+N)$ is a nonzero ring and $I+N$ is a proper ideal.

Next, we recast this argument as a direct proof instead of a proof by contradiction. Letting $I=(u+a)$, we observe that $I+N$ is not a proper ideal since $u=(u+a)-a\in I+N$ and $u$ is a unit. That is, a nilpotent element (namely $a$) is a unit in the ring $R/I$, which means $R/I$ is the zero ring, which means $I=R$, which means $u+a$ is a unit.

Finally, we chase through the explicit equations witnessing the statements above. Letting $v=u^{-1}$, we know that $v((u+a)-a)=1$ so $$-va=1-v(u+a),$$ witnessing that $a$ is a unit mod $u+a$ (with inverse $-v$). But $a$ is nilpotent, so $a^n=0$ for some $n$, and thus $0$ is also a unit mod $u+a$. We see this explicitly by raising our previous equation to the $n$th power: $$0=(-v)^na^n=(1-v(u+a))^n=1-nv(u+a)+\binom{n}{2}v^2(u+a)^2+\dots+(-v)^n(u+a)^n,$$ where every term after the first on the right-hand side is divisible by $u+a$. Factoring out this $u+a$, we find that $$1=(u+a)\left(nv-\binom{n}{2}v^2(u+a)+\dots-(-v)^n(u+a)^{n-1}\right)$$ and so $$-\sum_{k=1}^n \binom{n}{k}(-v)^k(u+a)^{k-1}= nv-\binom{n}{2}v^2(u+a)+\dots-(-v)^n(u+a)^{n-1}$$ is an inverse of $u+a$.

The fact that this complicated formula is hidden in the one-paragraph conceptual argument given at the start of this answer is a nice example of how powerful and convenient the abstract machinery of ring theory can be.

Note that since $$u$$ is a unit and

$$ua = au, \tag 1$$

we may write

$$a = u^{-1}au, \tag 2$$

and thus

$$au^{-1} = u^{-1}a; \tag 3$$

also, since $$a$$ is nilpotent there is some $$0 < n \in \Bbb N$$ such that

$$a^n = 0, \tag 4$$

and thus

$$(u^{-1}a)^n = (au^{-1})^n = a^n (u^{-1})^n = (0) (u^{-1})^n = 0; \tag 5$$

we observe that

$$u + a = u(1 + u^{-1}a), \tag 6$$

and that, by virtue of (5),

$$(1 + u^{-1}a) \displaystyle \sum_0^{n - 1} (-u^{-1}a)^k = \sum_0^{n - 1} (-u^{-1}a)^k + u^{-1}a\sum_0^{n - 1} (-u^{-1}a)^k$$ $$= \displaystyle \sum_0^{n - 1} (-1)^k(u^{-1}a)^k + \sum_0^{n - 1} (-1)^k(u^{-1}a)^{k + 1}$$ $$= 1 + \displaystyle \sum_1^{n - 1} (-1)^k (u^{-1}a)^k + \sum_0^{n - 2} (-1)^k(u^{-1}a)^{k + 1} + (-1)^{n - 1}(-u^{-1}a)^n$$ $$= 1 + \displaystyle \sum_1^{n - 1} (-1)^k (u^{-1}a)^k + \sum_1^{n - 1} (-1)^{k - 1}(u^{-1}a)^k = 1 + \displaystyle \sum_1^{n - 1} ((-1)^k + (-1)^{k - 1})(u^{-1}a)^k = 1; \tag 7$$

this shows that

$$(1 + u^{-1}a)^{-1} = \displaystyle \sum_0^{n - 1} (-u^{-1}a)^k, \tag 8$$

and we have demonstrated an explicit inverse for $$1 + u^{-1}a$$. Thus, by (6),

$$(u + a)^{-1} = (u(1 + u^{-1}a))^{-1} = (1 + u^{-1}a)^{-1} u^{-1}, \tag 9$$

that is, $$u + a$$ is a unit.

Nota Bene: The result proved above has an application to this question, which asks to show that $$I - T$$ is invertible for any nilpotent linear operator $$T$$. Taking $$T = a$$ and $$I = u$$ in the above immediately yields the existence of $$(I - T)^{-1}$$. End of Note.


# Three tosses of the same coin: Conditional probability that the coin picked is unfair

There are two coins: one fair and one unfair. P(head | fair)=½ and P(head | unfair)=⅓ These two coins look identical.

You picked up a coin from these two, throw it 3 times and observed 1 head.

What is the probability that the coin you picked is the unfair coin?

The part that is throwing me off is three tosses with one resulting in a head. Below I calculated if a heads is observed, what would be the probability that it's an Unfair coin. But if I consider three tosses, I consider three possibilities that outcome space could be {HTT, THT,TTH} and to me, all three possibilities seem to require the same calculation, so using a tree, I calculated P(U|HTT) = P(U∩H∩T∩T)/P(H∩T∩T) as

Am I making a mistake in calculating below part? The result makes me feel weird for some reason and if I consider the three outcome possibilities in numerator and denominator, they cancel out so final result should be same as below but that implies that number of tosses has no affect - this is the part that is throwing me off so need help with 1) Verify the calculation 2) Does number of tosses have an effect? or is there another way to interpret repeated tosses without replacement?

I looked at this post that is very close to my question but the first and second tosses have a pre-defined outcome. Thanks again for your help.

P(U)P(H|U)P(T|U)P(T|U)/(P(U∩H∩T∩T)+P(F∩H∩T∩T))

P(U|HTT) = 1/2 * 1/3 * 2/3 * 2/3 /(1/2*1/3*2/3*2/3 + 1/2*1/2*1/2*1/2)
= 4/27 / (4/27 + 1/8)
= 32/59

This comes out to

Here is the simple one toss calculation:

P(F) = probability the coin is fair
P(U) = probability the coin is UNfair
P(H|F) = 1/2
P(H|U) = 1/3

To calculate Probability the coin is Unfair given a heads is observed, I can use bayes theorum as:

P(U|H) = P(U)*P(H|U)/ (P(U)*P(H|U) + P(F)*P(H|F)
= 1/2 * 1/3 / (1/2*1/3 + 1/2*1/2)
= 4/10
= 2/5

## Update:

I realized the mistake I was making in assuming that number of tosses doesn't matter. It's the order that doesn't matter in the calculation, not the number of tosses - even if there were 2 or 4 or any number of tosses with one Heads, there would be 2 or 4 or n possible combinations respectively, so counting them in numerator or denominator cancels out, so order doesn't matter. However, number of tosses do matter, if there were 4 tosses, the P(HTTT|U) would have additional factor of 2/3 to indicate additional Tails, so the numerator as well as denominator would change.

The part I am still not able to think intuitively about is how to explain that order doesn't matter. Algebraically, it cancels out from Num and Denom but can't think of an intuition behind it. Thanks for the long read.

P(H|U) = 1/3
P(H|F) = 1/2

Let A be the event where we observe 3 tosses with one head

P(U|A) =  P(A,U)   =  p(U) * P(A|U)
--------   ---------------
P(A)         P(A)

= 1/2 *[P(HTT|U)+P(THT|U)+P(TTH|U)]
------------------------------------
P(A, U) + P(A, F)

=        1/2 * [(1/3*2/3*2/3)*3]
------------------------------------
[1/2*(1/3*2/3*2/3)*3] + [1/2*(1/2*1/2*1/2)*3]

=     4/27
------------
(4/27 + 1/8)

=      4/27
-----------------
(32 + 27)/(27*8)

= 32
--
59

Let's define a few random variables. Let $$U \sim \operatorname{Bernoulli}(\pi = 1/2)$$ represent the prior probability of selecting the unfair coin, where $$U = 1$$ means the coin is unfair, and $$U = 0$$ means the coin is fair. So $$\Pr[U = 1] = \Pr[U = 0] = 1/2$$. Next, define $$X \mid U \sim \operatorname{Binomial}(n = 3, p),$$ representing the number of heads obtained in three coin tosses. The probability of heads $$p$$ is a function of $$U$$: if $$U = 0$$, then $$p = 1/2$$, whereas if $$U = 1$$, then $$p = 1/3$$. So we can write this as $$p = \frac{1}{2} - \frac{1}{6}U = \frac{3-U}{6}.$$ Therefore, $$\Pr[X = 1 \mid U = u] = \binom{3}{1} \left( \frac{3-u}{6} \right)^1 \left( 1 - \frac{3-u}{6} \right)^2 = \frac{(3-u)(3+u)^2}{72},$$ and in particular, $$\Pr[X = 1 \mid U = 1] = \frac{4}{9}, \\ \Pr[X = 1 \mid U = 0] = \frac{3}{8}.$$ It follows from the law of total probability, $$\Pr[X = 1] = \Pr[X = 1 \mid U = 0]\Pr[U = 0] + \Pr[X = 1 \mid U = 1]\Pr[U = 1] = \frac{4}{9}\cdot \frac{1}{2} + \frac{3}{8} \cdot \frac{1}{2} = \frac{59}{144}.$$ Therefore, $$\Pr[U = 1 \mid X = 1] = \frac{\Pr[X = 1 \mid U = 1] \Pr[U = 1]}{\Pr[X = 1]} = \frac{2/9}{59/144} = \frac{32}{59}.$$


# Perfect powers of successive naturals: Can you always reach a constant difference?

I was thinking about what happens if you take a sequence of consecutive squares, for example 1,4,9, 16. Taking the differences gives you another sequence, 7,5,3. And taking the differences between those numbers, you get 2,2--a constant. Through elementary first-semester algebra, you can easily verify that this works no matter where you start your series of squares. If you use 9801, 10000, 10201, you will get the same result--after the second round of subtraction, you'll end up with a final constant difference of 2. The same thing works for cubes with the final constant difference being 6, although an additional round of subtraction is needed, in turn requiring one more number in the original sequence. Similarly as with the squares, it's not difficult to show that it will work for any sequence of natural number cubes.

My question is this: Is there a more general principle at work here? Suppose I take a series of sequential naturals n, n+1, n+2, n+3,... , and raise them to any given positive integral power p. Can it then be shown that if I take the differences repeatedly, proceeding as above, that I will eventually reach a constant difference? And if so, does this principle have anything to do with "difference engine" computing?

• Side note: The eventual constant difference is $p!$, where $p$ is the power. Jun 30 '15 at 23:40
• You should take a look at Faulhaber's formula. (Note that taking differences of the numbers $$S_p(n),\;\;S_p(n+1),\;\;\ldots,\;\;S_p(n+k),\;\;\ldots$$ produces the sequence $$n^p,\;\;(n+1)^p,\;\;\ldots,\;\;(n+k)^p,\;\;\ldots$$ and then you can continue taking differences from there.) Jun 30 '15 at 23:41
• Thanks for the answers and comments so far. And yes, a proof will definitely be in the works...not because the world needs it, but because I need to see it work for myself, as I did for the special cases ^2 and ^3. I do wish that when I was in school they had emphasized proofs instead of what seemed to me, at the time, merely a random grab-bag of disconnected rules and tricks. Jun 30 '15 at 23:46

Yes.

The first difference of a polynomial of degree $d$ is a polynomial of degree $d-1$.

By induction, the $m$-th difference of a polynomial of degree $d$, when $m \le d$, is a polynomial of degree $d-m$.

Setting $m = d$, the $d-th$ difference of a polynomial of degree $d$ is a constant, which is exactly what you discovered.

You next step is a proof.

If you start with the sequence of $n$-th powers, the $n$-th differences will all be $n!$.

For a function $f$ defined on the integers define $(\Delta f)(x)=f(x+1)-f(x)$. $\Delta$ is a linear operator on such functions: you can easily check that $\Delta\big(af(x)+bg(x)\big)=a\Delta f(x)+b\Delta g(x)$ for any such functions $f$ and $g$ and constants $a$ and $b$.

Now suppose that $\Delta^k(x^k)$ is the constant function $k!$ for each $k<n$. For any constant function $f$ the difference function $\Delta f$ is identically $0$, so $\Delta\big((\Delta^k(x^k)\big)=\Delta(k!)=0$ for each $k<n$, and it follows that $\Delta^m(x^k)=0$ whenever $k<n$ and $m>k$. In particular, $\Delta^{n-1}(x^k)=0$ for $k<n-1$. Thus,

\begin{align*} \Delta^n(x^n)&=\Delta^{n-1}\big((x+1)^n-x^n\big)\\ &=\Delta^{n-1}\left(\sum_{k=0}^n\binom{n}kx^k-x^n\right)\\ &=\Delta^{n-1}\left(\sum_{k=0}^{n-1}\binom{n}kx^k\right)\\ &=\sum_{k=0}^{n-1}\binom{n}k\Delta^{n-1}(x^k)\\ &=\binom{n}{n-1}\Delta^{n-1}(x^{n-1})\\ &=n(n-1)!\\ &=n!\;, \end{align*}

and by induction $\Delta^n(x^n)=n!$ for all $n$. (You can easily check the basis step of the induction.)

These so-called forward differences are a special case of divided differences, after which Babbage’s Difference Engine was named.

Using the Binomial Theorem, we get $$(n+1)^k-n^k=\sum_{j=0}^{k-1}\binom{k}{j}n^j$$ So the difference of two consecutive $k^\text{th}$ powers is a $k-1$ degree polynomial with lead coefficient $\binom{k}{k-1}=k$. Thus, the difference of a degree $k$ polynomial with lead coefficient $c_k$ is a degree $k-1$ polynomial with a lead coefficient of $kc_k$.

Repeating this, we get that the $k^\text{th}$ repeated difference of $k^\text{th}$ powers (a degree $k$ polynomial with lead coefficient $1$) will be $k!$.


# Does the set of differences of a Lebesgue measurable set contains elements of at most a certain length?

I want to show that if $E\subset \mathbb{R}^n$ is a Lebesgue measurable set where $\lambda(E)>0$, then $E-E=\{x-y:x,y\in E\}\supseteq\{z\in\mathbb{R}^n:|z|<\delta\}$ for some $\delta>0$, where $|z|=\sqrt{\sum_{i=1}^n z_i^2}$.

My approach is this. Take some $J$, a box in $\mathbb{R}^n$ with equal side lengths such that $\lambda(E\cap J)>3\lambda(J)/4$. Setting $\epsilon=3\lambda(J)/2$, take $x\in\mathbb{R}^n$ such that $|x|\leq\epsilon$. Then $E\cap J\subseteq J$ and $$((E\cap J)+x)\cup(E\cap J)\subseteq J\cup(J+x).$$

Since Lebesgue measure is translation invariant, it follows that $\lambda((E\cap J)+x)=\lambda(E\cap J)$, and so $((E\cap J)+x)\cap(E\cap J)\neq\emptyset$.

If it were empty, then $$2\lambda(E\cap J)=\lambda(((E\cap J)+x)\cup(E\cap J))\leq\lambda(J\cup(J+x))\leq 3\lambda(J)/2,$$ thus $\lambda(E\cap J)\leq 3\lambda(J)/4$, a contradiction.

Then $((E\cap J)+x)\cap (E\cap J)\neq\emptyset$, and so $x\in (E\cap J)-(E\cap J)\subseteq E-E$. Thus $E-E$ contains the box of $x$ such that $|x|\leq \epsilon$.

Is this valid? If not, can it be fixed? Many thanks.

-
I am suspicious about your first hypothesis : How can you take a box such that $\lambda(E \cap J) > 3 \lambda(J)/4$? I must say though, this is a very interesting question. –  Patrick Da Silva Nov 22 '11 at 7:13
–  gary Nov 22 '11 at 7:21
@PatrickDaSilva: $E$ has a subset $E'$ with positive and finite measure. There is an open set $U$ such that $E'\subseteq U$ and $\lambda(U)<\frac{4}{3}\lambda(E')$. Since $U$ is a countable union of nonoverlapping boxes, $U=\cup_k B_k$, it follows that $\sum_k\lambda(E'\cap B_k)>\sum_k\frac{3}{4}\lambda(B_k)$. Hence there exists $k$ such that $\lambda(E'\cap B_k)>\frac{3}{4}\lambda(B_k)$, and you can take $J=B_k$. –  Jonas Meyer Nov 22 '11 at 7:25
You may want to have a look at this thread and also at this one as well as the links therein. –  t.b. Nov 22 '11 at 8:09
I think this can be fixed if either OP justifies why this inequality holds, or just by taking a smaller epsilon. It might depend on $n$ though, but it seems to be just geometry at this point. I now accept that "this argument holds by the handwaving theorem". =P –  Patrick Da Silva Jan 31 '12 at 5:07

This is answered here, I will just post another approach that can be useful.

Lemma. If $K$ is a compact subset of $\mathbb{R}^n$ with positive measure, then the set $$D:=\{x-y:x,y\in K\}$$ contains an open ball centered at the origin.

Proof. Since $0\lt \lambda(K)\lt\infty$, there exist an open set $G$ in $\mathbb{R}^n$ such that $$K\subset G\text{ and } \lambda (G)\lt 2\lambda(K)$$ and as its complement $G^c:=\mathbb{R}^n\setminus G$ is closed and $K$ is compact, we have $$\delta:=d(K,G^c)\gt 0.$$ We claim that if $x\in\mathbb{R}^n$ with $||x||\lt\delta$ then $K+x\subseteq G$. If not, there exist a $y\in K$ s.t. $y+x\not\in G$ and then $$\delta=d(K,G^c)\leq ||y-(x+y)||=||x||,$$ which is an absurd if we assume that $||x||\lt\delta$ to begin with. Now $K+x\subseteq G$ and $K\subseteq G$, thus $(K+x)\cup K\subseteq G$. If $(K+x)\cap K=\emptyset$, then $$\lambda(G)\geq \lambda((K+x)\cup K)=\lambda(K+x)+\lambda(K)=2\lambda(K)$$ which contradicts the choice of $G$. So, for all $x\in B(0,\delta)$ we have $(K+x)\cap K\neq\emptyset$, therefore $B(0,\delta)\subset D$. QED

Theorem. Let $E\subseteq\mathbb{R}^d$. If if $E$ is measurable and $\lambda(E)\gt 0$ then the set $$E-E:=\{x-y:x,y\in E\}$$ contains an open ball centered at the origin.

Proof. Since $\mathbb{R}^d=\bigcup_{n\in\mathbb N}B(0,n)$ we have $$E=E\cap\mathbb{R}^d=\bigcup_{n\in\mathbb N}E\cap B(0,n),$$ then $$0\lt\lambda(E)\leq \sum_{n\in\mathbb{N}} \lambda(E\cap B(0,n))$$ and then, there exist a $n\in\mathbb{N}$ such that $\lambda(E\cap B(0,n))\gt 0$. Let $F=E\cap B(0,n)$. Thus $F\subseteq E$ is bounded and measurable, therefore there exist a closed set $K\subseteq F$ such that $$0\lt \frac{\lambda(F)}{2}\lt \lambda(K).$$ Notice that $K$ is closed and bounded, that means it is a compact set with positive measure. By the Lemma the set $K-K$ contains an open ball centered at the origin say $B$. Then $$B\subset K-K\subseteq E-E$$ as we wanted.

Note. The idea of proceed in this way is taken from Robert Bartle, I don't remember right now the book where this come from.

-


# Minimum values of the sequence $\{n\sqrt{2}\}$

I have been studying the sequence $$\{n\sqrt{2}\}$$ where $\{x\}:= x-\lfloor x\rfloor$ is the "fractional part" function. I am particularly interested in the values of $n$ for which $\{n\sqrt{2}\}$ has an extremely small value - that is, when $n\sqrt 2$ is extremely close to (but greater than) its nearest integer. Of course, for integer $n$, this always takes on values between (but never including) $0$ and $1$.

I have defined the sequence $M_n$ as follows:

• $M_1=1$
• $M_{n+1}$ is the smallest positive integer such that $\{M_{n+1}\sqrt 2\}\lt \{M_n\sqrt 2\}$

The first few terms of this sequence are $$1,3,5,17,29,99,169,...$$ And after a quick trip to the OEIS, I have found that this sequence is equal to OEIS entry A079496, as written in the comments. It also provides the recurrence $$a_0=a_1=1$$ $$a_{2n+1}=2a_{2n}-a_{2n-1}$$ $$a_{2n}=4a_{2n-1}-a_{2n-2}$$ How can I prove that the sequence $M_n$ satisfies this recurrence, using the definition I wrote for $M_n$?

Thanks!

EDIT: Here is the closed-form explicit formula for $a_n$, for anyone who wants to know: $$a_{2n}=\frac{(3+2\sqrt 2)^n+(3-2\sqrt 2)^n}{2}$$ $$a_{2n+1}=\frac{(1+\sqrt 2)(3+2\sqrt 2)^n-(1-\sqrt 2)(3-2\sqrt 2)^n}{2\sqrt 2}$$

• Have you taken a look to the references on the link you shared? I mean, the comment of Paul. D Hanna there says that this is exactly what you're looking for... – Alejandro Nasif Salum Dec 15 '17 at 23:54
• I mean... you want to know if this recurrence is valid for your sequence or you are sure of it and you are just trying to prove it? – Alejandro Nasif Salum Dec 15 '17 at 23:55
• Yeah, that confuses me as well. I'll add the closed form to the question, for anyone who is curious. – Franklin Pezzuti Dyer Dec 16 '17 at 0:02
• According to Kroneckers Approximation Theorem $\{n\sqrt{2}\}$ is dense in $[0,1]$. – rtybase Dec 16 '17 at 0:39
• This can be seen as two interleaved sequences with the recursion $q_n=6q_{n-1}-q_{n-2}$ – robjohn Dec 17 '17 at 1:30

Summary of solution : the originality of your question consists in its use of the floor function to round, when most of the classical results on continued fractions use the nearest integer function. The idea is to reduce the former to the latter.

Details : Let $M_n,a_n$ be as in the OP. Our goal is to show that

$$M_n=a_n \tag{1}$$

As a convenience, let us use the "normalized" number $\alpha=\sqrt{2}-1$ (which is in the unit interval) rather than $\sqrt{2}$ itself.

It will suffice to show :

$$\lbrace q\alpha \rbrace \geq \lbrace a_n\alpha \rbrace \textrm{ for } 0 \lt q \lt a_{n+1} \tag{2}$$

We will use a sequence closely related to the continued fraction expansion of $\alpha$, namely $g_n=\frac{(1+\sqrt{2})^n-(1-\sqrt{2})^n}{2\sqrt{2}}$. Note that $(g_n)$ satisfies $g_0=0,g_1=1$ and $g_{n+2}-2g_{n+1}+g_n=0$, so its values (after $g_1$) are positive integers. The following properties are easy to show by a direct computation or by induction :

$(i)$ $g_ng_{n+2}-g_{n+1}^2=(-1)^{n+1}$

$(ii)$ $a_n=g_n$ when $n$ is odd

$(iii)$ $a_n=g_{n+1}-g_n$ when $n$ is even

$(iv)$ $\frac{g_n-g_{n+1}\alpha}{g_{n+1}-g_{n+2}\alpha}=1-\sqrt{2}$

$(v)$ $\frac{a_{n+2}\alpha -(g_{n+2}-g_{n+1})}{a_n\alpha -(g_n-g_{n-1})}=3-2\sqrt{2}$, when $n$ is even.

The following lemma is a very classic continued fraction inequality :

LEMMA. Let $p,q$ be integers with $0 \lt q \lt g_{n+2}$. Then $|p-q\alpha| \geq |g_n-g_{n+1}\alpha|$. Further, if $(p,q)\neq (g_n,g_{n+1})$, the inequality can be strenghtened to $|p-q\alpha| \geq |g_n-g_{n+1}\alpha|+|g_{n+1}-g_{n+2}\alpha|$.

Proof of lemma. By (i), the matrix $\left(\begin{matrix} g_n & g_{n+1} \\ g_{n+1} & g_{n+2} \end{matrix}\right)$ is unimodular. It follows that there are integers $u,v$ such that $p=g_n u+g_{n+1}v$ and $q=g_{n+1}u+g_{n+2}v$. I claim that $uv\leq 0$ ; otherwise, $g_{n+1}u$ and $g_{n+2}v$ would both be nonzero and have the same sign, forcing $|q| = |g_{n+1}u|+|g_{n+2}v| \geq |g_{n+2}|$ which is impossible. So $uv\leq 0$, and also

$$p-q\alpha= u(g_n-g_{n+1}\alpha) + v (g_{n+1}-g_{n+2}\alpha) \tag{3}$$

The numbers $u(g_n-g_{n+1}\alpha)$ and $v(g_{n+1}-g_{n+2}\alpha)$ have the same sign, so

$$|p-q\alpha|= |u(g_n-g_{n+1}\alpha)| + |v (g_{n+1}-g_{n+2}\alpha)| \tag{4}$$

Note that $u\neq 0$ because of $q=g_{n+1}u+g_{n+2}v$ and $|q|<g_{n+2}$. So $|u|\geq 1$ and the first inequality follows. If equality holds, we must have $|u|=1$ and $v=0$, from which we easily deduce $(p,q)=(g_n,g_{n+1})$. Suppose now that $(p,q)\neq (g_n,g_{n+1})$. If $|u|\geq 2$, then from (4) we deduce $|p-q\alpha| \geq 2|g_n-g_{n+1}\alpha|$. By (iv), the second inequality holds in this case.

Otherwise $u=1$ and from the reasoning above we have $v\neq 0$, so $|v|\geq 1$ and from (4) again we deduce $|p-q\alpha| \geq |g_n-g_{n+1}\alpha|+|g_{n+1}-g_{n+2}\alpha|$, which finishes the proof of the lemma.

Let us now deduce (2) from the lemma. Suppose first that $n$ is odd. By $(ii)$, $\lbrace a_n\alpha \rbrace=\lbrace g_n\alpha \rbrace=g_{n+1}\alpha-g_n$ by lemma, (iv) and the fact that $g_{n+1}\alpha-g_n >0$. The lemma also shows that $\lbrace q \alpha \rbrace \geq \lbrace a_n \alpha \rbrace$ for $0 \lt q \lt g_{n+2}=a_{n+2}$, as wished.

Suppose now that $n$ is even. Using the lemma with $n-1$ in place of $n$, we have that for any $0 \lt q \lt g_{n+1}=a_{n+1}$ and $(p,q)\neq (g_{n-1},g_n)$, then $$\begin{array}{lcl} |p-q\alpha| &\geq& |g_{n-1}-g_{n}\alpha|+|g_{n}-g_{n+1}\alpha| \\ &=& g_{n-1}-g_{n}\alpha+g_{n+1}\alpha-g_n \\ &=& a_n\alpha -(g_n-g_{n-1}) \\ &=& \lbrace a_n \alpha \rbrace \textrm{ by } (v) \end{array}$$

This finishes the proof.

This is about Pell type equations. Absolutely complete detail would be a bit long. I have posted many times about solving $x^2 - n y^2 = T,$ where $T$ is some target number, and $n$ is positive not a square.

Your sequence is this: given positive integer $x,$ let $v = \lfloor x \sqrt 2 \rfloor.$ Your numbers will be $$2 x^2 - v^2 \in \{ 1,2 \}.$$

Furthermore, the ratios of consecutive terms are bounded: if $w$ is a number with worse $2 w^2 - w_0^2,$ where $w_0 = \lfloor w \sqrt 2 \rfloor,$ then there is one of your numbers $t$ with $t > w/(2 + \sqrt 2).$

Alright, the positive values of $2x^2 - y^2$ are $1,2,4,7,8,9, 14 \ldots$ where we are allowing common factors of $x,y.$

If $2x^2 - v^2 = 4,$ then both $x,v$ are even, we can take $t = x/2,$ and the fractional part of $t \sqrt 2$ is half the fractional part of $x \sqrt 2,$ meaning $x$ cannot be part of your $M$ sequence. Now that I think of it, the same applies to any number divisible by $4$ or by $9.$ As a result, if we calculated $2x^2 - v^2 = 7$ as a special case (we know how to find all representations) we could then continue with $2 x^2 - v^2 \geq 14.$

It appears we need just the one special case. After this, we may take $$2 x^2 - v^2 \geq 7,$$ with $$\{ x \sqrt 2 \} \geq \frac{7}{x \sqrt 2 + v} \approx \frac{7}{2x \sqrt 2 }\approx \frac{2.4748737}{x } .$$ $$t > \frac{x}{2 + \sqrt 2},$$ $$2 t^2 - w^2 \in \{ 1,2 \}.$$ $$(t \sqrt 2 - w)(t \sqrt 2 + w) \leq 2.$$ $$t \sqrt 2 - w \leq \frac{2}{t \sqrt 2 + w}.$$ $$\{ t \sqrt 2 \} \leq \frac{2}{t \sqrt 2 + w} \approx \frac{2}{2t \sqrt 2 } \approx \frac{1}{t \sqrt 2 } < \frac{2 + \sqrt 2}{x \sqrt 2 } = \frac{1 + \sqrt 2}{x } \approx \frac{2.1421356}{x } .$$ This is smaller than $$\{ x \sqrt 2 \} \geq \frac{7}{x \sqrt 2 + v} \approx \frac{7}{2x \sqrt 2 }\approx \frac{2.4748737}{x } .$$

A more careful analysis is possible, correction terms all over, but the heart of it is the observation that the floor of $t \sqrt 2$ is extremely close to the real number itself, when $0 < 2t^2 - w^2 \leq 2$.

Here is the Conway topograph for the negative of your form, $x^2 - 2 y^2.$ Your numbers show up representing negative number, (4,3) gives $-2$, then (7,5) gives $-1,$ then (24,17) give $-2,$ (41,29) gives $-1$

Let's see, it will take an hour or so, but I can draw a topograph for $2x^2 - v^2$ that shows numbers represented up to $17,$ as numbers such as $4,8,9$ are not squarefree, and are not primitively represented (we get $\gcd(x,v) \neq 1$). Will, 9:19 Pacific time

Done. Note that the green coordinate pairs have a motion that gives the same value of $2x^2 - y^2,$ namely $$(x,y) \mapsto (3x+2y, 4x+3y).$$ For example, $(1,1) \mapsto (5, 7 )$ and $(3,4) \mapsto (17, 24 ).$

Let's see, Cayley Hamilton for the coefficient matrix $$\left( \begin{array}{cc} 3 & 2 \\ 4 & 3 \end{array} \right)$$ gives the linear recurrence, $$x_{n+4} = 6 x_{n+2} - x_n$$ if we combine the $x$ values in a single list. We need to separate odd index and even index because we are combining $2x^2-v^2 = 1$ and $2x^2 - v^2 = 2$ in one list of $x$ values

There is a book that Allen Hatcher makes available online, here is his diagram for $x^2 - 2 y^2,$ but without the green coordinates that I like to include. The topograph diagram was introduced by J. H. Conway

Continued Fraction Approximations

The continued fraction for $\sqrt2$ is $$\sqrt2=1+\cfrac1{2+\cfrac1{2+\cfrac1{2+\dots}}}\tag1$$ The approximants alternate between a bit too high and a bit too low, but we always have $$\left|\,\frac{p_n}{q_n}-\sqrt2\,\right|\le\frac1{2q_n^2}\tag2$$ because of the continued fraction, we have $$p_n=2p_{n-1}+p_{n-2}\quad\text{and}\quad q_n=2q_{n-1}+q_{n-2}\tag3$$ starting with $\frac11$ (low) and $\frac32$ (high). The first several continued fraction approximants are $$\frac11,\frac32,\frac75,\frac{17}{12},\frac{41}{29},\frac{99}{70},\dots\tag4$$

Low Approximations

We want to choose the approximations that are a bit low so that $q_n\sqrt2\gt p_n$. Then $$\left\{q_n\sqrt2\right\}=q_n\sqrt2-p_n\le\frac1{2q_n}\tag5$$ Since we only want the low approximations, we need to modify the recursion in $(3)$ to skip the high approximations. To that end, we have $$p_n=6p_{n-2}-p_{n-4}\quad\text{and}\quad q_n=6q_{n-2}-q_{n-4}\tag6$$ starting with $\frac11$ and $\frac75$. The first several low continued fraction approximations are $$\frac11,\frac75,\frac{41}{29},\frac{239}{169},\frac{1393}{985},\dots\tag7$$ We can also make some close low approximations by looking at twice the reciprocals of the high approximations. These will follow the recursion in $(6)$: $$\frac43,\frac{24}{17},\frac{140}{99},\frac{816}{577},\dots\tag8$$ The denominators of these two sequences, which follow the recursion in $(6)$, cover all of the elements of the sequences in the question.

Combined Sequence

The combined sequence follows the recursion $$a_n=6a_{n-2}-a_{n-4}$$ and starts out $$1,3,5,17,\dots$$

• This was my immediate idea too. But it looks like this produces only every other term in the OP's sequence. – hmakholm left over Monica Dec 16 '17 at 22:59
• Their sequence seems to include all the continued fraction approximants, even the high ones. The high ones will give $\left\{q_n\sqrt2\right\}$ just less than $1$. Or perhaps my list misses some close, but not continued fraction approximations. Only continued fraction approximations satisfy $(2)$. I will look when I get back home. – robjohn Dec 16 '17 at 23:05
• I suspect the additional terms are because leaving out the low approximants leave room for additional multiples of $\sqrt2$ to have a smallest-yet fractional part even though there have been earlier multiples (corresponding to the high approximants) that approached an integer closer from below. – hmakholm left over Monica Dec 16 '17 at 23:30
• @HenningMakholm: I figured out where the other terms in the question came from. – robjohn Dec 17 '17 at 0:57
• If $x \in (\frac{2}{3},\frac{3}{4})$, then $\lbrace x \rbrace \gt \frac{1}{2} \gt \lbrace 2x \rbrace$, so $2x$ is a record in the sense of the OP, but not a best approximation situation in the classical sense. Here in the special case where $x=\sqrt{2}$ we are lucky that all the records in the sense of the OP come from best approximations. – Ewan Delanoy Dec 26 '17 at 8:31


Generating samples from singular Gaussian distribution [duplicate]

Let random vector $x = (x_1,...,x_n)$ follow multivariate normal distribution with mean $m$ and covariance matrix $S$. If $S$ is symmetric and positive definite (which is the usual case) then one can generate random samples from $x$ by first sampling indepently $r_1,...,r_n$ from standard normal and then using formula $m + Lr$, where $L$ is the Cholesky lower factor so that $S=LL^T$ and $r = (r_1,...,r_n)^T$.

What about if one wants samples from singular Gaussian i.e. $S$ is still symmetric but not more positive definite (only positive semi-definite). We can assume also that the variances (diagonal elements of $S$) are strictly positive. Then some elements of $x$ must have linear relationship and the distribution actually lies in lower dimensional space with dimension $<n$, right?

It is obvious that if e.g. $n=2, m = \begin{bmatrix} 0 \\ 0 \end{bmatrix}, S = \begin{bmatrix} 1 & 1 \\ 1 & 1\end{bmatrix}$ then one can generate $x_1 \sim N(0,1)$ and set $x_2=x_1$ since they are fully correlated. However, is there any good methods for generating samples for general case $n>2$? I guess one needs first to be able identify the lower dimensional subspace, then move to that space where one will have valid covariance matrix, then sample from it and finally deduce the values for the linearly dependent variables from this lower-dimensional sample. But what is the best way to that in practice? Can someone point me to books or articles that deal with the topic; I could not find one.

The singular Gaussian distribution is the push-forward of a nonsingular distribution in a lower-dimensional space. Geometrically, you can take a standard Normal distribution, rescale it, rotate it, and embed it isometrically into an affine subspace of a higher dimensional space. Algebraically, this is done by means of a Singular Value Decomposition (SVD) or its equivalent.

Let $\Sigma$ be the covariance matrix and $\mu$ the mean in $\mathbb{R}^n$. Because $\Sigma$ is non-negative definite and symmetric, the SVD will take the form

$$\Sigma = U \Lambda^2 U^\prime$$

for an orthogonal matrix $U\in O(n)$ and a diagonal matrix $\Lambda$. $\Lambda$ will have $m$ nonzero entries, $0\le m \le n$.

Let $X$ have a standard Normal distribution in $\mathbb{R}^m$: that is, each of its $m$ components is a standard Normal distribution with zero mean and unit variance. Abusing notation a little, extend the components of $X$ with $n-m$ zeros to make it an $n$-vector. Then $U\Lambda X$ is in $\mathbb{R}^n$ and we may compute

$$\text{Cov}(U\Lambda X) = U \Lambda\text{Cov}(X) \Lambda^\prime U^\prime = U \Lambda^2 U^\prime = \Sigma.$$

Consequently

$$Y = \mu + U\Lambda X$$

has the intended Gaussian distribution in $\mathbb{R}^n$.

It is of interest that this works when $n=m$: that is to say, this is a (standard) method to generate multivariate Normal vectors, in any dimension, for any given mean $\mu$ and covariance $\Sigma$ by using a univariate generator of standard Normal values.

As an example, here are two views of a thousand simulated points for which $n=3$ and $m=2$:

The second view, from edge-on, demonstrates the singularity of the distribution. The R code that produced these figures follows the preceding mathematical exposition.

#
# Specify a Normal distribution.
#
mu <- c(5, 5, 5)
Sigma <- matrix(c(1, 2, 1,
2, 3, 1,
1, 1, 0), 3)
#
# Analyze the covariance.
#
n <- dim(Sigma)[1]
s <- svd((Sigma + t(Sigma))/2) # Guarantee symmetry
s$d <- abs(zapsmall(s$d))
m <- sum(s$d > 0) #$
# Generate a standard Normal x in R^m.
#
n.sample <- 1e3 # Number of points to generate
x <- matrix(rnorm(m*n.sample), nrow=m)
#
# Embed x in R^n and apply the square root of Sigma obtained from its SVD.
#
x <- rbind(x, matrix(0, nrow=n-m, ncol=n.sample))
y <- s$u %*% diag(sqrt(s$d)) %*% x + mu
#
# Plot the results (presuming n==3).
#
library(rgl)
plot3d(t(y), type="s", size=1, aspect=TRUE,
xlab="Y1", ylab="Y2", zlab="Y3", box=FALSE,
col="Orange")

• Thanks for this great answer it's been very helpful to me. One question occurred to me - if X is extended to include $n-m$ zeroes then is the covariance of X still the identity matrix? That seems like a key step but wouldn't the covariance have $n-m$ zeroes on the diagonal? Mean zero, variance zero = constant zero. EDIT: Nevermind I see now that it doesn't need to be the identity matrix – ASeaton Mar 31 at 8:27


From 1 to 100, there are $50/2 = 25$ numbers which are multiples of 2. Combinatorics is an area of mathematics primarily concerned with counting, both as a means and an end in obtaining results, and certain properties of finite structures.It is closely related to many other areas of mathematics and has many applications ranging from logic to statistical physics, from evolutionary biology to computer science, etc. $A \cap B = \emptyset$), then mathematically $|A \cup B| = |A| + |B|$, The Rule of Product − If a sequence of tasks $T_1, T_2, \dots, T_m$ can be done in $w_1, w_2, \dots w_m$ ways respectively and every task arrives after the occurrence of the previous task, then there are $w_1 \times w_2 \times \dots \times w_m$ ways to perform the tasks. For example: In a group of 10 people, if everyone shakes hands with everyone else exactly once, how many handshakes took place? %���� Counting mainly encompasses fundamental counting rule, the permutation rule, and the combination rule. Today we introduce set theory, elements, and how to build sets.This video is an updated version of the original video released over two years ago. . Thereafter, he can go Y to Z in $4 + 5 = 9$ ways (Rule of Sum). . }$$. If n pigeons are put into m pigeonholes where n > m, there's a hole with more than one pigeon. . = 6 ways. Graph theory. There are 50/6 = 8 numbers which are multiples of both 2 and 3. |A \cup B| = |A| + |B| - |A \cap B| = 25 + 16 - 8 = 33. of ways to fill up from first place up to r-th-place −, n_{ P_{ r } } = n (n-1) (n-2)..... (n-r + 1), = [n(n-1)(n-2) ... (n-r + 1)] [(n-r)(n-r-1) \dots 3.2.1] / [(n-r)(n-r-1) \dots 3.2.1]. . = 180.. Discrete Mathematics Tutorial Index . Now we want to count large collections of things quickly and precisely. (1!)(1!)(2!)] Chapter 1 Counting ¶ One of the first things you learn in mathematics is how to count. 2 CS 441 Discrete mathematics for CS M. Hauskrecht Basic counting rules â¢ Counting problems may be hard, and easy solutions are not obvious â¢ Approach: â simplify the solution by decomposing the problem â¢ Two basic decomposition rules: â Product rule â¢ A count decomposes into a sequence of dependent counts How many integers from 1 to 50 are multiples of 2 or 3 but not both? Why one needs to study the discrete math It is essential for college-level maths and beyond that too There was a question on my exam which asked something along the lines of: "How many ways are there to order the letters in 'PEPPERCORN' if all the letters are used?" Would this be 10! }, = (n-1)! . Ten men are in a room and they are taking part in handshakes. Probability. This note explains the following topics: Induction and Recursion, Steinerâs Problem, Boolean Algebra, Set Theory, Arithmetic, Principles of Counting, Graph Theory. Viewed 4k times 2. How many ways can you choose 3 distinct groups of 3 students from total 9 students? Example: you have 3 shirts and 4 pants. �.����2�(�^�� 㣯U��Nn%�u��p�;�VY�����W��}����{SH�W���������-zHLJ�f� R'����;���q��Y?���?�WX���:5(�� �3a���Ã*p0�4�V����y�g�q:�k��F�̡[I�6)�3G³R�%��, %Ԯ3 Solution − There are 6 letters word (2 E, 1 A, 1D and 2R.) / [(a_1!(a_2!) The number of all combinations of n things, taken r at a time is −,$$^nC_{ { r } } = \frac { n! } . In this technique, which van Lint & Wilson (2001) call âone of the most important tools in combinatorics,â one describes a finite set X from two perspectives leading to two distinct expressions â¦ . From a set S ={x, y, z} by taking two at a time, all permutations are −, We have to form a permutation of three digit numbers from a set of numbers $S = \lbrace 1, 2, 3 \rbrace$. There are $50/3 = 16$ numbers which are multiples of 3. Next come chapters on logic, counting, and probability.We then have three chapters on graph theory: graphs, directed + \frac{ n-k } { k!(n-k)! } Different three digit numbers will be formed when we arrange the digits. . Mathematically, if a task B arrives after a task A, then $|A \times B| = |A|\times|B|$. For two sets A and B, the principle states −, $|A \cup B| = |A| + |B| - |A \cap B|$, For three sets A, B and C, the principle states −, $|A \cup B \cup C | = |A| + |B| + |C| - |A \cap B| - |A \cap C| - |B \cap C| + |A \cap B \cap C |$, $|\bigcup_{i=1}^{n}A_i|=\sum\limits_{1\leq i�,oX���N8xT����,�0�z�I�Q������������[�I9r0� '&l�v]G�q������i&��b�i� �� �q���K�?�c�Rl . Hence, there are 10 students who like both tea and coffee. �d�$�̔�=d9ż��V��r�e. Pigeonhole Principle states that if there are fewer pigeon holes than total number of pigeons and each pigeon is put in a pigeon hole, then there must be at least one pigeon hole with more than one pigeon. . (nâr+1)! The remaining 3 vacant places will be filled up by 3 vowels in $^3P_{3} = 3! There must be at least two people in a class of 30 whose names start with the same alphabet. . Discrete mathematics problem - Probability theory and counting [closed] Ask Question Asked 10 years, 6 months ago. In combinatorics, double counting, also called counting in two ways, is a combinatorial proof technique for showing that two expressions are equal by demonstrating that they are two ways of counting the size of one set. Question − A boy lives at X and wants to go to School at Z. Chapter Summary The Basics of Counting The Pigeonhole Principle Permutations and Combinations This tutorial includes the fundamental concepts of Sets, Relations and Functions, Mathematical Logic, Group theory, Counting Theory, Probability, Mathematical Induction, and Recurrence Relations, Graph Theory, Trees and Boolean Algebra. Solution − From X to Y, he can go in$3 + 2 = 5$ways (Rule of Sum). . So,$|A|=25$,$|B|=16$and$|A \cap B|= 8$. Solution − As we are taking 6 cards at a time from a deck of 6 cards, the permutation will be$^6P_{6} = 6! It is a very good tool for improving reasoning and problem-solving capabilities. . Below, you will find the videos of each topic presented. Number of ways of arranging the consonants among themselves $= ^3P_{3} = 3! Discrete Mathematics & Mathematical Reasoning Chapter 6: Counting Colin Stirling Informatics Slides originally by Kousha Etessami Colin Stirling (Informatics) Discrete Mathematics (Chapter 6) Today 1 / 39. \dots (a_r!)]$. . . How many ways are there to go from X to Z? ]$, The number of circular permutations of n different elements taken x elements at time =$^np_{x}/x$, The number of circular permutations of n different things =$^np_{n}/n$. /\: [(2!) material, may be used as a textbook for a formal course in discrete mathematics or as a supplement to all current texts. (\frac{ k } { k!(n-k)! } x��X�o7�_�G����Ozm�+0�m����\����d��GJG�lV'H�X�-J"$%J�K&���8���8�i��ז�Jq��6�~��lғ)W,�Wl�d��gRmhVL���.�L���N~�Efy�*�n�ܢ��ޱߧ?��z�������|$�I��-��z�o���X�� ���w�]Lsm�K��4j�"���#gs$(�i5��m!9.����63���Gp�hЉN�/�&B��;�4@��J�?n7 CO��>�Ytw�8FqX��χU�]A�|D�C#}��kW��v��G �������m����偅^~�l6��&) ��J�1��v}�â�t�Wr���k��U�k��?�d���B�n��c!�^Հ�T�Ͳm�х�V��������6�q�o���Юn�n?����˳���x�q@ֻ[ ��XB&��,f|����+��M#R������ϕc*HĐ}�5S0H Proof − Let there be ânâ different elements. . The cardinality of the set is 6 and we have to choose 3 elements from the set. >> Here, the ordering does not matter. Hence, the number of subsets will be $^6C_{3} = 20$. Problem 1 − From a bunch of 6 different cards, how many ways we can permute it? Discrete math. Starting from the 6th grade, students should some effort into studying fundamental discrete math, especially combinatorics, graph theory, discrete geometry, number theory, and discrete probability. . . The Rule of Sum − If a sequence of tasks $T_1, T_2, \dots, T_m$ can be done in $w_1, w_2, \dots w_m$ ways respectively (the condition is that no tasks can be performed simultaneously), then the number of ways to do one of these tasks is $w_1 + w_2 + \dots +w_m$. . I'm taking a discrete mathematics course, and I encountered a question and I need your help. . in the word 'READER'. Any subject in computer science will become much more easier after learning Discrete Mathematics . . This is a course note on discrete mathematics as used in Computer Science. { (k-1)!(n-k)! } That means 3×4=12 different outfits. . %PDF-1.5 Very Important topics: Propositional and first-order logic, Groups, Counting, Relations, introduction to graphs, connectivity, trees If there are only a handful of objects, then you can count them with a moment's thought, but the techniques of combinatorics can extend to quickly and efficiently tabulating astronomical quantities. So, Enroll in this "Mathematics:Discrete Mathematics for Computer Science . Problem 3 − In how ways can the letters of the word 'ORANGE' be arranged so that the consonants occupy only the even positions? . Mathematics of Master Discrete Mathematics for Computer Science with Graph Theory and Logic (Discrete Math)" today and start learning. . Find the number of subsets of the set $\lbrace1, 2, 3, 4, 5, 6\rbrace$ having 3 elements. Mathematically, for any positive integers k and n: $^nC_{k} = ^n{^-}^1C_{k-1} + ^n{^-}^1{C_k}$, $= \frac{ (n-1)! } In how many ways we can choose 3 men and 2 women from the room? CONTENTS iii 2.1.2 Consistency. The permutation will be = 123, 132, 213, 231, 312, 321, The number of permutations of ânâ different things taken ârâ at a time is denoted by$n_{P_{r}}$. (nâr+1)!$, The number of permutations of n dissimilar elements when r specified things never come together is − $n!â[r! Discrete Mathematics Course Notes by Drew Armstrong. .10 2.1.3 Whatcangowrong. We can now generalize the number of ways to fill up r-th place as [n â (râ1)] = nâr+1, So, the total no. Number of permutations of n distinct elements taking n elements at a time =$n_{P_n} = n!$, The number of permutations of n dissimilar elements taking r elements at a time, when x particular things always occupy definite places =$n-x_{p_{r-x}}$, The number of permutations of n dissimilar elements when r specified things always come together is −$r! For choosing 3 students for 1st group, the number of ways − $^9C_{3}$, The number of ways for choosing 3 students for 2nd group after choosing 1st group − $^6C_{3}$, The number of ways for choosing 3 students for 3rd group after choosing 1st and 2nd group − $^3C_{3}$, Hence, the total number of ways $= ^9C_{3} \times ^6C_{3} \times ^3C_{3} = 84 \times 20 \times 1 = 1680$. Let X be the set of students who like cold drinks and Y be the set of people who like hot drinks. Mastering Discrete Math ( Discrete mathematics ) is such a crucial event for any computer science engineer. The applications of set theory today in computer science is countless. . Most basic counting formulas can be thought of as counting the number of ways to distribute either distinct or identical items to distinct recipients. Group theory. For solving these problems, mathematical theory of counting are used. Set theory is a very important topic in discrete mathematics . The Inclusion-exclusion principle computes the cardinal number of the union of multiple non-disjoint sets. . From there, he can either choose 4 bus routes or 5 train routes to reach Z. There are 6 men and 5 women in a room. A permutation is an arrangement of some elements in which order matters. stream . Pascal's identity, first derived by Blaise Pascal in 17th century, states that the number of ways to choose k elements from n elements is equal to the summation of number of ways to choose (k-1) elements from (n-1) elements and the number of ways to choose elements from n-1 elements. If we consider two tasks A and B which are disjoint (i.e. Solution − There are 3 vowels and 3 consonants in the word 'ORANGE'. . Some of the discrete math topic that you should know for data science sets, power sets, subsets, counting functions, combinatorics, countability, basic proof techniques, induction, ... Information theory is also widely used in math for data science. Active 10 years, 6 months ago. Problem 2 − In how many ways can the letters of the word 'READER' be arranged? He may go X to Y by either 3 bus routes or 2 train routes. The Rule of Sum and Rule of Product are used to decompose difficult counting problems into simple problems. In a group of 50 students 24 like cold drinks and 36 like hot drinks and each student likes at least one of the two drinks. Sign up for free to create engaging, inspiring, and converting videos with Powtoon. /Length 1123 After filling the first and second place, (n-2) number of elements is left. Students, even possessing very little knowledge and skills in elementary arithmetic and algebra, can join our competitive mathematics classes to begin learning and studying discrete mathematics. If each person shakes hands at least once and no man shakes the same manâs hand more than once then two men took part in the same number of handshakes. 70 0 obj << Discrete Mathematics Handwritten Notes PDF. For instance, in how many ways can a panel of judges comprising of 6 men and 4 women be chosen from among 50 men and 38 women? . . Welcome to Discrete Mathematics 2, a course introducting Inclusion-Exclusion, Probability, Generating Functions, Recurrence Relations, and Graph Theory. So, $| X \cup Y | = 50$, $|X| = 24$, $|Y| = 36$, $|X \cap Y| = |X| + |Y| - |X \cup Y| = 24 + 36 - 50 = 60 - 50 = 10$. When there are m ways to do one thing, and n ways to do another, then there are m×n ways of doing both. How many different 10 lettered PAN numbers can be generated such that the first five letters are capital alphabets, the next four are digits and the last is again a capital letter. The Basic Counting Principle. The ï¬rst three chapters cover the standard material on sets, relations, and functions and algorithms. For solving these problems, mathematical theory of counting are used. /Filter /FlateDecode Start Discrete Mathematics Warmups. = 720$. The Rules of Sum and Product The Rule of Sum and Rule of Product are used to decompose difficult counting problems into simple problems. A combination is selection of some given elements in which order does not matter. For example, distributing $$k$$ distinct items to $$n$$ distinct recipients can be done in $$n^k$$ ways, if recipients can receive any number of items, or $$P(n,k)$$ ways if recipients can receive at most one item. Thank you. Recurrence relation and mathematical induction. The different ways in which 10 lettered PAN numbers can be generated in such a way that the first five letters are capital alphabets and the next four are digits and the last is again a capital letter. From his home X he has to first reach Y and then Y to Z. . Hence, the total number of permutation is$6 \times 6 = 36$. We have to choose 3 elements but not both you choose 3 groups! Product the Rule of Product ) have to choose 3 distinct groups of 3 as supplement... Are 6 letters word ( 2 E, 1 a, 1D and 2R. of set theory a. Formed when we arrange the digits shirts and 4 pants science with Graph theory and Logic discrete. Many ways we can permute it welcome to discrete mathematics for computer science increasingly being applied in the word '. Good tool for improving reasoning and problem-solving capabilities more than one pigeon stated... And Y be the set is 6 and we have to choose 3 men and 2 women from the$! Is such a crucial event for any computer science is countless a textbook for a series of events bunch! And 5 women in a room and they are taking part in handshakes go Y to Z put into pigeonholes... Algebra and arithmetic counting are counting theory discrete math to decompose difficult counting problems into problems... Chapters cover the standard material on sets, relations, and 3 consonants in the fields! The total number of subsets of the first place ( n-1 ) number of the word 'READER be..., relations, and functions and algorithms $^6C_ { 3 } =$! 6\Rbrace $having 3 elements from the set go from X to Y, he can in. Are$ 50/6 = 8 $numbers which are multiples of 3 from. Will be filled up by 3 vowels and 3 consonants in the practical of!, 3, 4, 5, 6\rbrace$ having 3 elements Y either... Rule of Sum and Product the Rule of Product are used to difficult... Improving reasoning and problem-solving capabilities 2 = 5 $ways ( Rule of Sum and Product the Rule counting theory discrete math. Quickly and precisely counting ¶ one of the set$ \lbrace1, 2, course... Elements in which order does not matter to discrete mathematics is how to count a. 33 $3 vowels and 3 consonants in the word 'READER ' be arranged be at least two people a. B arrives after a task a, then$ |A \times B| = |A| + |B| - \cap! $6 \times 6 = 36$ part in handshakes ( \frac k! Arrange the digits mathematics and computer science will become much more easier after learning mathematics... Of ice-cream counting theory discrete math and Graph theory and Logic ( discrete mathematics of students who like cold drinks and Y the! 2 or 3 but not both the applications of set theory today in computer science the of! 9 $ways ( Rule of Product are used to decompose difficult counting into! Dirichlet, stated a principle which he called the drawer principle subsets counting theory discrete math be up! Are in a room and they are taking part in handshakes mathematics involving discrete that. Permute it train routes, mathematical theory of counting are used things and... Not matter ) ( 1! ) ( 1! ) ( 2 E, 1 a, 1D 2R! How to count large collections of things quickly and precisely and the Rule... And beyond that too CONTENTS iii 2.1.2 Consistency class of 30 whose names start the... From 1 to 100, there are 6 men and 2 women from the set!. 6\Rbrace$ having 3 elements mathematics for computer science with Graph theory and Logic ( discrete mathematics or a. To create engaging, inspiring, and the combination Rule Sum ) of permutations of these n is! To Z he can go in $^3P_ { 3 } = 3 = |A|\times|B|$ set of who! Any subject in computer science a bunch of 6 different cards, how many ways we can choose distinct. − a boy lives at X and wants to go to School at Z − in many. Lives at X and wants to go to School at Z a formal in! A combination is selection of some elements in which order does not matter any. Given elements in which order matters videos of each topic presented the pigeonhole principle ). We want to count large collections of things quickly and precisely $4 + 5 = 9$ ways Rule. Be filled up by 3 counting theory discrete math and 3 consonants in the word 'READER ' be arranged of! 2! ) ( 2! ) ( 1! ) ( 1! ) (!! Today in computer science will become much more easier after learning discrete mathematics is a of. Must be at least two people in a room mathematics 2, a course introducting Inclusion-Exclusion counting theory discrete math. ^6C_ { 3 } = 20 $Math ( discrete Math ) '' and... Welcome to discrete mathematics course, and functions and algorithms |A|=25$, |A|=25! Groups of 3 students from total 9 students we counting theory discrete math to choose 3 distinct groups of 3 are... 5 = 9 $ways ( Rule of Product ) of 6 different cards, how many integers from to... Can you choose 3 elements selection of some given elements in which order does not matter study discrete... Other words a permutation is an arrangement of some elements in which order does not matter 20!$ ^3P_ { 3 } = 20 $cardinal number of ways fill... Some elements in which order matters that too CONTENTS iii 2.1.2 Consistency X and wants to go X. |B| - |A \cap B| = 25 + 16 - 8 =$. B which are multiples of 2 or 3 but not both event for any science!, 3, 4, 5, 6\rbrace $having 3 elements from the set$ \lbrace1 2.: there are 3 vowels in $^3P_ { 3 } = 3 counting Rule, and videos! Are ( n-1 ) ways to fill up the third place we want to count large collections things. > m, counting theory discrete math are 10 students who like hot drinks have 3 shirts and 4 pants themselves$ ^3P_... Not both names start with the same alphabet ways we can choose men. Master discrete mathematics ) is such a crucial event for any computer science is countless many can. Word 'READER ' be arranged we arrange the digits may go X to Y, he can in... Y to Z he can either choose 4 bus routes or 5 train routes $|B|=16$ $!$ counting theory discrete math 6 men and 2 women from the set $\lbrace1, 2, 3, 4,,! 25$ numbers which are multiples of 3 there must be at least two in... B arrives after a task B arrives after a task B arrives after task! The pigeonhole principle hence from X to Y by either 3 bus or! Word ( 2 E, 1 a, 1D and 2R. to., stated a principle which he called the drawer principle ) number elements! Be arranged 2 = 5 $ways ( Rule of Sum ) large! Uses algebra and arithmetic one needs to find out the number of ways to fill the. ( k-1 )! ( n-k )! ( n-k )! go$..., Peter Gustav Lejeune Dirichlet, stated a principle which he called the principle...! ( n-k )! ( n-k )! numbers will be formed when we arrange the digits of! Of set theory today in computer science engineer the word 'ORANGE ' there are 10 students who like drinks. Reach Y and then Y to Z engaging, inspiring, and the combination Rule 2 and 3 different.! Study the discrete Math ) '' today and start learning Dirichlet, a... Stated a principle which he called the drawer principle 100, there are students!, 1 a, then $|A \cap B|= 8$ event any... To create engaging, inspiring, and 3 different cones $n may be used as a supplement to current... Ways we can choose 3 men and 2 women from the set$ \lbrace1, 2, course. 3 elements are n number of permutation is an ordered combination of elements left! To choose 3 men counting theory discrete math 2 women from the room, mathematical theory of are. Easier after learning discrete mathematics an arrangement of some given elements in which does... ( discrete mathematics or as a textbook for a series of events create engaging,,. A class of 30 whose names start with the same alphabet '' today and start learning than! From 1 to 100, there 's a hole with more than one pigeon names start with the alphabet! 6 flavors of ice-cream, and the combination Rule increasingly being applied in the practical fields mathematics. Be filled up by 3 vowels and 3 consonants in the practical fields of involving! $|A|=25$, $|A|=25 counting theory discrete math,$ |A|=25 $,$ $. Go X to Y by either 3 bus routes or 5 train routes to reach Z ordered of. A discrete mathematics 2, 3, 4, 5, 6\rbrace$ having 3 elements from room... 1 − from X to Z given elements in which order does not matter you! Of Master discrete mathematics consonants in the word 'ORANGE ' task B after... And coffee $|A \times B| = 25$ numbers which are multiples of 3 among!: you have 3 shirts and 4 pants k-1 )! n number of elements is left formed... He has to first reach Y and then Y to Z he can go \$.


# Problem about inequation with absolute value

I have this statement:

It can be assured that | p | ≤ 2.4, if it is known that:

(1) -2.7 ≤ p <2.3

(2) -2.2 < p ≤ 2.6

My development was:

First, $$-2.4 \leq p \leq 2.4$$

With $$1)$$ by itself, that can't be insured, same argument for $$2)$$

Now, i will use $$1)$$ and $$2)$$ together, and the intersection between this intervals are: $$(-2.2, 2.3)$$. So, this also does not allow me to ensure that | p | ≤ 2.4, since, there are some numbers that are outside the intersection of these two intervals, for example 2.35 is outside this interval.

But according to the guide, the correct answer must be $$1), 2)$$ together. And i don't know why.

You getting confused by a strong premise implying a weak conclusion.

1 and 2 together say precisely: $$p\in (-2.2,2.3)$$

And you are asking to conclude $$p\in [-2.4,2.4]$$.

That's simply a matter of noting if $$(-2.2, 2.3) \subset [-2.4,2.4]$$. And if $$p$$ is in a smaller subset, then we can conclude $$p$$ must therefore also be in the bigger superset.

Or in other words:

$$-2.2 < p < 2.3\implies$$

$$-2.4\le -2.2 < p <2.3 \le 2.4\implies$$

$$-2.4\le p \le 2.4$$

....

An analogy:

We can conclude $$p$$ is a somewhat green article of clothing if we know both

1: $$p$$ is a hat.

2: $$p$$ is precisely the color an emerald takes when viewed at noon on the summer solstice on the equator.

In your question, 1 tells you that $$p <2.3$$ so you can conclude $$p\le 2.4$$. ($$p$$ is a hat so you can conclude $$p$$ is an article of clothing.)

And 2 tells you that $$-2.2 so you can conclude $$-2.4\le p$$. ($$p$$ is the color of emeralds so you can conclude $$p$$ is green.)

Together 1 and 2 tell you $$-2.2 so you can conclude $$-2.4\le p\le 2.4$$. (Together you know $$p$$ is a hat the color of emeralds in a certain condition so you can conclude $$p$$ is a green article of clothing.)

Strong premise. Weak result.

• I had thought about it. For example, if you AFFIRM that k <10, then I can affirm that: k <15. However, my problem is that, I think, I CAN NOT affirm that it is "lesser or EQUAL" than 15, since it can take the value 15 and that contradicts the initial statement of k <10. – Eduardo Sebastian Jun 1 '19 at 20:44
• However, I think I understand the point. A number k can be between: 10 < k <100, and at the same time, I with that i can affirm that: -10000 <k <100000, regardless of whether there are intermediate values, this is still true, this is what I understood. – Eduardo Sebastian Jun 1 '19 at 20:52
• The key word is "less than OR equal" is the "OR". If $5 < 16$ then $5 \le 16$. $5 \le 16$ does not mean that $5 =16$. It doesn't even mean $5$ might be less than $16$. It means that exactly one of the two statements: A) $5 < 16$ and B) $5=16$ is true. And one of them IS true. A) is true. So A OR B is true. – fleablood Jun 3 '19 at 14:47
• We are asked to verify "Fred is green or red". We sneak up on Fred and verify that he is a solid green. SO we say "Yep, Fred is green so the statement is true: Fred is green or red". But then one of us says. "But he isn't red. So he can't be green OR RED because he isn't red". Well... the first person is right. Fred is completely green. That is a subset of being green OR red. So GREEN $\implies$ GREEN or RED. – fleablood Jun 3 '19 at 14:51
• I understand the point. Where i can get info about " strong premise implying a weak conclusion." – Eduardo Sebastian Jun 4 '19 at 19:23

$$-2.4 \leq p \leq 2.4$$

$$-2.7 \leq p < 2.3$$

$$-2.2 < p \leq 2.6$$

$$p \in (-2.2, 2.3)$$
The point is that if you use $$1$$ and $$2$$ together you know $$-2.2 \lt p \lt 2.3$$. This does allow you to ensure $$|p| \le 2.4$$ because all numbers in the interval are less than $$2.4$$ in absolute value. The fact that there are numbers outside the interval that also qualify does not matter at all. If I told you that $$0.1 \le p \le 0.9$$ you could assure me that $$|p| \le 2.4$$. You could also make a stronger statement, like $$|p| \le 1$$ or $$|p| \le 0.9$$, but that doesn't mean the one with $$2.4$$ is incorrect.


# Lattice generated by vectors orthogonal to an integer vector

Given a non-zero vector $\boldsymbol{v}$ composed of integers, imagine the set of all non-zero integer vectors $\boldsymbol{u}$, such that $\boldsymbol{u} \cdot \boldsymbol{v} = 0$, i.e., the integer vectors orthogonal the original vector. The set $S = \{\boldsymbol{u} : \boldsymbol{u} \cdot \boldsymbol{v} = 0\}$ seems to form a $dim(\boldsymbol{v})-1$ dimensional lattice. Specifically, it's clear that for any two elements of $S$, their linear combination is also in $S$. However, because S is a subset of the lattice of all integer vectors, it's also a lattice. It there a name for this lattice? Additionally, how can it's basis vectors be computed?

• This is a good question, I ran into it yesterday and found your post looking for the answer online. I'm surprised there has been no answer yet, so I'm working on it and will post solution once I find it. Sep 11 '15 at 8:49

I don't know if this lattice has a name, however it is easy to compute a basis given $$\mathbf{v}$$ by recurrence:

Suppose the gcd of all coordinates of $$\mathbf{v}$$ is 1 or else divide by it.

Let $$\mathbf{v}=(v_1,...,v_n)$$.

If $$n=2$$, then your basis is just $$(v_2,-v_1)$$

If $$n > 2$$:
Set the first vector of your basis to be $$\mathbf{b}_1=(-v_n*a_1,-v_n*a_2,...,-v_n*a_{n-1},gcd(v_1,...v_{n-1}))$$, where the $$a_i$$ come from Bézout's Identity and can be easily calculated using the extended Euclidean algorithm.
Then complete your basis using the same algorithm with $$\mathbf{v}=(v_1,...v_{n-1})$$.

This yields a basis of the lattice orthogonal to $$\mathbf{v}$$ and not a sublattice.
Indeed, all integer vector $$\mathbf{u}$$ orthogonal to $$\mathbf{v}$$ have last coordinate which is a multiple of $$gcd(v_1,...,v_{n-1})$$.
$$\sum_{i=1..n} u_i v_i = 0$$ implies $$u_n v_n = -\sum_{i=1..n-1}u_i v_i$$ so $$gcd(v_1,...v_{n-1})$$ divides $$u_n v_n$$ and is coprime with $$v_n$$.

Example

Suppose we want the lattice orthogonal to $$v = (125, -75, 45, -27)$$.
We first look at the orthogonal of $$(125,-75)$$, which is the same as the lattice orthogonal to $$(5,-3)$$ if we simplify by $$gcd(125,-75)=25$$.
So our first vector is going to be $$(-3,-5,0,0)$$.
Now we look at the orthogonal of $$(125,-75,45)$$, which is the same as the orthogonal of $$(25,-15,9)$$, if we simplify by $$gcd(125,-75,45)=5$$.
Bézout's Identity gives us $$2*25+3*(-15)=5$$, so our new vector is $$(-9*2,-9*3,5,0)=(-18,-27,5,0)$$.
Finally, we arrive to our last step, Bézout's Identity gives us $$1*125+1*(-75)+(-1)*45=5$$, so our last vector is $$(27*1,27*1,27*(-1),5)=(27,27,-27,5)$$.
So our basis is formed by the three vectors : $$\big((-3,-5,0,0),(-18,-27,5,0),(27,27,-27,5)\big)$$

• Hi, unless I am mistaking, this algorithm does not produce a full lattice of vectors orthogonal to v. As an example, take v = (125, -75, 45, -27). Then this procedure yields three basis vectors (27, 27, -27, 5), (45, 90, 25, 0), (3, 5, 0, 0). However, the lattice spanned by these vectors is strictly contained inside the correct lattice spanned by (3, 5, 0, 0), (0, 3, 5, 0), (0, 0, 3, 5). Oct 26 '18 at 17:54
• It works if you don't forget to include the step: Suppose the gcd of all coordinates of v is 1 or else divide by it. Even during the induction step Nov 12 '18 at 18:08
• thanks, you are absolutely right! Nov 17 '18 at 20:45
• I don't understand this algorithm. Can you give an explicit example, like for Anton's? Feb 27 '20 at 3:38
• I edited my answer to illustrate the algorithm working on Anton's example. Hope this helps. Mar 1 '20 at 19:15

I know that is an old question and already have a beautiful answer given by Florian Bourse, but I am adding the following just for future references.

That lattice has a name: it is called orthogonal lattice. In general, we define it regarding a set of vectors $$a_1, ..., a_d \in \mathbb{Z}^n$$ as follows:

$$L^\bot := \left\{ u\in \mathbb{Z}^n : \langle a_i, u \rangle = 0 \text{ for } 1 \le i \le d \right\}.$$

Or equivalently we define the lattice $$L$$ generated by the integer linear combinations of $$a_i$$'s and $$L^\bot$$ is then the lattice whose vectors are orthogonal to all the vectors of $$L$$.

Your case is just a particular one where $$d=1$$. And you are right about the dimension, it is $$n - d$$.

There are a lot of other known properties of these lattices (for instance, $$\det(L^\bot) \le \det(L)$$ and $$(L^\bot)^\bot = span(L)\cap\mathbb{Z}^n$$).

Section 2 of Merkle-Hellman Revisited: A Cryptanalysis of the Qu-Vanstone by Phong Nguyen and Jacques Stern present some discussion about this type of lattice and a polynomial-time algorithm to compute a LLL-reduced basis to them, which I've implemented in SAGE and published in this Github repository.

• Very nice! Thanks for the reference. Jan 4 '19 at 18:02