Many of you wanted shortcuts to count the number of triangles. So I am writing this post which will cover every possible scenario for counting squares, rectangles and triangles. If the question doesn't fall in any of the below category, you will have to count manually :)
1) Counting squares within a square
How many squares are there in the above figure?
Solution : There are 4 rows in the above figure. Hence n=4
Apply the formula [n(n+1)(2n+1)/6]
= 4*5*9/6
Answer : 30
2) Counting squares within a rectangle
How many squares are there in the above figure?
Solution : This rectangle is a 4 x 3 grid [4 rows and 3 columns]
So total number of squares is m(m+1)(2m+1)/6 + (n-m)*m(m+1)/2.where n is the larger dimension
Here n = 4, m = 3
Answer : 20
3) Counting rectangles within a rectangle
How many rectangles are there in the above figure?
Solution : For a 'n x m' grid ['n' is the number of rows and 'm' is the number of columns]
Number of rectangles = (m)(m+1)/2 (n)(n+1)/2 = m(m+1)(n)(n+1)/4
In the above figure
n = 4, m=6
Put the values
Answer : 210
4) Counting rectangles in a square
The formula to count the number of rectangles within a square can be obainted by putting n = m in the above formula (3rd case)
So, No. of rectangles = [n(n+1)/2]^2
Ques. How many rectangles are there in a chess board?
Solution : We know that the chess board is a 8 x 8 grid
Put n = 8 in the above formula
Answer : 1296
Note : From the above formulae, you only have to mug two, i.e., 2 and 3. Formula 1 can be obtained by putting n=m in formula 2 and formula 4 can be obtained by putting n=m in formula 3.
5) Counting triangles within a triangle
How many triangles are there in the above figure?
The formula is given by -
You should note 3 things about this formula-
1. It is only applicable for matchstick arrangement (like the figure above)
2. n = number of unit triangles in a side. In this question n=4 (I have counted the triangles for you)
3. Those are not brackets enclosing the formula; they denote floor function. So after applying the formula, if you are not getting an integer, you should completely reject the decimal numbers. E.g. 17.12 will become 17 and 56.98 wil become 56
Caution : You don't have to round off the number, so 77.9 will be equal to 77 not 78.
Put n=4 in the formula
Answer : 27
Next question-
Here n=3
Apply the formula and you will get 13.125. Reject the decimal places-
Answer : 13
Keep Reading :
To buy the super-hit SSC Hack-Book, follow the below link-
Buy SSC Hack Book
1) Counting squares within a square
How many squares are there in the above figure?
Solution : There are 4 rows in the above figure. Hence n=4
Apply the formula [n(n+1)(2n+1)/6]
= 4*5*9/6
Answer : 30
2) Counting squares within a rectangle
How many squares are there in the above figure?
Solution : This rectangle is a 4 x 3 grid [4 rows and 3 columns]
So total number of squares is m(m+1)(2m+1)/6 + (n-m)*m(m+1)/2.where n is the larger dimension
Here n = 4, m = 3
Answer : 20
3) Counting rectangles within a rectangle
How many rectangles are there in the above figure?
Solution : For a 'n x m' grid ['n' is the number of rows and 'm' is the number of columns]
Number of rectangles = (m)(m+1)/2 (n)(n+1)/2 = m(m+1)(n)(n+1)/4
In the above figure
n = 4, m=6
Put the values
Answer : 210
4) Counting rectangles in a square
The formula to count the number of rectangles within a square can be obainted by putting n = m in the above formula (3rd case)
So, No. of rectangles = [n(n+1)/2]^2
Ques. How many rectangles are there in a chess board?
Solution : We know that the chess board is a 8 x 8 grid
Put n = 8 in the above formula
Answer : 1296
Note : From the above formulae, you only have to mug two, i.e., 2 and 3. Formula 1 can be obtained by putting n=m in formula 2 and formula 4 can be obtained by putting n=m in formula 3.
5) Counting triangles within a triangle
How many triangles are there in the above figure?
The formula is given by -
You should note 3 things about this formula-
1. It is only applicable for matchstick arrangement (like the figure above)
2. n = number of unit triangles in a side. In this question n=4 (I have counted the triangles for you)
3. Those are not brackets enclosing the formula; they denote floor function. So after applying the formula, if you are not getting an integer, you should completely reject the decimal numbers. E.g. 17.12 will become 17 and 56.98 wil become 56
Caution : You don't have to round off the number, so 77.9 will be equal to 77 not 78.
Put n=4 in the formula
Answer : 27
Next question-
Here n=3
Apply the formula and you will get 13.125. Reject the decimal places-
Answer : 13
Keep Reading :
To buy the super-hit SSC Hack-Book, follow the below link-
Buy SSC Hack Book




























