nxn square within an mxm square

246 Views Asked by At

How would we find the number of ways of placing an nxn square within an mxm square? For example, say we had a 3x3 square. There are 4 ways of placing a 2x2 square within this 3x3 square. Likewise, there are 784 ways of placing a 5x5 square within a 32x32 square. Please see the image below for what exactly is meant by a 'square'.

enter image description here

2

There are 2 best solutions below

0
On BEST ANSWER

Consider first fixing the movement to one particular row. You can move $m-(n-1) = m -n + 1$ ways. The same argument holds for the number of columns: $m - n + 1$. You then multiply the two together to get the resulting:

$$\begin{align} (m - n + 1)(m - n + 1) &= m^2 - mn + m - nm + n^2 - n + m - n + 1 \\ &= m^2 - 2nm + m + n^2 - n + m - n + 1 \\ &= m^2 - 2nm + 2m - 2n + n^2 + 1 \end{align}$$

0
On

A basic principle of combinatorics is the following: If you can choose independently an element of some $m$ element set and an element of some $n$ element set there are $N=m\,n$ choices in total.