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)
 
Thread 'Video on imaginary numbers and some queries'
Hi, I was watching the following video. I found some points confusing. Could you please help me to understand the gaps? Thanks, in advance! Question 1: Around 4:22, the video says the following. So for those mathematicians, negative numbers didn't exist. You could subtract, that is find the difference between two positive quantities, but you couldn't have a negative answer or negative coefficients. Mathematicians were so averse to negative numbers that there was no single quadratic...
Insights auto threads is broken atm, so I'm manually creating these for new Insight articles. In Dirac’s Principles of Quantum Mechanics published in 1930 he introduced a “convenient notation” he referred to as a “delta function” which he treated as a continuum analog to the discrete Kronecker delta. The Kronecker delta is simply the indexed components of the identity operator in matrix algebra Source: https://www.physicsforums.com/insights/what-exactly-is-diracs-delta-function/ by...
Thread 'Unit Circle Double Angle Derivations'
Here I made a terrible mistake of assuming this to be an equilateral triangle and set 2sinx=1 => x=pi/6. Although this did derive the double angle formulas it also led into a terrible mess trying to find all the combinations of sides. I must have been tired and just assumed 6x=180 and 2sinx=1. By that time, I was so mindset that I nearly scolded a person for even saying 90-x. I wonder if this is a case of biased observation that seeks to dis credit me like Jesus of Nazareth since in reality...

Similar threads

Back
Top