MHB Counting Squares Challenge: Proving Formula and Evaluating Sum

AI Thread Summary
The discussion centers on the formula for counting squares in an n x n grid of dots, where it is proven that the number of squares, including those with diagonal sides, is given by s_n = (n^4 - n^2) / 12. The proof utilizes mathematical induction, breaking down the number of squares based on their positions in the grid. Additionally, the sum S = ∑(1/s_k) from k=2 to infinity is evaluated, resulting in S = 21 - 2π^2 after applying partial fraction decomposition and recognizing a telescoping series. The calculations demonstrate a clear relationship between the grid size and the total number of squares formed.
lfdahl
Gold Member
MHB
Messages
747
Reaction score
0
We have an $n \times n$ square grid of dots ($n \ge 2$).

Let $s_n$ denote the number of squares that can be constructed from the grid points.

(a). Show, that $$s_n = \frac{n^4-n^2}{12}.$$

Note, that squares with "diagonal sides" also count.

(b). Evaluate the sum:

\[S = \sum_{k = 2}^{\infty }\frac{1}{s_k}\]
 
Last edited:
Mathematics news on Phys.org
lfdahl said:
We have an $n \times n$ square grid of dots ($n \ge 2$).

Let $s_n$ denote the number of squares that can be constructed from the grid points.

(a). Show, that $$s_n = \frac{n^4-n^2}{12}.$$

Note, that squares with "diagonal sides" also count.

(b). Evaluate the sum:

\[S = \sum_{k = 2}^{\infty }\frac{1}{s_k}\]
(a)
[sp]Proving the formula for $s_n$ by induction, the base case $s_2 = 1$ is easy to check.

For the inductive step, label the rows and columns from $1$ to $n$. Then $s_{n-1}$ is the number of squares whose vertices are all in the first $n-1$ rows and columns of the $n\times n$ grid. Let $u_n$ be the number of squares with at least one vertex in column $n$, and let $v_n$ be the number of squares with no vertices in column $n$ but at least one vertex in row $n$. Then $s_n = s_{n-1} + u_n + v_n.$

[TIKZ][scale=0.5]
\foreach \x in {1,...,8}
\foreach \y in {1,...,8}
{
\fill [gray] (\x,\y) circle (2pt) ;
\draw (\x,0) node{$\x$} ;
\draw (0,\y) node{$\y$} ;
}
\draw[thin,gray,dashed] (1,7.5) -- (7.5,7.5) ;
\draw[thin,gray,dashed] (7.5,1) -- (7.5,8.2) ;
\foreach \x in {3,...,7}
\foreach \y in {1,...,3}
\fill [red] (\x,\y) circle (3pt) ;
\draw[thin,red] (8,3) -- (3,1) -- (1,6) -- (6,8) -- cycle ;
\draw[thin,red] (8,3) -- (5,3) -- (5,6) -- (8,6) -- cycle ;
\fill [blue] (8,3) circle (3pt) ;
[/TIKZ]
To calculate $u_n$, notice that the number of squares whose lowest vertex in column $n$ is at the point $(n,k)$ is $k(n-k)$. [In the above diagram, $n=8$, $k=3$, so $(n,k)$ is the blue dot. The possible locations for the lowest of the remaining three vertices are the red dots. Two of the resulting squares are shown in red. There are $k(n-k) = 3\times5$ red squares in this case. They are the dots in rows $1$ to $k$ and columns $k$ to $n-1$.]

Therefore $$u_n = \sum_{k=1}^{n-1}k(n-k) = \tfrac12n^2(n-1) - \tfrac16(n-1)n(2n-1) = \tfrac16n(n-1)(n+1).$$

The next step is to find $v_n$. Every square that counts towards $v_n$ must lie in the $(n-1)\times(n-1)$ grid consisting of rows $2$ to $n$ and columns $1$ to $n-1$ of the $n\times n$ grid. We are looking for the number of squares with at least one vertex in the top row of this $(n-1)\times(n-1)$ grid. The calculation for that is exactly the same as that for $u_{n-1}$. Therefore $v_n = u_{n-1} = \frac16(n-1)(n-2)n$.

Now for the actual inductive step. Assume that $s_{n-1} = \tfrac1{12}\bigl((n-1)^4 - (n-1)^2\bigr) = \tfrac1{12}(n-1)^2n(n-2).$ Then $$\begin{aligned}s_n &= s_{n-1} + u_n + v_n \\ &= \tfrac1{12}n(n-1)^2(n-2) + \tfrac16n(n-1)(n+1) + \tfrac 16n(n-1)(n-2) \\ &= \tfrac1{12}n(n-1)\bigl((n-1)(n-2) + 2(n+1) + 2(n-2)\bigr) \\ &= \tfrac1{12}n(n-1)(n^2+n) \\ &= \tfrac1{12}n^2(n-1)(n+1) = \tfrac1{12}(n^4 - n^2), \end{aligned}$$ as required. That completes the inductive proof.[/sp]

(b)
[sp]$$\frac{1}{s_k} = \frac{12}{k^2(k-1)(k+1)} = -\frac{12}{k^2} + \frac6{k-1} - \frac6{k+1},$$ using partial fractions. Therefore $$S = \sum_{k = 2}^{\infty }\frac{1}{s_k}= -\sum_{k=2}^\infty \frac{12}{k^2} + \sum_{k=2}^\infty\Bigl(\frac6{k-1} - \frac6{k+1}\Bigr).$$ For the first of those sums, use the famous result $$\sum_{k=1}^\infty \frac1{k^2} = \frac{\pi^2}6,$$ so that $$\sum_{k=2}^\infty \frac{12}{k^2} = 2\pi^2 - 12$$. The second sum is a telescoping series in which only the early terms $6+3$ survive cancellation. So $S = - (2\pi^2 - 12) + 9 = 21 - 2\pi^2.$

[/sp]
 
Last edited:
Opalg said:
(a)
[sp]Proving the formula for $s_n$ by induction, the base case $s_2 = 1$ is easy to check.

For the inductive step, label the rows and columns from $1$ to $n$. Then $s_{n-1}$ is the number of squares whose vertices are all in the first $n-1$ rows and columns of the $n\times n$ grid. Let $u_n$ be the number of squares with at least one vertex in column $n$, and let $v_n$ be the number of squares with no vertices in column $n$ but at least one vertex in row $n$. Then $s_n = s_{n-1} + u_n + v_n.$

[TIKZ][scale=0.5]
\foreach \x in {1,...,8}
\foreach \y in {1,...,8}
{
\fill [gray] (\x,\y) circle (2pt) ;
\draw (\x,0) node{$\x$} ;
\draw (0,\y) node{$\y$} ;
}
\draw[thin,gray,dashed] (1,7.5) -- (7.5,7.5) ;
\draw[thin,gray,dashed] (7.5,1) -- (7.5,8.2) ;
\foreach \x in {3,...,7}
\foreach \y in {1,...,3}
\fill [red] (\x,\y) circle (3pt) ;
\draw[thin,red] (8,3) -- (3,1) -- (1,6) -- (6,8) -- cycle ;
\draw[thin,red] (8,3) -- (5,3) -- (5,6) -- (8,6) -- cycle ;
\fill [blue] (8,3) circle (3pt) ;
[/TIKZ]
To calculate $u_n$, notice that the number of squares whose lowest vertex in column $n$ is at the point $(n,k)$ is $k(n-k)$. [In the above diagram, $n=8$, $k=3$, so $(n,k)$ is the blue dot. The possible locations for the lowest of the remaining three vertices are the red dots. Two of the resulting squares are shown in red. There are $k(n-k) = 3\times5$ red squares in this case. They are the dots in rows $1$ to $k$ and columns $k$ to $n-1$.]

Therefore $$u_n = \sum_{k=1}^{n-1}k(n-k) = \tfrac12n^2(n-1) - \tfrac16(n-1)n(2n-1) = \tfrac16n(n-1)(n+1).$$

The next step is to find $v_n$. Every square that counts towards $v_n$ must lie in the $(n-1)\times(n-1)$ grid consisting of rows $2$ to $n$ and columns $1$ to $n-1$ of the $n\times n$ grid. We are looking for the number of squares with at least one vertex in the top row of this $(n-1)\times(n-1)$ grid. The calculation for that is exactly the same as that for $u_{n-1}$. Therefore $v_n = u_{n-1} = \frac16(n-1)(n-2)n$.

Now for the actual inductive step. Assume that $s_{n-1} = \tfrac1{12}\bigl((n-1)^4 - (n-1)^2\bigr) = \tfrac1{12}(n-1)^2n(n-2).$ Then $$\begin{aligned}s_n &= s_{n-1} + u_n + v_n \\ &= \tfrac1{12}n(n-1)^2(n-2) + \tfrac16n(n-1)(n+1) + \tfrac 16n(n-1)(n-2) \\ &= \tfrac1{12}n(n-1)\bigl((n-1)(n-2) + 2(n+1) + 2(n-2)\bigr) \\ &= \tfrac1{12}n(n-1)(n^2+n) \\ &= \tfrac1{12}n^2(n-1)(n+1) = \tfrac1{12}(n^4 - n^2), \end{aligned}$$ as required. That completes the inductive proof.[/sp]

(b)
[sp]$$\frac{1}{s_k} = \frac{12}{k^2(k-1)(k+1)} = -\frac{12}{k^2} + \frac6{k-1} - \frac6{k+1},$$ using partial fractions. Therefore $$S = \sum_{k = 2}^{\infty }\frac{1}{s_k}= -\sum_{k=2}^\infty \frac{12}{k^2} + \sum_{k=2}^\infty\Bigl(\frac6{k-1} - \frac6{k+1}\Bigr).$$ For the first of those sums, use the famous result $$\sum_{k=1}^\infty \frac1{k^2} = \frac{\pi^2}6,$$ so that $$\sum_{k=2}^\infty \frac{12}{k^2} = 2\pi^2 - 12$$. The second sum is a telescoping series in which only the early terms $6+3$ survive cancellation. So $S = - (2\pi^2 - 12) + 9 = 21 - 2\pi^2.$

[/sp]

Thankyou very much, Opalg for an exemplary contribution!(Handshake)
 
Fermat's Last Theorem has long been one of the most famous mathematical problems, and is now one of the most famous theorems. It simply states that the equation $$ a^n+b^n=c^n $$ has no solutions with positive integers if ##n>2.## It was named after Pierre de Fermat (1607-1665). The problem itself stems from the book Arithmetica by Diophantus of Alexandria. It gained popularity because Fermat noted in his copy "Cubum autem in duos cubos, aut quadratoquadratum in duos quadratoquadratos, et...
Suppose ,instead of the usual x,y coordinate system with an I basis vector along the x -axis and a corresponding j basis vector along the y-axis we instead have a different pair of basis vectors ,call them e and f along their respective axes. I have seen that this is an important subject in maths My question is what physical applications does such a model apply to? I am asking here because I have devoted quite a lot of time in the past to understanding convectors and the dual...
Thread 'Imaginary Pythagorus'
I posted this in the Lame Math thread, but it's got me thinking. Is there any validity to this? Or is it really just a mathematical trick? Naively, I see that i2 + plus 12 does equal zero2. But does this have a meaning? I know one can treat the imaginary number line as just another axis like the reals, but does that mean this does represent a triangle in the complex plane with a hypotenuse of length zero? Ibix offered a rendering of the diagram using what I assume is matrix* notation...

Similar threads

Back
Top